From a05acd2044810b8e180381e871c5571ae883b8b8 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Wed, 23 Aug 2017 13:58:17 +0200 Subject: [PATCH 01/42] added the AVL tree to the tests \#17 --- demo/js/bundle.js | 2 +- package-lock.json | 8018 +++++++++++++++++++++++++++++++++ package.json | 1 + test/compare_segments.test.js | 36 +- test/divide_segment.test.js | 6 +- test/sweep_line.test.js | 28 +- 6 files changed, 8054 insertions(+), 37 deletions(-) create mode 100644 package-lock.json diff --git a/demo/js/bundle.js b/demo/js/bundle.js index d506fd1..5933766 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -4021,4 +4021,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":15,"./signed_area":19}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9jb21wb25lbnQtZW1pdHRlci9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9mdW5jdGlvbmFsLXJlZC1ibGFjay10cmVlL3JidHJlZS5qcyIsIm5vZGVfbW9kdWxlcy9zdXBlcmFnZW50L2xpYi9jbGllbnQuanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvaXMtb2JqZWN0LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvbGliL3JlcXVlc3QtYmFzZS5qcyIsIm5vZGVfbW9kdWxlcy9zdXBlcmFnZW50L2xpYi9yZXF1ZXN0LmpzIiwibm9kZV9tb2R1bGVzL3RpbnlxdWV1ZS9pbm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cmVlIHVzaW5nIHJvdGF0aW9uc1xuICAvL2NvbnNvbGUubG9nKFwic3RhcnQgaW5zZXJ0XCIsIGtleSwgZF9zdGFjaylcbiAgZm9yKHZhciBzPW5fc3RhY2subGVuZ3RoLTE7IHM+MTsgLS1zKSB7XG4gICAgdmFyIHAgPSBuX3N0YWNrW3MtMV1cbiAgICB2YXIgbiA9IG5fc3RhY2tbc11cbiAgICBpZihwLl9jb2xvciA9PT0gQkxBQ0sgfHwgbi5fY29sb3IgPT09IEJMQUNLKSB7XG4gICAgICBicmVha1xuICAgIH1cbiAgICB2YXIgcHAgPSBuX3N0YWNrW3MtMl1cbiAgICBpZihwcC5sZWZ0ID09PSBwKSB7XG4gICAgICBpZihwLmxlZnQgPT09IG4pIHtcbiAgICAgICAgdmFyIHkgPSBwcC5yaWdodFxuICAgICAgICBpZih5ICYmIHkuX2NvbG9yID09PSBSRUQpIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiTExyXCIpXG4gICAgICAgICAgcC5fY29sb3IgPSBCTEFDS1xuICAgICAgICAgIHBwLnJpZ2h0ID0gcmVwYWludChCTEFDSywgeSlcbiAgICAgICAgICBwcC5fY29sb3IgPSBSRURcbiAgICAgICAgICBzIC09IDFcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiTExiXCIpXG4gICAgICAgICAgcHAuX2NvbG9yID0gUkVEXG4gICAgICAgICAgcHAubGVmdCA9IHAucmlnaHRcbiAgICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgICAgcC5yaWdodCA9IHBwXG4gICAgICAgICAgbl9zdGFja1tzLTJdID0gcFxuICAgICAgICAgIG5fc3RhY2tbcy0xXSA9IG5cbiAgICAgICAgICByZWNvdW50KHBwKVxuICAgICAgICAgIHJlY291bnQocClcbiAgICAgICAgICBpZihzID49IDMpIHtcbiAgICAgICAgICAgIHZhciBwcHAgPSBuX3N0YWNrW3MtM11cbiAgICAgICAgICAgIGlmKHBwcC5sZWZ0ID09PSBwcCkge1xuICAgICAgICAgICAgICBwcHAubGVmdCA9IHBcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBwcC5yaWdodCA9IHBcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIHkgPSBwcC5yaWdodFxuICAgICAgICBpZih5ICYmIHkuX2NvbG9yID09PSBSRUQpIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiTFJyXCIpXG4gICAgICAgICAgcC5fY29sb3IgPSBCTEFDS1xuICAgICAgICAgIHBwLnJpZ2h0ID0gcmVwYWludChCTEFDSywgeSlcbiAgICAgICAgICBwcC5fY29sb3IgPSBSRURcbiAgICAgICAgICBzIC09IDFcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiTFJiXCIpXG4gICAgICAgICAgcC5yaWdodCA9IG4ubGVmdFxuICAgICAgICAgIHBwLl9jb2xvciA9IFJFRFxuICAgICAgICAgIHBwLmxlZnQgPSBuLnJpZ2h0XG4gICAgICAgICAgbi5fY29sb3IgPSBCTEFDS1xuICAgICAgICAgIG4ubGVmdCA9IHBcbiAgICAgICAgICBuLnJpZ2h0ID0gcHBcbiAgICAgICAgICBuX3N0YWNrW3MtMl0gPSBuXG4gICAgICAgICAgbl9zdGFja1tzLTFdID0gcFxuICAgICAgICAgIHJlY291bnQocHApXG4gICAgICAgICAgcmVjb3VudChwKVxuICAgICAgICAgIHJlY291bnQobilcbiAgICAgICAgICBpZihzID49IDMpIHtcbiAgICAgICAgICAgIHZhciBwcHAgPSBuX3N0YWNrW3MtM11cbiAgICAgICAgICAgIGlmKHBwcC5sZWZ0ID09PSBwcCkge1xuICAgICAgICAgICAgICBwcHAubGVmdCA9IG5cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBwcC5yaWdodCA9IG5cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZihwLnJpZ2h0ID09PSBuKSB7XG4gICAgICAgIHZhciB5ID0gcHAubGVmdFxuICAgICAgICBpZih5ICYmIHkuX2NvbG9yID09PSBSRUQpIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiUlJyXCIsIHkua2V5KVxuICAgICAgICAgIHAuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgICBwcC5sZWZ0ID0gcmVwYWludChCTEFDSywgeSlcbiAgICAgICAgICBwcC5fY29sb3IgPSBSRURcbiAgICAgICAgICBzIC09IDFcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiUlJiXCIpXG4gICAgICAgICAgcHAuX2NvbG9yID0gUkVEXG4gICAgICAgICAgcHAucmlnaHQgPSBwLmxlZnRcbiAgICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgICAgcC5sZWZ0ID0gcHBcbiAgICAgICAgICBuX3N0YWNrW3MtMl0gPSBwXG4gICAgICAgICAgbl9zdGFja1tzLTFdID0gblxuICAgICAgICAgIHJlY291bnQocHApXG4gICAgICAgICAgcmVjb3VudChwKVxuICAgICAgICAgIGlmKHMgPj0gMykge1xuICAgICAgICAgICAgdmFyIHBwcCA9IG5fc3RhY2tbcy0zXVxuICAgICAgICAgICAgaWYocHBwLnJpZ2h0ID09PSBwcCkge1xuICAgICAgICAgICAgICBwcHAucmlnaHQgPSBwXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwcHAubGVmdCA9IHBcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIHkgPSBwcC5sZWZ0XG4gICAgICAgIGlmKHkgJiYgeS5fY29sb3IgPT09IFJFRCkge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJSTHJcIilcbiAgICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgICAgcHAubGVmdCA9IHJlcGFpbnQoQkxBQ0ssIHkpXG4gICAgICAgICAgcHAuX2NvbG9yID0gUkVEXG4gICAgICAgICAgcyAtPSAxXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy9jb25zb2xlLmxvZyhcIlJMYlwiKVxuICAgICAgICAgIHAubGVmdCA9IG4ucmlnaHRcbiAgICAgICAgICBwcC5fY29sb3IgPSBSRURcbiAgICAgICAgICBwcC5yaWdodCA9IG4ubGVmdFxuICAgICAgICAgIG4uX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgICBuLnJpZ2h0ID0gcFxuICAgICAgICAgIG4ubGVmdCA9IHBwXG4gICAgICAgICAgbl9zdGFja1tzLTJdID0gblxuICAgICAgICAgIG5fc3RhY2tbcy0xXSA9IHBcbiAgICAgICAgICByZWNvdW50KHBwKVxuICAgICAgICAgIHJlY291bnQocClcbiAgICAgICAgICByZWNvdW50KG4pXG4gICAgICAgICAgaWYocyA+PSAzKSB7XG4gICAgICAgICAgICB2YXIgcHBwID0gbl9zdGFja1tzLTNdXG4gICAgICAgICAgICBpZihwcHAucmlnaHQgPT09IHBwKSB7XG4gICAgICAgICAgICAgIHBwcC5yaWdodCA9IG5cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBwcC5sZWZ0ID0gblxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG4gIC8vUmV0dXJuIG5ldyB0cmVlXG4gIG5fc3RhY2tbMF0uX2NvbG9yID0gQkxBQ0tcbiAgcmV0dXJuIG5ldyBSZWRCbGFja1RyZWUoY21wLCBuX3N0YWNrWzBdKVxufVx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dFxuICAgICAgICBzLmxlZnQgPSBwXG4gICAgICAgIHMucmlnaHQgPSB6XG4gICAgICAgIHMuX2NvbG9yID0gcC5fY29sb3JcbiAgICAgICAgbi5fY29sb3IgPSBCTEFDS1xuICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgIHouX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgcmVjb3VudChwKVxuICAgICAgICByZWNvdW50KHMpXG4gICAgICAgIGlmKGkgPiAxKSB7XG4gICAgICAgICAgdmFyIHBwID0gc3RhY2tbaS0yXVxuICAgICAgICAgIGlmKHBwLmxlZnQgPT09IHApIHtcbiAgICAgICAgICAgIHBwLmxlZnQgPSBzXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHBwLnJpZ2h0ID0gc1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdGFja1tpLTFdID0gc1xuICAgICAgICByZXR1cm5cbiAgICAgIH0gZWxzZSBpZihzLmxlZnQgJiYgcy5sZWZ0Ll9jb2xvciA9PT0gUkVEKSB7XG4gICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDE6IGxlZnQgc2libGluZyBjaGlsZCByZWRcIilcbiAgICAgICAgcyA9IHAucmlnaHQgPSBjbG9uZU5vZGUocylcbiAgICAgICAgeiA9IHMubGVmdCA9IGNsb25lTm9kZShzLmxlZnQpXG4gICAgICAgIHAucmlnaHQgPSB6LmxlZnRcbiAgICAgICAgcy5sZWZ0ID0gei5yaWdodFxuICAgICAgICB6LmxlZnQgPSBwXG4gICAgICAgIHoucmlnaHQgPSBzXG4gICAgICAgIHouX2NvbG9yID0gcC5fY29sb3JcbiAgICAgICAgcC5fY29sb3IgPSBCTEFDS1xuICAgICAgICBzLl9jb2xvciA9IEJMQUNLXG4gICAgICAgIG4uX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgcmVjb3VudChwKVxuICAgICAgICByZWNvdW50KHMpXG4gICAgICAgIHJlY291bnQoeilcbiAgICAgICAgaWYoaSA+IDEpIHtcbiAgICAgICAgICB2YXIgcHAgPSBzdGFja1tpLTJdXG4gICAgICAgICAgaWYocHAubGVmdCA9PT0gcCkge1xuICAgICAgICAgICAgcHAubGVmdCA9IHpcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcHAucmlnaHQgPSB6XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHN0YWNrW2ktMV0gPSB6XG4gICAgICAgIHJldHVyblxuICAgICAgfVxuICAgICAgaWYocy5fY29sb3IgPT09IEJMQUNLKSB7XG4gICAgICAgIGlmKHAuX2NvbG9yID09PSBSRUQpIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiY2FzZSAyOiBibGFjayBzaWJsaW5nLCByZWQgcGFyZW50XCIsIHAucmlnaHQudmFsdWUpXG4gICAgICAgICAgcC5fY29sb3IgPSBCTEFDS1xuICAgICAgICAgIHAucmlnaHQgPSByZXBhaW50KFJFRCwgcylcbiAgICAgICAgICByZXR1cm5cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiY2FzZSAyOiBibGFjayBzaWJsaW5nLCBibGFjayBwYXJlbnRcIiwgcC5yaWdodC52YWx1ZSlcbiAgICAgICAgICBwLnJpZ2h0ID0gcmVwYWludChSRUQsIHMpXG4gICAgICAgICAgY29udGludWUgIFxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvL2NvbnNvbGUubG9nKFwiY2FzZSAzOiByZWQgc2libGluZ1wiKVxuICAgICAgICBzID0gY2xvbmVOb2RlKHMpXG4gICAgICAgIHAucmlnaHQgPSBzLmxlZnRcbiAgICAgICAgcy5sZWZ0ID0gcFxuICAgICAgICBzLl9jb2xvciA9IHAuX2NvbG9yXG4gICAgICAgIHAuX2NvbG9yID0gUkVEXG4gICAgICAgIHJlY291bnQocClcbiAgICAgICAgcmVjb3VudChzKVxuICAgICAgICBpZihpID4gMSkge1xuICAgICAgICAgIHZhciBwcCA9IHN0YWNrW2ktMl1cbiAgICAgICAgICBpZihwcC5sZWZ0ID09PSBwKSB7XG4gICAgICAgICAgICBwcC5sZWZ0ID0gc1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBwcC5yaWdodCA9IHNcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgc3RhY2tbaS0xXSA9IHNcbiAgICAgICAgc3RhY2tbaV0gPSBwXG4gICAgICAgIGlmKGkrMSA8IHN0YWNrLmxlbmd0aCkge1xuICAgICAgICAgIHN0YWNrW2krMV0gPSBuXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgc3RhY2sucHVzaChuKVxuICAgICAgICB9XG4gICAgICAgIGkgPSBpKzJcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgLy9jb25zb2xlLmxvZyhcInJpZ2h0IGNoaWxkXCIpXG4gICAgICBzID0gcC5sZWZ0XG4gICAgICBpZihzLmxlZnQgJiYgcy5sZWZ0Ll9jb2xvciA9PT0gUkVEKSB7XG4gICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDE6IGxlZnQgc2libGluZyBjaGlsZCByZWRcIiwgcC52YWx1ZSwgcC5fY29sb3IpXG4gICAgICAgIHMgPSBwLmxlZnQgPSBjbG9uZU5vZGUocylcbiAgICAgICAgeiA9IHMubGVmdCA9IGNsb25lTm9kZShzLmxlZnQpXG4gICAgICAgIHAubGVmdCA9IHMucmlnaHRcbiAgICAgICAgcy5yaWdodCA9IHBcbiAgICAgICAgcy5sZWZ0ID0gelxuICAgICAgICBzLl9jb2xvciA9IHAuX2NvbG9yXG4gICAgICAgIG4uX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgcC5fY29sb3IgPSBCTEFDS1xuICAgICAgICB6Ll9jb2xvciA9IEJMQUNLXG4gICAgICAgIHJlY291bnQocClcbiAgICAgICAgcmVjb3VudChzKVxuICAgICAgICBpZihpID4gMSkge1xuICAgICAgICAgIHZhciBwcCA9IHN0YWNrW2ktMl1cbiAgICAgICAgICBpZihwcC5yaWdodCA9PT0gcCkge1xuICAgICAgICAgICAgcHAucmlnaHQgPSBzXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHBwLmxlZnQgPSBzXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHN0YWNrW2ktMV0gPSBzXG4gICAgICAgIHJldHVyblxuICAgICAgfSBlbHNlIGlmKHMucmlnaHQgJiYgcy5yaWdodC5fY29sb3IgPT09IFJFRCkge1xuICAgICAgICAvL2NvbnNvbGUubG9nKFwiY2FzZSAxOiByaWdodCBzaWJsaW5nIGNoaWxkIHJlZFwiKVxuICAgICAgICBzID0gcC5sZWZ0ID0gY2xvbmVOb2RlKHMpXG4gICAgICAgIHogPSBzLnJpZ2h0ID0gY2xvbmVOb2RlKHMucmlnaHQpXG4gICAgICAgIHAubGVmdCA9IHoucmlnaHRcbiAgICAgICAgcy5yaWdodCA9IHoubGVmdFxuICAgICAgICB6LnJpZ2h0ID0gcFxuICAgICAgICB6LmxlZnQgPSBzXG4gICAgICAgIHouX2NvbG9yID0gcC5fY29sb3JcbiAgICAgICAgcC5fY29sb3IgPSBCTEFDS1xuICAgICAgICBzLl9jb2xvciA9IEJMQUNLXG4gICAgICAgIG4uX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgcmVjb3VudChwKVxuICAgICAgICByZWNvdW50KHMpXG4gICAgICAgIHJlY291bnQoeilcbiAgICAgICAgaWYoaSA+IDEpIHtcbiAgICAgICAgICB2YXIgcHAgPSBzdGFja1tpLTJdXG4gICAgICAgICAgaWYocHAucmlnaHQgPT09IHApIHtcbiAgICAgICAgICAgIHBwLnJpZ2h0ID0gelxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBwcC5sZWZ0ID0gelxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdGFja1tpLTFdID0gelxuICAgICAgICByZXR1cm5cbiAgICAgIH1cbiAgICAgIGlmKHMuX2NvbG9yID09PSBCTEFDSykge1xuICAgICAgICBpZihwLl9jb2xvciA9PT0gUkVEKSB7XG4gICAgICAgICAgLy9jb25zb2xlLmxvZyhcImNhc2UgMjogYmxhY2sgc2libGluZywgcmVkIHBhcmVudFwiKVxuICAgICAgICAgIHAuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgICBwLmxlZnQgPSByZXBhaW50KFJFRCwgcylcbiAgICAgICAgICByZXR1cm5cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiY2FzZSAyOiBibGFjayBzaWJsaW5nLCBibGFjayBwYXJlbnRcIilcbiAgICAgICAgICBwLmxlZnQgPSByZXBhaW50KFJFRCwgcylcbiAgICAgICAgICBjb250aW51ZSAgXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDM6IHJlZCBzaWJsaW5nXCIpXG4gICAgICAgIHMgPSBjbG9uZU5vZGUocylcbiAgICAgICAgcC5sZWZ0ID0gcy5yaWdodFxuICAgICAgICBzLnJpZ2h0ID0gcFxuICAgICAgICBzLl9jb2xvciA9IHAuX2NvbG9yXG4gICAgICAgIHAuX2NvbG9yID0gUkVEXG4gICAgICAgIHJlY291bnQocClcbiAgICAgICAgcmVjb3VudChzKVxuICAgICAgICBpZihpID4gMSkge1xuICAgICAgICAgIHZhciBwcCA9IHN0YWNrW2ktMl1cbiAgICAgICAgICBpZihwcC5yaWdodCA9PT0gcCkge1xuICAgICAgICAgICAgcHAucmlnaHQgPSBzXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHBwLmxlZnQgPSBzXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHN0YWNrW2ktMV0gPSBzXG4gICAgICAgIHN0YWNrW2ldID0gcFxuICAgICAgICBpZihpKzEgPCBzdGFjay5sZW5ndGgpIHtcbiAgICAgICAgICBzdGFja1tpKz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G4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGRlZmF1bHRzIHRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAuc2VuZCgnbmFtZT10b2JpJylcbiAqICAgICAgICAuc2VuZCgnc3BlY2llcz1mZXJyZXQnKVxuICogICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogQHBhcmFtIHtTdHJpbmd8T2JqZWN0fSBkYXRhXG4gKiBAcmV0dXJuIHtSZXF1ZXN0fSBmb3IgY2hhaW5pbmdcbiAqIEBhcGkgcHVibGljXG4gKi9cblxuZXhwb3J0cy5zZW5kID0gZnVuY3Rpb24oZGF0YSl7XG4gIHZhciBvYmogPSB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jb21wYXJlID0gdGhpcy5jb21wYXJlO1xuXG4gICAgICAgIHdoaWxlIChwb3MgPiAwKSB7XG4gICAgICAgICAgICB2YXIgcGFyZW50ID0gTWF0aC5mbG9vcigocG9zIC0gMSkgLyAyKTtcbiAgICAgICAgICAgIGlmIChjb21wYXJlKGRhdGFbcG9zXSwgZGF0YVtwYXJlbnRdKSA8IDApIHtcbiAgICAgICAgICAgICAgICBzd2FwKGRhdGEsIHBhcmVudCwgcG9zKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBwYXJlbnQ7XG5cbiAgICAgICAgICAgIH0gZWxzZSBicmVhaztcbiAgICAgICAgfVxuICAgIH0sXG5cbiAgICBfZG93bjogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmUsXG4gICAgICAgICAgICBsZW4gPSB0aGlzLmxlbmd0aDtcblxuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgdmFyIGxlZnQgPSAyICogcG9zICsgMSxcbiAgICAgICAgICAgICAgICByaWdodCA9IGxlZnQgKyAxLFxuICAgICAgICAgICAgICAgIG1pbiA9IHBvcztcblxuICAgICAgICAgICAgaWYgKGxlZnQgPCBsZW4gJiYgY29tcGFyZShkYXRhW2xlZnRdLCBkYXRhW21pbl0pIDwgMCkgbWluID0gbGVmdDtcbiAgICAgICAgICAgIGlmIChyaWdodCA8IGxlbiAmJiBjb21wYXJlKGRhdGFbcmlnaHRdLCBkYXRhW21pbl0pIDwgMCkgbWluID0gcmlnaHQ7XG5cbiAgICAgICAgICAgIGlmIChtaW4gPT09IHBvcykgcmV0dXJuO1xuXG4gICAgICAgICAgICBzd2FwKGRhdGEsIG1pbiwgcG9zKTtcbiAgICAgICAgICAgIHBvcyA9IG1pbjtcbiAgICAgICAgfVxuICAgIH1cbn07XG5cbmZ1bmN0aW9uIHN3YXAoZGF0YSwga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9uKTtcbiAgICAgIGlmIChuZXh0Lm5vZGUpIHtcbiAgICAgICAgaWYgKHBvc3NpYmxlSW50ZXJzZWN0aW9uKGV2ZW50LCBuZXh0LmtleSwgZXZlbnRRdWV1ZSkgPT09IDIpIHtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgbmV4dC5rZXksIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKHByZXYubm9kZSkge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHN3ZWVwTGluZS5maW5kKHByZXYua2V5KTtcbiAgICAgICAgICBpZiAocHJldnByZXYubm9kZSAhPT0gc3dlZXBMaW5lLmJlZ2luKSB7XG4gICAgICAgICAgICBwcmV2cHJldi5wcmV2KCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHByZXZwcmV2ID0gc3dlZXBMaW5lLmZpbmQoc3dlZXBMaW5lLmVuZCk7XG4gICAgICAgICAgICBwcmV2cHJldi5uZXh0KCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHByZXZwcmV2RXZlbnQgPSBwcmV2cHJldi5rZXkgfHwgbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZXZlbnQgPSBldmVudC5vdGhlckV2ZW50O1xuICAgICAgbmV4dCA9IHN3ZWVwTGluZS5maW5kKGV2ZW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gIHRoaXMuaXNFeHRlcmlvclJpbmcgPSB0cnVlO1xufVxuXG5cblN3ZWVwRXZlbnQucHJvdG90eXBlID0ge1xuXG4gIC8qKlxuICAgKiBAcGFyYW0gIHtBcnJheS48TnVtYmVyPn0gIHBcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzQmVsb3c6IGZ1bmN0aW9uIChwKSB7XG4gICAgcmV0dXJuIHRoaXMubGVmdCA/XG4gICAgICBzaWduZWRBcmVhKHRoaXMucG9pbnQsIHRoaXMub3RoZXJFdmVudC5wb2ludCwgcCkgPiAwIDpcbiAgICAgIHNpZ25lZEFyZWEodGhpcy5vdGhlckV2ZW50LnBvaW50LCB0aGlzLnBvaW50LCBwKSA+IDA7XG4gIH0sXG5cblxuICAvKipcbiAgICogQHBhcmFtICB7QXJyYXkuPE51bWJlcj59ICBwXG4gICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAqL1xuICBpc0Fib3ZlOiBmdW5jdGlvbiAocCkge1xuICAgIHJldHVybiAhdGhpcy5pc0JlbG93KHApO1xuICB9LFxuXG5cbiAgLyoqXG4gICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAqL1xuICBpc1ZlcnRpY2FsOiBmdW5jdGlvbiAoKSB7XG4gICAgcmV0dXJuIHRoaXMucG9pbnRbMF0gPT09IHRoaXMub3RoZXJFdmVudC5wb2ludFswXTtcbiAgfVxufTtcblxubW9kdWxlLmV4cG9ydHMgPSBTd2VlcEV2ZW50O1xuIl19 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJp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b3JtLCAnc3VibWl0JywgZnVuY3Rpb24gKGV2dCkge1xuICAgICAgICBMLkRvbUV2ZW50LnN0b3AoZXZ0KTtcbiAgICAgICAgdmFyIHJhZGlvcyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKFxuICAgICAgICAgIGZvcm0ucXVlcnlTZWxlY3RvckFsbCgnaW5wdXRbdHlwZT1yYWRpb10nKSk7XG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSByYWRpb3MubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgICBpZiAocmFkaW9zW2ldLmNoZWNrZWQpIHtcbiAgICAgICAgICAgIHRoaXMub3B0aW9ucy5jYWxsYmFjayhwYXJzZUludChyYWRpb3NbaV0udmFsdWUpKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSwgdGhpcylcbiAgICAgIC5vbihmb3JtWydjbGVhciddLCAnY2xpY2snLCBmdW5jdGlvbihldnQpIHtcbiAgICAgICAgTC5Eb21FdmVudC5zdG9wKGV2dCk7XG4gICAgICAgIHRoaXMub3B0aW9ucy5jbGVhcigpO1xuICAgICAgfSwgdGhpcyk7XG5cbiAgICBMLkRvbUV2ZW50XG4gICAgICAuZGlzYWJsZUNsaWNrUHJvcGFnYXRpb24odGhpcy5fY29udGFpbmVyKVxuICAgICAgLmRpc2FibGVTY3JvbGxQcm9wYWdhdGlvbih0aGlzLl9jb250YWluZXIpO1xuICAgIHJldHVybiB0aGlzLl9jb250YWluZXI7XG4gIH1cblxufSk7IiwiTC5Db29yZGluYXRlcyA9IEwuQ29udHJvbC5leHRlbmQoe1xuICBvcHRpb25zOiB7XG4gICAgcG9zaXRpb246ICdib3R0b21yaWdodCdcbiAgfSxcblxuICBvbkFkZDogZnVuY3Rpb24obWFwKSB7XG4gICAgdGhpcy5fY29udGFpbmVyID0gTC5Eb21VdGlsLmNyZWF0ZSgnZGl2JywgJ2xlYWZ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AgICAgIC8vY29uc29sZS5sb2coXCJMTGJcIilcbiAgICAgICAgICBwcC5fY29sb3IgPSBSRURcbiAgICAgICAgICBwcC5sZWZ0ID0gcC5yaWdodFxuICAgICAgICAgIHAuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgICBwLnJpZ2h0ID0gcHBcbiAgICAgICAgICBuX3N0YWNrW3MtMl0gPSBwXG4gICAgICAgICAgbl9zdGFja1tzLTFdID0gblxuICAgICAgICAgIHJlY291bnQocHApXG4gICAgICAgICAgcmVjb3VudChwKVxuICAgICAgICAgIGlmKHMgPj0gMykge1xuICAgICAgICAgICAgdmFyIHBwcCA9IG5fc3RhY2tbcy0zXVxuICAgICAgICAgICAgaWYocHBwLmxlZnQgPT09IHBwKSB7XG4gICAgICAgICAgICAgIHBwcC5sZWZ0ID0gcFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcHBwLnJpZ2h0ID0gcFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgeSA9IHBwLnJpZ2h0XG4gICAgICAgIGlmKHkgJiYgeS5fY29sb3IgPT09IFJFRCkge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJMUnJcIilcbiAgICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgICAgcHAucmlnaHQgPSByZXBhaW50KEJMQUNLLCB5KVxuICAgICAgICAgIHBwLl9jb2xvciA9IFJFRFxuICAgICAgICAgIHMgLT0gMVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJMUmJcIilcbiAgICAgICAgICBwLnJpZ2h0ID0gbi5sZWZ0XG4gICAgICAgICAgcHAuX2NvbG9yID0gUkVEXG4gICAgICAgICAgcHAubGVmdCA9IG4ucmlnaHRcbiAgICAgICAgICBuLl9jb2xvciA9IEJMQUNLXG4gICAgICAgICAgbi5sZWZ0ID0gcFxuICAgICAgICAgIG4ucmlnaHQgPSBwcFxuICAgICAgICAgIG5fc3RhY2tbcy0yXSA9IG5cbiAgICAgICAgICBuX3N0YWNrW3MtMV0gPSBwXG4gICAgICAgICAgcmVjb3VudChwcClcbiAgICAgICAgICByZWNvdW50KHApXG4gICAgICAgICAgcmVjb3VudChuKVxuICAgICAgICAgIGlmKHMgPj0gMykge1xuICAgICAgICAgICAgdmFyIHBwcCA9IG5fc3RhY2tbcy0zXVxuICAgICAgICAgICAgaWYocHBwLmxlZnQgPT09IHBwKSB7XG4gICAgICAgICAgICAgIHBwcC5sZWZ0ID0gblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcHBwLnJpZ2h0ID0gblxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmKHAucmlnaHQgPT09IG4pIHtcbiAgICAgICAgdmFyIHkgPSBwcC5sZWZ0XG4gICAgICAgIGlmKHkgJiYgeS5fY29sb3IgPT09IFJFRCkge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJSUnJcIiwgeS5rZXkpXG4gICAgICAgICAgcC5fY29sb3IgPSBCTEFDS1xuICAgICAgICAgIHBwLmxlZnQgPSByZXBhaW50KEJMQUNLLCB5KVxuICAgICAgICAgIHBwLl9jb2xvciA9IFJFRFxuICAgICAgICAgIHMgLT0gMVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJSUmJcIilcbiAgICAgICAgICBwcC5fY29sb3IgPSBSRURcbiAgICAgICAgICBwcC5yaWdodCA9IHAubGVmdFxuICAgICAgICAgIHAuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgICBwLmxlZnQgPSBwcFxuICAgICAgICAgIG5fc3RhY2tbcy0yXSA9IHBcbiAgICAgICAgICBuX3N0YWNrW3MtMV0gPSBuXG4gICAgICAgICAgcmVjb3VudChwcClcbiAgICAgICAgICByZWNvdW50KHApXG4gICAgICAgICAgaWYocyA+PSAzKSB7XG4gICAgICAgICAgICB2YXIgcHBwID0gbl9zdGFja1tzLTNdXG4gICAgICAgICAgICBpZihwcHAucmlnaHQgPT09IHBwKSB7XG4gICAgICAgICAgICAgIHBwcC5yaWdodCA9IHBcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBwcC5sZWZ0ID0gcFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgeSA9IHBwLmxlZnRcbiAgICAgICAgaWYoeSAmJiB5Ll9jb2xvciA9PT0gUkVEKSB7XG4gICAgICAgICAgLy9jb25zb2xlLmxvZyhcIlJMclwiKVxuICAgICAgICAgIHAuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgICBwcC5sZWZ0ID0gcmVwYWludChCTEFDSywgeSlcbiAgICAgICAgICBwcC5fY29sb3IgPSBSRURcbiAgICAgICAgICBzIC09IDFcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiUkxiXCIpXG4gICAgICAgICAgcC5sZWZ0ID0gbi5yaWdodFxuICAgICAgICAgIHBwLl9jb2xvciA9IFJFRFxuICAgICAgICAgIHBwLnJpZ2h0ID0gbi5sZWZ0XG4gICAgICAgICAgbi5fY29sb3IgPSBCTEFDS1xuICAgICAgICAgIG4ucmlnaHQgPSBwXG4gICAgICAgICAgbi5sZWZ0ID0gcHBcbiAgICAgICAgICBuX3N0YWNrW3MtMl0gPSBuXG4gICAgICAgICAgbl9zdGFja1tzLTFdID0gcFxuICAgICAgICAgIHJlY291bnQocHApXG4gICAgICAgICAgcmVjb3VudChwKVxuICAgICAgICAgIHJlY291bnQobilcbiAgICAgICAgICBpZihzID49IDMpIHtcbiAgICAgICAgICAgIHZhciBwcHAgPS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ICAgIHAgPSBzdGFja1tpLTFdXG4gICAgaWYocC5sZWZ0ID09PSBuKSB7XG4gICAgICAvL2NvbnNvbGUubG9nKFwibGVmdCBjaGlsZFwiKVxuICAgICAgcyA9IHAucmlnaHRcbiAgICAgIGlmKHMucmlnaHQgJiYgcy5yaWdodC5fY29sb3IgPT09IFJFRCkge1xuICAgICAgICAvL2NvbnNvbGUubG9nKFwiY2FzZSAxOiByaWdodCBzaWJsaW5nIGNoaWxkIHJlZFwiKVxuICAgICAgICBzID0gcC5yaWdodCA9IGNsb25lTm9kZShzKVxuICAgICAgICB6ID0gcy5yaWdodCA9IGNsb25lTm9kZShzLnJpZ2h0KVxuICAgICAgICBwLnJpZ2h0ID0gcy5sZWZ0XG4gICAgICAgIHMubGVmdCA9IHBcbiAgICAgICAgcy5yaWdodCA9IHpcbiAgICAgICAgcy5fY29sb3IgPSBwLl9jb2xvclxuICAgICAgICBuLl9jb2xvciA9IEJMQUNLXG4gICAgICAgIHAuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgei5fY29sb3IgPSBCTEFDS1xuICAgICAgICByZWNvdW50KHApXG4gICAgICAgIHJlY291bnQocylcbiAgICAgICAgaWYoaSA+IDEpIHtcbiAgICAgICAgICB2YXIgcHAgPSBzdGFja1tpLTJdXG4gICAgICAgICAgaWYocHAubGVmdCA9PT0gcCkge1xuICAgICAgICAgICAgcHAubGVmdCA9IHNcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcHAucmlnaHQgPSBzXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHN0YWNrW2ktMV0gPSBzXG4gICAgICAgIHJldHVyblxuICAgICAgfSBlbHNlIGlmKHMubGVmdCAmJiBzLmxlZnQuX2NvbG9yID09PSBSRUQpIHtcbiAgICAgICAgLy9jb25zb2xlLmxvZyhcImNhc2UgMTogbGVmdCBzaWJsaW5nIGNoaWxkIHJlZFwiKVxuICAgICAgICBzID0gcC5yaWdodCA9IGNsb25lTm9kZShzKVxuICAgICAgICB6ID0gcy5sZWZ0ID0gY2xvbmVOb2RlKHMubGVmdClcbiAgICAgICAgcC5yaWdodCA9IHoubGVmdFxuICAgICAgICBzLmxlZnQgPSB6LnJpZ2h0XG4gICAgICAgIHoubGVmdCA9IHBcbiAgICAgICAgei5yaWdodCA9IHNcbiAgICAgICAgei5fY29sb3IgPSBwLl9jb2xvclxuICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgIHMuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgbi5fY29sb3IgPSBCTEFDS1xuICAgICAgICByZWNvdW50KHApXG4gICAgICAgIHJlY291bnQocylcbiAgICAgICAgcmVjb3VudCh6KVxuICAgICAgICBpZihpID4gMSkge1xuICAgICAgICAgIHZhciBwcCA9IHN0YWNrW2ktMl1cbiAgICAgICAgICBpZihwcC5sZWZ0ID09PSBwKSB7XG4gICAgICAgICAgICBwcC5sZWZ0ID0gelxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBwcC5yaWdodCA9IHpcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgc3RhY2tbaS0xXSA9IHpcbiAgICAgICAgcmV0dXJuXG4gICAgICB9XG4gICAgICBpZihzLl9jb2xvciA9PT0gQkxBQ0spIHtcbiAgICAgICAgaWYocC5fY29sb3IgPT09IFJFRCkge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDI6IGJsYWNrIHNpYmxpbmcsIHJlZCBwYXJlbnRcIiwgcC5yaWdodC52YWx1ZSlcbiAgICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgICAgcC5yaWdodCA9IHJlcGFpbnQoUkVELCBzKVxuICAgICAgICAgIHJldHVyblxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDI6IGJsYWNrIHNpYmxpbmcsIGJsYWNrIHBhcmVudFwiLCBwLnJpZ2h0LnZhbHVlKVxuICAgICAgICAgIHAucmlnaHQgPSByZXBhaW50KFJFRCwgcylcbiAgICAgICAgICBjb250aW51ZSAgXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDM6IHJlZCBzaWJsaW5nXCIpXG4gICAgICAgIHMgPSBjbG9uZU5vZGUocylcbiAgICAgICAgcC5yaWdodCA9IHMubGVmdFxuICAgICAgICBzLmxlZnQgPSBwXG4gICAgICAgIHMuX2NvbG9yID0gcC5fY29sb3JcbiAgICAgICAgcC5fY29sb3IgPSBSRURcbiAgICAgICAgcmVjb3VudChwKVxuICAgICAgICByZWNvdW50KHMpXG4gICAgICAgIGlmKGkgPiAxKSB7XG4gICAgICAgICAgdmFyIHBwID0gc3RhY2tbaS0yXVxuICAgICAgICAgIGlmKHBwLmxlZnQgPT09IHApIHtcbiAgICAgICAgICAgIHBwLmxlZnQgPSBzXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHBwLnJpZ2h0ID0gc1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdGFja1tpLTFdID0gc1xuICAgICAgICBzdGFja1tpXSA9IHBcbiAgICAgICAgaWYoaSsxIDwgc3RhY2subGVuZ3RoKSB7XG4gICAgICAgICAgc3RhY2tbaSsxXSA9IG5cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzdGFjay5wdXNoKG4pXG4gICAgICAgIH1cbiAgICAgICAgaSA9IGkrMlxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAvL2NvbnNvbGUubG9nKFwicmlnaHQgY2hpbGRcIilcbiAgICAgIHMgPSBwLmxlZnRcbiAgICAgIGlmKHMubGVmdCAmJiBzLmxlZnQuX2NvbG9yID09PSBSRUQpIHtcbiAgICAgICAgLy9jb25zb2xlLmxvZyhcImNhc2UgMTogbGVmdCBzaWJsaW5nIGNoaWxkIHJlZFwiLCBwLnZhbHVlLCBwLl9jb2xvcilcbiAgICAgICAgcyA9IHAubGVmdCA9IGNsb25lTm9kZShzKVxuICAgICAgICB6ID0gcy5sZWZ0ID0gY2xvbmVOb2RlKHMubGVmdClcbiAgICAgICAgcC5sZWZ0ID0gcy5yaWdodFxuICAgICAgICBzLnJpZ2h0ID0gcFxuICAgICAgICBzLmxlZnQgPSB6XG4gICAgICAgIHMuX2NvbG9yID0gcC5fY29sb3JcbiAgICAgICAgbi5fY29sb3IgPSBCTEFDS1xuICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgIHouX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgcmVjb3VudChwKVxuICAgICAgICByZWNvdW50KHMpXG4gICAgICAgIGlmKGkgPiAxKSB7XG4gICAgICAgICAgdmFyIHBwID0gc3RhY2tbaS0yXVxuICAgICAgICAgIGlmKHBwLnJpZ2h0ID09PSBwKSB7XG4gICAgICAgICAgICBwcC5yaWdodCA9IHNcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcHAubGVmdCA9IHNcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgc3RhY2tbaS0xXSA9IHNcbiAgICAgICAgcmV0dXJuXG4gICAgICB9IGVsc2UgaWYocy5yaWdodCAmJiBzLnJpZ2h0Ll9jb2xvciA9PT0gUkVEKSB7XG4gICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDE6IHJpZ2h0IHNpYmxpbmcgY2hpbGQgcmVkXCIpXG4gICAgICAgIHMgPSBwLmxlZnQgPSBjbG9uZU5vZGUocylcbiAgICAgICAgeiA9IHMucmlnaHQgPSBjbG9uZU5vZGUocy5yaWdodClcbiAgICAgICAgcC5sZWZ0ID0gei5yaWdodFxuICAgICAgICBzLnJpZ2h0ID0gei5sZWZ0XG4gICAgICAgIHoucmlnaHQgPSBwXG4gICAgICAgIHoubGVmdCA9IHNcbiAgICAgICAgei5fY29sb3IgPSBwLl9jb2xvclxuICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgIHMuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgbi5fY29sb3IgPSBCTEFDS1xuICAgICAgICByZWNvdW50KHApXG4gICAgICAgIHJlY291bnQocylcbiAgICAgICAgcmVjb3VudCh6KVxuICAgICAgICBpZihpID4gMSkge1xuICAgICAgICAgIHZhciBwcCA9IHN0YWNrW2ktMl1cbiAgICAgICAgICBpZihwcC5yaWdodCA9PT0gcCkge1xuICAgICAgICAgICAgcHAucmlnaHQgPSB6XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHBwLmxlZnQgPSB6XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHN0YWNrW2ktMV0gPSB6XG4gICAgICAgIHJldHVyblxuICAgICAgfVxuICAgICAgaWYocy5fY29sb3IgPT09IEJMQUNLKSB7XG4gICAgICAgIGlmKHAuX2NvbG9yID09PSBSRUQpIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiY2FzZSAyOiBibGFjayBzaWJsaW5nLCByZWQgcGFyZW50XCIpXG4gICAgICAgICAgcC5fY29sb3IgPSBCTEFDS1xuICAgICAgICAgIHAubGVmdCA9IHJlcGFpbnQoUkVELCBzKVxuICAgICAgICAgIHJldHVyblxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDI6IGJsYWNrIHNpYmxpbmcsIGJsYWNrIHBhcmVudFwiKVxuICAgICAgICAgIHAubGVmdCA9IHJlcGFpbnQoUkVELCBzKVxuICAgICAgICAgIGNvbnRpbnVlICBcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy9jb25zb2xlLmxvZyhcImNhc2UgMzogcmVkIHNpYmxpbmdcIilcbiAgICAgICAgcyA9IGNsb25lTm9kZShzKVxuICAgICAgICBwLmxlZnQgPSBzLnJpZ2h0XG4gICAgICAgIHMucmlnaHQgPSBwXG4gICAgICAgIHMuX2NvbG9yID0gcC5fY29sb3JcbiAgICA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AgICAgICB2YXIgdG9wID0gdGhpcy5kYXRhWzBdO1xuICAgICAgICB0aGlzLmRhdGFbMF0gPSB0aGlzLmRhdGFbdGhpcy5sZW5ndGggLSAxXTtcbiAgICAgICAgdGhpcy5sZW5ndGgtLTtcbiAgICAgICAgdGhpcy5kYXRhLnBvcCgpO1xuICAgICAgICB0aGlzLl9kb3duKDApO1xuICAgICAgICByZXR1cm4gdG9wO1xuICAgIH0sXG5cbiAgICBwZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRhdGFbMF07XG4gICAgfSxcblxuICAgIF91cDogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmU7XG5cbiAgICAgICAgd2hpbGUgKHBvcyA+IDApIHtcbiAgICAgICAgICAgIHZhciBwYXJlbnQgPSBNYXRoLmZsb29yKChwb3MgLSAxKSAvIDIpO1xuICAgICAgICAgICAgaWYgKGNvbXBhcmUoZGF0YVtwb3NdLCBkYXRhW3BhcmVudF0pIDwgMCkge1xuICAgICAgICAgICAgICAgIHN3YXAoZGF0YSwgcGFyZW50LCBwb3MpO1xuICAgICAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcblxuICAgICAgICAgICAgfSBlbHNlIGJyZWFrO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhLFxuICAgICAgICAgICAgY29tcGFyZSA9IHRoaXMuY29tcGFyZSxcbiAgICAgICAgICAgIGxlbiA9IHRoaXMubGVuZ3RoO1xuXG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICB2YXIgbGVmdCA9IDIgKiBwb3MgKyAxLFxuICAgICAgICAgICAgICAgIHJpZ2h0ID0gbGVmdCArIDEsXG4gICAgICAgICAgICA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V2Lm5vZGUgIT09IHN3ZWVwTGluZS5iZWdpbikge1xuICAgICAgICBwcmV2LnByZXYoKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHByZXYgPSBzd2VlcExpbmUuYmVnaW47XG4gICAgICAgIHByZXYucHJldigpO1xuICAgICAgICBwcmV2Lm5leHQoKTtcbiAgICAgIH1cbiAgICAgIG5leHQubmV4dCgpO1xuXG4gICAgICB2YXIgcHJldkV2ZW50ID0gKHByZXYua2V5IHx8IG51bGwpLCBwcmV2cHJldkV2ZW50O1xuICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgaWYgKG5leHQubm9kZSkge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAocHJldi5ub2RlKSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgZXZlbnQsIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgdmFyIHByZXZwcmV2ID0gc3dlZXBMaW5lLmZpbmQocHJldi5rZXkpO1xuICAgICAgICAgIGlmIChwcmV2cHJldi5ub2RlICE9PSBzd2VlcExpbmUuYmVnaW4pIHtcbiAgICAgICAgICAgIHByZXZwcmV2LnByZXYoKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcHJldnByZXYgPSBzd2VlcExpbmUuZmluZChzd2VlcExpbmUuZW5kKTtcbiAgICAgICAgICAgIHByZXZwcmV2Lm5leHQoKTtcbiAgICAgICAgICB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1cbiAgICovXG4gIGlzVmVydGljYWw6IGZ1bmN0aW9uICgpIHtcbiAgICByZXR1cm4gdGhpcy5wb2ludFswXSA9PT0gdGhpcy5vdGhlckV2ZW50LnBvaW50WzBdO1xuICB9XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IFN3ZWVwRXZlbnQ7XG4iXX0= diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..d463376 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,8018 @@ +{ + "name": "martinez-polygon-clipping", + "version": "0.2.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/geojson": { + "version": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.2.tgz", + "integrity": "sha1-sC0QqwKOKSisWSoFGqpJgaGUHQM=", + "dev": true + }, + "abbrev": { + "version": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", + "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", + "dev": true + }, + "acorn": { + "version": "https://registry.npmjs.org/acorn/-/acorn-4.0.11.tgz", + "integrity": "sha1-7c2jvZN+dVZBDULtWGD2c5nHlMA=", + "dev": true + }, + "acorn-jsx": { + "version": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz" + }, + "dependencies": { + "acorn": { + "version": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "https://registry.npmjs.org/ajv/-/ajv-4.11.7.tgz", + "integrity": "sha1-hlWl2G0IJJhcxHGh2RP7Zymg7Eg=", + "dev": true, + "requires": { + "co": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "json-stable-stringify": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz" + }, + "dependencies": { + "json-stable-stringify": { + "version": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" + } + } + } + }, + "ajv-keywords": { + "version": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", + "dev": true + }, + "amdefine": { + "version": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-escapes": { + "version": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "ansi-regex": { + "version": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "anymatch": { + "version": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", + "integrity": "sha1-o+Uvo5FoyCX/V7AkgSbOWo/5VQc=", + "dev": true, + "requires": { + "arrify": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "micromatch": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz" + } + }, + "archiver": { + "version": "https://registry.npmjs.org/archiver/-/archiver-0.14.4.tgz", + "integrity": "sha1-W53bn17hzu8hy487Ag5iQOy0MVw=", + "dev": true, + "requires": { + "async": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "buffer-crc32": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", + "lazystream": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "tar-stream": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.1.5.tgz", + "zip-stream": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.5.2.tgz" + }, + "dependencies": { + "async": { + "version": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "dev": true + }, + "glob": { + "version": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", + "integrity": "sha1-gPuwjKVA8jiszl0R0em8QedRc9M=", + "dev": true, + "requires": { + "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + } + }, + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "lodash": { + "version": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", + "integrity": "sha1-S/UKMkP5rrC6xBpV09WZBnWkYvs=", + "dev": true + }, + "minimatch": { + "version": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", + "dev": true, + "requires": { + "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + } + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + } + } + } + }, + "argparse": { + "version": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" + } + }, + "arr-diff": { + "version": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz" + } + }, + "arr-flatten": { + "version": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz", + "integrity": "sha1-5f/lTUXhnzLyFukeuZyM6JK7YEs=", + "dev": true + }, + "array-filter": { + "version": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-map": { + "version": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "array-union": { + "version": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz" + } + }, + "array-uniq": { + "version": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arrify": { + "version": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asn1": { + "version": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true + }, + "asn1.js": { + "version": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz", + "integrity": "sha1-SLokC0WpKA6UdImQull9IWYX/UA=", + "dev": true, + "requires": { + "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimalistic-assert": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz" + } + }, + "assert": { + "version": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "https://registry.npmjs.org/util/-/util-0.10.3.tgz" + } + }, + "assert-plus": { + "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true + }, + "astw": { + "version": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", + "integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=", + "dev": true, + "requires": { + "acorn": "https://registry.npmjs.org/acorn/-/acorn-4.0.11.tgz" + } + }, + "async": { + "version": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", + "dev": true + }, + "async-each": { + "version": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "asynckit": { + "version": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "avl": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/avl/-/avl-1.3.0.tgz", + "integrity": "sha512-KIl7yrh+ZSBOBBFD+Ovuh9mMEJuPrLmpYN6tynqWIZSP/r0odVmZBIBGs/JMbRx4qIfegoCoe0Q3byQy95nhjA==" + }, + "aws-sign2": { + "version": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true + }, + "aws4": { + "version": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true + }, + "babel-cli": { + "version": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.23.0.tgz", + "integrity": "sha1-Uv+UaisPZGRcNee9XuomeqCUjA8=", + "dev": true, + "requires": { + "babel-core": "https://registry.npmjs.org/babel-core/-/babel-core-6.23.1.tgz", + "babel-polyfill": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", + "babel-register": "https://registry.npmjs.org/babel-register/-/babel-register-6.23.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "chokidar": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz", + "commander": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "convert-source-map": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.4.0.tgz", + "fs-readdir-recursive": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "output-file-sync": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "slash": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "v8flags": "https://registry.npmjs.org/v8flags/-/v8flags-2.0.11.tgz" + } + }, + "babel-code-frame": { + "version": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", + "integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=", + "dev": true, + "requires": { + "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "js-tokens": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz" + } + }, + "babel-core": { + "version": "https://registry.npmjs.org/babel-core/-/babel-core-6.23.1.tgz", + "integrity": "sha1-wUPLYhuy9iFxDCIMXVedFbikQt8=", + "dev": true, + "requires": { + "babel-code-frame": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", + "babel-generator": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.23.0.tgz", + "babel-helpers": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.23.0.tgz", + "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "babel-register": "https://registry.npmjs.org/babel-register/-/babel-register-6.23.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", + "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", + "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.16.1.tgz", + "convert-source-map": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.4.0.tgz", + "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", + "json5": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "private": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", + "slash": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + } + }, + "babel-generator": { + "version": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.23.0.tgz", + "integrity": "sha1-a47auVbvMRb3nYyExaPAXzKnS8U=", + "dev": true, + "requires": { + "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", + "detect-indent": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "jsesc": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "trim-right": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz" + } + }, + "babel-helper-call-delegate": { + "version": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz", + "integrity": "sha1-EZkhtWEg8X6drj90tPXMe8wbN+8=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-helper-define-map": { + "version": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.23.0.tgz", + "integrity": "sha1-FET5YMlpHWmiztaiBTFfj9AIBOc=", + "dev": true, + "requires": { + "babel-helper-function-name": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + } + }, + "babel-helper-function-name": { + "version": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz", + "integrity": "sha1-JXQtZxdciQPb5LbLnZ4fy43PI6Y=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", + "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-helper-get-function-arity": { + "version": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz", + "integrity": "sha1-C+tGStadxzR0EKxq3p8DpQY09c4=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-helper-hoist-variables": { + "version": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz", + "integrity": "sha1-Pqy/cx2AcFhF3S6XGPYAz7m0unI=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-helper-optimise-call-expression": { + "version": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz", + "integrity": "sha1-8+5+7TVbQoITizPQK3g2nkcGIvU=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-helper-regex": { + "version": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz", + "integrity": "sha1-efUyvhZHsfDuNHS19cPaWAAdJH0=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + } + }, + "babel-helper-replace-supers": { + "version": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz", + "integrity": "sha1-7q+K2bWOxDN8qUIjus3KH42bS/0=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz", + "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", + "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-helpers": { + "version": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.23.0.tgz", + "integrity": "sha1-T48uCS0LaogIpL3nnCfx4uzw2ZI=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz" + } + }, + "babel-messages": { + "version": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz", + "integrity": "sha1-5IiVzws3W+FIzXyIebQicHoFO1E=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", + "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz", + "integrity": "sha1-SbU/MmICov0bO7ql4u3YpPeGQ8E=", + "dev": true, + "requires": { + "babel-helper-define-map": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.23.0.tgz", + "babel-helper-function-name": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz", + "babel-helper-optimise-call-expression": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz", + "babel-helper-replace-supers": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz", + "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", + "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz", + "integrity": "sha1-fDg+lim7pIIMEbBCW91ikPfwV+c=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz", + "integrity": "sha1-ZyOXAxwhYQ1y3Su7C6n7Ynfhw2s=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz", + "integrity": "sha1-9fzIsJCT+aI8dqw9njksPsS3cQQ=", + "dev": true, + "requires": { + "babel-helper-function-name": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.22.0.tgz", + "integrity": "sha1-v2nNNIiaQcM9kN+3QOAJHM/1LyE=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.23.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.23.0.tgz", + "integrity": "sha1-y6eqY3n7fsmSUObUbeKXOq/6e5I=", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.22.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.23.0.tgz", + "integrity": "sha1-rjRpIn/6w5sDENkP7HO/3E9jF7A=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.23.0.tgz", + "integrity": "sha1-jShK4uGe2P4h0rGybW5+D82U8PE=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.22.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz", + "integrity": "sha1-2qYOEUoELqdp3VP+Uo/IIxHrmPw=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz", + "integrity": "sha1-OiqrtwyK+UXVzjhvGkJQYlqDrjs=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz", + "babel-helper-get-function-arity": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", + "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz", + "integrity": "sha1-i6d24K/6pgv/IekhQDuKZSov9yM=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz", + "integrity": "sha1-qzFoKehm7j9LnrlpOXV9GaW8RZM=", + "dev": true, + "requires": { + "babel-helper-regex": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz", + "integrity": "sha1-jZzCfn7h3s/mVFT7mGRSoEphPSA=", + "dev": true, + "requires": { + "babel-helper-regex": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "regexpu-core": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz" + } + }, + "babel-plugin-transform-regenerator": { + "version": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz", + "integrity": "sha1-ZXQFk6MZxEUiFXU41pC4QJRhfqY=", + "dev": true, + "requires": { + "regenerator-transform": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.9.8.tgz" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.22.0.tgz", + "integrity": "sha1-4AjfATQP3IfpWdplmRt+BZcMjHw=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + } + }, + "babel-polyfill": { + "version": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", + "integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "core-js": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", + "regenerator-runtime": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz" + } + }, + "babel-preset-es2015": { + "version": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.22.0.tgz", + "integrity": "sha1-r1qY7LNeuK92StiloF6zbcQ4aDU=", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "babel-plugin-transform-es2015-arrow-functions": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "babel-plugin-transform-es2015-block-scoped-functions": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "babel-plugin-transform-es2015-block-scoping": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz", + "babel-plugin-transform-es2015-classes": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz", + "babel-plugin-transform-es2015-computed-properties": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz", + "babel-plugin-transform-es2015-destructuring": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "babel-plugin-transform-es2015-duplicate-keys": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz", + "babel-plugin-transform-es2015-for-of": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "babel-plugin-transform-es2015-function-name": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz", + "babel-plugin-transform-es2015-literals": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "babel-plugin-transform-es2015-modules-amd": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.22.0.tgz", + "babel-plugin-transform-es2015-modules-commonjs": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.23.0.tgz", + "babel-plugin-transform-es2015-modules-systemjs": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.23.0.tgz", + "babel-plugin-transform-es2015-modules-umd": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.23.0.tgz", + "babel-plugin-transform-es2015-object-super": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz", + "babel-plugin-transform-es2015-parameters": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz", + "babel-plugin-transform-es2015-shorthand-properties": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz", + "babel-plugin-transform-es2015-spread": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "babel-plugin-transform-es2015-sticky-regex": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz", + "babel-plugin-transform-es2015-template-literals": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "babel-plugin-transform-es2015-typeof-symbol": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "babel-plugin-transform-es2015-unicode-regex": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz", + "babel-plugin-transform-regenerator": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz" + } + }, + "babel-register": { + "version": "https://registry.npmjs.org/babel-register/-/babel-register-6.23.0.tgz", + "integrity": "sha1-yao9TMqUtR2jSCbEoPnggUXXT/M=", + "dev": true, + "requires": { + "babel-core": "https://registry.npmjs.org/babel-core/-/babel-core-6.23.1.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "core-js": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", + "home-or-tmp": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "source-map-support": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.11.tgz" + } + }, + "babel-runtime": { + "version": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "integrity": "sha1-CpSJ8UTecO+zzkMArM2zKeL8VDs=", + "dev": true, + "requires": { + "core-js": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", + "regenerator-runtime": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz" + } + }, + "babel-template": { + "version": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", + "integrity": "sha1-BNTycK27OqcEqBQ64m+qUpI45jg=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", + "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.16.1.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + } + }, + "babel-traverse": { + "version": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", + "integrity": "sha1-08tZAQ7NBql9gTEAZflmtpnhT0g=", + "dev": true, + "requires": { + "babel-code-frame": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", + "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", + "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.16.1.tgz", + "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", + "globals": "https://registry.npmjs.org/globals/-/globals-9.16.0.tgz", + "invariant": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + } + }, + "babel-types": { + "version": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", + "integrity": "sha1-uxcXnXU4utOM0MnhFdNA935+ms8=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "to-fast-properties": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.2.tgz" + } + }, + "babelify": { + "version": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", + "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", + "dev": true, + "requires": { + "babel-core": "https://registry.npmjs.org/babel-core/-/babel-core-6.23.1.tgz", + "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + } + }, + "babylon": { + "version": "https://registry.npmjs.org/babylon/-/babylon-6.16.1.tgz", + "integrity": "sha1-MMWiL0gZeKnn+M399JaxHZS0BNM=", + "dev": true + }, + "balanced-match": { + "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + }, + "base64-js": { + "version": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", + "integrity": "sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" + } + }, + "binary-extensions": { + "version": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz", + "integrity": "sha1-SOyNFt9Dd+rl+liEaCSAr02Vx3Q=", + "dev": true + }, + "bl": { + "version": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", + "integrity": "sha1-wGt5evCF6gC8Unr8jvzxHeIjIFQ=", + "dev": true, + "requires": { + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + }, + "dependencies": { + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + } + } + } + }, + "bluebird": { + "version": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", + "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=", + "dev": true + }, + "bn.js": { + "version": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true + }, + "boom": { + "version": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + } + }, + "brace-expansion": { + "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", + "dev": true, + "requires": { + "balanced-match": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + }, + "braces": { + "version": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "preserve": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "repeat-element": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz" + } + }, + "brorand": { + "version": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-pack": { + "version": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.2.tgz", + "integrity": "sha1-+GzWzvT1MAyOY+B6TVEvZfv/RTE=", + "dev": true, + "requires": { + "combine-source-map": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz", + "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "umd": "https://registry.npmjs.org/umd/-/umd-3.0.1.tgz" + } + }, + "browser-resolve": { + "version": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", + "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", + "dev": true, + "requires": { + "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz" + }, + "dependencies": { + "resolve": { + "version": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "browserify": { + "version": "https://registry.npmjs.org/browserify/-/browserify-13.3.0.tgz", + "integrity": "sha1-tanJAgJD8McORnW+yCI7xifkFc4=", + "dev": true, + "requires": { + "assert": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "browser-pack": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.2.tgz", + "browser-resolve": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", + "browserify-zlib": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "buffer": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "cached-path-relative": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", + "concat-stream": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "console-browserify": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "constants-browserify": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "crypto-browserify": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.0.tgz", + "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "deps-sort": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "domain-browser": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "duplexer2": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "events": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "has": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "htmlescape": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "https-browserify": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "insert-module-globals": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.1.tgz", + "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "labeled-stream-splicer": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz", + "module-deps": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", + "os-browserify": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "parents": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "path-browserify": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "process": "https://registry.npmjs.org/process/-/process-0.11.9.tgz", + "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "querystring-es3": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "read-only-stream": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", + "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.2.tgz", + "shasum": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "shell-quote": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "stream-browserify": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "stream-http": "https://registry.npmjs.org/stream-http/-/stream-http-2.6.3.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "subarg": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "syntax-error": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.3.0.tgz", + "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "timers-browserify": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "tty-browserify": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "url": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "util": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "vm-browserify": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + }, + "browserify-aes": { + "version": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", + "integrity": "sha1-Xncl297x/Vkw1OurSFZ85FHEigo=", + "dev": true, + "requires": { + "buffer-xor": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "cipher-base": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.3.tgz", + "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", + "evp_bytestokey": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + } + }, + "browserify-cipher": { + "version": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", + "dev": true, + "requires": { + "browserify-aes": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", + "browserify-des": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "evp_bytestokey": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz" + } + }, + "browserify-des": { + "version": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", + "dev": true, + "requires": { + "cipher-base": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.3.tgz", + "des.js": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + } + }, + "browserify-rsa": { + "version": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "randombytes": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz" + } + }, + "browserify-sign": { + "version": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.0.tgz", + "integrity": "sha1-EHc5EMPCBtVCCkaq2GlPgguFlo8=", + "dev": true, + "requires": { + "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "browserify-rsa": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", + "create-hmac": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.4.tgz", + "elliptic": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "parse-asn1": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.0.0.tgz" + } + }, + "browserify-zlib": { + "version": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz" + } + }, + "buffer": { + "version": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "dev": true, + "requires": { + "base64-js": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", + "ieee754": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + } + }, + "buffer-crc32": { + "version": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, + "buffer-shims": { + "version": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", + "dev": true + }, + "buffer-xor": { + "version": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-status-codes": { + "version": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "cached-path-relative": { + "version": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", + "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=", + "dev": true + }, + "caller-path": { + "version": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz" + } + }, + "callsites": { + "version": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camelcase": { + "version": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "chalk": { + "version": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "has-ansi": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "supports-color": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + } + }, + "chokidar": { + "version": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz", + "integrity": "sha1-L0RHq16W5Q+z14n9kNTHLg5McMI=", + "dev": true, + "requires": { + "anymatch": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", + "async-each": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "fsevents": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.1.tgz", + "glob-parent": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "is-binary-path": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "readdirp": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz" + } + }, + "chrome-launch": { + "version": "https://registry.npmjs.org/chrome-launch/-/chrome-launch-1.1.4.tgz", + "integrity": "sha1-yJhb0CJjWlzIlwmbr9GYMYOKclI=", + "dev": true, + "requires": { + "chrome-location": "https://registry.npmjs.org/chrome-location/-/chrome-location-1.2.1.tgz", + "quick-tmp": "https://registry.npmjs.org/quick-tmp/-/quick-tmp-0.0.0.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", + "shallow-copy": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz" + } + }, + "chrome-location": { + "version": "https://registry.npmjs.org/chrome-location/-/chrome-location-1.2.1.tgz", + "integrity": "sha1-aRFRGk6sVQJ2Jcc7k3ylynq5SZU=", + "dev": true, + "requires": { + "userhome": "https://registry.npmjs.org/userhome/-/userhome-1.0.0.tgz", + "which": "https://registry.npmjs.org/which/-/which-1.2.12.tgz" + } + }, + "cipher-base": { + "version": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.3.tgz", + "integrity": "sha1-7qvxlEGc6QDaMBjCB9IS8qbfCgc=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + } + }, + "circular-json": { + "version": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.1.tgz", + "integrity": "sha1-vos2rvzN6LPKeqLWr8B6NyQsDS0=", + "dev": true + }, + "clean-yaml-object": { + "version": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", + "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", + "dev": true + }, + "cli-cursor": { + "version": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz" + } + }, + "cli-width": { + "version": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", + "integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=", + "dev": true + }, + "co": { + "version": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "color-support": { + "version": "https://registry.npmjs.org/color-support/-/color-support-1.1.2.tgz", + "integrity": "sha1-ScyZuJ0b3vEpLp2TI8ZpcaM+uJ0=", + "dev": true + }, + "colors": { + "version": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + }, + "combine-source-map": { + "version": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz", + "integrity": "sha1-CHAxKFazB6h8xKxIbzqaYq7MwJ4=", + "dev": true, + "requires": { + "convert-source-map": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "inline-source-map": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "lodash.memoize": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + }, + "dependencies": { + "convert-source-map": { + "version": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + } + } + }, + "combined-stream": { + "version": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "dev": true, + "requires": { + "delayed-stream": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + } + }, + "commander": { + "version": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true, + "requires": { + "graceful-readlink": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" + } + }, + "component-emitter": { + "version": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "compress-commons": { + "version": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.2.9.tgz", + "integrity": "sha1-Qi2SdDDAGr0GzUVbbfwEy0z4ADw=", + "dev": true, + "requires": { + "buffer-crc32": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "crc32-stream": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.3.4.tgz", + "node-int64": "https://registry.npmjs.org/node-int64/-/node-int64-0.3.3.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + }, + "dependencies": { + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + } + } + } + }, + "concat-map": { + "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "typedarray": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" + }, + "dependencies": { + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "dev": true, + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + } + } + } + }, + "configstore": { + "version": "https://registry.npmjs.org/configstore/-/configstore-1.4.0.tgz", + "integrity": "sha1-w1eB0FAdJowlxUuLF/YkDopPsCE=", + "dev": true, + "requires": { + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "os-tmpdir": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "osenv": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "uuid": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", + "write-file-atomic": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.1.tgz", + "xdg-basedir": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz" + } + }, + "console-browserify": { + "version": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz" + } + }, + "constants-browserify": { + "version": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "convert-source-map": { + "version": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.4.0.tgz", + "integrity": "sha1-49rRlb9hv+E6ejxz6YduwUoCaPM=", + "dev": true + }, + "cookiejar": { + "version": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.0.tgz", + "integrity": "sha1-hlSWiVObbQ4mm2Y3owS+UIGU2Jg=", + "dev": true + }, + "core-js": { + "version": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", + "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=", + "dev": true + }, + "core-util-is": { + "version": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "corser": { + "version": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", + "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=", + "dev": true + }, + "coveralls": { + "version": "https://registry.npmjs.org/coveralls/-/coveralls-2.12.0.tgz", + "integrity": "sha1-s9BkEI4pcoOFtW5C/C0Rn0Pg5Rc=", + "dev": true, + "requires": { + "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz", + "lcov-parse": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", + "log-driver": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", + "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "request": "https://registry.npmjs.org/request/-/request-2.79.0.tgz" + }, + "dependencies": { + "caseless": { + "version": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "dev": true + }, + "esprima": { + "version": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "har-validator": { + "version": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "dev": true, + "requires": { + "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "commander": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "is-my-json-valid": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", + "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + } + }, + "js-yaml": { + "version": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz", + "integrity": "sha1-bl/mfYsgXOTSL60Ft3geja3MSzA=", + "dev": true, + "requires": { + "argparse": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "esprima": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz" + } + }, + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "qs": { + "version": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", + "dev": true + }, + "request": { + "version": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "dev": true, + "requires": { + "aws-sign2": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "aws4": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "caseless": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "extend": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "forever-agent": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "form-data": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", + "har-validator": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "hawk": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "http-signature": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "is-typedarray": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "isstream": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "json-stringify-safe": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", + "oauth-sign": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "qs": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "stringstream": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "tough-cookie": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "tunnel-agent": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "uuid": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz" + } + }, + "uuid": { + "version": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", + "integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=", + "dev": true + } + } + }, + "crc32-stream": { + "version": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.3.4.tgz", + "integrity": "sha1-c7wltF+sHbZjIjGnv86JJ+nwZVI=", + "dev": true, + "requires": { + "buffer-crc32": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + }, + "dependencies": { + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + } + } + } + }, + "create-ecdh": { + "version": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", + "dev": true, + "requires": { + "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "elliptic": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz" + } + }, + "create-hash": { + "version": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", + "integrity": "sha1-USEAYte7dHn2xlu0GpIgix1hq60=", + "dev": true, + "requires": { + "cipher-base": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.3.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "ripemd160": "https://registry.npmjs.org/ripemd160/-/ripemd160-1.0.1.tgz", + "sha.js": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz" + } + }, + "create-hmac": { + "version": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.4.tgz", + "integrity": "sha1-0/tLolPriz9W456i+8uK90e9MXA=", + "dev": true, + "requires": { + "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + } + }, + "cross-spawn": { + "version": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "dev": true, + "requires": { + "lru-cache": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", + "which": "https://registry.npmjs.org/which/-/which-1.2.12.tgz" + } + }, + "cryptiles": { + "version": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + } + }, + "crypto-browserify": { + "version": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.0.tgz", + "integrity": "sha1-NlKgkGq5sqfgw85mpAjpV6JIVSI=", + "dev": true, + "requires": { + "browserify-cipher": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "browserify-sign": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.0.tgz", + "create-ecdh": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", + "create-hmac": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.4.tgz", + "diffie-hellman": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "pbkdf2": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.9.tgz", + "public-encrypt": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "randombytes": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz" + } + }, + "ctype": { + "version": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", + "integrity": "sha1-gsGMJGH3QRTvFsE1IkrQuRRMoS8=", + "dev": true + }, + "d": { + "version": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", + "integrity": "sha1-2hhMU10Y2O57oqoim5FACfrhEwk=", + "dev": true, + "requires": { + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz" + } + }, + "dashdash": { + "version": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + }, + "dependencies": { + "assert-plus": { + "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "date-now": { + "version": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", + "integrity": "sha1-eYVQkLosTjEVzH2HaUkdWPBJE1E=", + "dev": true, + "requires": { + "ms": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz" + } + }, + "decamelize": { + "version": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-equal": { + "version": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, + "deep-extend": { + "version": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.1.tgz", + "integrity": "sha1-7+QRPQgIX05vlod1mBD4B0aeIlM=", + "dev": true + }, + "deep-is": { + "version": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "deeper": { + "version": "https://registry.npmjs.org/deeper/-/deeper-2.1.0.tgz", + "integrity": "sha1-vFZOX3MXT98gHgiwADDooU2nQ2g=", + "dev": true + }, + "define-properties": { + "version": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "object-keys": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz" + } + }, + "defined": { + "version": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "del": { + "version": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "is-path-cwd": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "is-path-in-cwd": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "pify": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz" + } + }, + "delayed-stream": { + "version": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "deps-sort": { + "version": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "dev": true, + "requires": { + "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "shasum": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "subarg": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz" + } + }, + "des.js": { + "version": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimalistic-assert": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz" + } + }, + "detect-indent": { + "version": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz" + } + }, + "detective": { + "version": "https://registry.npmjs.org/detective/-/detective-4.5.0.tgz", + "integrity": "sha1-blqMaybmx6JUsca210kNmOyR7dE=", + "dev": true, + "requires": { + "acorn": "https://registry.npmjs.org/acorn/-/acorn-4.0.11.tgz", + "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz" + } + }, + "diff": { + "version": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", + "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=", + "dev": true + }, + "diffie-hellman": { + "version": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", + "dev": true, + "requires": { + "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "miller-rabin": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.0.tgz", + "randombytes": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz" + } + }, + "doctrine": { + "version": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", + "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", + "dev": true, + "requires": { + "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + } + }, + "dom-walk": { + "version": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", + "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=", + "dev": true + }, + "domain-browser": { + "version": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "dev": true + }, + "duplexer": { + "version": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, + "duplexer2": { + "version": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + } + }, + "duplexify": { + "version": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", + "integrity": "sha1-GqdzAC4VeEV+nZ1KULDMquvL1gQ=", + "dev": true, + "requires": { + "end-of-stream": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", + "stream-shift": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz" + } + }, + "ecc-jsbn": { + "version": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" + } + }, + "ecstatic": { + "version": "https://registry.npmjs.org/ecstatic/-/ecstatic-1.4.1.tgz", + "integrity": "sha1-Mst7b6LikNWGaGdNEV6PDD1WfWo=", + "dev": true, + "requires": { + "he": "https://registry.npmjs.org/he/-/he-0.5.0.tgz", + "mime": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "url-join": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz" + }, + "dependencies": { + "mime": { + "version": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=", + "dev": true + }, + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "elliptic": { + "version": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "dev": true, + "requires": { + "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "brorand": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "hash.js": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz", + "hmac-drbg": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.0.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimalistic-assert": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "minimalistic-crypto-utils": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz" + } + }, + "end-of-stream": { + "version": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", + "integrity": "sha1-1FlucCc0qT5A6a+GQxnqvZn/Lw4=", + "dev": true, + "requires": { + "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz" + }, + "dependencies": { + "once": { + "version": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "dev": true, + "requires": { + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + } + } + }, + "error-ex": { + "version": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" + } + }, + "es-abstract": { + "version": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.7.0.tgz", + "integrity": "sha1-363ndOAb/Nl/lhgCmMRJyGI/uUw=", + "dev": true, + "requires": { + "es-to-primitive": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "function-bind": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", + "is-callable": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "is-regex": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz" + } + }, + "es-to-primitive": { + "version": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "is-date-object": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "is-symbol": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz" + } + }, + "es5-ext": { + "version": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz", + "integrity": "sha1-qoRkHU23a2Krul5F/YBey6sUAEc=", + "dev": true, + "requires": { + "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz" + } + }, + "es6-iterator": { + "version": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", + "integrity": "sha1-vZaFZ9YWNeM8C4BydhPJy0sJa6w=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz" + } + }, + "es6-map": { + "version": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "es6-set": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "event-emitter": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz" + }, + "dependencies": { + "d": { + "version": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" + } + }, + "es5-ext": { + "version": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "integrity": "sha1-wzClk0we4hKEp8CBqG5f2TfJHqY=", + "dev": true, + "requires": { + "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" + } + }, + "es6-iterator": { + "version": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" + } + }, + "es6-symbol": { + "version": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" + } + } + } + }, + "es6-promise": { + "version": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=", + "dev": true + }, + "es6-set": { + "version": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "event-emitter": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz" + }, + "dependencies": { + "d": { + "version": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" + } + }, + "es5-ext": { + "version": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "integrity": "sha1-wzClk0we4hKEp8CBqG5f2TfJHqY=", + "dev": true, + "requires": { + "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" + } + }, + "es6-iterator": { + "version": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" + } + }, + "es6-symbol": { + "version": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" + } + } + } + }, + "es6-symbol": { + "version": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz", + "integrity": "sha1-lEgcZV56fK2C66gy2X1UM0ltf/o=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz" + } + }, + "es6-weak-map": { + "version": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" + }, + "dependencies": { + "d": { + "version": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" + } + }, + "es5-ext": { + "version": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "integrity": "sha1-wzClk0we4hKEp8CBqG5f2TfJHqY=", + "dev": true, + "requires": { + "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" + } + }, + "es6-iterator": { + "version": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" + } + }, + "es6-symbol": { + "version": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" + } + } + } + }, + "escape-string-regexp": { + "version": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escope": { + "version": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", + "dev": true, + "requires": { + "es6-map": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "es6-weak-map": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "esrecurse": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.1.0.tgz", + "estraverse": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz" + } + }, + "eslint": { + "version": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", + "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", + "dev": true, + "requires": { + "babel-code-frame": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", + "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "concat-stream": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", + "doctrine": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", + "escope": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "espree": "https://registry.npmjs.org/espree/-/espree-3.4.2.tgz", + "esquery": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "estraverse": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "file-entry-cache": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "globals": "https://registry.npmjs.org/globals/-/globals-9.16.0.tgz", + "ignore": "https://registry.npmjs.org/ignore/-/ignore-3.2.7.tgz", + "imurmurhash": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "inquirer": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", + "is-my-json-valid": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", + "is-resolvable": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", + "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", + "json-stable-stringify": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "levn": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "natural-compare": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "optionator": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "path-is-inside": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "pluralize": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", + "progress": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "require-uncached": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "shelljs": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.7.tgz", + "strip-bom": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "strip-json-comments": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "table": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", + "text-table": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "user-home": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz" + }, + "dependencies": { + "json-stable-stringify": { + "version": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" + } + }, + "user-home": { + "version": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", + "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", + "dev": true, + "requires": { + "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" + } + } + } + }, + "eslint-config-mourner": { + "version": "https://registry.npmjs.org/eslint-config-mourner/-/eslint-config-mourner-2.0.1.tgz", + "integrity": "sha1-hOAPRMo3Mki02Nh/w7uqOyp2mp0=", + "dev": true + }, + "espree": { + "version": "https://registry.npmjs.org/espree/-/espree-3.4.2.tgz", + "integrity": "sha1-ONve2+3JW4lhofvwRzSo9qnIxZI=", + "dev": true, + "requires": { + "acorn": "https://registry.npmjs.org/acorn/-/acorn-5.0.3.tgz", + "acorn-jsx": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz" + }, + "dependencies": { + "acorn": { + "version": "https://registry.npmjs.org/acorn/-/acorn-5.0.3.tgz", + "integrity": "sha1-xGDfCEkUY/AozLguqzcwvwEIez0=", + "dev": true + } + } + }, + "esprima": { + "version": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "esquery": { + "version": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "requires": { + "estraverse": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz" + } + }, + "esrecurse": { + "version": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.1.0.tgz", + "integrity": "sha1-RxO2U2rffyrE8yfVWed1a/9kgiA=", + "dev": true, + "requires": { + "estraverse": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz", + "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + }, + "dependencies": { + "estraverse": { + "version": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz", + "integrity": "sha1-9srKcokzqFDvkGYdDheYK6RxEaI=", + "dev": true + } + } + }, + "estraverse": { + "version": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-emitter": { + "version": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" + }, + "dependencies": { + "d": { + "version": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" + } + }, + "es5-ext": { + "version": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "integrity": "sha1-wzClk0we4hKEp8CBqG5f2TfJHqY=", + "dev": true, + "requires": { + "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", + "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz" + } + } + } + }, + "event-stream": { + "version": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", + "dev": true, + "requires": { + "duplexer": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "from": "https://registry.npmjs.org/from/-/from-0.1.3.tgz", + "map-stream": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "pause-stream": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "split": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "stream-combiner": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + } + }, + "eventemitter3": { + "version": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", + "integrity": "sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg=", + "dev": true + }, + "events": { + "version": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "events-to-array": { + "version": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.0.2.tgz", + "integrity": "sha1-s0hEZVNP5P9m+90ag7d3cTukBKo=", + "dev": true + }, + "eventsource": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-0.1.6.tgz", + "integrity": "sha1-Cs7ehJ7X3RzMMsgRuxG5RNTykjI=", + "dev": true, + "requires": { + "original": "1.0.0" + } + }, + "evp_bytestokey": { + "version": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz", + "integrity": "sha1-SXtmrZ/vZc18CKYYCCS6FHa2blM=", + "dev": true, + "requires": { + "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz" + } + }, + "exit-hook": { + "version": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true + }, + "expand-brackets": { + "version": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz" + } + }, + "expand-range": { + "version": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" + } + }, + "extend": { + "version": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "integrity": "sha1-WkdDU7nzNT3dgXbf03uRyDpG8dQ=", + "dev": true + }, + "extglob": { + "version": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + } + }, + "extsprintf": { + "version": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", + "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", + "dev": true + }, + "fast-levenshtein": { + "version": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "faye-websocket": { + "version": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.4.4.tgz", + "integrity": "sha1-wUxbO/FNdBf/v9mQwKdJXNnzN7w=", + "dev": true + }, + "figures": { + "version": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + } + }, + "file-entry-cache": { + "version": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", + "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + } + }, + "filename-regex": { + "version": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz", + "integrity": "sha1-mW4+gEebmLmJfxWopYs9CE6SZ3U=", + "dev": true + }, + "fill-range": { + "version": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true, + "requires": { + "is-number": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "isobject": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "randomatic": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.6.tgz", + "repeat-element": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "repeat-string": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" + } + }, + "firefox-launch": { + "version": "https://registry.npmjs.org/firefox-launch/-/firefox-launch-1.0.2.tgz", + "integrity": "sha1-hE5tdiIAY4flikGcAzPDC0iYaCc=", + "dev": true, + "requires": { + "firefox-location": "https://registry.npmjs.org/firefox-location/-/firefox-location-1.0.2.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "quick-tmp": "https://registry.npmjs.org/quick-tmp/-/quick-tmp-0.0.0.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", + "shallow-copy": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz" + } + }, + "firefox-location": { + "version": "https://registry.npmjs.org/firefox-location/-/firefox-location-1.0.2.tgz", + "integrity": "sha1-S+5a+TewR5Qf8glkTK/479MrK0c=", + "dev": true, + "requires": { + "userhome": "https://registry.npmjs.org/userhome/-/userhome-1.0.0.tgz", + "which": "https://registry.npmjs.org/which/-/which-1.2.12.tgz" + } + }, + "first-match": { + "version": "https://registry.npmjs.org/first-match/-/first-match-0.0.1.tgz", + "integrity": "sha1-pg7GQnAPD0NyNOu37D84JHblQv0=", + "dev": true + }, + "flat-cache": { + "version": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", + "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", + "dev": true, + "requires": { + "circular-json": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.1.tgz", + "del": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "write": "https://registry.npmjs.org/write/-/write-0.2.1.tgz" + } + }, + "for-each": { + "version": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", + "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", + "dev": true, + "requires": { + "is-function": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz" + } + }, + "for-in": { + "version": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" + } + }, + "foreach": { + "version": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "foreground-child": { + "version": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", + "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "dev": true, + "requires": { + "cross-spawn": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz" + } + }, + "forever-agent": { + "version": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", + "integrity": "sha1-icNTQAi5fq2ky7FX1Y9vXfAl6uQ=", + "dev": true, + "requires": { + "asynckit": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz" + } + }, + "from": { + "version": "https://registry.npmjs.org/from/-/from-0.1.3.tgz", + "integrity": "sha1-72OsIGKsMqz3hi4NQLRLiW8i87w=", + "dev": true + }, + "fs-readdir-recursive": { + "version": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz", + "integrity": "sha1-jNF0XItPiinIyuw5JHaSG6GV9WA=", + "dev": true + }, + "fs.realpath": { + "version": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.1.tgz", + "integrity": "sha1-8Z/Sj0Pur3YWgOUZogPE0LPTGv8=", + "dev": true, + "optional": true, + "requires": { + "nan": "https://registry.npmjs.org/nan/-/nan-2.5.1.tgz", + "node-pre-gyp": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz" + }, + "dependencies": { + "abbrev": { + "version": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", + "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true, + "optional": true + }, + "aproba": { + "version": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", + "integrity": "sha1-ldNgDwdxCqDpKYxyatXs8urLq6s=", + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz", + "integrity": "sha1-gORw6VoIR5T+GJkmLFZnxuiN4bM=", + "dev": true, + "optional": true, + "requires": { + "delegates": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz" + } + }, + "asn1": { + "version": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true, + "optional": true + }, + "asynckit": { + "version": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true, + "optional": true + }, + "aws4": { + "version": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" + } + }, + "block-stream": { + "version": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + } + }, + "boom": { + "version": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + } + }, + "brace-expansion": { + "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", + "dev": true, + "requires": { + "balanced-match": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + }, + "buffer-shims": { + "version": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", + "dev": true + }, + "caseless": { + "version": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "dev": true, + "optional": true + }, + "chalk": { + "version": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "has-ansi": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "supports-color": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + } + }, + "code-point-at": { + "version": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "combined-stream": { + "version": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "dev": true, + "requires": { + "delayed-stream": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + } + }, + "commander": { + "version": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true, + "optional": true, + "requires": { + "graceful-readlink": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" + } + }, + "concat-map": { + "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "console-control-strings": { + "version": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, + "core-util-is": { + "version": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cryptiles": { + "version": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "optional": true, + "requires": { + "boom": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + } + }, + "dashdash": { + "version": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + }, + "dependencies": { + "assert-plus": { + "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "optional": true, + "requires": { + "ms": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + } + }, + "deep-extend": { + "version": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.1.tgz", + "integrity": "sha1-7+QRPQgIX05vlod1mBD4B0aeIlM=", + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegates": { + "version": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" + } + }, + "escape-string-regexp": { + "version": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "optional": true + }, + "extend": { + "version": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "integrity": "sha1-WkdDU7nzNT3dgXbf03uRyDpG8dQ=", + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", + "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", + "dev": true + }, + "forever-agent": { + "version": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true, + "optional": true + }, + "form-data": { + "version": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", + "integrity": "sha1-icNTQAi5fq2ky7FX1Y9vXfAl6uQ=", + "dev": true, + "optional": true, + "requires": { + "asynckit": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz" + } + }, + "fs.realpath": { + "version": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fstream": { + "version": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz", + "integrity": "sha1-YE6Kkv4m/9n2+uMDmdSYThqyKCI=", + "dev": true, + "requires": { + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz" + } + }, + "fstream-ignore": { + "version": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", + "integrity": "sha1-nDHa40dnAY/h0kmyTa2mfQktoQU=", + "dev": true, + "optional": true, + "requires": { + "fstream": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" + } + }, + "gauge": { + "version": "https://registry.npmjs.org/gauge/-/gauge-2.7.3.tgz", + "integrity": "sha1-HCOFX5YvF7OtPQ3HRD8wRULt/gk=", + "dev": true, + "optional": true, + "requires": { + "aproba": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", + "console-control-strings": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "has-unicode": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "wide-align": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz" + } + }, + "generate-function": { + "version": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "dev": true, + "optional": true + }, + "generate-object-property": { + "version": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, + "optional": true, + "requires": { + "is-property": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" + } + }, + "getpass": { + "version": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", + "integrity": "sha1-KD/9n8ElaECHUxHBtg6MQBhxEOY=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + }, + "dependencies": { + "assert-plus": { + "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "dev": true, + "requires": { + "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + } + }, + "graceful-fs": { + "version": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "graceful-readlink": { + "version": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true, + "optional": true + }, + "har-validator": { + "version": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "dev": true, + "optional": true, + "requires": { + "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "commander": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "is-my-json-valid": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz", + "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + } + }, + "has-ansi": { + "version": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + } + }, + "has-unicode": { + "version": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true, + "optional": true + }, + "hawk": { + "version": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "optional": true, + "requires": { + "boom": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "cryptiles": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "sntp": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" + } + }, + "hoek": { + "version": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "http-signature": { + "version": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "jsprim": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", + "sshpk": "https://registry.npmjs.org/sshpk/-/sshpk-1.10.2.tgz" + } + }, + "inflight": { + "version": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + }, + "inherits": { + "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" + } + }, + "is-my-json-valid": { + "version": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz", + "integrity": "sha1-k27do8o8IR/ZjzstPgjaQ/eykVs=", + "dev": true, + "optional": true, + "requires": { + "generate-function": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "generate-object-property": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "jsonpointer": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + }, + "is-property": { + "version": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "dev": true, + "optional": true + }, + "is-typedarray": { + "version": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true, + "optional": true + }, + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isstream": { + "version": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", + "integrity": "sha1-BtSRIlUJNBlHfUJWM2BuDpB4KWc=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" + } + }, + "jsbn": { + "version": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "json-schema": { + "version": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true, + "optional": true + }, + "json-stringify-safe": { + "version": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true, + "optional": true + }, + "jsonpointer": { + "version": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "dev": true, + "optional": true + }, + "jsprim": { + "version": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", + "integrity": "sha1-KnJW9wQSop7jZwqspiWZTE3P8lI=", + "dev": true, + "optional": true, + "requires": { + "extsprintf": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", + "json-schema": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "verror": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz" + } + }, + "mime-db": { + "version": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz", + "integrity": "sha1-6v/NDk/Gk1z4E02iRuLmw1MFrf8=", + "dev": true + }, + "mime-types": { + "version": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", + "integrity": "sha1-9+99l1g/yvO30oK2+LVnnaselO4=", + "dev": true, + "requires": { + "mime-db": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz" + } + }, + "minimatch": { + "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", + "dev": true, + "requires": { + "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + } + }, + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + } + }, + "ms": { + "version": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz", + "integrity": "sha1-ZArFUZj2qSWXLgwWxKwmoDTV7Mk=", + "dev": true, + "optional": true, + "requires": { + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "nopt": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "npmlog": "https://registry.npmjs.org/npmlog/-/npmlog-4.0.2.tgz", + "rc": "https://registry.npmjs.org/rc/-/rc-1.1.7.tgz", + "request": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "semver": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "tar": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "tar-pack": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.3.0.tgz" + } + }, + "nopt": { + "version": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "optional": true, + "requires": { + "abbrev": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz" + } + }, + "npmlog": { + "version": "https://registry.npmjs.org/npmlog/-/npmlog-4.0.2.tgz", + "integrity": "sha1-0DlQ4OeM4VJ7om0qdZLpNIrD518=", + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz", + "console-control-strings": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "gauge": "https://registry.npmjs.org/gauge/-/gauge-2.7.3.tgz", + "set-blocking": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" + } + }, + "number-is-nan": { + "version": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true, + "optional": true + }, + "object-assign": { + "version": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "optional": true + }, + "once": { + "version": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + }, + "path-is-absolute": { + "version": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "pinkie": { + "version": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true, + "optional": true + }, + "pinkie-promise": { + "version": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "optional": true, + "requires": { + "pinkie": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + } + }, + "process-nextick-args": { + "version": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "punycode": { + "version": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true, + "optional": true + }, + "qs": { + "version": "https://registry.npmjs.org/qs/-/qs-6.3.1.tgz", + "integrity": "sha1-kYwLO802Z5dyuvE1say0wWUe150=", + "dev": true, + "optional": true + }, + "rc": { + "version": "https://registry.npmjs.org/rc/-/rc-1.1.7.tgz", + "integrity": "sha1-xepWS7B6/5/TpbMukGwdOmWUD+o=", + "dev": true, + "optional": true, + "requires": { + "deep-extend": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.1.tgz", + "ini": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "strip-json-comments": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" + }, + "dependencies": { + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz", + "integrity": "sha1-qeb+w8fdqF+LsbO6cChgRVb8gl4=", + "dev": true, + "optional": true, + "requires": { + "buffer-shims": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + } + }, + "request": { + "version": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "aws4": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "caseless": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "extend": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "forever-agent": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "form-data": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", + "har-validator": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "hawk": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "http-signature": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "is-typedarray": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "isstream": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "json-stringify-safe": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", + "oauth-sign": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "qs": "https://registry.npmjs.org/qs/-/qs-6.3.1.tgz", + "stringstream": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "tough-cookie": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "tunnel-agent": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "uuid": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz" + } + }, + "rimraf": { + "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "integrity": "sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ=", + "dev": true, + "requires": { + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz" + } + }, + "semver": { + "version": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true, + "optional": true + }, + "sntp": { + "version": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "optional": true, + "requires": { + "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + } + }, + "sshpk": { + "version": "https://registry.npmjs.org/sshpk/-/sshpk-1.10.2.tgz", + "integrity": "sha1-1agEziJpVRVjjnmNviMnPeBwpfo=", + "dev": true, + "optional": true, + "requires": { + "asn1": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "bcrypt-pbkdf": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "dashdash": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "ecc-jsbn": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "getpass": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", + "jodid25519": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", + "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "tweetnacl": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" + }, + "dependencies": { + "assert-plus": { + "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "string_decoder": { + "version": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "string-width": { + "version": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "is-fullwidth-code-point": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + } + }, + "stringstream": { + "version": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + } + }, + "strip-json-comments": { + "version": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "optional": true + }, + "supports-color": { + "version": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true, + "optional": true + }, + "tar": { + "version": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "dev": true, + "requires": { + "block-stream": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "fstream": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + } + }, + "tar-pack": { + "version": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.3.0.tgz", + "integrity": "sha1-MJMYFkGPVa/E0hd1r91nIM7kXa4=", + "dev": true, + "optional": true, + "requires": { + "debug": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "fstream": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz", + "fstream-ignore": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", + "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "tar": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "uid-number": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz" + }, + "dependencies": { + "once": { + "version": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "dev": true, + "optional": true, + "requires": { + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", + "integrity": "sha1-ZvqLcg4UOLNkaB8q0aY8YYRIydA=", + "dev": true, + "optional": true, + "requires": { + "buffer-shims": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + } + } + } + }, + "tough-cookie": { + "version": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "dev": true, + "optional": true, + "requires": { + "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz" + } + }, + "tunnel-agent": { + "version": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true, + "optional": true + }, + "tweetnacl": { + "version": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "uid-number": { + "version": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", + "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", + "integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=", + "dev": true, + "optional": true + }, + "verror": { + "version": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", + "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", + "dev": true, + "optional": true, + "requires": { + "extsprintf": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" + } + }, + "wide-align": { + "version": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz", + "integrity": "sha1-QO3egCpx/qHwcNo+YtzaLnrdlq0=", + "dev": true, + "optional": true, + "requires": { + "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" + } + }, + "wrappy": { + "version": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xtend": { + "version": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true, + "optional": true + } + } + }, + "function-bind": { + "version": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", + "integrity": "sha1-FhdnFMgBeY5Ojyz391KUZ7tKV3E=", + "dev": true + }, + "functional-red-black-tree": { + "version": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "generate-function": { + "version": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "dev": true + }, + "generate-object-property": { + "version": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, + "requires": { + "is-property": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" + } + }, + "geojson-project": { + "version": "https://registry.npmjs.org/geojson-project/-/geojson-project-1.0.1.tgz", + "integrity": "sha1-qpNGWGVYo2XETWaY/80L/FffRAY=", + "dev": true + }, + "getpass": { + "version": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", + "integrity": "sha1-KD/9n8ElaECHUxHBtg6MQBhxEOY=", + "dev": true, + "requires": { + "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + }, + "dependencies": { + "assert-plus": { + "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "glob": { + "version": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "dev": true, + "requires": { + "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + } + }, + "glob-base": { + "version": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + } + }, + "glob-parent": { + "version": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + } + }, + "global": { + "version": "https://registry.npmjs.org/global/-/global-4.3.1.tgz", + "integrity": "sha1-X3V5CMfLq85U84auRA4R4mt5Ft8=", + "dev": true, + "requires": { + "min-document": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "process": "https://registry.npmjs.org/process/-/process-0.5.2.tgz" + }, + "dependencies": { + "process": { + "version": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", + "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", + "dev": true + } + } + }, + "globals": { + "version": "https://registry.npmjs.org/globals/-/globals-9.16.0.tgz", + "integrity": "sha1-Y+kDZYFx7C2fUbHTHeXiuNwB+4A=", + "dev": true + }, + "globby": { + "version": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "arrify": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "pify": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + } + }, + "got": { + "version": "https://registry.npmjs.org/got/-/got-3.3.1.tgz", + "integrity": "sha1-5dDtSvVfw+701WAHdp2YGSvLLso=", + "dev": true, + "requires": { + "duplexify": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", + "infinity-agent": "https://registry.npmjs.org/infinity-agent/-/infinity-agent-2.0.3.tgz", + "is-redirect": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "is-stream": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "lowercase-keys": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "nested-error-stacks": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz", + "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "prepend-http": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "read-all-stream": "https://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz", + "timed-out": "https://registry.npmjs.org/timed-out/-/timed-out-2.0.0.tgz" + }, + "dependencies": { + "object-assign": { + "version": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true + } + } + }, + "graceful-fs": { + "version": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "graceful-readlink": { + "version": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, + "has": { + "version": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz" + } + }, + "has-ansi": { + "version": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + } + }, + "hash.js": { + "version": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz", + "integrity": "sha1-EzL/ABVsCg/92CNgE9B7d6BFFXM=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + } + }, + "hawk": { + "version": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "cryptiles": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "sntp": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" + } + }, + "he": { + "version": "https://registry.npmjs.org/he/-/he-0.5.0.tgz", + "integrity": "sha1-LAX/rvkLaOhg8/0rVO9YCYknfuI=", + "dev": true + }, + "hmac-drbg": { + "version": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.0.tgz", + "integrity": "sha1-PbRx9FquSplKBogyIXH1G4uRvuU=", + "dev": true, + "requires": { + "hash.js": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz", + "minimalistic-assert": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "minimalistic-crypto-utils": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz" + } + }, + "hoek": { + "version": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "home-or-tmp": { + "version": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "os-tmpdir": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" + } + }, + "htmlescape": { + "version": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "dev": true + }, + "http-proxy": { + "version": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz", + "integrity": "sha1-Bt/ykpUr9k2+hHH6nfcwZtTzd0I=", + "dev": true, + "requires": { + "eventemitter3": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", + "requires-port": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" + } + }, + "http-server": { + "version": "https://registry.npmjs.org/http-server/-/http-server-0.9.0.tgz", + "integrity": "sha1-jxsGvcczYY1NxCgxx7oa/04GABo=", + "dev": true, + "requires": { + "colors": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "corser": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", + "ecstatic": "https://registry.npmjs.org/ecstatic/-/ecstatic-1.4.1.tgz", + "http-proxy": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz", + "opener": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz", + "optimist": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "portfinder": "https://registry.npmjs.org/portfinder/-/portfinder-0.4.0.tgz", + "union": "https://registry.npmjs.org/union/-/union-0.4.6.tgz" + }, + "dependencies": { + "optimist": { + "version": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "wordwrap": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" + } + }, + "wordwrap": { + "version": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "http-signature": { + "version": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "requires": { + "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "jsprim": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", + "sshpk": "https://registry.npmjs.org/sshpk/-/sshpk-1.11.0.tgz" + } + }, + "https-browserify": { + "version": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "dev": true + }, + "ieee754": { + "version": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", + "dev": true + }, + "ignore": { + "version": "https://registry.npmjs.org/ignore/-/ignore-3.2.7.tgz", + "integrity": "sha1-SBDKXx2OylWVITo0uU8utO2Sa70=", + "dev": true + }, + "ignore-by-default": { + "version": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, + "imurmurhash": { + "version": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indexof": { + "version": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "infinity-agent": { + "version": "https://registry.npmjs.org/infinity-agent/-/infinity-agent-2.0.3.tgz", + "integrity": "sha1-ReDi/3qesDCyfWK3SzdEt6esQhY=", + "dev": true + }, + "inflight": { + "version": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + }, + "inherits": { + "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "dev": true + }, + "inline-source-map": { + "version": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "dev": true, + "requires": { + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + } + }, + "inquirer": { + "version": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", + "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", + "dev": true, + "requires": { + "ansi-escapes": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "cli-cursor": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "cli-width": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", + "figures": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "readline2": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", + "run-async": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", + "rx-lite": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", + "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + } + }, + "insert-module-globals": { + "version": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.1.tgz", + "integrity": "sha1-wDv04BywhtW15azorQr+eInWOMM=", + "dev": true, + "requires": { + "combine-source-map": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz", + "concat-stream": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "is-buffer": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz", + "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "lexical-scope": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", + "process": "https://registry.npmjs.org/process/-/process-0.11.9.tgz", + "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + }, + "interpret": { + "version": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", + "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=", + "dev": true + }, + "invariant": { + "version": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", + "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "dev": true, + "requires": { + "loose-envify": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz" + } + }, + "invert-kv": { + "version": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-arrayish": { + "version": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz" + } + }, + "is-buffer": { + "version": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz", + "integrity": "sha1-z8hszV3FpS+oBIkRHGkgxFfi2Ys=", + "dev": true + }, + "is-callable": { + "version": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "dev": true + }, + "is-date-object": { + "version": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-dom": { + "version": "https://registry.npmjs.org/is-dom/-/is-dom-1.0.9.tgz", + "integrity": "sha1-SDgy1SlyBz3hK5/j9gMghw2oNw0=", + "dev": true + }, + "is-dotfile": { + "version": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz", + "integrity": "sha1-LBMjg/ORmfjtwmjKAbmwB9IFzE0=", + "dev": true + }, + "is-equal-shallow": { + "version": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + } + }, + "is-extendable": { + "version": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" + } + }, + "is-fullwidth-code-point": { + "version": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" + } + }, + "is-function": { + "version": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", + "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", + "dev": true + }, + "is-glob": { + "version": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + } + }, + "is-my-json-valid": { + "version": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", + "integrity": "sha1-8Hndm/2uZe4gOKrorLyGqxCeNpM=", + "dev": true, + "requires": { + "generate-function": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "generate-object-property": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "jsonpointer": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + }, + "is-npm": { + "version": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", + "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", + "dev": true + }, + "is-number": { + "version": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz" + } + }, + "is-path-cwd": { + "version": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz" + } + }, + "is-path-inside": { + "version": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", + "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "dev": true, + "requires": { + "path-is-inside": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz" + } + }, + "is-posix-bracket": { + "version": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-property": { + "version": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "dev": true + }, + "is-redirect": { + "version": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", + "dev": true + }, + "is-regex": { + "version": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "https://registry.npmjs.org/has/-/has-1.0.1.tgz" + } + }, + "is-resolvable": { + "version": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", + "integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI=", + "dev": true, + "requires": { + "tryit": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz" + } + }, + "is-stream": { + "version": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-symbol": { + "version": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, + "is-typedarray": { + "version": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz", + "integrity": "sha1-NvPiLmB1CSD15yQaR2qMakInWtA=", + "dev": true + }, + "isobject": { + "version": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + } + }, + "isstream": { + "version": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "jodid25519": { + "version": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", + "integrity": "sha1-BtSRIlUJNBlHfUJWM2BuDpB4KWc=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" + } + }, + "js-tokens": { + "version": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz", + "integrity": "sha1-COnxMkhKLEWjCQfp3E1VZ7fxFNc=", + "dev": true + }, + "js-yaml": { + "version": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", + "integrity": "sha1-AtPiwPa+qyAkjUEsNSIDgn14ZyE=", + "dev": true, + "requires": { + "argparse": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "esprima": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz" + } + }, + "jsbn": { + "version": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "jsesc": { + "version": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "json-schema": { + "version": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-stable-stringify": { + "version": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "dev": true, + "requires": { + "jsonify": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" + } + }, + "json-stringify-safe": { + "version": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "dev": true + }, + "json5": { + "version": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonify": { + "version": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonparse": { + "version": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.0.tgz", + "integrity": "sha1-hfwkWx2SWazGlBlguQWt9k594Og=", + "dev": true + }, + "jsonpointer": { + "version": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "dev": true + }, + "JSONStream": { + "version": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", + "dev": true, + "requires": { + "jsonparse": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.0.tgz", + "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + } + }, + "jsprim": { + "version": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", + "integrity": "sha1-KnJW9wQSop7jZwqspiWZTE3P8lI=", + "dev": true, + "requires": { + "extsprintf": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", + "json-schema": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "verror": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz" + } + }, + "kind-of": { + "version": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz", + "integrity": "sha1-R11pil5J/15T0U4+cyQp3Iv0z0c=", + "dev": true, + "requires": { + "is-buffer": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz" + } + }, + "labeled-stream-splicer": { + "version": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz", + "integrity": "sha1-pS4dE4AkwAuGscDJH2d5GLiuClk=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "stream-splicer": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz" + }, + "dependencies": { + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "latest-version": { + "version": "https://registry.npmjs.org/latest-version/-/latest-version-1.0.1.tgz", + "integrity": "sha1-cs/Ebj6NG+ZR4eu1Tqn26pbzdLs=", + "dev": true, + "requires": { + "package-json": "https://registry.npmjs.org/package-json/-/package-json-1.2.0.tgz" + } + }, + "lazystream": { + "version": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz", + "integrity": "sha1-GyXWPHcqTCDwpe0KnXf0hLbhaSA=", + "dev": true, + "requires": { + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + }, + "dependencies": { + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + } + } + } + }, + "lcid": { + "version": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz" + } + }, + "lcov-parse": { + "version": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", + "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", + "dev": true + }, + "levn": { + "version": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "type-check": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" + } + }, + "lexical-scope": { + "version": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", + "integrity": "sha1-/Ope3HBKSzqHls3KQZw6CvryLfQ=", + "dev": true, + "requires": { + "astw": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz" + } + }, + "load-json-file": { + "version": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "parse-json": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "pify": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "strip-bom": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz" + } + }, + "localtunnel": { + "version": "https://registry.npmjs.org/localtunnel/-/localtunnel-1.8.2.tgz", + "integrity": "sha1-kTBR6DKLUfda2KIq0fXFuMWZo1k=", + "dev": true, + "requires": { + "debug": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "openurl": "https://registry.npmjs.org/openurl/-/openurl-1.1.0.tgz", + "request": "https://registry.npmjs.org/request/-/request-2.78.0.tgz", + "yargs": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz" + }, + "dependencies": { + "caseless": { + "version": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "dev": true + }, + "cliui": { + "version": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "wrap-ansi": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz" + } + }, + "debug": { + "version": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + } + }, + "har-validator": { + "version": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "dev": true, + "requires": { + "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "commander": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "is-my-json-valid": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", + "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + } + }, + "ms": { + "version": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + }, + "qs": { + "version": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", + "dev": true + }, + "request": { + "version": "https://registry.npmjs.org/request/-/request-2.78.0.tgz", + "integrity": "sha1-4cjew0bhyBkjskrNszfxHeyr6cw=", + "dev": true, + "requires": { + "aws-sign2": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "aws4": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "caseless": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "extend": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "forever-agent": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "form-data": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", + "har-validator": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "hawk": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "http-signature": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "is-typedarray": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "isstream": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "json-stringify-safe": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", + "node-uuid": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", + "oauth-sign": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "qs": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "stringstream": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "tough-cookie": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "tunnel-agent": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz" + } + }, + "window-size": { + "version": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", + "dev": true + }, + "yargs": { + "version": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz", + "integrity": "sha1-GquWYOrnnYuPZ1vK7qtu40ws9pw=", + "dev": true, + "requires": { + "camelcase": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "cliui": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "decamelize": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "os-locale": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "window-size": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "y18n": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz" + } + } + } + }, + "lodash": { + "version": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, + "lodash._baseassign": { + "version": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "dev": true, + "requires": { + "lodash._basecopy": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "lodash.keys": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz" + } + }, + "lodash._basecopy": { + "version": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._bindcallback": { + "version": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", + "integrity": "sha1-5THCdkTPi1epnhftlbNcdIeJOS4=", + "dev": true + }, + "lodash._createassigner": { + "version": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", + "integrity": "sha1-g4pbri/aymOsIt7o4Z+k5taXCxE=", + "dev": true, + "requires": { + "lodash._bindcallback": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", + "lodash._isiterateecall": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "lodash.restparam": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz" + } + }, + "lodash._getnative": { + "version": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash.assign": { + "version": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", + "integrity": "sha1-POnwI0tLIiPilrj6CsH+6OvKZPo=", + "dev": true, + "requires": { + "lodash._baseassign": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "lodash._createassigner": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", + "lodash.keys": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz" + } + }, + "lodash.defaults": { + "version": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-3.1.2.tgz", + "integrity": "sha1-xzCLGNv4vJNy1wGnNJPGEZK9Liw=", + "dev": true, + "requires": { + "lodash.assign": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", + "lodash.restparam": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz" + } + }, + "lodash.isarguments": { + "version": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.keys": { + "version": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "lodash.isarguments": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "lodash.isarray": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz" + } + }, + "lodash.memoize": { + "version": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "dev": true + }, + "lodash.restparam": { + "version": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", + "dev": true + }, + "log-driver": { + "version": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", + "integrity": "sha1-euTsJXMC/XkNVXyxDJcQDYV7AFY=", + "dev": true + }, + "loose-envify": { + "version": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "dev": true, + "requires": { + "js-tokens": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz" + } + }, + "lowercase-keys": { + "version": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", + "dev": true + }, + "lru-cache": { + "version": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", + "integrity": "sha1-HRdnnAac2l0ECZGgnbwsDbN35V4=", + "dev": true, + "requires": { + "pseudomap": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "yallist": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz" + } + }, + "map-stream": { + "version": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", + "dev": true + }, + "methods": { + "version": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "micromatch": { + "version": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "array-unique": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "braces": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "expand-brackets": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "extglob": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "filename-regex": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz", + "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz", + "normalize-path": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz", + "object.omit": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "parse-glob": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "regex-cache": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz" + } + }, + "miller-rabin": { + "version": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.0.tgz", + "integrity": "sha1-SmL7HUKTPAVYOYL0xxb2+55sbT0=", + "dev": true, + "requires": { + "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "brorand": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz" + } + }, + "mime-db": { + "version": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz", + "integrity": "sha1-6v/NDk/Gk1z4E02iRuLmw1MFrf8=", + "dev": true + }, + "mime-types": { + "version": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", + "integrity": "sha1-9+99l1g/yvO30oK2+LVnnaselO4=", + "dev": true, + "requires": { + "mime-db": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz" + } + }, + "min-document": { + "version": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "dev": true, + "requires": { + "dom-walk": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz" + } + }, + "minimalistic-assert": { + "version": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", + "dev": true, + "requires": { + "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + } + }, + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + } + }, + "module-deps": { + "version": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", + "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", + "dev": true, + "requires": { + "browser-resolve": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", + "cached-path-relative": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", + "concat-stream": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "detective": "https://registry.npmjs.org/detective/-/detective-4.5.0.tgz", + "duplexer2": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "parents": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", + "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.2.tgz", + "stream-combiner2": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "subarg": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + }, + "ms": { + "version": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + }, + "mute-stream": { + "version": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", + "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", + "dev": true + }, + "nan": { + "version": "https://registry.npmjs.org/nan/-/nan-2.5.1.tgz", + "integrity": "sha1-1bAWkSUzJql6K77p5hxV2NYDUeI=", + "dev": true, + "optional": true + }, + "natural-compare": { + "version": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nested-error-stacks": { + "version": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz", + "integrity": "sha1-GfYZWRUZ8JZ2mlupqG5u7sgjw88=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + } + }, + "node-int64": { + "version": "https://registry.npmjs.org/node-int64/-/node-int64-0.3.3.tgz", + "integrity": "sha1-LW5rLs5d6FiLQ9iNG8QbJs0fqE0=", + "dev": true + }, + "node-uuid": { + "version": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", + "integrity": "sha1-baWhdmjEs91ZYjvaEc9/pMH2Cm8=", + "dev": true + }, + "nodemon": { + "version": "https://registry.npmjs.org/nodemon/-/nodemon-1.11.0.tgz", + "integrity": "sha1-ImxWK9KnsT09dRi0mtSCijYj0Gw=", + "dev": true, + "requires": { + "chokidar": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz", + "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", + "es6-promise": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "ignore-by-default": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "lodash.defaults": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-3.1.2.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "ps-tree": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", + "touch": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", + "undefsafe": "https://registry.npmjs.org/undefsafe/-/undefsafe-0.0.3.tgz", + "update-notifier": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.5.0.tgz" + } + }, + "nopt": { + "version": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, + "requires": { + "abbrev": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz" + } + }, + "normalize-path": { + "version": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz", + "integrity": "sha1-R4hqwWYnYNQmG32XnSQXCdPOP3o=", + "dev": true + }, + "number-is-nan": { + "version": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nyc": { + "version": "https://registry.npmjs.org/nyc/-/nyc-7.1.0.tgz", + "integrity": "sha1-jhSXHzoV0au+x6xhDvVMuInp/7Q=", + "dev": true, + "requires": { + "arrify": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "caching-transform": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", + "convert-source-map": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.3.0.tgz", + "default-require-extensions": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", + "find-cache-dir": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", + "find-up": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "foreground-child": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.3.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz", + "istanbul-lib-coverage": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0-alpha.4.tgz", + "istanbul-lib-hook": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.0.0-alpha.4.tgz", + "istanbul-lib-instrument": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.1.0-alpha.4.tgz", + "istanbul-lib-report": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.0.0-alpha.3.tgz", + "istanbul-lib-source-maps": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.0.0-alpha.10.tgz", + "istanbul-reports": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.0.0-alpha.8.tgz", + "md5-hex": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", + "micromatch": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "pkg-up": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", + "resolve-from": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz", + "spawn-wrap": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.2.4.tgz", + "test-exclude": "https://registry.npmjs.org/test-exclude/-/test-exclude-1.1.0.tgz", + "yargs": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "yargs-parser": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz" + }, + "dependencies": { + "align-text": { + "version": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz", + "longest": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "repeat-string": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz" + } + }, + "amdefine": { + "version": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz", + "integrity": "sha1-/RdHRwDLXMnCtwnwvp0jzjwZjDM=", + "dev": true + }, + "ansi-regex": { + "version": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", + "integrity": "sha1-xQYbbg74qBd15Q9dZhUb9r83EQc=", + "dev": true + }, + "ansi-styles": { + "version": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "append-transform": { + "version": "https://registry.npmjs.org/append-transform/-/append-transform-0.3.0.tgz", + "integrity": "sha1-1pM85KhfCURdnMxMwRkFG3OBqBM=", + "dev": true + }, + "arr-diff": { + "version": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz" + } + }, + "arr-flatten": { + "version": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz", + "integrity": "sha1-5f/lTUXhnzLyFukeuZyM6JK7YEs=", + "dev": true + }, + "array-unique": { + "version": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arrify": { + "version": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "async": { + "version": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "babel-code-frame": { + "version": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.11.0.tgz", + "integrity": "sha1-kHLdI1P7D4W2tX0sl/DRNNGIrtg=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", + "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "js-tokens": "https://registry.npmjs.org/js-tokens/-/js-tokens-2.0.0.tgz" + } + }, + "babel-generator": { + "version": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.11.4.tgz", + "integrity": "sha1-FPaTOrsgxiZm0n47e59bncBxKpo=", + "dev": true, + "requires": { + "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.8.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.11.1.tgz", + "detect-indent": "https://registry.npmjs.org/detect-indent/-/detect-indent-3.0.1.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz", + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + } + }, + "babel-messages": { + "version": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.8.0.tgz", + "integrity": "sha1-v1BHNsqWfm1l7wrbWipflHyODrk=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz" + } + }, + "babel-runtime": { + "version": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", + "integrity": "sha1-1/45G8LMKbgIfB2bOYeJEun8/Vk=", + "dev": true, + "requires": { + "core-js": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", + "regenerator-runtime": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.9.5.tgz" + } + }, + "babel-template": { + "version": "https://registry.npmjs.org/babel-template/-/babel-template-6.9.0.tgz", + "integrity": "sha1-lwkPz2vBVoW08FvmXAqUOKp+I+M=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", + "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.11.4.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.11.1.tgz", + "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.8.4.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz" + } + }, + "babel-traverse": { + "version": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.11.4.tgz", + "integrity": "sha1-On3vakwf6fWLWcmiK+gfYZ+Cl2w=", + "dev": true, + "requires": { + "babel-code-frame": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.11.0.tgz", + "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.8.0.tgz", + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.11.1.tgz", + "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.8.4.tgz", + "debug": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "globals": "https://registry.npmjs.org/globals/-/globals-8.18.0.tgz", + "invariant": "https://registry.npmjs.org/invariant/-/invariant-2.2.1.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz" + } + }, + "babel-types": { + "version": "https://registry.npmjs.org/babel-types/-/babel-types-6.11.1.tgz", + "integrity": "sha1-o981W6uQ3c9mMYZAcXzywVTmZIo=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", + "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.11.4.tgz", + "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz", + "to-fast-properties": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.2.tgz" + } + }, + "babylon": { + "version": "https://registry.npmjs.org/babylon/-/babylon-6.8.4.tgz", + "integrity": "sha1-CXMGuNq66VFZIlzymz6lWRIFMYA=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz" + } + }, + "balanced-match": { + "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + }, + "brace-expansion": { + "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", + "dev": true, + "requires": { + "balanced-match": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + }, + "braces": { + "version": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "preserve": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "repeat-element": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz" + } + }, + "builtin-modules": { + "version": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "caching-transform": { + "version": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", + "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", + "dev": true, + "requires": { + "md5-hex": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "write-file-atomic": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.4.tgz" + } + }, + "camelcase": { + "version": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "center-align": { + "version": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "lazy-cache": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz" + } + }, + "chalk": { + "version": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "has-ansi": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "supports-color": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + } + }, + "cliui": { + "version": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "right-align": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "wordwrap": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" + }, + "dependencies": { + "wordwrap": { + "version": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + } + } + }, + "code-point-at": { + "version": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", + "integrity": "sha1-9psZLT99keOC5Lcb3bd4eGGasMY=", + "dev": true, + "requires": { + "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + } + }, + "commondir": { + "version": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "concat-map": { + "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.3.0.tgz", + "integrity": "sha1-6fPpxuJyjvwmdmlqcOs4L3MQamc=", + "dev": true + }, + "core-js": { + "version": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", + "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=", + "dev": true + }, + "cross-spawn": { + "version": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.0.tgz", + "integrity": "sha1-glR3SrR4a4xbPPTfumbOVjkywlI=", + "dev": true, + "requires": { + "lru-cache": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz", + "which": "https://registry.npmjs.org/which/-/which-1.2.10.tgz" + } + }, + "debug": { + "version": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + } + }, + "decamelize": { + "version": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "default-require-extensions": { + "version": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", + "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", + "dev": true, + "requires": { + "strip-bom": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz" + } + }, + "detect-indent": { + "version": "https://registry.npmjs.org/detect-indent/-/detect-indent-3.0.1.tgz", + "integrity": "sha1-ncXl3bzu+DJXZLlFGwK8bVQIT3U=", + "dev": true, + "requires": { + "get-stdin": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "repeating": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz" + }, + "dependencies": { + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "error-ex": { + "version": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.0.tgz", + "integrity": "sha1-5ntD8+gsluo6WE/+4Ln8MyXYAtk=", + "dev": true, + "requires": { + "is-arrayish": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" + } + }, + "escape-string-regexp": { + "version": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esutils": { + "version": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "expand-brackets": { + "version": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz" + } + }, + "expand-range": { + "version": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" + } + }, + "extglob": { + "version": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + } + }, + "filename-regex": { + "version": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz", + "integrity": "sha1-mW4+gEebmLmJfxWopYs9CE6SZ3U=", + "dev": true + }, + "fill-range": { + "version": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true, + "requires": { + "is-number": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "isobject": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "randomatic": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.5.tgz", + "repeat-element": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "repeat-string": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz" + } + }, + "find-cache-dir": { + "version": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", + "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", + "dev": true, + "requires": { + "commondir": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "pkg-dir": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz" + } + }, + "find-up": { + "version": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + } + }, + "for-in": { + "version": "https://registry.npmjs.org/for-in/-/for-in-0.1.5.tgz", + "integrity": "sha1-AHN04rbVxnQgoUeb23WgSHK3OMQ=", + "dev": true + }, + "for-own": { + "version": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz", + "integrity": "sha1-AUm0GjkIjHUV9R6+HBOG1F+TUHI=", + "dev": true, + "requires": { + "for-in": "https://registry.npmjs.org/for-in/-/for-in-0.1.5.tgz" + } + }, + "foreground-child": { + "version": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.3.tgz", + "integrity": "sha1-lN1qumcTiYZ96OV+mfHC7PsVwBo=", + "dev": true, + "requires": { + "cross-spawn": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.0.tgz", + "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz" + } + }, + "fs.realpath": { + "version": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "get-caller-file": { + "version": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.1.tgz", + "integrity": "sha1-qm/3uYobItwMizuQX6sytVL1rEE=", + "dev": true + }, + "get-stdin": { + "version": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "glob": { + "version": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz", + "integrity": "sha1-tCAqaQmbu00pKnwblbZoK2fr3JU=", + "dev": true, + "requires": { + "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", + "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + } + }, + "glob-base": { + "version": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + } + }, + "glob-parent": { + "version": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + } + }, + "globals": { + "version": "https://registry.npmjs.org/globals/-/globals-8.18.0.tgz", + "integrity": "sha1-k9SmK9ysOM+vr8R9awNHaMsP/LQ=", + "dev": true + }, + "graceful-fs": { + "version": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz", + "integrity": "sha1-7widKIDwM7ARgjzlyPrnmNp3Xb0=", + "dev": true + }, + "handlebars": { + "version": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.5.tgz", + "integrity": "sha1-ksbta7FkEQxQ1NjQ+93HCAbG+Oc=", + "dev": true, + "requires": { + "async": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "optimist": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "uglify-js": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.7.0.tgz" + }, + "dependencies": { + "source-map": { + "version": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz" + } + } + } + }, + "has-ansi": { + "version": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + } + }, + "has-flag": { + "version": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "hosted-git-info": { + "version": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.5.tgz", + "integrity": "sha1-C6gdkNouJas0ozLm7HeTbhWYEYs=", + "dev": true + }, + "imurmurhash": { + "version": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", + "integrity": "sha1-2zIEzVqd4ubNiQuFxuL2a89PYgo=", + "dev": true, + "requires": { + "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + }, + "inherits": { + "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "invariant": { + "version": "https://registry.npmjs.org/invariant/-/invariant-2.2.1.tgz", + "integrity": "sha1-sJcBBUdmjH4zcCjr6Bbr42yKjVQ=", + "dev": true, + "requires": { + "loose-envify": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.2.0.tgz" + } + }, + "invert-kv": { + "version": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-arrayish": { + "version": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-buffer": { + "version": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.3.tgz", + "integrity": "sha1-24l/w/esotUN6UtsjCiWpHcWJ68=", + "dev": true + }, + "is-builtin-module": { + "version": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz" + } + }, + "is-dotfile": { + "version": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz", + "integrity": "sha1-LBMjg/ORmfjtwmjKAbmwB9IFzE0=", + "dev": true + }, + "is-equal-shallow": { + "version": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + } + }, + "is-extendable": { + "version": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.1.tgz", + "integrity": "sha1-ZDhgPq6+J5OUj/SkJi7I2z1iWXs=", + "dev": true, + "requires": { + "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + } + }, + "is-fullwidth-code-point": { + "version": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + } + }, + "is-glob": { + "version": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + } + }, + "is-number": { + "version": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz" + } + }, + "is-posix-bracket": { + "version": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-utf8": { + "version": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz", + "integrity": "sha1-NvPiLmB1CSD15yQaR2qMakInWtA=", + "dev": true + }, + "isobject": { + "version": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + } + }, + "istanbul-lib-coverage": { + "version": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0-alpha.4.tgz", + "integrity": "sha1-Ym9/2c+Am2479+1CqAn44LZK6XY=", + "dev": true + }, + "istanbul-lib-hook": { + "version": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.0.0-alpha.4.tgz", + "integrity": "sha1-jFu59vvYUm4K5s9jmvKCZpBrk48=", + "dev": true, + "requires": { + "append-transform": "https://registry.npmjs.org/append-transform/-/append-transform-0.3.0.tgz" + } + }, + "istanbul-lib-instrument": { + "version": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.1.0-alpha.4.tgz", + "integrity": "sha1-d9mxE+n3YaqEmIM5ATpyA6zJitw=", + "dev": true, + "requires": { + "babel-generator": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.11.4.tgz", + "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.9.0.tgz", + "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.11.4.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.11.1.tgz", + "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.8.4.tgz", + "istanbul-lib-coverage": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0-alpha.4.tgz" + } + }, + "istanbul-lib-report": { + "version": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.0.0-alpha.3.tgz", + "integrity": "sha1-MtX27H8zyjpgIgnieLLm/xQ0mK8=", + "dev": true, + "requires": { + "async": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "istanbul-lib-coverage": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0-alpha.4.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "path-parse": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "supports-color": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz" + }, + "dependencies": { + "supports-color": { + "version": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "dev": true, + "requires": { + "has-flag": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.0.0-alpha.10.tgz", + "integrity": "sha1-mxWlyLWdG5EBviy33VTHA9hq3vE=", + "dev": true, + "requires": { + "istanbul-lib-coverage": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0-alpha.4.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + } + }, + "istanbul-reports": { + "version": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.0.0-alpha.8.tgz", + "integrity": "sha1-CUgw9Mfz1ILkZqrIq9oklfmuRok=", + "dev": true, + "requires": { + "handlebars": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.5.tgz" + } + }, + "js-tokens": { + "version": "https://registry.npmjs.org/js-tokens/-/js-tokens-2.0.0.tgz", + "integrity": "sha1-eZA/VWPud4zBFi5tzxoAJ8l/nLU=", + "dev": true + }, + "kind-of": { + "version": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz", + "integrity": "sha1-xhYIdH2BWwNiVW2zJ2Nip6OK3tM=", + "dev": true, + "requires": { + "is-buffer": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.3.tgz" + } + }, + "lazy-cache": { + "version": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, + "lcid": { + "version": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz" + } + }, + "load-json-file": { + "version": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz", + "parse-json": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "pify": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "strip-bom": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz" + } + }, + "lodash": { + "version": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz", + "integrity": "sha1-g+SxCRP0hJbU0W/sSlYK8u50S2g=", + "dev": true + }, + "lodash.assign": { + "version": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.0.9.tgz", + "integrity": "sha1-Cgcx2TWQ3dm6RYn61lqvbuCSF+M=", + "dev": true, + "requires": { + "lodash.keys": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.0.7.tgz", + "lodash.rest": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz" + } + }, + "lodash.keys": { + "version": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.0.7.tgz", + "integrity": "sha1-MOGzvZjlTWoGEZkYEmhba8R8tjs=", + "dev": true + }, + "lodash.rest": { + "version": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz", + "integrity": "sha1-TBwyxAAoCHJQ+r9w1C4BUVSPSMU=", + "dev": true + }, + "longest": { + "version": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loose-envify": { + "version": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.2.0.tgz", + "integrity": "sha1-aaZarT3lQs9O4PT+dOjjPHCcyw8=", + "dev": true, + "requires": { + "js-tokens": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.3.tgz" + }, + "dependencies": { + "js-tokens": { + "version": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.3.tgz", + "integrity": "sha1-FOVutoyPGpLEPVn1AU7CncIPKuE=", + "dev": true + } + } + }, + "lru-cache": { + "version": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz", + "integrity": "sha1-E0OVXtry432bnn7nJB4nxLn7cr4=", + "dev": true, + "requires": { + "pseudomap": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "yallist": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz" + } + }, + "md5-hex": { + "version": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", + "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", + "dev": true, + "requires": { + "md5-o-matic": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz" + } + }, + "md5-o-matic": { + "version": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", + "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", + "dev": true + }, + "micromatch": { + "version": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "array-unique": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "braces": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "expand-brackets": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "extglob": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "filename-regex": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz", + "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz", + "normalize-path": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz", + "object.omit": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.0.tgz", + "parse-glob": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "regex-cache": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz" + } + }, + "minimatch": { + "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", + "integrity": "sha1-DzmKcwDqRB6cNIyD2Yq4ydv5xAo=", + "dev": true, + "requires": { + "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + } + }, + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + } + }, + "ms": { + "version": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + }, + "normalize-package-data": { + "version": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz", + "integrity": "sha1-jZJPFClg4Xd+f/4XBUNjHMfLAt8=", + "dev": true, + "requires": { + "hosted-git-info": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.5.tgz", + "is-builtin-module": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "semver": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "validate-npm-package-license": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz" + } + }, + "normalize-path": { + "version": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz", + "integrity": "sha1-R4hqwWYnYNQmG32XnSQXCdPOP3o=", + "dev": true + }, + "number-is-nan": { + "version": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", + "integrity": "sha1-wCD1KcUoKt/dIz2R1LGBw9aG3Es=", + "dev": true + }, + "object.omit": { + "version": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.0.tgz", + "integrity": "sha1-hoWXMz1U5gZilAu0WGBd1q4S/pQ=", + "dev": true, + "requires": { + "for-own": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz", + "is-extendable": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + } + }, + "once": { + "version": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "dev": true, + "requires": { + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + }, + "optimist": { + "version": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "wordwrap": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" + } + }, + "os-homedir": { + "version": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", + "integrity": "sha1-DWK99EuRb9O73PLKsZGUj7CU8Ac=", + "dev": true + }, + "os-locale": { + "version": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz" + } + }, + "parse-glob": { + "version": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "is-dotfile": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz", + "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + } + }, + "parse-json": { + "version": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.0.tgz" + } + }, + "path-exists": { + "version": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + } + }, + "path-is-absolute": { + "version": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", + "integrity": "sha1-Jj2tpmqz8vsQv3+dJN2PPlcO+RI=", + "dev": true + }, + "path-parse": { + "version": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-type": { + "version": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz", + "pify": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + } + }, + "pify": { + "version": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + } + }, + "pkg-dir": { + "version": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz" + } + }, + "pkg-up": { + "version": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", + "integrity": "sha1-Pgj7RhUlxEIWJKM7n35tCvWwWiY=", + "dev": true, + "requires": { + "find-up": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz" + } + }, + "preserve": { + "version": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "pseudomap": { + "version": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "randomatic": { + "version": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.5.tgz", + "integrity": "sha1-Xp718tVzxnvSuBJK6QtRVuRXhAs=", + "dev": true, + "requires": { + "is-number": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz" + } + }, + "read-pkg": { + "version": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "normalize-package-data": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz", + "path-type": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz" + } + }, + "read-pkg-up": { + "version": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "read-pkg": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz" + } + }, + "regenerator-runtime": { + "version": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.9.5.tgz", + "integrity": "sha1-QD1tQKS9/5wzDdk5Lcuy2ai7ofw=", + "dev": true + }, + "regex-cache": { + "version": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", + "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", + "dev": true, + "requires": { + "is-equal-shallow": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "is-primitive": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + } + }, + "repeat-element": { + "version": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz", + "integrity": "sha1-ZOwMkeD0tHX5DVtkNlHj5uW2wtU=", + "dev": true + }, + "repeating": { + "version": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", + "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=", + "dev": true, + "requires": { + "is-finite": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.1.tgz" + } + }, + "require-directory": { + "version": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "resolve-from": { + "version": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=", + "dev": true + }, + "right-align": { + "version": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz" + } + }, + "rimraf": { + "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "integrity": "sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ=", + "dev": true, + "requires": { + "glob": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz" + } + }, + "semver": { + "version": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true + }, + "set-blocking": { + "version": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "signal-exit": { + "version": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz", + "integrity": "sha1-PAVDtl17T7xgts2UWT2b9DZzm+g=", + "dev": true + }, + "slide": { + "version": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "dev": true + }, + "source-map": { + "version": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", + "dev": true + }, + "spawn-wrap": { + "version": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.2.4.tgz", + "integrity": "sha1-kg6yEadpwJPuv71bDnpdLmirLkA=", + "dev": true, + "requires": { + "foreground-child": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.3.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-2.1.2.tgz", + "which": "https://registry.npmjs.org/which/-/which-1.2.10.tgz" + }, + "dependencies": { + "signal-exit": { + "version": "https://registry.npmjs.org/signal-exit/-/signal-exit-2.1.2.tgz", + "integrity": "sha1-N1h5sfkuvDszRIDQONxUam1VhWQ=", + "dev": true + } + } + }, + "spdx-correct": { + "version": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true, + "requires": { + "spdx-license-ids": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.1.tgz" + } + }, + "spdx-exceptions": { + "version": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.5.tgz", + "integrity": "sha1-nSGsTaS9tx0GD7dOWmdTHQMsu6Y=", + "dev": true + }, + "spdx-expression-parse": { + "version": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz", + "integrity": "sha1-1SsUtelnB3FECvIlvLVjEirEUvY=", + "dev": true, + "requires": { + "spdx-exceptions": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.5.tgz", + "spdx-license-ids": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.1.tgz" + } + }, + "spdx-license-ids": { + "version": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.1.tgz", + "integrity": "sha1-0H6hek0v2TUfnZTi/5zsdBgP6PM=", + "dev": true + }, + "string-width": { + "version": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", + "integrity": "sha1-ySEptvHX9SrPmvQkom44ZKBc6wo=", + "dev": true, + "requires": { + "code-point-at": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", + "is-fullwidth-code-point": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + } + }, + "strip-ansi": { + "version": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + } + }, + "strip-bom": { + "version": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz" + } + }, + "supports-color": { + "version": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "test-exclude": { + "version": "https://registry.npmjs.org/test-exclude/-/test-exclude-1.1.0.tgz", + "integrity": "sha1-9d3XGJJ7Ev0C8nCgqpOc627qQVE=", + "dev": true, + "requires": { + "arrify": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "lodash.assign": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.0.9.tgz", + "micromatch": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "read-pkg-up": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "require-main-filename": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz" + } + }, + "to-fast-properties": { + "version": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.2.tgz", + "integrity": "sha1-8/XAw7pymafvmUJ+RGMyV63kMyA=", + "dev": true + }, + "uglify-js": { + "version": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.7.0.tgz", + "integrity": "sha1-8CHji6LKdAhg9b1caVwqgXNF8Ow=", + "dev": true, + "optional": true, + "requires": { + "async": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "uglify-to-browserify": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "yargs": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz" + }, + "dependencies": { + "async": { + "version": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true, + "optional": true + }, + "yargs": { + "version": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "cliui": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "decamelize": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "window-size": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz" + } + } + } + }, + "uglify-to-browserify": { + "version": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "validate-npm-package-license": { + "version": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true, + "requires": { + "spdx-correct": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "spdx-expression-parse": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz" + } + }, + "which": { + "version": "https://registry.npmjs.org/which/-/which-1.2.10.tgz", + "integrity": "sha1-kc2b0HUTIkEbZZtA8FSyHelXqy0=", + "dev": true, + "requires": { + "isexe": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz" + } + }, + "which-module": { + "version": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "window-size": { + "version": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + }, + "wrap-ansi": { + "version": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.0.0.tgz", + "integrity": "sha1-fTD4+HP5pbvDpk2ryNF34HGuQm8=", + "dev": true, + "requires": { + "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz" + } + }, + "wrappy": { + "version": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.4.tgz", + "integrity": "sha1-sfUtwujcDjywTRh6JfdYo4qQyjs=", + "dev": true, + "requires": { + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz", + "imurmurhash": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "slide": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" + } + }, + "y18n": { + "version": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz", + "integrity": "sha1-MGxUODXwnuGkyyO3vOmrNByRzdQ=", + "dev": true + }, + "yargs": { + "version": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "dev": true, + "requires": { + "cliui": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "decamelize": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "get-caller-file": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.1.tgz", + "lodash.assign": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.0.9.tgz", + "os-locale": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "read-pkg-up": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "require-directory": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "require-main-filename": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "set-blocking": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", + "which-module": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "window-size": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "y18n": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "yargs-parser": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz" + }, + "dependencies": { + "cliui": { + "version": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "wrap-ansi": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.0.0.tgz" + } + }, + "window-size": { + "version": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", + "dev": true + } + } + }, + "yargs-parser": { + "version": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "dev": true, + "requires": { + "camelcase": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "lodash.assign": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.0.9.tgz" + }, + "dependencies": { + "camelcase": { + "version": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + } + } + } + } + }, + "oauth-sign": { + "version": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object-assign": { + "version": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-inspect": { + "version": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.2.1.tgz", + "integrity": "sha1-O2Iibrj21EF1HH2PIqIP+ArJ3D8=", + "dev": true + }, + "object-keys": { + "version": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "dev": true + }, + "object.omit": { + "version": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "is-extendable": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + } + }, + "once": { + "version": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + }, + "onetime": { + "version": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "only-shallow": { + "version": "https://registry.npmjs.org/only-shallow/-/only-shallow-1.2.0.tgz", + "integrity": "sha1-cc7O26kyS8BRiu8Q7AgNMkncJGU=", + "dev": true + }, + "opener": { + "version": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz", + "integrity": "sha1-XG2ixdflgx6P+jlklQ+NZnSskLg=", + "dev": true + }, + "openurl": { + "version": "https://registry.npmjs.org/openurl/-/openurl-1.1.0.tgz", + "integrity": "sha1-4vIYnZmcBIIyAfCD8PGnzYkDGHo=", + "dev": true + }, + "optionator": { + "version": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "fast-levenshtein": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "levn": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "prelude-ls": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "type-check": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "wordwrap": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" + } + }, + "original": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/original/-/original-1.0.0.tgz", + "integrity": "sha1-kUf5P6FpbQS+YeAb1QuurKZWvTs=", + "dev": true, + "requires": { + "url-parse": "1.0.5" + }, + "dependencies": { + "url-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.0.5.tgz", + "integrity": "sha1-CFSGBCKv3P7+tsllxmLUgAFpkns=", + "dev": true, + "requires": { + "querystringify": "0.0.4", + "requires-port": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" + } + } + } + }, + "os-browserify": { + "version": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=", + "dev": true + }, + "os-homedir": { + "version": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz" + } + }, + "os-tmpdir": { + "version": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "dev": true, + "requires": { + "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "os-tmpdir": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" + } + }, + "outpipe": { + "version": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", + "integrity": "sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I=", + "dev": true, + "requires": { + "shell-quote": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz" + } + }, + "output-file-sync": { + "version": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", + "dev": true, + "requires": { + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + } + }, + "package-json": { + "version": "https://registry.npmjs.org/package-json/-/package-json-1.2.0.tgz", + "integrity": "sha1-yOysCUInzfdqMWh07QXifMk5oOA=", + "dev": true, + "requires": { + "got": "https://registry.npmjs.org/got/-/got-3.3.1.tgz", + "registry-url": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz" + } + }, + "pako": { + "version": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "dev": true + }, + "parents": { + "version": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "dev": true, + "requires": { + "path-platform": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz" + } + }, + "parse-asn1": { + "version": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.0.0.tgz", + "integrity": "sha1-NQYPbVAV03Yox3D04JGgtaJ4vCM=", + "dev": true, + "requires": { + "asn1.js": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz", + "browserify-aes": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", + "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", + "evp_bytestokey": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz", + "pbkdf2": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.9.tgz" + } + }, + "parse-glob": { + "version": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "is-dotfile": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz", + "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + } + }, + "parse-headers": { + "version": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", + "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", + "dev": true, + "requires": { + "for-each": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", + "trim": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz" + } + }, + "parse-json": { + "version": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz" + } + }, + "path-browserify": { + "version": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "dev": true + }, + "path-is-absolute": { + "version": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-parse": { + "version": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-platform": { + "version": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "dev": true + }, + "pause-stream": { + "version": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "dev": true, + "requires": { + "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + } + }, + "pbkdf2": { + "version": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.9.tgz", + "integrity": "sha1-8sSyWmAAWLPDdzwIbDfbvuH/5pM=", + "dev": true, + "requires": { + "create-hmac": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.4.tgz" + } + }, + "pify": { + "version": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + } + }, + "pluralize": { + "version": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", + "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", + "dev": true + }, + "portfinder": { + "version": "https://registry.npmjs.org/portfinder/-/portfinder-0.4.0.tgz", + "integrity": "sha1-o/+t/6/k+5jgYBqF7aJ8J86Eyh4=", + "dev": true, + "requires": { + "async": "https://registry.npmjs.org/async/-/async-0.9.0.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" + }, + "dependencies": { + "async": { + "version": "https://registry.npmjs.org/async/-/async-0.9.0.tgz", + "integrity": "sha1-rDYTsdqb7RtHUQu0ZRuJMeRxRsc=", + "dev": true + } + } + }, + "prelude-ls": { + "version": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prepend-http": { + "version": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "preserve": { + "version": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "private": { + "version": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", + "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=", + "dev": true + }, + "process": { + "version": "https://registry.npmjs.org/process/-/process-0.11.9.tgz", + "integrity": "sha1-e9WtIapiU+fahoImTx4R0RwDGME=", + "dev": true + }, + "process-nextick-args": { + "version": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "progress": { + "version": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "dev": true + }, + "ps-tree": { + "version": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", + "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=", + "dev": true, + "requires": { + "event-stream": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz" + } + }, + "pseudomap": { + "version": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "public-encrypt": { + "version": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", + "dev": true, + "requires": { + "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "browserify-rsa": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", + "parse-asn1": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.0.0.tgz", + "randombytes": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz" + } + }, + "punycode": { + "version": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "q": { + "version": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", + "dev": true + }, + "querystring": { + "version": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "querystringify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-0.0.4.tgz", + "integrity": "sha1-DPf4T5Rj/wrlHExLFC2VvjdyTZw=", + "dev": true + }, + "quick-tmp": { + "version": "https://registry.npmjs.org/quick-tmp/-/quick-tmp-0.0.0.tgz", + "integrity": "sha1-QWXmYyDqBfnLzM874fj9X9sF998=", + "dev": true, + "requires": { + "first-match": "https://registry.npmjs.org/first-match/-/first-match-0.0.1.tgz", + "osenv": "https://registry.npmjs.org/osenv/-/osenv-0.0.3.tgz" + }, + "dependencies": { + "osenv": { + "version": "https://registry.npmjs.org/osenv/-/osenv-0.0.3.tgz", + "integrity": "sha1-zWrY3bKQkVrZ4idlV2Al1BHynLY=", + "dev": true + } + } + }, + "randomatic": { + "version": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.6.tgz", + "integrity": "sha1-EQ3Kv/OX6dz/fAeJzMCkmt8exbs=", + "dev": true, + "requires": { + "is-number": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz" + } + }, + "randombytes": { + "version": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz", + "integrity": "sha1-Z0yZdgkBw8QRJ3GjHlIdw0nMCew=", + "dev": true + }, + "rc": { + "version": "https://registry.npmjs.org/rc/-/rc-1.1.7.tgz", + "integrity": "sha1-xepWS7B6/5/TpbMukGwdOmWUD+o=", + "dev": true, + "requires": { + "deep-extend": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.1.tgz", + "ini": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "strip-json-comments": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" + }, + "dependencies": { + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "read-all-stream": { + "version": "https://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz", + "integrity": "sha1-NcPhd/IHjveJ7kv6+kNzB06u9Po=", + "dev": true, + "requires": { + "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + } + }, + "read-only-stream": { + "version": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "dev": true, + "requires": { + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + } + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", + "integrity": "sha1-nPSUY5hd8BbIrogTCXqSk6mzNyk=", + "dev": true, + "requires": { + "buffer-shims": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + } + }, + "readdirp": { + "version": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", + "set-immediate-shim": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz" + } + }, + "readline2": { + "version": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", + "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", + "dev": true, + "requires": { + "code-point-at": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "is-fullwidth-code-point": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "mute-stream": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz" + } + }, + "rechoir": { + "version": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.2.tgz" + } + }, + "regenerate": { + "version": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.2.tgz", + "integrity": "sha1-0ZQcZ7rUN+G+dkM63Vs4X5WxkmA=", + "dev": true + }, + "regenerator-runtime": { + "version": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz", + "integrity": "sha1-jENnqQS1HqYqkIrDEL+Z/5CoKj4=", + "dev": true + }, + "regenerator-transform": { + "version": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.9.8.tgz", + "integrity": "sha1-D4i7K8A5Mt23trcxLmgHjwECbWw=", + "dev": true, + "requires": { + "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", + "private": "https://registry.npmjs.org/private/-/private-0.1.7.tgz" + } + }, + "regex-cache": { + "version": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", + "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", + "dev": true, + "requires": { + "is-equal-shallow": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "is-primitive": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + } + }, + "regexpu-core": { + "version": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.2.tgz", + "regjsgen": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "regjsparser": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz" + } + }, + "registry-url": { + "version": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "dev": true, + "requires": { + "rc": "https://registry.npmjs.org/rc/-/rc-1.1.7.tgz" + } + }, + "regjsgen": { + "version": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" + }, + "dependencies": { + "jsesc": { + "version": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "repeat-element": { + "version": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz" + } + }, + "require-uncached": { + "version": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "resolve-from": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz" + } + }, + "requires-port": { + "version": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "resolve": { + "version": "https://registry.npmjs.org/resolve/-/resolve-1.3.2.tgz", + "integrity": "sha1-HwRCyeDLuBNuh7kwX5MvRsfygjU=", + "dev": true, + "requires": { + "path-parse": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz" + } + }, + "resolve-from": { + "version": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "onetime": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz" + } + }, + "resumer": { + "version": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", + "dev": true, + "requires": { + "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + } + }, + "rimraf": { + "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", + "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", + "dev": true, + "requires": { + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz" + } + }, + "ripemd160": { + "version": "https://registry.npmjs.org/ripemd160/-/ripemd160-1.0.1.tgz", + "integrity": "sha1-k6S71JQrxXS2mo+lfHHeEOzKfW4=", + "dev": true + }, + "run-async": { + "version": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", + "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", + "dev": true, + "requires": { + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + } + }, + "rx-lite": { + "version": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", + "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", + "dev": true + }, + "semver": { + "version": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true + }, + "semver-diff": { + "version": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", + "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", + "dev": true, + "requires": { + "semver": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz" + } + }, + "set-immediate-shim": { + "version": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "sha.js": { + "version": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz", + "integrity": "sha1-NwaMLEdra69ALRSknGf1l5IfY08=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + } + }, + "shallow-copy": { + "version": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", + "integrity": "sha1-QV9CcC1z2BAzApLMXuhurhoRoXA=", + "dev": true + }, + "shasum": { + "version": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", + "dev": true, + "requires": { + "json-stable-stringify": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "sha.js": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz" + } + }, + "shell-quote": { + "version": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "array-map": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "array-reduce": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "jsonify": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" + } + }, + "shelljs": { + "version": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.7.tgz", + "integrity": "sha1-svXHfvlxSPS09uImguELuoZnz/E=", + "dev": true, + "requires": { + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "interpret": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", + "rechoir": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" + } + }, + "shoe": { + "version": "https://registry.npmjs.org/shoe/-/shoe-0.0.15.tgz", + "integrity": "sha1-uu2PGn8I9TC2bwkUKH/KplsSRDo=", + "dev": true, + "requires": { + "sockjs": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.7.tgz", + "sockjs-client": "1.1.4" + } + }, + "signal-exit": { + "version": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slash": { + "version": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "slice-ansi": { + "version": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "dev": true + }, + "slide": { + "version": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "dev": true + }, + "smokestack": { + "version": "https://registry.npmjs.org/smokestack/-/smokestack-3.4.1.tgz", + "integrity": "sha1-yw2V+kVbzkIU3SdQp6zlJAOmD/E=", + "dev": true, + "requires": { + "bl": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", + "chrome-launch": "https://registry.npmjs.org/chrome-launch/-/chrome-launch-1.1.4.tgz", + "convert-source-map": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.4.0.tgz", + "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", + "firefox-launch": "https://registry.npmjs.org/firefox-launch/-/firefox-launch-1.0.2.tgz", + "is-dom": "https://registry.npmjs.org/is-dom/-/is-dom-1.0.9.tgz", + "localtunnel": "https://registry.npmjs.org/localtunnel/-/localtunnel-1.8.2.tgz", + "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.3.4.tgz", + "shoe": "https://registry.npmjs.org/shoe/-/shoe-0.0.15.tgz", + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "source-map-support": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz", + "split": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "synthetic-dom-events": "https://registry.npmjs.org/synthetic-dom-events/-/synthetic-dom-events-0.2.2.tgz", + "tap-finished": "https://registry.npmjs.org/tap-finished/-/tap-finished-0.0.1.tgz", + "through2": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "wd": "https://registry.npmjs.org/wd/-/wd-0.3.12.tgz", + "xhr": "https://registry.npmjs.org/xhr/-/xhr-2.4.0.tgz" + }, + "dependencies": { + "glob": { + "version": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", + "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", + "dev": true, + "requires": { + "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + } + }, + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "minimatch": { + "version": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", + "dev": true, + "requires": { + "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + } + }, + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", + "integrity": "sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=", + "dev": true + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + } + }, + "rimraf": { + "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.3.4.tgz", + "integrity": "sha1-gtm8Gy/PMeIFrHsoE4oCXQjpFZo=", + "dev": true, + "requires": { + "glob": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz" + } + }, + "source-map": { + "version": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz" + } + }, + "source-map-support": { + "version": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz", + "integrity": "sha1-6lo5AKHByyUJagrozFwrSxDe09w=", + "dev": true, + "requires": { + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz" + }, + "dependencies": { + "source-map": { + "version": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz", + "integrity": "sha1-yLbBZ3l7pHQKjqMyUhYv8IWRsmY=", + "dev": true, + "requires": { + "amdefine": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz" + } + } + } + }, + "through2": { + "version": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "dev": true, + "requires": { + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + } + } + }, + "sntp": { + "version": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + } + }, + "sockjs": { + "version": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.7.tgz", + "integrity": "sha1-KVDgWG2KnTBElYqDGt5o2xl3Scs=", + "dev": true, + "requires": { + "faye-websocket": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.4.4.tgz", + "node-uuid": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.3.3.tgz" + }, + "dependencies": { + "node-uuid": { + "version": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.3.3.tgz", + "integrity": "sha1-09tNe1aBDZ5AMjQnZigq8HORcps=", + "dev": true + } + } + }, + "sockjs-client": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.1.4.tgz", + "integrity": "sha1-W6vjhrd15M8U51IJEUUmVAFsixI=", + "dev": true, + "requires": { + "debug": "2.6.8", + "eventsource": "0.1.6", + "faye-websocket": "0.11.1", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "json3": "3.3.2", + "url-parse": "1.1.9" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "faye-websocket": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", + "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", + "dev": true, + "requires": { + "websocket-driver": "0.6.5" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "source-map": { + "version": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", + "dev": true + }, + "source-map-support": { + "version": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.11.tgz", + "integrity": "sha1-ZH+TmXizhTWQlTCIUwPa8jJ58yI=", + "dev": true, + "requires": { + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + } + }, + "split": { + "version": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", + "dev": true, + "requires": { + "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + } + }, + "sprintf-js": { + "version": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "https://registry.npmjs.org/sshpk/-/sshpk-1.11.0.tgz", + "integrity": "sha1-LY1eu0pvqyj/ujf6YqkPSj6lnXc=", + "dev": true, + "requires": { + "asn1": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "bcrypt-pbkdf": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "dashdash": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "ecc-jsbn": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "getpass": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", + "jodid25519": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", + "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "tweetnacl": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" + }, + "dependencies": { + "assert-plus": { + "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "stack-utils": { + "version": "https://registry.npmjs.org/stack-utils/-/stack-utils-0.4.0.tgz", + "integrity": "sha1-lAy4L8z6hOj/Lz/fKT/ngBa+zNE=", + "dev": true + }, + "stream-browserify": { + "version": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + } + }, + "stream-combiner": { + "version": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", + "dev": true, + "requires": { + "duplexer": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz" + } + }, + "stream-combiner2": { + "version": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "dev": true, + "requires": { + "duplexer2": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + } + }, + "stream-http": { + "version": "https://registry.npmjs.org/stream-http/-/stream-http-2.6.3.tgz", + "integrity": "sha1-TD3b+WNZaOos/U5I1D3l3vJiWsM=", + "dev": true, + "requires": { + "builtin-status-codes": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", + "to-arraybuffer": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + }, + "stream-shift": { + "version": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "stream-splicer": { + "version": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", + "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + } + }, + "string_decoder": { + "version": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "string-length": { + "version": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", + "integrity": "sha1-VpcPscOFWOnnC3KL894mmsRa36w=", + "dev": true, + "requires": { + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + } + }, + "string-width": { + "version": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "is-fullwidth-code-point": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + } + }, + "string.prototype.trim": { + "version": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", + "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", + "dev": true, + "requires": { + "define-properties": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "es-abstract": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.7.0.tgz", + "function-bind": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz" + } + }, + "stringstream": { + "version": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true + }, + "strip-ansi": { + "version": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + } + }, + "strip-bom": { + "version": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "subarg": { + "version": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz" + }, + "dependencies": { + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "superagent": { + "version": "https://registry.npmjs.org/superagent/-/superagent-2.3.0.tgz", + "integrity": "sha1-cDUpoHFOV+EjlZ3e+84ZOy5Q0RU=", + "dev": true, + "requires": { + "component-emitter": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "cookiejar": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.0.tgz", + "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", + "extend": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "form-data": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz", + "formidable": "https://registry.npmjs.org/formidable/-/formidable-1.1.1.tgz", + "methods": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "mime": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "qs": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + }, + "dependencies": { + "async": { + "version": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "form-data": { + "version": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz", + "integrity": "sha1-BaxrwiIntD5EYfSIFhVUaZ1Pi14=", + "dev": true, + "requires": { + "async": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz" + } + }, + "formidable": { + "version": "https://registry.npmjs.org/formidable/-/formidable-1.1.1.tgz", + "integrity": "sha1-lriIb3w8NQi5Mta9cMTTqI818ak=", + "dev": true + }, + "mime": { + "version": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=", + "dev": true + }, + "qs": { + "version": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", + "dev": true + } + } + }, + "supports-color": { + "version": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "syntax-error": { + "version": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.3.0.tgz", + "integrity": "sha1-HtkmbE1AvnXcVb+bsct3Biu5bKE=", + "dev": true, + "requires": { + "acorn": "https://registry.npmjs.org/acorn/-/acorn-4.0.11.tgz" + } + }, + "synthetic-dom-events": { + "version": "https://registry.npmjs.org/synthetic-dom-events/-/synthetic-dom-events-0.2.2.tgz", + "integrity": "sha1-fsfRPz87wMmXAbWsvLrMRZw/jAw=", + "dev": true + }, + "table": { + "version": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", + "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", + "dev": true, + "requires": { + "ajv": "https://registry.npmjs.org/ajv/-/ajv-4.11.7.tgz", + "ajv-keywords": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "slice-ansi": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "string-width": "https://registry.npmjs.org/string-width/-/string-width-2.0.0.tgz" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "https://registry.npmjs.org/string-width/-/string-width-2.0.0.tgz", + "integrity": "sha1-Y1xUNsxypuDDh87KJ41OLuxSaH4=", + "dev": true, + "requires": { + "is-fullwidth-code-point": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + } + } + } + }, + "tap": { + "version": "https://registry.npmjs.org/tap/-/tap-6.3.2.tgz", + "integrity": "sha1-4RTImqqqHAp3fiWnHLExT9BGpV4=", + "dev": true, + "requires": { + "bluebird": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", + "clean-yaml-object": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", + "color-support": "https://registry.npmjs.org/color-support/-/color-support-1.1.2.tgz", + "coveralls": "https://registry.npmjs.org/coveralls/-/coveralls-2.12.0.tgz", + "deeper": "https://registry.npmjs.org/deeper/-/deeper-2.1.0.tgz", + "foreground-child": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "isexe": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz", + "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", + "nyc": "https://registry.npmjs.org/nyc/-/nyc-7.1.0.tgz", + "only-shallow": "https://registry.npmjs.org/only-shallow/-/only-shallow-1.2.0.tgz", + "opener": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz", + "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", + "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "stack-utils": "https://registry.npmjs.org/stack-utils/-/stack-utils-0.4.0.tgz", + "tap-mocha-reporter": "https://registry.npmjs.org/tap-mocha-reporter/-/tap-mocha-reporter-0.0.27.tgz", + "tap-parser": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.2.2.tgz", + "tmatch": "https://registry.npmjs.org/tmatch/-/tmatch-2.0.1.tgz" + }, + "dependencies": { + "bluebird": { + "version": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", + "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=", + "dev": true + }, + "os-homedir": { + "version": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", + "integrity": "sha1-DWK99EuRb9O73PLKsZGUj7CU8Ac=", + "dev": true + }, + "tap-parser": { + "version": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.2.2.tgz", + "integrity": "sha1-Xi9pcGEfB5x8+FfeHceqG0gN56U=", + "dev": true, + "requires": { + "events-to-array": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + } + } + } + }, + "tap-finished": { + "version": "https://registry.npmjs.org/tap-finished/-/tap-finished-0.0.1.tgz", + "integrity": "sha1-CLW1Q/3ASDApDGxWEnlVLnHEvWc=", + "dev": true, + "requires": { + "tap-parser": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.2.1.tgz", + "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + } + }, + "tap-mocha-reporter": { + "version": "https://registry.npmjs.org/tap-mocha-reporter/-/tap-mocha-reporter-0.0.27.tgz", + "integrity": "sha1-svcvPh6Lp4DuApGPzes6QNqAGPc=", + "dev": true, + "requires": { + "color-support": "https://registry.npmjs.org/color-support/-/color-support-1.1.2.tgz", + "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", + "diff": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", + "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "tap-parser": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.3.2.tgz", + "unicode-length": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz" + }, + "dependencies": { + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true, + "optional": true + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "optional": true, + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + } + }, + "tap-parser": { + "version": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.3.2.tgz", + "integrity": "sha1-EgxQiciMPIp5PvKIhn3jIeGPjCI=", + "dev": true, + "requires": { + "events-to-array": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + }, + "dependencies": { + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", + "integrity": "sha1-nPSUY5hd8BbIrogTCXqSk6mzNyk=", + "dev": true, + "optional": true, + "requires": { + "buffer-shims": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + } + } + } + } + } + }, + "tap-parser": { + "version": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.2.1.tgz", + "integrity": "sha1-jh6CPyEU7iHQMuLzHk+2QqKW9Qs=", + "dev": true, + "requires": { + "split": "https://registry.npmjs.org/split/-/split-0.1.2.tgz" + }, + "dependencies": { + "split": { + "version": "https://registry.npmjs.org/split/-/split-0.1.2.tgz", + "integrity": "sha1-8HEHRMRT1VH8cUPq2YPaYBTjNsw=", + "dev": true, + "requires": { + "through": "https://registry.npmjs.org/through/-/through-1.1.2.tgz" + } + }, + "through": { + "version": "https://registry.npmjs.org/through/-/through-1.1.2.tgz", + "integrity": "sha1-NEpUJaN3MxTKfg62US+6+vdsC/4=", + "dev": true + } + } + }, + "tap-status": { + "version": "https://registry.npmjs.org/tap-status/-/tap-status-1.0.1.tgz", + "integrity": "sha1-r7nUGYzD00BqW8OvuxxwcuiA5fk=", + "dev": true, + "requires": { + "tap-parser": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.3.2.tgz", + "tape": "https://registry.npmjs.org/tape/-/tape-4.6.3.tgz" + }, + "dependencies": { + "tap-parser": { + "version": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.3.2.tgz", + "integrity": "sha1-EgxQiciMPIp5PvKIhn3jIeGPjCI=", + "dev": true, + "requires": { + "events-to-array": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + } + } + } + }, + "tape": { + "version": "https://registry.npmjs.org/tape/-/tape-4.6.3.tgz", + "integrity": "sha1-Y353WB6ass4XV36b1M5PV1gG2LY=", + "dev": true, + "requires": { + "deep-equal": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "for-each": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", + "function-bind": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "has": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "object-inspect": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.2.1.tgz", + "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "resumer": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "string.prototype.trim": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", + "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + }, + "dependencies": { + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "resolve": { + "version": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "tar-stream": { + "version": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.1.5.tgz", + "integrity": "sha1-vpIYwTDCACnhB7D5Z/sj3gV50Tw=", + "dev": true, + "requires": { + "bl": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", + "end-of-stream": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + }, + "dependencies": { + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + } + } + } + }, + "text-table": { + "version": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + }, + "timed-out": { + "version": "https://registry.npmjs.org/timed-out/-/timed-out-2.0.0.tgz", + "integrity": "sha1-84sK6B03R9YoAB9B2vxlKs5nHAo=", + "dev": true + }, + "timers-browserify": { + "version": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "https://registry.npmjs.org/process/-/process-0.11.9.tgz" + } + }, + "tinyqueue": { + "version": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-1.1.0.tgz", + "integrity": "sha1-nF929UqEX0kU51T1qo1z72wBH3s=" + }, + "tmatch": { + "version": "https://registry.npmjs.org/tmatch/-/tmatch-2.0.1.tgz", + "integrity": "sha1-DFYkbzPzDaG409colauvFmYPOM8=", + "dev": true + }, + "to-arraybuffer": { + "version": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-fast-properties": { + "version": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.2.tgz", + "integrity": "sha1-8/XAw7pymafvmUJ+RGMyV63kMyA=", + "dev": true + }, + "touch": { + "version": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", + "integrity": "sha1-RJy+LbrlqMgDjjDXH6D/RklHxN4=", + "dev": true, + "requires": { + "nopt": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz" + } + }, + "tough-cookie": { + "version": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "dev": true, + "requires": { + "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz" + } + }, + "trim": { + "version": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=", + "dev": true + }, + "trim-right": { + "version": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "tryit": { + "version": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", + "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", + "dev": true + }, + "tty-browserify": { + "version": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "tunnel-agent": { + "version": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true + }, + "tweetnacl": { + "version": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "type-check": { + "version": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" + } + }, + "typedarray": { + "version": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "https://registry.npmjs.org/typescript/-/typescript-2.3.1.tgz", + "integrity": "sha1-4zYfs5XGw/nGn67qvJUD+L3srqE=", + "dev": true + }, + "uglify-to-browserify": { + "version": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true + }, + "uglifyjs": { + "version": "https://registry.npmjs.org/uglifyjs/-/uglifyjs-2.4.10.tgz", + "integrity": "sha1-YyknMZ+mo9o/yR+Xc6wnv+bD7pI=", + "dev": true, + "requires": { + "async": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz", + "uglify-to-browserify": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "yargs": "https://registry.npmjs.org/yargs/-/yargs-1.3.3.tgz" + }, + "dependencies": { + "async": { + "version": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "source-map": { + "version": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz", + "integrity": "sha1-p8/omux7FoLDsZjQrPtH19CQVms=", + "dev": true, + "requires": { + "amdefine": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz" + } + }, + "yargs": { + "version": "https://registry.npmjs.org/yargs/-/yargs-1.3.3.tgz", + "integrity": "sha1-BU3oth8i7v23IHBZ6u+da4P7kxo=", + "dev": true + } + } + }, + "umd": { + "version": "https://registry.npmjs.org/umd/-/umd-3.0.1.tgz", + "integrity": "sha1-iuVW4RAR9jwllnCKiDclnwGz1g4=", + "dev": true + }, + "undefsafe": { + "version": "https://registry.npmjs.org/undefsafe/-/undefsafe-0.0.3.tgz", + "integrity": "sha1-7Mo6A+VrmvFzhbqsgSrIO5lKli8=", + "dev": true + }, + "underscore.string": { + "version": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.0.3.tgz", + "integrity": "sha1-Rhe4waJQz25QZPu7Nj0PqWzxRVI=", + "dev": true + }, + "unicode-length": { + "version": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz", + "integrity": "sha1-Wtp6f+1RhBpBijKM8UlHisg1irs=", + "dev": true, + "requires": { + "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + } + }, + "union": { + "version": "https://registry.npmjs.org/union/-/union-0.4.6.tgz", + "integrity": "sha1-GY+9rrolTniLDvy2MLwR8kopWeA=", + "dev": true, + "requires": { + "qs": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz" + }, + "dependencies": { + "qs": { + "version": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", + "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=", + "dev": true + } + } + }, + "update-notifier": { + "version": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.5.0.tgz", + "integrity": "sha1-B7XcIGazYnqztPUwEw9+3doHpMw=", + "dev": true, + "requires": { + "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "configstore": "https://registry.npmjs.org/configstore/-/configstore-1.4.0.tgz", + "is-npm": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", + "latest-version": "https://registry.npmjs.org/latest-version/-/latest-version-1.0.1.tgz", + "repeating": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", + "semver-diff": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", + "string-length": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz" + }, + "dependencies": { + "repeating": { + "version": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", + "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=", + "dev": true, + "requires": { + "is-finite": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz" + } + } + } + }, + "url": { + "version": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "querystring": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz" + }, + "dependencies": { + "punycode": { + "version": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "url-join": { + "version": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz", + "integrity": "sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg=", + "dev": true + }, + "url-parse": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.1.9.tgz", + "integrity": "sha1-xn8dd11R8KGJEd17P/rSe7nlvRk=", + "dev": true, + "requires": { + "querystringify": "1.0.0", + "requires-port": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" + }, + "dependencies": { + "querystringify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-1.0.0.tgz", + "integrity": "sha1-YoYkIRLFtxL6ZU5SZlK/ahP/Bcs=", + "dev": true + } + } + }, + "user-home": { + "version": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", + "dev": true + }, + "userhome": { + "version": "https://registry.npmjs.org/userhome/-/userhome-1.0.0.tgz", + "integrity": "sha1-tkkf8S0hpecmcd+czIcX4cZojAs=", + "dev": true + }, + "util": { + "version": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + }, + "dependencies": { + "inherits": { + "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", + "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=", + "dev": true + }, + "v8flags": { + "version": "https://registry.npmjs.org/v8flags/-/v8flags-2.0.11.tgz", + "integrity": "sha1-vKjzDw1tYGEswsAGQeaWLUKuaIE=", + "dev": true, + "requires": { + "user-home": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz" + } + }, + "vargs": { + "version": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz", + "integrity": "sha1-a2GE2mUgzDIEzhtAfKwm2SYJ6/8=", + "dev": true + }, + "verror": { + "version": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", + "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", + "dev": true, + "requires": { + "extsprintf": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" + } + }, + "vm-browserify": { + "version": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz" + } + }, + "watchify": { + "version": "https://registry.npmjs.org/watchify/-/watchify-3.9.0.tgz", + "integrity": "sha1-8HX9LoqGrN6Eztum5cKgvt1SPZ4=", + "dev": true, + "requires": { + "anymatch": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", + "browserify": "https://registry.npmjs.org/browserify/-/browserify-14.1.0.tgz", + "chokidar": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz", + "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "outpipe": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", + "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + }, + "dependencies": { + "browserify": { + "version": "https://registry.npmjs.org/browserify/-/browserify-14.1.0.tgz", + "integrity": "sha1-BQjMHnv0wVIxLC+lI+Z2wLC5IxE=", + "dev": true, + "requires": { + "assert": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "browser-pack": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.2.tgz", + "browser-resolve": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", + "browserify-zlib": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "buffer": "https://registry.npmjs.org/buffer/-/buffer-5.0.5.tgz", + "cached-path-relative": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", + "concat-stream": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "console-browserify": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "constants-browserify": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "crypto-browserify": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.0.tgz", + "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "deps-sort": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "domain-browser": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "duplexer2": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "events": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "has": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "htmlescape": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "https-browserify": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "insert-module-globals": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.1.tgz", + "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "labeled-stream-splicer": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz", + "module-deps": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", + "os-browserify": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "parents": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "path-browserify": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "process": "https://registry.npmjs.org/process/-/process-0.11.9.tgz", + "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "querystring-es3": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "read-only-stream": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", + "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.2.tgz", + "shasum": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "shell-quote": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "stream-browserify": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "stream-http": "https://registry.npmjs.org/stream-http/-/stream-http-2.6.3.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "subarg": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "syntax-error": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.3.0.tgz", + "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "timers-browserify": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "tty-browserify": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "url": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "util": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "vm-browserify": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + }, + "buffer": { + "version": "https://registry.npmjs.org/buffer/-/buffer-5.0.5.tgz", + "integrity": "sha1-Nck5MkSpCv+DWBBj0W8Igs7MlBg=", + "dev": true, + "requires": { + "base64-js": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", + "ieee754": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz" + } + } + } + }, + "wd": { + "version": "https://registry.npmjs.org/wd/-/wd-0.3.12.tgz", + "integrity": "sha1-P7Tx11n4yF3eU5PRczT/4D6bsyk=", + "dev": true, + "requires": { + "archiver": "https://registry.npmjs.org/archiver/-/archiver-0.14.4.tgz", + "async": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz", + "q": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "request": "https://registry.npmjs.org/request/-/request-2.55.0.tgz", + "underscore.string": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.0.3.tgz", + "vargs": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz" + }, + "dependencies": { + "asn1": { + "version": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", + "integrity": "sha1-VZvhg3bQik7E2+gId9J4GGObLfc=", + "dev": true + }, + "assert-plus": { + "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", + "integrity": "sha1-7nQAlBMALYTOxyGcasgRgS5yMWA=", + "dev": true + }, + "aws-sign2": { + "version": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", + "integrity": "sha1-xXED96F/wDfwLXwuZLYC6iI/fWM=", + "dev": true + }, + "caseless": { + "version": "https://registry.npmjs.org/caseless/-/caseless-0.9.0.tgz", + "integrity": "sha1-t7Zc5r8UE4hlOc/VM/CzDv+pz4g=", + "dev": true + }, + "combined-stream": { + "version": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", + "dev": true, + "requires": { + "delayed-stream": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz" + } + }, + "delayed-stream": { + "version": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", + "integrity": "sha1-1LH0OpPoKW3+AmlPRoC8N6MTxz8=", + "dev": true + }, + "form-data": { + "version": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", + "integrity": "sha1-Jvi8JtpkQOKZy9z7aQNcT3em5GY=", + "dev": true, + "requires": { + "async": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz" + }, + "dependencies": { + "async": { + "version": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "dev": true + } + } + }, + "har-validator": { + "version": "https://registry.npmjs.org/har-validator/-/har-validator-1.8.0.tgz", + "integrity": "sha1-2DhCsOtMQ1lgrrEIoGejqpTA7rI=", + "dev": true, + "requires": { + "bluebird": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", + "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "commander": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "is-my-json-valid": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz" + } + }, + "hawk": { + "version": "https://registry.npmjs.org/hawk/-/hawk-2.3.1.tgz", + "integrity": "sha1-HnMc45RH+h0PbXB/e87r7A/R7B8=", + "dev": true, + "requires": { + "boom": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "cryptiles": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "sntp": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" + } + }, + "http-signature": { + "version": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", + "integrity": "sha1-T72sEyVZqoMjEh5UB3nAoBKyfmY=", + "dev": true, + "requires": { + "asn1": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", + "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", + "ctype": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz" + } + }, + "lodash": { + "version": "https://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz", + "integrity": "sha1-AVnoaDL+/8bWHYUrEqlTuZSWvTI=", + "dev": true + }, + "mime-db": { + "version": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz", + "integrity": "sha1-PQxjGA9FjrENMlqqN9fFiuMS6dc=", + "dev": true + }, + "mime-types": { + "version": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", + "integrity": "sha1-MQ4VnbI+B3+Lsit0jav6SVcUCqY=", + "dev": true, + "requires": { + "mime-db": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz" + } + }, + "oauth-sign": { + "version": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.6.0.tgz", + "integrity": "sha1-fb6uRPbKRU4fFoRR1jB0ZzWBPOM=", + "dev": true + }, + "qs": { + "version": "https://registry.npmjs.org/qs/-/qs-2.4.2.tgz", + "integrity": "sha1-9854jld33wtQENp/fE5zujJHD1o=", + "dev": true + }, + "request": { + "version": "https://registry.npmjs.org/request/-/request-2.55.0.tgz", + "integrity": "sha1-11wc32eddrsQD5v/4f5VG1wk6T0=", + "dev": true, + "requires": { + "aws-sign2": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", + "bl": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", + "caseless": "https://registry.npmjs.org/caseless/-/caseless-0.9.0.tgz", + "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "forever-agent": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "form-data": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", + "har-validator": "https://registry.npmjs.org/har-validator/-/har-validator-1.8.0.tgz", + "hawk": "https://registry.npmjs.org/hawk/-/hawk-2.3.1.tgz", + "http-signature": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", + "isstream": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "json-stringify-safe": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", + "node-uuid": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", + "oauth-sign": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.6.0.tgz", + "qs": "https://registry.npmjs.org/qs/-/qs-2.4.2.tgz", + "stringstream": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "tough-cookie": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "tunnel-agent": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz" + } + } + } + }, + "websocket-driver": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.6.5.tgz", + "integrity": "sha1-XLJVbOuF9Dc8bYI4qmkchFThOjY=", + "dev": true, + "requires": { + "websocket-extensions": "0.1.1" + } + }, + "websocket-extensions": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.1.tgz", + "integrity": "sha1-domUmcGEtu91Q3fC27DNbLVdKec=", + "dev": true + }, + "which": { + "version": "https://registry.npmjs.org/which/-/which-1.2.12.tgz", + "integrity": "sha1-3me15FAmnxlJCe8j7OTr5Bb6EZI=", + "dev": true, + "requires": { + "isexe": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz" + } + }, + "wordwrap": { + "version": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrap-ansi": { + "version": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + } + }, + "wrappy": { + "version": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" + } + }, + "write-file-atomic": { + "version": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.1.tgz", + "integrity": "sha1-fUW6MjFjKN0ex9kPYOvA2EW7dZo=", + "dev": true, + "requires": { + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "imurmurhash": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "slide": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" + } + }, + "xdg-basedir": { + "version": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz", + "integrity": "sha1-7byQPMOF/ARSPZZqM1UEtVBNG9I=", + "dev": true, + "requires": { + "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" + } + }, + "xhr": { + "version": "https://registry.npmjs.org/xhr/-/xhr-2.4.0.tgz", + "integrity": "sha1-4W5mpF+GmGHu76tBbV7/ci3ECZM=", + "dev": true, + "requires": { + "global": "https://registry.npmjs.org/global/-/global-4.3.1.tgz", + "is-function": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", + "parse-headers": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + }, + "xtend": { + "version": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz", + "integrity": "sha1-MGxUODXwnuGkyyO3vOmrNByRzdQ=", + "dev": true + }, + "zip-stream": { + "version": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.5.2.tgz", + "integrity": "sha1-Mty8UG0Nq00hNyYlvX66rDwv/1Y=", + "dev": true, + "requires": { + "compress-commons": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.2.9.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + }, + "dependencies": { + "isarray": { + "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "lodash": { + "version": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", + "integrity": "sha1-S/UKMkP5rrC6xBpV09WZBnWkYvs=", + "dev": true + }, + "readable-stream": { + "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + } + } + } + } + } +} diff --git a/package.json b/package.json index f289c7a..79b38ec 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "watchify": "^3.7.0" }, "dependencies": { + "avl": "^1.3.0", "functional-red-black-tree": "1.0.1", "tinyqueue": "1.1.0" } diff --git a/test/compare_segments.test.js b/test/compare_segments.test.js index 0ddb31a..267c926 100644 --- a/test/compare_segments.test.js +++ b/test/compare_segments.test.js @@ -1,45 +1,45 @@ 'use strict'; var tap = require('tap'); -var Tree = require('functional-red-black-tree'); +var Tree = require('avl'); var compareSegments = require('../src/compare_segments'); var compareEvents = require('../src/compare_events'); var SweepEvent = require('../src/sweep_event'); -tap.test('compare segments', function (main) { +tap.test('compare segments', (main) => { - main.test('not collinear', function (secondary) { + main.test('not collinear', (secondary) => { - secondary.test('shared left point - right point first', function (t) { + secondary.test('shared left point - right point first', (t) => { var tree = new Tree(compareSegments); var pt = [0.0, 0.0]; var se1 = new SweepEvent(pt, true, new SweepEvent([1, 1], false)); var se2 = new SweepEvent(pt, true, new SweepEvent([2, 3], false)); - tree = tree.insert(se1); - tree = tree.insert(se2); + tree.insert(se1); + tree.insert(se2); - t.strictSame(tree.end.key.otherEvent.point, [2, 3]); - t.strictSame(tree.begin.key.otherEvent.point, [1, 1]); + t.strictSame(tree.maxNode().key.otherEvent.point, [2, 3]); + t.strictSame(tree.minNode().key.otherEvent.point, [1, 1]); t.end(); }); - secondary.test('different left point - right point y coord to sort', function (t) { + secondary.test('different left point - right point y coord to sort', (t) => { var tree = new Tree(compareSegments); var se1 = new SweepEvent([0, 1], true, new SweepEvent([1, 1], false)); var se2 = new SweepEvent([0, 2], true, new SweepEvent([2, 3], false)); - tree = tree.insert(se1); - tree = tree.insert(se2); + tree.insert(se1); + tree.insert(se2); - t.strictSame(tree.begin.key.otherEvent.point, [1, 1]); - t.strictSame(tree.end.key.otherEvent.point, [2, 3]); + t.strictSame(tree.minNode().key.otherEvent.point, [1, 1]); + t.strictSame(tree.maxNode().key.otherEvent.point, [2, 3]); t.end(); }); - secondary.test('events order in sweep line', function (t) { + secondary.test('events order in sweep line', (t) => { var se1 = new SweepEvent([0, 1], true, new SweepEvent([2, 1], false)); var se2 = new SweepEvent([-1, 0], true, new SweepEvent([2, 3], false)); @@ -59,7 +59,7 @@ tap.test('compare segments', function (main) { t.end(); }); - secondary.test('first point is below', function (t) { + secondary.test('first point is below', (t) => { var se2 = new SweepEvent([0, 1], true, new SweepEvent([2, 1], false)); var se1 = new SweepEvent([-1, 0], true, new SweepEvent([2, 3], false)); @@ -72,7 +72,7 @@ tap.test('compare segments', function (main) { secondary.end(); }); - main.test('collinear segments', function (t) { + main.test('collinear segments', (t) => { var se1 = new SweepEvent([1, 1], true, new SweepEvent([5, 1], false), true); var se2 = new SweepEvent([2, 1], true, new SweepEvent([3, 1], false), false); @@ -82,7 +82,7 @@ tap.test('compare segments', function (main) { t.end(); }); - main.test('collinear shared left point', function (t) { + main.test('collinear shared left point', (t) => { var pt = [0, 1]; var se1 = new SweepEvent(pt, true, new SweepEvent([5, 1], false), false); @@ -105,7 +105,7 @@ tap.test('compare segments', function (main) { }); - main.test('collinear same polygon different left points', function (t) { + main.test('collinear same polygon different left points', (t) => { var se1 = new SweepEvent([1, 1], true, new SweepEvent([5, 1], false), true); var se2 = new SweepEvent([2, 1], true, new SweepEvent([3, 1], false), true); diff --git a/test/divide_segment.test.js b/test/divide_segment.test.js index a8a8ae6..1d3f335 100644 --- a/test/divide_segment.test.js +++ b/test/divide_segment.test.js @@ -13,7 +13,7 @@ var equals = require('../src/equals'); // GeoJSON Data var shapes = load.sync(path.join(__dirname, 'fixtures', 'two_shapes.geojson')); -var Tree = require('functional-red-black-tree'); +var Tree = require('avl'); var compareSegments = require('../src/compare_segments'); var subject = shapes.features[0]; @@ -98,8 +98,8 @@ tap.test('divide segments', function (main) { var tr = new Tree(compareSegments); - t.ok(tr = tr.insert(te), 'insert'); - t.ok(tr = tr.insert(te3), 'insert'); + t.ok(tr.insert(te), 'insert'); + t.ok(tr.insert(te3), 'insert'); t.equals(tr.find(te).key, te); t.equals(tr.find(te3).key, te3); diff --git a/test/sweep_line.test.js b/test/sweep_line.test.js index 9a75192..e69b28d 100644 --- a/test/sweep_line.test.js +++ b/test/sweep_line.test.js @@ -2,7 +2,7 @@ var tap = require('tap'); var path = require('path'); -var Tree = require('functional-red-black-tree'); +var Tree = require('avl'); var load = require('load-json-file'); var compareSegments = require('../src/compare_segments'); var SweepEvent = require('../src/sweep_event'); @@ -24,38 +24,36 @@ tap.test('sweep line', function (t) { EG.name = 'EG'; var tree = new Tree(compareSegments); - tree = tree.insert(EF); - tree = tree.insert(EG); + tree.insert(EF); + tree.insert(EG); t.equals(tree.find(EF).key, EF, 'able to retrieve node'); - t.equals(tree.begin.key, EF, 'EF is at the begin'); - t.equals(tree.end.key, EG, 'EG is at the end'); + t.equals(tree.minNode().key, EF, 'EF is at the begin'); + t.equals(tree.maxNode().key, EG, 'EG is at the end'); var it = tree.find(EF); - it.next(); - t.equals(it.key, EG); + t.equals(tree.next(it).key, EG); it = tree.find(EG); - it.prev(); - t.equals(it.key, EF); + t.equals(tree.prev(it).key, EF); var DA = new SweepEvent(c[0][0], true, new SweepEvent(c[0][2], false), true); var DC = new SweepEvent(c[0][0], true, new SweepEvent(c[0][1], false), true); - tree = tree.insert(DA); - tree = tree.insert(DC); + tree.insert(DA); + tree.insert(DC); - var begin = tree.begin; + var begin = tree.minNode(); t.equals(begin.key, DA, 'DA'); - begin.next(); + begin = tree.next(begin); t.equals(begin.key, DC, 'DC'); - begin.next(); + begin = tree.next(begin); t.equals(begin.key, EF, 'EF'); - begin.next(); + begin = tree.next(begin); t.equals(begin.key, EG, 'EG'); t.end(); From f4779874fb2bc3f0e45bdb8f300bcecf6d6f055b Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Wed, 30 Aug 2017 20:13:21 +1000 Subject: [PATCH 02/42] First pass at integrating avl --- package.json | 2 +- src/index.js | 71 ++++++++++++++++++++++++++-------------------------- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 79b38ec..addd2c3 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "watchify": "^3.7.0" }, "dependencies": { - "avl": "^1.3.0", + "avl": "^1.4.0", "functional-red-black-tree": "1.0.1", "tinyqueue": "1.1.0" } diff --git a/src/index.js b/src/index.js index c37a8c4..92e610c 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,7 @@ 'use strict'; var Queue = require('tinyqueue'); -var Tree = require('functional-red-black-tree'); +var Tree = require('avl'); var edgeType = require('./edge_type'); var SweepEvent = require('./sweep_event'); var compareEvents = require('./compare_events'); @@ -353,43 +353,42 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio } if (event.left) { - sweepLine = sweepLine.insert(event); + sweepLine.insert(event); //_renderSweepLine(sweepLine, event.point, event); - next = sweepLine.find(event); prev = sweepLine.find(event); event.iterator = sweepLine.find(event); - if (prev.node !== sweepLine.begin) { - prev.prev(); + if (prev !== sweepLine.minNode()) { + prev = sweepLine.prev(prev); } else { - prev = sweepLine.begin; - prev.prev(); - prev.next(); + prev = sweepLine.minNode(); + prev = sweepLine.prev(prev); + prev = sweepLine.next(prev); } - next.next(); - - var prevEvent = (prev.key || null), prevprevEvent; - computeFields(event, prevEvent, operation); - if (next.node) { - if (possibleIntersection(event, next.key, eventQueue) === 2) { - computeFields(event, prevEvent, operation); - computeFields(event, next.key, operation); + next = sweepLine.next(next); + + var prevprev = null; + computeFields(event, prev, operation); + if (next) { + if (possibleIntersection(event, next, eventQueue) === 2) { + computeFields(event, prev, operation); + computeFields(event, next, operation); } } - if (prev.node) { - if (possibleIntersection(prev.key, event, eventQueue) === 2) { - var prevprev = sweepLine.find(prev.key); - if (prevprev.node !== sweepLine.begin) { - prevprev.prev(); + if (prev) { + if (possibleIntersection(prev, event, eventQueue) === 2) { + prevprev = sweepLine.find(prev); + if (prevprev !== sweepLine.minNode()) { + prevprev = sweepLine.prev(prevprev); } else { - prevprev = sweepLine.find(sweepLine.end); - prevprev.next(); + prevprev = sweepLine.find(sweepLine.maxNode()); + prevprev = sweepLine.next(prevprev); } - prevprevEvent = prevprev.key || null; - computeFields(prevEvent, prevprevEvent, operation); - computeFields(event, prevEvent, operation); + prevprev = prevprev || null; + computeFields(prev, prevprev, operation); + computeFields(event, prev, operation); } } } else { @@ -401,21 +400,21 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio if (!(prev && next)) continue; - if (prev.node !== sweepLine.begin) { - prev.prev(); + if (prev !== sweepLine.minNode()) { + prev = sweepLine.prev(prev); } else { - prev = sweepLine.begin; - prev.prev(); - prev.next(); + prev = sweepLine.minNode(); + prev = sweepLine.prev(prev); + prev = sweepLine.next(prev); } - next.next(); - sweepLine = sweepLine.remove(event); + next = sweepLine.next(next); + sweepLine.remove(event); // _renderSweepLine(sweepLine, event.otherEvent.point, event); - if (next.node && prev.node) { - if (typeof prev.node.value !== 'undefined' && typeof next.node.value !== 'undefined') { - possibleIntersection(prev.key, next.key, eventQueue); + if (next && prev) { + if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + possibleIntersection(prev, next, eventQueue); } } } From 873ca52dc28e69ae054cda54071c7c49ff0c8969 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Wed, 30 Aug 2017 20:47:25 +1000 Subject: [PATCH 03/42] Updates --- src/index.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/index.js b/src/index.js index 92e610c..a5999d3 100644 --- a/src/index.js +++ b/src/index.js @@ -368,27 +368,27 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio } next = sweepLine.next(next); - var prevprev = null; - computeFields(event, prev, operation); + var prevEvent = prev ? prev.key : null; + var prevprevEvent; + computeFields(event, prevEvent, operation); if (next) { - if (possibleIntersection(event, next, eventQueue) === 2) { - computeFields(event, prev, operation); - computeFields(event, next, operation); + if (possibleIntersection(event, next.key, eventQueue) === 2) { + computeFields(event, prevEvent, operation); + computeFields(event, next.key, operation); } } - if (prev) { - if (possibleIntersection(prev, event, eventQueue) === 2) { - prevprev = sweepLine.find(prev); + if (possibleIntersection(prev.key, event, eventQueue) === 2) { + var prevprev = sweepLine.find(prev); if (prevprev !== sweepLine.minNode()) { prevprev = sweepLine.prev(prevprev); } else { prevprev = sweepLine.find(sweepLine.maxNode()); prevprev = sweepLine.next(prevprev); } - prevprev = prevprev || null; - computeFields(prev, prevprev, operation); - computeFields(event, prev, operation); + prevprevEvent = prevprev.key || null; + computeFields(prevEvent, prevprevEvent, operation); + computeFields(event, prevEvent, operation); } } } else { @@ -414,7 +414,7 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio if (next && prev) { if (typeof prev !== 'undefined' && typeof next !== 'undefined') { - possibleIntersection(prev, next, eventQueue); + possibleIntersection(prev.key, next.key, eventQueue); } } } From 8630459c49ce1ccd013aac0e02c28a31c38f0dc0 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Wed, 30 Aug 2017 18:48:33 +0300 Subject: [PATCH 04/42] tests are passing, demos work --- demo/js/bundle.js | 1807 +++++------ demo/js/index.js | 7 +- dist/martinez.js | 1614 ++++------ package-lock.json | 7648 ++++++++++++++++++++++++--------------------- src/index.js | 61 +- 5 files changed, 5537 insertions(+), 5600 deletions(-) diff --git a/demo/js/bundle.js b/demo/js/bundle.js index 5933766..3011771 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -123,8 +123,10 @@ var map = window.map = L.map('image-map', { minZoom: 1, maxZoom: 20, center: [0, 0], - zoom: 1, - crs: mode === 'geo' ? L.CRS.EPSG4326 : L.CRS.Simple, + zoom: 2, + crs: mode === 'geo' ? L.CRS.EPSG4326 : L.extend({}, L.CRS.Simple, { + transformation: new L.Transformation(0.5, 0, -0.5, 0) + }), editable: true }); @@ -193,6 +195,7 @@ function run (op) { var result = operation(subject.geometry.coordinates, clipping.geometry.coordinates); console.timeEnd('martinez'); + //if (op === OPERATIONS.UNION) result = result[0]; //console.log('result', result); results.clearLayers(); @@ -296,6 +299,731 @@ module.exports = { }; },{"./src/index":17}],6:[function(require,module,exports){ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.avl = factory()); +}(this, (function () { 'use strict'; + +/** + * Prints tree horizontally + * @param {Node} root + * @param {Function(node:Node):String} [printNode] + * @return {String} + */ +function print (root, printNode) { + if ( printNode === void 0 ) printNode = function (n) { return n.key; }; + + var out = []; + row(root, '', true, function (v) { return out.push(v); }, printNode); + return out.join(''); +} + +/** + * Prints level of the tree + * @param {Node} root + * @param {String} prefix + * @param {Boolean} isTail + * @param {Function(in:string):void} out + * @param {Function(node:Node):String} printNode + */ +function row (root, prefix, isTail, out, printNode) { + if (root) { + out(("" + prefix + (isTail ? '└── ' : '├── ') + (printNode(root)) + "\n")); + var indent = prefix + (isTail ? ' ' : '│ '); + if (root.left) { row(root.left, indent, false, out, printNode); } + if (root.right) { row(root.right, indent, true, out, printNode); } + } +} + + +/** + * Is the tree balanced (none of the subtrees differ in height by more than 1) + * @param {Node} root + * @return {Boolean} + */ +function isBalanced(root) { + if (root === null) { return true; } // If node is empty then return true + + // Get the height of left and right sub trees + var lh = height(root.left); + var rh = height(root.right); + + if (Math.abs(lh - rh) <= 1 && + isBalanced(root.left) && + isBalanced(root.right)) { return true; } + + // If we reach here then tree is not height-balanced + return false; +} + +/** + * The function Compute the 'height' of a tree. + * Height is the number of nodes along the longest path + * from the root node down to the farthest leaf node. + * + * @param {Node} node + * @return {Number} + */ +function height(node) { + return node ? (1 + Math.max(height(node.left), height(node.right))) : 0; +} + +// function createNode (parent, left, right, height, key, data) { +// return { parent, left, right, balanceFactor: height, key, data }; +// } + +/** + * @typedef {{ + * parent: ?Node, + * left: ?Node, + * right: ?Node, + * balanceFactor: number, + * key: Key, + * data: Value + * }} Node + */ + +/** + * @typedef {*} Key + */ + +/** + * @typedef {*} Value + */ + +/** + * Default comparison function + * @param {Key} a + * @param {Key} b + * @returns {number} + */ +function DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; } + + +/** + * Single left rotation + * @param {Node} node + * @return {Node} + */ +function rotateLeft (node) { + var rightNode = node.right; + node.right = rightNode.left; + + if (rightNode.left) { rightNode.left.parent = node; } + + rightNode.parent = node.parent; + if (rightNode.parent) { + if (rightNode.parent.left === node) { + rightNode.parent.left = rightNode; + } else { + rightNode.parent.right = rightNode; + } + } + + node.parent = rightNode; + rightNode.left = node; + + node.balanceFactor += 1; + if (rightNode.balanceFactor < 0) { + node.balanceFactor -= rightNode.balanceFactor; + } + + rightNode.balanceFactor += 1; + if (node.balanceFactor > 0) { + rightNode.balanceFactor += node.balanceFactor; + } + return rightNode; +} + + +function rotateRight (node) { + var leftNode = node.left; + node.left = leftNode.right; + if (node.left) { node.left.parent = node; } + + leftNode.parent = node.parent; + if (leftNode.parent) { + if (leftNode.parent.left === node) { + leftNode.parent.left = leftNode; + } else { + leftNode.parent.right = leftNode; + } + } + + node.parent = leftNode; + leftNode.right = node; + + node.balanceFactor -= 1; + if (leftNode.balanceFactor > 0) { + node.balanceFactor -= leftNode.balanceFactor; + } + + leftNode.balanceFactor -= 1; + if (node.balanceFactor < 0) { + leftNode.balanceFactor += node.balanceFactor; + } + + return leftNode; +} + + +// function leftBalance (node) { +// if (node.left.balanceFactor === -1) rotateLeft(node.left); +// return rotateRight(node); +// } + + +// function rightBalance (node) { +// if (node.right.balanceFactor === 1) rotateRight(node.right); +// return rotateLeft(node); +// } + + +var AVLTree = function AVLTree (comparator, noDuplicates) { + if ( noDuplicates === void 0 ) noDuplicates = false; + + this._comparator = comparator || DEFAULT_COMPARE; + this._root = null; + this._size = 0; + this._noDuplicates = !!noDuplicates; +}; + +var prototypeAccessors = { size: {} }; + + +/** + * Clear the tree + * @return {AVLTree} + */ +AVLTree.prototype.destroy = function destroy () { + this._root = null; + return this; +}; + +/** + * Number of nodes + * @return {number} + */ +prototypeAccessors.size.get = function () { + return this._size; +}; + + +/** + * Whether the tree contains a node with the given key + * @param{Key} key + * @return {boolean} true/false + */ +AVLTree.prototype.contains = function contains (key) { + if (this._root){ + var node = this._root; + var comparator = this._comparator; + while (node){ + var cmp = comparator(key, node.key); + if (cmp === 0) { return true; } + else if (cmp < 0) { node = node.left; } + else { node = node.right; } + } + } + return false; +}; + + +/* eslint-disable class-methods-use-this */ + +/** + * Successor node + * @param{Node} node + * @return {?Node} + */ +AVLTree.prototype.next = function next (node) { + var successor = node; + if (successor) { + if (successor.right) { + successor = successor.right; + while (successor && successor.left) { successor = successor.left; } + } else { + successor = node.parent; + while (successor && successor.right === node) { + node = successor; successor = successor.parent; + } + } + } + return successor; +}; + + +/** + * Predecessor node + * @param{Node} node + * @return {?Node} + */ +AVLTree.prototype.prev = function prev (node) { + var predecessor = node; + if (predecessor) { + if (predecessor.left) { + predecessor = predecessor.left; + while (predecessor && predecessor.right) { predecessor = predecessor.right; } + } else { + predecessor = node.parent; + while (predecessor && predecessor.left === node) { + node = predecessor; + predecessor = predecessor.parent; + } + } + } + return predecessor; +}; +/* eslint-enable class-methods-use-this */ + + +/** + * Callback for forEach + * @callback forEachCallback + * @param {Node} node + * @param {number} index + */ + +/** + * @param{forEachCallback} callback + * @return {AVLTree} + */ +AVLTree.prototype.forEach = function forEach (callback) { + var current = this._root; + var s = [], done = false, i = 0; + + while (!done) { + // Reach the left most Node of the current Node + if (current) { + // Place pointer to a tree node on the stack + // before traversing the node's left subtree + s.push(current); + current = current.left; + } else { + // BackTrack from the empty subtree and visit the Node + // at the top of the stack; however, if the stack is + // empty you are done + if (s.length > 0) { + current = s.pop(); + callback(current, i++); + + // We have visited the node and its left + // subtree. Now, it's right subtree's turn + current = current.right; + } else { done = true; } + } + } + return this; +}; + + +/** + * Returns all keys in order + * @return {Array} + */ +AVLTree.prototype.keys = function keys () { + var current = this._root; + var s = [], r = [], done = false; + + while (!done) { + if (current) { + s.push(current); + current = current.left; + } else { + if (s.length > 0) { + current = s.pop(); + r.push(current.key); + current = current.right; + } else { done = true; } + } + } + return r; +}; + + +/** + * Returns `data` fields of all nodes in order. + * @return {Array} + */ +AVLTree.prototype.values = function values () { + var current = this._root; + var s = [], r = [], done = false; + + while (!done) { + if (current) { + s.push(current); + current = current.left; + } else { + if (s.length > 0) { + current = s.pop(); + r.push(current.data); + current = current.right; + } else { done = true; } + } + } + return r; +}; + + +/** + * Returns node at given index + * @param{number} index + * @return {?Node} + */ +AVLTree.prototype.at = function at (index) { + // removed after a consideration, more misleading than useful + // index = index % this.size; + // if (index < 0) index = this.size - index; + + var current = this._root; + var s = [], done = false, i = 0; + + while (!done) { + if (current) { + s.push(current); + current = current.left; + } else { + if (s.length > 0) { + current = s.pop(); + if (i === index) { return current; } + i++; + current = current.right; + } else { done = true; } + } + } + return null; +}; + + +/** + * Returns node with the minimum key + * @return {?Node} + */ +AVLTree.prototype.minNode = function minNode () { + var node = this._root; + if (!node) { return null; } + while (node.left) { node = node.left; } + return node; +}; + + +/** + * Returns node with the max key + * @return {?Node} + */ +AVLTree.prototype.maxNode = function maxNode () { + var node = this._root; + if (!node) { return null; } + while (node.right) { node = node.right; } + return node; +}; + + +/** + * Min key + * @return {?Key} + */ +AVLTree.prototype.min = function min () { + var node = this._root; + if (!node) { return null; } + while (node.left) { node = node.left; } + return node.key; +}; + + +/** + * Max key + * @return {?Key} + */ +AVLTree.prototype.max = function max () { + var node = this._root; + if (!node) { return null; } + while (node.right) { node = node.right; } + return node.key; +}; + + +/** + * @return {boolean} true/false + */ +AVLTree.prototype.isEmpty = function isEmpty () { + return !this._root; +}; + + +/** + * Removes and returns the node with smallest key + * @return {?Node} + */ +AVLTree.prototype.pop = function pop () { + var node = this._root, returnValue = null; + if (node) { + while (node.left) { node = node.left; } + returnValue = { key: node.key, data: node.data }; + this.remove(node.key); + } + return returnValue; +}; + + +/** + * Find node by key + * @param{Key} key + * @return {?Node} + */ +AVLTree.prototype.find = function find (key) { + var root = this._root; + // if (root === null) return null; + // if (key === root.key) return root; + + var subtree = root, cmp; + var compare = this._comparator; + while (subtree) { + cmp = compare(key, subtree.key); + if (cmp === 0) { return subtree; } + else if (cmp < 0) { subtree = subtree.left; } + else { subtree = subtree.right; } + } + + return null; +}; + + +/** + * Insert a node into the tree + * @param{Key} key + * @param{Value} [data] + * @return {?Node} + */ +AVLTree.prototype.insert = function insert (key, data) { + var this$1 = this; + + if (!this._root) { + this._root = { + parent: null, left: null, right: null, balanceFactor: 0, + key: key, data: data + }; + this._size++; + return this._root; + } + + var compare = this._comparator; + var node = this._root; + var parent= null; + var cmp = 0; + + if (this._noDuplicates) { + while (node) { + cmp = compare(key, node.key); + parent = node; + if (cmp === 0) { return null; } + else if (cmp < 0) { node = node.left; } + else { node = node.right; } + } + } else { + while (node) { + cmp = compare(key, node.key); + parent = node; + if (cmp <= 0){ node = node.left; } //return null; + else { node = node.right; } + } + } + + var newNode = { + left: null, + right: null, + balanceFactor: 0, + parent: parent, key: key, data: data + }; + var newRoot; + if (cmp <= 0) { parent.left= newNode; } + else { parent.right = newNode; } + + while (parent) { + cmp = compare(parent.key, key); + if (cmp < 0) { parent.balanceFactor -= 1; } + else { parent.balanceFactor += 1; } + + if (parent.balanceFactor === 0) { break; } + else if (parent.balanceFactor < -1) { + // inlined + //var newRoot = rightBalance(parent); + if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } + newRoot = rotateLeft(parent); + + if (parent === this$1._root) { this$1._root = newRoot; } + break; + } else if (parent.balanceFactor > 1) { + // inlined + // var newRoot = leftBalance(parent); + if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } + newRoot = rotateRight(parent); + + if (parent === this$1._root) { this$1._root = newRoot; } + break; + } + parent = parent.parent; + } + + this._size++; + return newNode; +}; + + +/** + * Removes the node from the tree. If not found, returns null. + * @param{Key} key + * @return {?Node} + */ +AVLTree.prototype.remove = function remove (key) { + var this$1 = this; + + if (!this._root) { return null; } + + var node = this._root; + var compare = this._comparator; + var cmp = 0; + + while (node) { + cmp = compare(key, node.key); + if (cmp === 0) { break; } + else if (cmp < 0) { node = node.left; } + else { node = node.right; } + } + if (!node) { return null; } + + var returnValue = node.key; + var max, min; + + if (node.left) { + max = node.left; + + while (max.left || max.right) { + while (max.right) { max = max.right; } + + node.key = max.key; + node.data = max.data; + if (max.left) { + node = max; + max = max.left; + } + } + + node.key= max.key; + node.data = max.data; + node = max; + } + + if (node.right) { + min = node.right; + + while (min.left || min.right) { + while (min.left) { min = min.left; } + + node.key= min.key; + node.data = min.data; + if (min.right) { + node = min; + min = min.right; + } + } + + node.key= min.key; + node.data = min.data; + node = min; + } + + var parent = node.parent; + var pp = node; + var newRoot; + + while (parent) { + if (parent.left === pp) { parent.balanceFactor -= 1; } + else { parent.balanceFactor += 1; } + + if (parent.balanceFactor < -1) { + // inlined + //var newRoot = rightBalance(parent); + if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } + newRoot = rotateLeft(parent); + + if (parent === this$1._root) { this$1._root = newRoot; } + parent = newRoot; + } else if (parent.balanceFactor > 1) { + // inlined + // var newRoot = leftBalance(parent); + if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } + newRoot = rotateRight(parent); + + if (parent === this$1._root) { this$1._root = newRoot; } + parent = newRoot; + } + + if (parent.balanceFactor === -1 || parent.balanceFactor === 1) { break; } + + pp = parent; + parent = parent.parent; + } + + if (node.parent) { + if (node.parent.left === node) { node.parent.left= null; } + else { node.parent.right = null; } + } + + if (node === this._root) { this._root = null; } + + this._size--; + return returnValue; +}; + + +/** + * Bulk-load items + * @param{Array}keys + * @param{Array}[values] + * @return {AVLTree} + */ +AVLTree.prototype.load = function load (keys, values) { + var this$1 = this; + if ( keys === void 0 ) keys = []; + if ( values === void 0 ) values = []; + + if (Array.isArray(keys)) { + for (var i = 0, len = keys.length; i < len; i++) { + this$1.insert(keys[i], values[i]); + } + } + return this; +}; + + +/** + * Returns true if the tree is balanced + * @return {boolean} + */ +AVLTree.prototype.isBalanced = function isBalanced$1 () { + return isBalanced(this._root); +}; + + +/** + * String representation of the tree - primitive horizontal print-out + * @param{Function(Node):string} [printNode] + * @return {string} + */ +AVLTree.prototype.toString = function toString (printNode) { + return print(this._root, printNode); +}; + +Object.defineProperties( AVLTree.prototype, prototypeAccessors ); + +return AVLTree; + +}))); + + +},{}],7:[function(require,module,exports){ /** * Expose `Emitter`. @@ -460,1003 +1188,6 @@ Emitter.prototype.hasListeners = function(event){ return !! this.listeners(event).length; }; -},{}],7:[function(require,module,exports){ -"use strict" - -module.exports = createRBTree - -var RED = 0 -var BLACK = 1 - -function RBNode(color, key, value, left, right, count) { - this._color = color - this.key = key - this.value = value - this.left = left - this.right = right - this._count = count -} - -function cloneNode(node) { - return new RBNode(node._color, node.key, node.value, node.left, node.right, node._count) -} - -function repaint(color, node) { - return new RBNode(color, node.key, node.value, node.left, node.right, node._count) -} - -function recount(node) { - node._count = 1 + (node.left ? node.left._count : 0) + (node.right ? node.right._count : 0) -} - -function RedBlackTree(compare, root) { - this._compare = compare - this.root = root -} - -var proto = RedBlackTree.prototype - -Object.defineProperty(proto, "keys", { - get: function() { - var result = [] - this.forEach(function(k,v) { - result.push(k) - }) - return result - } -}) - -Object.defineProperty(proto, "values", { - get: function() { - var result = [] - this.forEach(function(k,v) { - result.push(v) - }) - return result - } -}) - -//Returns the number of nodes in the tree -Object.defineProperty(proto, "length", { - get: function() { - if(this.root) { - return this.root._count - } - return 0 - } -}) - -//Insert a new item into the tree -proto.insert = function(key, value) { - var cmp = this._compare - //Find point to insert new node at - var n = this.root - var n_stack = [] - var d_stack = [] - while(n) { - var d = cmp(key, n.key) - n_stack.push(n) - d_stack.push(d) - if(d <= 0) { - n = n.left - } else { - n = n.right - } - } - //Rebuild path to leaf node - n_stack.push(new RBNode(RED, key, value, null, null, 1)) - for(var s=n_stack.length-2; s>=0; --s) { - var n = n_stack[s] - if(d_stack[s] <= 0) { - n_stack[s] = new RBNode(n._color, n.key, n.value, n_stack[s+1], n.right, n._count+1) - } else { - n_stack[s] = new RBNode(n._color, n.key, n.value, n.left, n_stack[s+1], n._count+1) - } - } - //Rebalance tree using rotations - //console.log("start insert", key, d_stack) - for(var s=n_stack.length-1; s>1; --s) { - var p = n_stack[s-1] - var n = n_stack[s] - if(p._color === BLACK || n._color === BLACK) { - break - } - var pp = n_stack[s-2] - if(pp.left === p) { - if(p.left === n) { - var y = pp.right - if(y && y._color === RED) { - //console.log("LLr") - p._color = BLACK - pp.right = repaint(BLACK, y) - pp._color = RED - s -= 1 - } else { - //console.log("LLb") - pp._color = RED - pp.left = p.right - p._color = BLACK - p.right = pp - n_stack[s-2] = p - n_stack[s-1] = n - recount(pp) - recount(p) - if(s >= 3) { - var ppp = n_stack[s-3] - if(ppp.left === pp) { - ppp.left = p - } else { - ppp.right = p - } - } - break - } - } else { - var y = pp.right - if(y && y._color === RED) { - //console.log("LRr") - p._color = BLACK - pp.right = repaint(BLACK, y) - pp._color = RED - s -= 1 - } else { - //console.log("LRb") - p.right = n.left - pp._color = RED - pp.left = n.right - n._color = BLACK - n.left = p - n.right = pp - n_stack[s-2] = n - n_stack[s-1] = p - recount(pp) - recount(p) - recount(n) - if(s >= 3) { - var ppp = n_stack[s-3] - if(ppp.left === pp) { - ppp.left = n - } else { - ppp.right = n - } - } - break - } - } - } else { - if(p.right === n) { - var y = pp.left - if(y && y._color === RED) { - //console.log("RRr", y.key) - p._color = BLACK - pp.left = repaint(BLACK, y) - pp._color = RED - s -= 1 - } else { - //console.log("RRb") - pp._color = RED - pp.right = p.left - p._color = BLACK - p.left = pp - n_stack[s-2] = p - n_stack[s-1] = n - recount(pp) - recount(p) - if(s >= 3) { - var ppp = n_stack[s-3] - if(ppp.right === pp) { - ppp.right = p - } else { - ppp.left = p - } - } - break - } - } else { - var y = pp.left - if(y && y._color === RED) { - //console.log("RLr") - p._color = BLACK - pp.left = repaint(BLACK, y) - pp._color = RED - s -= 1 - } else { - //console.log("RLb") - p.left = n.right - pp._color = RED - pp.right = n.left - n._color = BLACK - n.right = p - n.left = pp - n_stack[s-2] = n - n_stack[s-1] = p - recount(pp) - recount(p) - recount(n) - if(s >= 3) { - var ppp = n_stack[s-3] - if(ppp.right === pp) { - ppp.right = n - } else { - ppp.left = n - } - } - break - } - } - } - } - //Return new tree - n_stack[0]._color = BLACK - return new RedBlackTree(cmp, n_stack[0]) -} - - -//Visit all nodes inorder -function doVisitFull(visit, node) { - if(node.left) { - var v = doVisitFull(visit, node.left) - if(v) { return v } - } - var v = visit(node.key, node.value) - if(v) { return v } - if(node.right) { - return doVisitFull(visit, node.right) - } -} - -//Visit half nodes in order -function doVisitHalf(lo, compare, visit, node) { - var l = compare(lo, node.key) - if(l <= 0) { - if(node.left) { - var v = doVisitHalf(lo, compare, visit, node.left) - if(v) { return v } - } - var v = visit(node.key, node.value) - if(v) { return v } - } - if(node.right) { - return doVisitHalf(lo, compare, visit, node.right) - } -} - -//Visit all nodes within a range -function doVisit(lo, hi, compare, visit, node) { - var l = compare(lo, node.key) - var h = compare(hi, node.key) - var v - if(l <= 0) { - if(node.left) { - v = doVisit(lo, hi, compare, visit, node.left) - if(v) { return v } - } - if(h > 0) { - v = visit(node.key, node.value) - if(v) { return v } - } - } - if(h > 0 && node.right) { - return doVisit(lo, hi, compare, visit, node.right) - } -} - - -proto.forEach = function rbTreeForEach(visit, lo, hi) { - if(!this.root) { - return - } - switch(arguments.length) { - case 1: - return doVisitFull(visit, this.root) - break - - case 2: - return doVisitHalf(lo, this._compare, visit, this.root) - break - - case 3: - if(this._compare(lo, hi) >= 0) { - return - } - return doVisit(lo, hi, this._compare, visit, this.root) - break - } -} - -//First item in list -Object.defineProperty(proto, "begin", { - get: function() { - var stack = [] - var n = this.root - while(n) { - stack.push(n) - n = n.left - } - return new RedBlackTreeIterator(this, stack) - } -}) - -//Last item in list -Object.defineProperty(proto, "end", { - get: function() { - var stack = [] - var n = this.root - while(n) { - stack.push(n) - n = n.right - } - return new RedBlackTreeIterator(this, stack) - } -}) - -//Find the ith item in the tree -proto.at = function(idx) { - if(idx < 0) { - return new RedBlackTreeIterator(this, []) - } - var n = this.root - var stack = [] - while(true) { - stack.push(n) - if(n.left) { - if(idx < n.left._count) { - n = n.left - continue - } - idx -= n.left._count - } - if(!idx) { - return new RedBlackTreeIterator(this, stack) - } - idx -= 1 - if(n.right) { - if(idx >= n.right._count) { - break - } - n = n.right - } else { - break - } - } - return new RedBlackTreeIterator(this, []) -} - -proto.ge = function(key) { - var cmp = this._compare - var n = this.root - var stack = [] - var last_ptr = 0 - while(n) { - var d = cmp(key, n.key) - stack.push(n) - if(d <= 0) { - last_ptr = stack.length - } - if(d <= 0) { - n = n.left - } else { - n = n.right - } - } - stack.length = last_ptr - return new RedBlackTreeIterator(this, stack) -} - -proto.gt = function(key) { - var cmp = this._compare - var n = this.root - var stack = [] - var last_ptr = 0 - while(n) { - var d = cmp(key, n.key) - stack.push(n) - if(d < 0) { - last_ptr = stack.length - } - if(d < 0) { - n = n.left - } else { - n = n.right - } - } - stack.length = last_ptr - return new RedBlackTreeIterator(this, stack) -} - -proto.lt = function(key) { - var cmp = this._compare - var n = this.root - var stack = [] - var last_ptr = 0 - while(n) { - var d = cmp(key, n.key) - stack.push(n) - if(d > 0) { - last_ptr = stack.length - } - if(d <= 0) { - n = n.left - } else { - n = n.right - } - } - stack.length = last_ptr - return new RedBlackTreeIterator(this, stack) -} - -proto.le = function(key) { - var cmp = this._compare - var n = this.root - var stack = [] - var last_ptr = 0 - while(n) { - var d = cmp(key, n.key) - stack.push(n) - if(d >= 0) { - last_ptr = stack.length - } - if(d < 0) { - n = n.left - } else { - n = n.right - } - } - stack.length = last_ptr - return new RedBlackTreeIterator(this, stack) -} - -//Finds the item with key if it exists -proto.find = function(key) { - var cmp = this._compare - var n = this.root - var stack = [] - while(n) { - var d = cmp(key, n.key) - stack.push(n) - if(d === 0) { - return new RedBlackTreeIterator(this, stack) - } - if(d <= 0) { - n = n.left - } else { - n = n.right - } - } - return new RedBlackTreeIterator(this, []) -} - -//Removes item with key from tree -proto.remove = function(key) { - var iter = this.find(key) - if(iter) { - return iter.remove() - } - return this -} - -//Returns the item at `key` -proto.get = function(key) { - var cmp = this._compare - var n = this.root - while(n) { - var d = cmp(key, n.key) - if(d === 0) { - return n.value - } - if(d <= 0) { - n = n.left - } else { - n = n.right - } - } - return -} - -//Iterator for red black tree -function RedBlackTreeIterator(tree, stack) { - this.tree = tree - this._stack = stack -} - -var iproto = RedBlackTreeIterator.prototype - -//Test if iterator is valid -Object.defineProperty(iproto, "valid", { - get: function() { - return this._stack.length > 0 - } -}) - -//Node of the iterator -Object.defineProperty(iproto, "node", { - get: function() { - if(this._stack.length > 0) { - return this._stack[this._stack.length-1] - } - return null - }, - enumerable: true -}) - -//Makes a copy of an iterator -iproto.clone = function() { - return new RedBlackTreeIterator(this.tree, this._stack.slice()) -} - -//Swaps two nodes -function swapNode(n, v) { - n.key = v.key - n.value = v.value - n.left = v.left - n.right = v.right - n._color = v._color - n._count = v._count -} - -//Fix up a double black node in a tree -function fixDoubleBlack(stack) { - var n, p, s, z - for(var i=stack.length-1; i>=0; --i) { - n = stack[i] - if(i === 0) { - n._color = BLACK - return - } - //console.log("visit node:", n.key, i, stack[i].key, stack[i-1].key) - p = stack[i-1] - if(p.left === n) { - //console.log("left child") - s = p.right - if(s.right && s.right._color === RED) { - //console.log("case 1: right sibling child red") - s = p.right = cloneNode(s) - z = s.right = cloneNode(s.right) - p.right = s.left - s.left = p - s.right = z - s._color = p._color - n._color = BLACK - p._color = BLACK - z._color = BLACK - recount(p) - recount(s) - if(i > 1) { - var pp = stack[i-2] - if(pp.left === p) { - pp.left = s - } else { - pp.right = s - } - } - stack[i-1] = s - return - } else if(s.left && s.left._color === RED) { - //console.log("case 1: left sibling child red") - s = p.right = cloneNode(s) - z = s.left = cloneNode(s.left) - p.right = z.left - s.left = z.right - z.left = p - z.right = s - z._color = p._color - p._color = BLACK - s._color = BLACK - n._color = BLACK - recount(p) - recount(s) - recount(z) - if(i > 1) { - var pp = stack[i-2] - if(pp.left === p) { - pp.left = z - } else { - pp.right = z - } - } - stack[i-1] = z - return - } - if(s._color === BLACK) { - if(p._color === RED) { - //console.log("case 2: black sibling, red parent", p.right.value) - p._color = BLACK - p.right = repaint(RED, s) - return - } else { - //console.log("case 2: black sibling, black parent", p.right.value) - p.right = repaint(RED, s) - continue - } - } else { - //console.log("case 3: red sibling") - s = cloneNode(s) - p.right = s.left - s.left = p - s._color = p._color - p._color = RED - recount(p) - recount(s) - if(i > 1) { - var pp = stack[i-2] - if(pp.left === p) { - pp.left = s - } else { - pp.right = s - } - } - stack[i-1] = s - stack[i] = p - if(i+1 < stack.length) { - stack[i+1] = n - } else { - stack.push(n) - } - i = i+2 - } - } else { - //console.log("right child") - s = p.left - if(s.left && s.left._color === RED) { - //console.log("case 1: left sibling child red", p.value, p._color) - s = p.left = cloneNode(s) - z = s.left = cloneNode(s.left) - p.left = s.right - s.right = p - s.left = z - s._color = p._color - n._color = BLACK - p._color = BLACK - z._color = BLACK - recount(p) - recount(s) - if(i > 1) { - var pp = stack[i-2] - if(pp.right === p) { - pp.right = s - } else { - pp.left = s - } - } - stack[i-1] = s - return - } else if(s.right && s.right._color === RED) { - //console.log("case 1: right sibling child red") - s = p.left = cloneNode(s) - z = s.right = cloneNode(s.right) - p.left = z.right - s.right = z.left - z.right = p - z.left = s - z._color = p._color - p._color = BLACK - s._color = BLACK - n._color = BLACK - recount(p) - recount(s) - recount(z) - if(i > 1) { - var pp = stack[i-2] - if(pp.right === p) { - pp.right = z - } else { - pp.left = z - } - } - stack[i-1] = z - return - } - if(s._color === BLACK) { - if(p._color === RED) { - //console.log("case 2: black sibling, red parent") - p._color = BLACK - p.left = repaint(RED, s) - return - } else { - //console.log("case 2: black sibling, black parent") - p.left = repaint(RED, s) - continue - } - } else { - //console.log("case 3: red sibling") - s = cloneNode(s) - p.left = s.right - s.right = p - s._color = p._color - p._color = RED - recount(p) - recount(s) - if(i > 1) { - var pp = stack[i-2] - if(pp.right === p) { - pp.right = s - } else { - pp.left = s - } - } - stack[i-1] = s - stack[i] = p - if(i+1 < stack.length) { - stack[i+1] = n - } else { - stack.push(n) - } - i = i+2 - } - } - } -} - -//Removes item at iterator from tree -iproto.remove = function() { - var stack = this._stack - if(stack.length === 0) { - return this.tree - } - //First copy path to node - var cstack = new Array(stack.length) - var n = stack[stack.length-1] - cstack[cstack.length-1] = new RBNode(n._color, n.key, n.value, n.left, n.right, n._count) - for(var i=stack.length-2; i>=0; --i) { - var n = stack[i] - if(n.left === stack[i+1]) { - cstack[i] = new RBNode(n._color, n.key, n.value, cstack[i+1], n.right, n._count) - } else { - cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) - } - } - - //Get node - n = cstack[cstack.length-1] - //console.log("start remove: ", n.value) - - //If not leaf, then swap with previous node - if(n.left && n.right) { - //console.log("moving to leaf") - - //First walk to previous leaf - var split = cstack.length - n = n.left - while(n.right) { - cstack.push(n) - n = n.right - } - //Copy path to leaf - var v = cstack[split-1] - cstack.push(new RBNode(n._color, v.key, v.value, n.left, n.right, n._count)) - cstack[split-1].key = n.key - cstack[split-1].value = n.value - - //Fix up stack - for(var i=cstack.length-2; i>=split; --i) { - n = cstack[i] - cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) - } - cstack[split-1].left = cstack[split] - } - //console.log("stack=", cstack.map(function(v) { return v.value })) - - //Remove leaf node - n = cstack[cstack.length-1] - if(n._color === RED) { - //Easy case: removing red leaf - //console.log("RED leaf") - var p = cstack[cstack.length-2] - if(p.left === n) { - p.left = null - } else if(p.right === n) { - p.right = null - } - cstack.pop() - for(var i=0; i 0) { - return this._stack[this._stack.length-1].key - } - return - }, - enumerable: true -}) - -//Returns value -Object.defineProperty(iproto, "value", { - get: function() { - if(this._stack.length > 0) { - return this._stack[this._stack.length-1].value - } - return - }, - enumerable: true -}) - - -//Returns the position of this iterator in the sorted list -Object.defineProperty(iproto, "index", { - get: function() { - var idx = 0 - var stack = this._stack - if(stack.length === 0) { - var r = this.tree.root - if(r) { - return r._count - } - return 0 - } else if(stack[stack.length-1].left) { - idx = stack[stack.length-1].left._count - } - for(var s=stack.length-2; s>=0; --s) { - if(stack[s+1] === stack[s].right) { - ++idx - if(stack[s].left) { - idx += stack[s].left._count - } - } - } - return idx - }, - enumerable: true -}) - -//Advances iterator to next element in list -iproto.next = function() { - var stack = this._stack - if(stack.length === 0) { - return - } - var n = stack[stack.length-1] - if(n.right) { - n = n.right - while(n) { - stack.push(n) - n = n.left - } - } else { - stack.pop() - while(stack.length > 0 && stack[stack.length-1].right === n) { - n = stack[stack.length-1] - stack.pop() - } - } -} - -//Checks if iterator is at end of tree -Object.defineProperty(iproto, "hasNext", { - get: function() { - var stack = this._stack - if(stack.length === 0) { - return false - } - if(stack[stack.length-1].right) { - return true - } - for(var s=stack.length-1; s>0; --s) { - if(stack[s-1].left === stack[s]) { - return true - } - } - return false - } -}) - -//Update value -iproto.update = function(value) { - var stack = this._stack - if(stack.length === 0) { - throw new Error("Can't update empty node!") - } - var cstack = new Array(stack.length) - var n = stack[stack.length-1] - cstack[cstack.length-1] = new RBNode(n._color, n.key, value, n.left, n.right, n._count) - for(var i=stack.length-2; i>=0; --i) { - n = stack[i] - if(n.left === stack[i+1]) { - cstack[i] = new RBNode(n._color, n.key, n.value, cstack[i+1], n.right, n._count) - } else { - cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) - } - } - return new RedBlackTree(this.tree._compare, cstack[0]) -} - -//Moves iterator backward one element -iproto.prev = function() { - var stack = this._stack - if(stack.length === 0) { - return - } - var n = stack[stack.length-1] - if(n.left) { - n = n.left - while(n) { - stack.push(n) - n = n.right - } - } else { - stack.pop() - while(stack.length > 0 && stack[stack.length-1].left === n) { - n = stack[stack.length-1] - stack.pop() - } - } -} - -//Checks if iterator is at start of tree -Object.defineProperty(iproto, "hasPrev", { - get: function() { - var stack = this._stack - if(stack.length === 0) { - return false - } - if(stack[stack.length-1].left) { - return true - } - for(var s=stack.length-1; s>0; --s) { - if(stack[s-1].right === stack[s]) { - return true - } - } - return false - } -}) - -//Default comparison function -function defaultCompare(a, b) { - if(a < b) { - return -1 - } - if(a > b) { - return 1 - } - return 0 -} - -//Build a tree -function createRBTree(compare) { - return new RedBlackTree(compare || defaultCompare, null) -} },{}],8:[function(require,module,exports){ /** * Root reference for iframes. @@ -2435,7 +2166,7 @@ request.put = function(url, data, fn){ return req; }; -},{"./is-object":9,"./request":11,"./request-base":10,"emitter":6}],9:[function(require,module,exports){ +},{"./is-object":9,"./request":11,"./request-base":10,"emitter":7}],9:[function(require,module,exports){ /** * Check if `obj` is an object. * @@ -3074,7 +2805,7 @@ module.exports = function equals(p1, p2) { 'use strict'; var Queue = require('tinyqueue'); -var Tree = require('functional-red-black-tree'); +var Tree = require('avl'); var edgeType = require('./edge_type'); var SweepEvent = require('./sweep_event'); var compareEvents = require('./compare_events'); @@ -3166,9 +2897,7 @@ function fillQueue(subject, clipping, sbbox, cbbox) { /** * @param {SweepEvent} event * @param {SweepEvent} prev - * @param {Tree} sweepLine * @param {Operation} operation - * @return {[type]} */ function computeFields(event, prev, operation) { // compute inOut and otherInOut fields @@ -3413,7 +3142,7 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio var rightbound = min(sbbox[2], cbbox[2]); - var prev, next; + var prev, next, begin, end; while (eventQueue.length) { var event = eventQueue.pop(); @@ -3426,69 +3155,55 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio } if (event.left) { - sweepLine = sweepLine.insert(event); + next = prev = sweepLine.insert(event); //_renderSweepLine(sweepLine, event.point, event); + begin = sweepLine.minNode(); - next = sweepLine.find(event); - prev = sweepLine.find(event); - event.iterator = sweepLine.find(event); + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; - if (prev.node !== sweepLine.begin) { - prev.prev(); - } else { - prev = sweepLine.begin; - prev.prev(); - prev.next(); - } - next.next(); + next = sweepLine.next(next); - var prevEvent = (prev.key || null), prevprevEvent; + var prevEvent = prev ? prev.key : null; + var prevprevEvent; computeFields(event, prevEvent, operation); - if (next.node) { + if (next) { if (possibleIntersection(event, next.key, eventQueue) === 2) { computeFields(event, prevEvent, operation); computeFields(event, next.key, operation); } } - - if (prev.node) { + if (prev) { if (possibleIntersection(prev.key, event, eventQueue) === 2) { - var prevprev = sweepLine.find(prev.key); - if (prevprev.node !== sweepLine.begin) { - prevprev.prev(); - } else { - prevprev = sweepLine.find(sweepLine.end); - prevprev.next(); - } - prevprevEvent = prevprev.key || null; + var prevprev = prev; + if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); + else prevprev = null; + + prevprevEvent = prevprev ? prevprev.key : null; computeFields(prevEvent, prevprevEvent, operation); computeFields(event, prevEvent, operation); } } } else { event = event.otherEvent; - next = sweepLine.find(event); - prev = sweepLine.find(event); + next = prev = sweepLine.find(event); // _renderSweepLine(sweepLine, event.otherEvent.point, event); - if (!(prev && next)) continue; + if (prev && next) { - if (prev.node !== sweepLine.begin) { - prev.prev(); - } else { - prev = sweepLine.begin; - prev.prev(); - prev.next(); - } - next.next(); - sweepLine = sweepLine.remove(event); + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; - // _renderSweepLine(sweepLine, event.otherEvent.point, event); + next = sweepLine.next(next); + sweepLine.remove(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); - if (next.node && prev.node) { - if (typeof prev.node.value !== 'undefined' && typeof next.node.value !== 'undefined') { - possibleIntersection(prev.key, next.key, eventQueue); + if (next && prev) { + //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + possibleIntersection(prev.key, next.key, eventQueue); + //} } } } @@ -3746,7 +3461,7 @@ module.exports.subdivideSegments = subdivideSegments; module.exports.divideSegment = divideSegment; module.exports.possibleIntersection = possibleIntersection; -},{"./compare_events":13,"./compare_segments":14,"./edge_type":15,"./equals":16,"./segment_intersection":18,"./sweep_event":20,"functional-red-black-tree":7,"tinyqueue":12}],18:[function(require,module,exports){ +},{"./compare_events":13,"./compare_segments":14,"./edge_type":15,"./equals":16,"./segment_intersection":18,"./sweep_event":20,"avl":6,"tinyqueue":12}],18:[function(require,module,exports){ 'use strict'; var EPSILON = 1e-9; @@ -4021,4 +3736,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":15,"./signed_area":19}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9jb21wb25lbnQtZW1pdHRlci9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9mdW5jdGlvbmFsLXJlZC1ibGFjay10cmVlL3JidHJlZS5qcyIsIm5vZGVfbW9kdWxlcy9zdXBlcmFnZW50L2xpYi9jbGllbnQuanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvaXMtb2JqZWN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ID0gblxuICAgICAgICAgIHJlY291bnQocHApXG4gICAgICAgICAgcmVjb3VudChwKVxuICAgICAgICAgIGlmKHMgPj0gMykge1xuICAgICAgICAgICAgdmFyIHBwcCA9IG5fc3RhY2tbcy0zXVxuICAgICAgICAgICAgaWYocHBwLmxlZnQgPT09IHBwKSB7XG4gICAgICAgICAgICAgIHBwcC5sZWZ0ID0gcFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcHBwLnJpZ2h0ID0gcFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgeSA9IHBwLnJpZ2h0XG4gICAgICAgIGlmKHkgJiYgeS5fY29sb3IgPT09IFJFRCkge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJMUnJcIilcbiAgICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgICAgcHAucmlnaHQgPSByZXBhaW50KEJMQUNLLCB5KVxuICAgICAgICAgIHBwLl9jb2xvciA9IFJFRFxuICAgICAgICAgIHMgLT0gMVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJMUmJcIilcbiAgICAgICAgICBwLnJpZ2h0ID0gbi5sZWZ0XG4gICAgICAgICAgcHAuX2NvbG9yID0gUkVEXG4gICAgICAgICAgcHAubGVmdCA9IG4ucmlnaHRcbiAgICAgICAgICBuLl9jb2xvciA9IEJMQUNLXG4gICAgICAgICAgbi5sZWZ0ID0gcFxuICAgICAgICAgIG4ucmlnaHQgPSBwcFxuICAgICAgICAgIG5fc3RhY2tbcy0yXSA9IG5cbiAgICAgICAgICBuX3N0YWNrW3MtMV0gPSBwXG4gICAgICAgICAgcmVjb3VudChwcClcbiAgICAgICAgICByZWNvdW50KHApXG4gICAgICAgICAgcmVjb3VudChuKVxuICAgICAgICAgIGlmKHMgPj0gMykge1xuICAgICAgICAgICAgdmFyIHBwcCA9IG5fc3RhY2tbcy0zXVxuICAgICAgICAgICAgaWYocHBwLmxlZnQgPT09IHBwKSB7XG4gICAgICAgICAgICAgIHBwcC5sZWZ0ID0gblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcHBwLnJpZ2h0ID0gblxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmKHAucmlnaHQgPT09IG4pIHtcbiAgICAgICAgdmFyIHkgPSBwcC5sZWZ0XG4gICAgICAgIGlmKHkgJiYgeS5fY29sb3IgPT09IFJFRCkge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJSUnJcIiwgeS5rZXkpXG4gICAgICAgICAgcC5fY29sb3IgPSBCTEFDS1xuICAgICAgICAgIHBwLmxlZnQgPSByZXBhaW50KEJMQUNLLCB5KVxuICAgICAgICAgIHBwLl9jb2xvciA9IFJFRFxuICAgICAgICAgIHMgLT0gMVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJSUmJcIilcbiAgICAgICAgICBwcC5fY29sb3IgPSBSRURcbiAgICAgICAgICBwcC5yaWdodCA9IHAubGVmdFxuICAgICAgICAgIHAuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgICBwLmxlZnQgPSBwcFxuICAgICAgICAgIG5fc3RhY2tbcy0yXSA9IHBcbiAgICAgICAgICBuX3N0YWNrW3MtMV0gPSBuXG4gICAgICAgICAgcmVjb3VudChwcClcbiAgICAgICAgICByZWNvdW50KHApXG4gICAgICAgICAgaWYocyA+PSAzKSB7XG4gICAgICAgICAgICB2YXIgcHBwID0gbl9zdGFja1tzLTNdXG4gICAgICAgICAgICBpZihwcHAucmlnaHQgPT09IHBwKSB7XG4gICAgICAgICAgICAgIHBwcC5yaWdodCA9IHBcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBwcC5sZWZ0ID0gcFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgeSA9IHBwLmxlZnRcbiAgICAgICAgaWYoeSAmJiB5Ll9jb2xvciA9PT0gUkVEKSB7XG4gICAgICAgICAgLy9jb25zb2xlLmxvZyhcIlJMclwiKVxuICAgICAgICAgIHAuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgICBwcC5sZWZ0ID0gcmVwYWludChCTEFDSywgeSlcbiAgICAgICAgICBwcC5fY29sb3IgPSBSRURcbiAgICAgICAgICBzIC09IDFcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiUkxiXCIpXG4gICAgICAgICAgcC5sZWZ0ID0gbi5yaWdodFxuICAgICAgICAgIHBwLl9jb2xvciA9IFJFRFxuICAgICAgICAgIHBwLnJpZ2h0ID0gbi5sZWZ0XG4gICAgICAgICAgbi5fY29sb3IgPSBCTEFDS1xuICAgICAgICAgIG4ucmlnaHQgPSBwXG4gICAgICAgICAgbi5sZWZ0ID0gcHBcbiAgICAgICAgICBuX3N0YWNrW3MtMl0gPSBuXG4gICAgICAgICAgbl9zdGFja1tzLTFdID0gcFxuICAgICAgICAgIHJlY291bnQocHApXG4gICAgICAgICAgcmVjb3VudChwKVxuICAgICAgICAgIHJlY291bnQobilcbiAgICAgICAgICBpZihzID49IDMpIHtcbiAgICAgICAgICAgIHZhciBwcHAgPSBuX3N0YWNrW3MtM11cbiAgICAgICAgICAgIGlmKHBwcC5yaWdodCA9PT0gcHApIHtcbiAgICAgICAgICAgICAgcHBwLnJpZ2h0ID0gblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcHBwLmxlZnQgPSBuXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIH1cbiAgICAgIH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aWJsaW5nIGNoaWxkIHJlZFwiKVxuICAgICAgICBzID0gcC5yaWdodCA9IGNsb25lTm9kZShzKVxuICAgICAgICB6ID0gcy5yaWdodCA9IGNsb25lTm9kZShzLnJpZ2h0KVxuICAgICAgICBwLnJpZ2h0ID0gcy5sZWZ0XG4gICAgICAgIHMubGVmdCA9IHBcbiAgICAgICAgcy5yaWdodCA9IHpcbiAgICAgICAgcy5fY29sb3IgPSBwLl9jb2xvclxuICAgICAgICBuLl9jb2xvciA9IEJMQUNLXG4gICAgICAgIHAuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgei5fY29sb3IgPSBCTEFDS1xuICAgICAgICByZWNvdW50KHApXG4gICAgICAgIHJlY291bnQocylcbiAgICAgICAgaWYoaSA+IDEpIHtcbiAgICAgICAgICB2YXIgcHAgPSBzdGFja1tpLTJdXG4gICAgICAgICAgaWYocHAubGVmdCA9PT0gcCkge1xuICAgICAgICAgICAgcHAubGVmdCA9IHNcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcHAucmlnaHQgPSBzXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHN0YWNrW2ktMV0gPSBzXG4gICAgICAgIHJldHVyblxuICAgICAgfSBlbHNlIGlmKHMubGVmdCAmJiBzLmxlZnQuX2NvbG9yID09PSBSRUQpIHtcbiAgICAgICAgLy9jb25zb2xlLmxvZyhcImNhc2UgMTogbGVmdCBzaWJsaW5nIGNoaWxkIHJlZFwiKVxuICAgICAgICBzID0gcC5yaWdodCA9IGNsb25lTm9kZShzKVxuICAgICAgICB6ID0gcy5sZWZ0ID0gY2xvbmVOb2RlKHMubGVmdClcbiAgICAgICAgcC5yaWdodCA9IHoubGVmdFxuICAgICAgICBzLmxlZnQgPSB6LnJpZ2h0XG4gICAgICAgIHoubGVmdCA9IHBcbiAgICAgICAgei5yaWdodCA9IHNcbiAgICAgICAgei5fY29sb3IgPSBwLl9jb2xvclxuICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgIHMuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgbi5fY29sb3IgPSBCTEFDS1xuICAgICAgICByZWNvdW50KHApXG4gICAgICAgIHJlY291bnQocylcbiAgICAgICAgcmVjb3VudCh6KVxuICAgICAgICBpZihpID4gMSkge1xuICAgICAgICAgIHZhciBwcCA9IHN0YWNrW2ktMl1cbiAgICAgICAgICBpZihwcC5sZWZ0ID09PSBwKSB7XG4gICAgICAgICAgICBwcC5sZWZ0ID0gelxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBwcC5yaWdodCA9IHpcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgc3RhY2tbaS0xXSA9IHpcbiAgICAgICAgcmV0dXJuXG4gICAgICB9XG4gICAgICBpZihzLl9jb2xvciA9PT0gQkxBQ0spIHtcbiAgICAgICAgaWYocC5fY29sb3IgPT09IFJFRCkge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDI6IGJsYWNrIHNpYmxpbmcsIHJlZCBwYXJlbnRcIiwgcC5yaWdodC52YWx1ZSlcbiAgICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgICAgcC5yaWdodCA9IHJlcGFpbnQoUkVELCBzKVxuICAgICAgICAgIHJldHVyblxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDI6IGJsYWNrIHNpYmxpbmcsIGJsYWNrIHBhcmVudFwiLCBwLnJpZ2h0LnZhbHVlKVxuICAgICAgICAgIHAucmlnaHQgPSByZXBhaW50KFJFRCwgcylcbiAgICAgICAgICBjb250aW51ZSAgXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDM6IHJlZCBzaWJsaW5nXCIpXG4gICAgICAgIHMgPSBjbG9uZU5vZGUocylcbiAgICAgICAgcC5yaWdodCA9IHMubGVmdFxuICAgICAgICBzLmxlZnQgPSBwXG4gICAgICAgIHMuX2NvbG9yID0gcC5fY29sb3JcbiAgICAgICAgcC5fY29sb3IgPSBSRURcbiAgICAgICAgcmVjb3VudChwKVxuICAgICAgICByZWNvdW50KHMpXG4gICAgICAgIGlmKGkgPiAxKSB7XG4gICAgICAgICAgdmFyIHBwID0gc3RhY2tbaS0yXVxuICAgICAgICAgIGlmKHBwLmxlZnQgPT09IHApIHtcbiAgICAgICAgICAgIHBwLmxlZnQgPSBzXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHBwLnJpZ2h0ID0gc1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdGFja1tpLTFdID0gc1xuICAgICAgICBzdGFja1tpXSA9IHBcbiAgICAgICAgaWYoaSsxIDwgc3RhY2subGVuZ3RoKSB7XG4gICAgICAgICAgc3RhY2tbaSsxXSA9IG5cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzdGFjay5wdXNoKG4pXG4gICAgICAgIH1cbiAgICAgICAgaSA9IGkrMlxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAvL2NvbnNvbGUubG9nKFwicmlnaHQgY2hpbGRcIilcbiAgICAgIHMgPSBwLmxlZnRcbiAgICAgIGlmKHMubGVmdCAmJiBzLmxlZnQuX2NvbG9yID09PSBSRUQpIHtcbiAgICAgICAgLy9jb25zb2xlLmxvZyhcImNhc2UgMTogbGVmdCBzaWJsaW5nIGNoaWxkIHJlZFwiLCBwLnZhbHVlLCBwLl9jb2xvcilcbiAgICAgICAgcyA9IHAubGVmdCA9IGNsb25lTm9kZShzKVxuICAgICAgICB6ID0gcy5sZWZ0ID0gY2xvbmVOb2RlKHMubGVmdClcbiAgICAgICAgcC5sZWZ0ID0gcy5yaWdodFxuICAgICAgICBzLnJpZ2h0ID0gcFxuICAgICAgICBzLmxlZnQgPSB6XG4gICAgICAgIHMuX2NvbG9yID0gcC5fY29sb3JcbiAgICAgICAgbi5fY29sb3IgPSBCTEFDS1xuICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgIHouX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgcmVjb3VudChwKVxuICAgICAgICByZWNvdW50KHMpXG4gICAgICAgIGlmKGkgPiAxKSB7XG4gICAgICAgICAgdmFyIHBwID0gc3RhY2tbaS0yXVxuICAgICAgICAgIGlmKHBwLnJpZ2h0ID09PSBwKSB7XG4gICAgICAgICAgICBwcC5yaWdodCA9IHNcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcHAubGVmdCA9IHNcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgc3RhY2tbaS0xXSA9IHNcbiAgICAgICAgcmV0dXJuXG4gICAgICB9IGVsc2UgaWYocy5yaWdodCAmJiBzLnJpZ2h0Ll9jb2xvciA9PT0gUkVEKSB7XG4gICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDE6IHJpZ2h0IHNpYmxpbmcgY2hpbGQgcmVkXCIpXG4gICAgICAgIHMgPSBwLmxlZnQgPSBjbG9uZU5vZGUocylcbiAgICAgICAgeiA9IHMucmlnaHQgPSBjbG9uZU5vZGUocy5yaWdodClcbiAgICAgICAgcC5sZWZ0ID0gei5yaWdodFxuICAgICAgICBzLnJpZ2h0ID0gei5sZWZ0XG4gICAgICAgIHoucmlnaHQgPSBwXG4gICAgICAgIHoubGVmdCA9IHNcbiAgICAgICAgei5fY29sb3IgPSBwLl9jb2xvclxuICAgICAgICBwLl9jb2xvciA9IEJMQUNLXG4gICAgICAgIHMuX2NvbG9yID0gQkxBQ0tcbiAgICAgICAgbi5fY29sb3IgPSBCTEFDS1xuICAgICAgICByZWNvdW50KHApXG4gICAgICAgIHJlY291bnQocylcbiAgICAgICAgcmVjb3VudCh6KVxuICAgICAgICBpZihpID4gMSkge1xuICAgICAgICAgIHZhciBwcCA9IHN0YWNrW2ktMl1cbiAgICAgICAgICBpZihwcC5yaWdodCA9PT0gcCkge1xuICAgICAgICAgICAgcHAucmlnaHQgPSB6XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHBwLmxlZnQgPSB6XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHN0YWNrW2ktMV0gPSB6XG4gICAgICAgIHJldHVyblxuICAgICAgfVxuICAgICAgaWYocy5fY29sb3IgPT09IEJMQUNLKSB7XG4gICAgICAgIGlmKHAuX2NvbG9yID09PSBSRUQpIHtcbiAgICAgICAgICAvL2NvbnNvbGUubG9nKFwiY2FzZSAyOiBibGFjayBzaWJsaW5nLCByZWQgcGFyZW50XCIpXG4gICAgICAgICAgcC5fY29sb3IgPSBCTEFDS1xuICAgICAgICAgIHAubGVmdCA9IHJlcGFpbnQoUkVELCBzKVxuICAgICAgICAgIHJldHVyblxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coXCJjYXNlIDI6IGJsYWNrIHNpYmxpbmcsIGJsYWNrIHBhcmVudFwiKVxuICAgICAgICAgIHAubGVmdCA9IHJlcGFpbnQoUkVELCBzKVxuICAgICAgICAgIGNvbnRpbnVlICBcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy9jb25zb2xlLmxvZyhcImNhc2UgMzogcmVkIHNpYmxpbmdcIilcbiAgICAgICAgcyA9IGNsb25lTm9kZShzKVxuICAgICAgICBwLmxlZnQgPSBzLnJpZ2h0XG4gICAgICAgIHMucmlnaHQgPSBwXG4gICAgICAgIHMuX2NvbG9yID0gcC5fY29sb3JcbiAgICAgICAgcC5fY29sb3IgPSBSRURcbiAgICAgICAgcmVjb3VudChwKVxuICAgICAgICByZWNvdW50KHMpXG4gICAgICAgIGlmKGkgPiAxKSB7XG4gICAgICAgICAgdmFyIHBwID0gc3RhY2tbaS0yXVxuICAgICAgICAgIGlmKHBwLnJpZ2h0ID09PSBwKSB7XG4gICAgICAgICAgICBwcC5yaWdodCA9IHNcbiAgICAgICAgICB9IGVsc2Uge1xuIC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SBgLnR5cGUoKWAgdG8gXCJqc29uXCIgd2hlblxuICogYW4gb2JqZWN0IGlzIGdpdmVuLlxuICpcbiAqIEV4YW1wbGVzOlxuICpcbiAqICAgICAgIC8vIG1hbnVhbCBqc29uXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2pzb24nKVxuICogICAgICAgICAuc2VuZCgne1wibmFtZVwiOlwidGpcIn0nKVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGF1dG8ganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIG1hbnVhbCB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKCduYW1lPXRqJylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdmb3JtJylcbiAqICAgICAgICAgLnNlbmQoeyBuYW1lOiAndGonIH0pXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gZGVmYXVsdHMgdG8geC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgIC5zZW5kKCduYW1lPXRvYmknKVxuICogICAgICAgIC5zZW5kKCdzcGVjaWVzPWZlcnJldCcpXG4gKiAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiBAcGFyYW0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XG5cbiAgICBwZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRhdGFbMF07XG4gICAgfSxcblxuICAgIF91cDogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmU7XG5cbiAgICAgICAgd2hpbGUgKHBvcyA+IDApIHtcbiAgICAgICAgICAgIHZhciBwYXJlbnQgPSBNYXRoLmZsb29yKChwb3MgLSAxKSAvIDIpO1xuICAgICAgICAgICAgaWYgKGNvbXBhcmUoZGF0YVtwb3NdLCBkYXRhW3BhcmVudF0pIDwgMCkge1xuICAgICAgICAgICAgICAgIHN3YXAoZGF0YSwgcGFyZW50LCBwb3MpO1xuICAgICAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcblxuICAgICAgICAgICAgfSBlbHNlIGJyZWFrO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhLFxuICAgICAgICAgICAgY29tcGFyZSA9IHRoaXMuY29tcGFyZSxcbiAgICAgICAgICAgIGxlbiA9IHRoaXMubGVuZ3RoO1xuXG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICB2YXIgbGVmdCA9IDIgKiBwb3MgKyAxLFxuICAgICAgICAgICAgICAgIHJpZ2h0ID0gbGVmdCArIDEsXG4gICAgICAgICAgICAgICAgbWluID0gcG9zO1xuXG4gICAgICAgICAgICBpZiAobGVmdCA8IGxlbiAmJiBjb21wYXJlKGRhdGFbbGVmdF0sIGRhdGFbbWluXSkgPCAwKSBtaW4gPSBsZWZ0O1xuICAgICAgICAgICAgaWYgKHJpZ2h0IDwgbGVuICYmIGNvbXBhcmUoZGF0YVtyaWdodF0sIGRhdGFbbWluXSkgPCAwKSBtaW4gPSByaWdodDtcblxuICA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JldkV2ZW50ID0gKHByZXYua2V5IHx8IG51bGwpLCBwcmV2cHJldkV2ZW50O1xuICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgaWYgKG5leHQubm9kZSkge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAocHJldi5ub2RlKSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgZXZlbnQsIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgdmFyIHByZXZwcmV2ID0gc3dlZXBMaW5lLmZpbmQocHJldi5rZXkpO1xuICAgICAgICAgIGlmIChwcmV2cHJldi5ub2RlICE9PSBzd2VlcExpbmUuYmVnaW4pIHtcbiAgICAgICAgICAgIHByZXZwcmV2LnByZXYoKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcHJldnByZXYgPSBzd2VlcExpbmUuZmluZChzd2VlcExpbmUuZW5kKTtcbiAgICAgICAgICAgIHByZXZwcmV2Lm5leHQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2LmtleSB8fCBudWxsO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMocHJldkV2ZW50LCBwcmV2cHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgf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c3VsdD9cbiAgICogQHR5cGUge0Jvb2xlYW59XG4gICAqL1xuICB0aGlzLmluUmVzdWx0ID0gZmFsc2U7XG5cblxuICAvLyBjb25uZWN0aW9uIHN0ZXBcblxuICAvKipcbiAgICogQHR5cGUge0Jvb2xlYW59XG4gICAqL1xuICB0aGlzLnJlc3VsdEluT3V0ID0gZmFsc2U7XG5cbiAgdGhpcy5pc0V4dGVyaW9yUmluZyA9IHRydWU7XG59XG5cblxuU3dlZXBFdmVudC5wcm90b3R5cGUgPSB7XG5cbiAgLyoqXG4gICAqIEBwYXJhbSAge0FycmF5LjxOdW1iZXI+fSAgcFxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNCZWxvdzogZnVuY3Rpb24gKHApIHtcbiAgICByZXR1cm4gdGhpcy5sZWZ0ID9cbiAgICAgIHNpZ25lZEFyZWEodGhpcy5wb2ludCwgdGhpcy5vdGhlckV2ZW50LnBvaW50LCBwKSA+IDAgOlxuICAgICAgc2lnbmVkQXJlYSh0aGlzLm90aGVyRXZlbnQucG9pbnQsIHRoaXMucG9pbnQsIHApID4gMDtcbiAgfSxcblxuXG4gIC8qKlxuICAgKiBAcGFyYW0gIHtBcnJheS48TnVtYmVyPn0gIHBcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzQWJvdmU6IGZ1bmN0aW9uIChwKSB7XG4gICAgcmV0dXJuICF0aGlzLmlzQmVsb3cocCk7XG4gIH0sXG5cblxuICAvKipcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzVmVydGljYWw6IGZ1bmN0aW9uICgpIHtcbiAgICByZXR1cm4gdGhpcy5wb2ludFswXSA9PT0gdGhpcy5vdGhlckV2ZW50LnBvaW50WzBdO1xuICB9XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IFN3ZWVwRXZlbnQ7XG4iXX0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJ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IHZhciBzdHIgPSB7fS50b1N0cmluZy5jYWxsKG9iaik7XG5cbiAgc3dpdGNoIChzdHIpIHtcbiAgICBjYXNlICdbb2JqZWN0IEZpbGVdJzpcbiAgICBjYXNlICdbb2JqZWN0IEJsb2JdJzpcbiAgICBjYXNlICdbb2JqZWN0IEZvcm1EYXRhXSc6XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICBkZWZhdWx0OlxuICAgICAgcmV0dXJuIGZhbHNlO1xuICB9XG59XG5cbi8qKlxuICogU2VuZCBgZGF0YWAgYXMgdGhlIHJlcXVlc3QgYm9keSwgZGVmYXVsdGluZyB0aGUgYC50eXBlKClgIHRvIFwianNvblwiIHdoZW5cbiAqIGFuIG9iamVjdCBpcyBnaXZlbi5cbiAqXG4gKiBFeGFtcGxlczpcbiAqXG4gKiAgICAgICAvLyBtYW51YWwganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAg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w7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZXZlbnQgPSBldmVudC5vdG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sc2U7XG5cbiAgdGhpcy5pc0V4dGVyaW9yUmluZyA9IHRydWU7XG59XG5cblxuU3dlZXBFdmVudC5wcm90b3R5cGUgPSB7XG5cbiAgLyoqXG4gICAqIEBwYXJhbSAge0FycmF5LjxOdW1iZXI+fSAgcFxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNCZWxvdzogZnVuY3Rpb24gKHApIHtcbiAgICByZXR1cm4gdGhpcy5sZWZ0ID9cbiAgICAgIHNpZ25lZEFyZWEodGhpcy5wb2ludCwgdGhpcy5vdGhlckV2ZW50LnBvaW50LCBwKSA+IDAgOlxuICAgICAgc2lnbmVkQXJlYSh0aGlzLm90aGVyRXZlbnQucG9pbnQsIHRoaXMucG9pbnQsIHApID4gMDtcbiAgfSxcblxuXG4gIC8qKlxuICAgKiBAcGFyYW0gIHtBcnJheS48TnVtYmVyPn0gIHBcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzQWJvdmU6IGZ1bmN0aW9uIChwKSB7XG4gICAgcmV0dXJuICF0aGlzLmlzQmVsb3cocCk7XG4gIH0sXG5cblxuICAvKipcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzVmVydGljYWw6IGZ1bmN0aW9uICgpIHtcbiAgICByZXR1cm4gdGhpcy5wb2ludFswXSA9PT0gdGhpcy5vdGhlckV2ZW50LnBvaW50WzBdO1xuICB9XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IFN3ZWVwRXZlbnQ7XG4iXX0= diff --git a/demo/js/index.js b/demo/js/index.js index 427d0d6..b780a1f 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -58,8 +58,10 @@ var map = window.map = L.map('image-map', { minZoom: 1, maxZoom: 20, center: [0, 0], - zoom: 1, - crs: mode === 'geo' ? L.CRS.EPSG4326 : L.CRS.Simple, + zoom: 2, + crs: mode === 'geo' ? L.CRS.EPSG4326 : L.extend({}, L.CRS.Simple, { + transformation: new L.Transformation(0.5, 0, -0.5, 0) + }), editable: true }); @@ -128,6 +130,7 @@ function run (op) { var result = operation(subject.geometry.coordinates, clipping.geometry.coordinates); console.timeEnd('martinez'); + //if (op === OPERATIONS.UNION) result = result[0]; //console.log('result', result); results.clearLayers(); diff --git a/dist/martinez.js b/dist/martinez.js index 81a2604..42e26ce 100644 --- a/dist/martinez.js +++ b/dist/martinez.js @@ -11,1002 +11,730 @@ module.exports = { }; },{"./src/index":8}],2:[function(require,module,exports){ -"use strict" +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.avl = factory()); +}(this, (function () { 'use strict'; -module.exports = createRBTree - -var RED = 0 -var BLACK = 1 +/** + * Prints tree horizontally + * @param {Node} root + * @param {Function(node:Node):String} [printNode] + * @return {String} + */ +function print (root, printNode) { + if ( printNode === void 0 ) printNode = function (n) { return n.key; }; -function RBNode(color, key, value, left, right, count) { - this._color = color - this.key = key - this.value = value - this.left = left - this.right = right - this._count = count + var out = []; + row(root, '', true, function (v) { return out.push(v); }, printNode); + return out.join(''); } -function cloneNode(node) { - return new RBNode(node._color, node.key, node.value, node.left, node.right, node._count) +/** + * Prints level of the tree + * @param {Node} root + * @param {String} prefix + * @param {Boolean} isTail + * @param {Function(in:string):void} out + * @param {Function(node:Node):String} printNode + */ +function row (root, prefix, isTail, out, printNode) { + if (root) { + out(("" + prefix + (isTail ? '└── ' : '├── ') + (printNode(root)) + "\n")); + var indent = prefix + (isTail ? ' ' : '│ '); + if (root.left) { row(root.left, indent, false, out, printNode); } + if (root.right) { row(root.right, indent, true, out, printNode); } + } } -function repaint(color, node) { - return new RBNode(color, node.key, node.value, node.left, node.right, node._count) -} -function recount(node) { - node._count = 1 + (node.left ? node.left._count : 0) + (node.right ? node.right._count : 0) +/** + * Is the tree balanced (none of the subtrees differ in height by more than 1) + * @param {Node} root + * @return {Boolean} + */ +function isBalanced(root) { + if (root === null) { return true; } // If node is empty then return true + + // Get the height of left and right sub trees + var lh = height(root.left); + var rh = height(root.right); + + if (Math.abs(lh - rh) <= 1 && + isBalanced(root.left) && + isBalanced(root.right)) { return true; } + + // If we reach here then tree is not height-balanced + return false; } -function RedBlackTree(compare, root) { - this._compare = compare - this.root = root +/** + * The function Compute the 'height' of a tree. + * Height is the number of nodes along the longest path + * from the root node down to the farthest leaf node. + * + * @param {Node} node + * @return {Number} + */ +function height(node) { + return node ? (1 + Math.max(height(node.left), height(node.right))) : 0; } -var proto = RedBlackTree.prototype - -Object.defineProperty(proto, "keys", { - get: function() { - var result = [] - this.forEach(function(k,v) { - result.push(k) - }) - return result - } -}) - -Object.defineProperty(proto, "values", { - get: function() { - var result = [] - this.forEach(function(k,v) { - result.push(v) - }) - return result - } -}) - -//Returns the number of nodes in the tree -Object.defineProperty(proto, "length", { - get: function() { - if(this.root) { - return this.root._count - } - return 0 - } -}) - -//Insert a new item into the tree -proto.insert = function(key, value) { - var cmp = this._compare - //Find point to insert new node at - var n = this.root - var n_stack = [] - var d_stack = [] - while(n) { - var d = cmp(key, n.key) - n_stack.push(n) - d_stack.push(d) - if(d <= 0) { - n = n.left - } else { - n = n.right - } - } - //Rebuild path to leaf node - n_stack.push(new RBNode(RED, key, value, null, null, 1)) - for(var s=n_stack.length-2; s>=0; --s) { - var n = n_stack[s] - if(d_stack[s] <= 0) { - n_stack[s] = new RBNode(n._color, n.key, n.value, n_stack[s+1], n.right, n._count+1) - } else { - n_stack[s] = new RBNode(n._color, n.key, n.value, n.left, n_stack[s+1], n._count+1) - } - } - //Rebalance tree using rotations - //console.log("start insert", key, d_stack) - for(var s=n_stack.length-1; s>1; --s) { - var p = n_stack[s-1] - var n = n_stack[s] - if(p._color === BLACK || n._color === BLACK) { - break - } - var pp = n_stack[s-2] - if(pp.left === p) { - if(p.left === n) { - var y = pp.right - if(y && y._color === RED) { - //console.log("LLr") - p._color = BLACK - pp.right = repaint(BLACK, y) - pp._color = RED - s -= 1 - } else { - //console.log("LLb") - pp._color = RED - pp.left = p.right - p._color = BLACK - p.right = pp - n_stack[s-2] = p - n_stack[s-1] = n - recount(pp) - recount(p) - if(s >= 3) { - var ppp = n_stack[s-3] - if(ppp.left === pp) { - ppp.left = p - } else { - ppp.right = p - } - } - break - } - } else { - var y = pp.right - if(y && y._color === RED) { - //console.log("LRr") - p._color = BLACK - pp.right = repaint(BLACK, y) - pp._color = RED - s -= 1 - } else { - //console.log("LRb") - p.right = n.left - pp._color = RED - pp.left = n.right - n._color = BLACK - n.left = p - n.right = pp - n_stack[s-2] = n - n_stack[s-1] = p - recount(pp) - recount(p) - recount(n) - if(s >= 3) { - var ppp = n_stack[s-3] - if(ppp.left === pp) { - ppp.left = n - } else { - ppp.right = n - } - } - break - } - } +// function createNode (parent, left, right, height, key, data) { +// return { parent, left, right, balanceFactor: height, key, data }; +// } + +/** + * @typedef {{ + * parent: ?Node, + * left: ?Node, + * right: ?Node, + * balanceFactor: number, + * key: Key, + * data: Value + * }} Node + */ + +/** + * @typedef {*} Key + */ + +/** + * @typedef {*} Value + */ + +/** + * Default comparison function + * @param {Key} a + * @param {Key} b + * @returns {number} + */ +function DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; } + + +/** + * Single left rotation + * @param {Node} node + * @return {Node} + */ +function rotateLeft (node) { + var rightNode = node.right; + node.right = rightNode.left; + + if (rightNode.left) { rightNode.left.parent = node; } + + rightNode.parent = node.parent; + if (rightNode.parent) { + if (rightNode.parent.left === node) { + rightNode.parent.left = rightNode; } else { - if(p.right === n) { - var y = pp.left - if(y && y._color === RED) { - //console.log("RRr", y.key) - p._color = BLACK - pp.left = repaint(BLACK, y) - pp._color = RED - s -= 1 - } else { - //console.log("RRb") - pp._color = RED - pp.right = p.left - p._color = BLACK - p.left = pp - n_stack[s-2] = p - n_stack[s-1] = n - recount(pp) - recount(p) - if(s >= 3) { - var ppp = n_stack[s-3] - if(ppp.right === pp) { - ppp.right = p - } else { - ppp.left = p - } - } - break - } - } else { - var y = pp.left - if(y && y._color === RED) { - //console.log("RLr") - p._color = BLACK - pp.left = repaint(BLACK, y) - pp._color = RED - s -= 1 - } else { - //console.log("RLb") - p.left = n.right - pp._color = RED - pp.right = n.left - n._color = BLACK - n.right = p - n.left = pp - n_stack[s-2] = n - n_stack[s-1] = p - recount(pp) - recount(p) - recount(n) - if(s >= 3) { - var ppp = n_stack[s-3] - if(ppp.right === pp) { - ppp.right = n - } else { - ppp.left = n - } - } - break - } - } + rightNode.parent.right = rightNode; } } - //Return new tree - n_stack[0]._color = BLACK - return new RedBlackTree(cmp, n_stack[0]) -} + node.parent = rightNode; + rightNode.left = node; -//Visit all nodes inorder -function doVisitFull(visit, node) { - if(node.left) { - var v = doVisitFull(visit, node.left) - if(v) { return v } + node.balanceFactor += 1; + if (rightNode.balanceFactor < 0) { + node.balanceFactor -= rightNode.balanceFactor; } - var v = visit(node.key, node.value) - if(v) { return v } - if(node.right) { - return doVisitFull(visit, node.right) + + rightNode.balanceFactor += 1; + if (node.balanceFactor > 0) { + rightNode.balanceFactor += node.balanceFactor; } + return rightNode; } -//Visit half nodes in order -function doVisitHalf(lo, compare, visit, node) { - var l = compare(lo, node.key) - if(l <= 0) { - if(node.left) { - var v = doVisitHalf(lo, compare, visit, node.left) - if(v) { return v } + +function rotateRight (node) { + var leftNode = node.left; + node.left = leftNode.right; + if (node.left) { node.left.parent = node; } + + leftNode.parent = node.parent; + if (leftNode.parent) { + if (leftNode.parent.left === node) { + leftNode.parent.left = leftNode; + } else { + leftNode.parent.right = leftNode; } - var v = visit(node.key, node.value) - if(v) { return v } } - if(node.right) { - return doVisitHalf(lo, compare, visit, node.right) - } -} -//Visit all nodes within a range -function doVisit(lo, hi, compare, visit, node) { - var l = compare(lo, node.key) - var h = compare(hi, node.key) - var v - if(l <= 0) { - if(node.left) { - v = doVisit(lo, hi, compare, visit, node.left) - if(v) { return v } - } - if(h > 0) { - v = visit(node.key, node.value) - if(v) { return v } - } + node.parent = leftNode; + leftNode.right = node; + + node.balanceFactor -= 1; + if (leftNode.balanceFactor > 0) { + node.balanceFactor -= leftNode.balanceFactor; } - if(h > 0 && node.right) { - return doVisit(lo, hi, compare, visit, node.right) + + leftNode.balanceFactor -= 1; + if (node.balanceFactor < 0) { + leftNode.balanceFactor += node.balanceFactor; } + + return leftNode; } -proto.forEach = function rbTreeForEach(visit, lo, hi) { - if(!this.root) { - return - } - switch(arguments.length) { - case 1: - return doVisitFull(visit, this.root) - break +// function leftBalance (node) { +// if (node.left.balanceFactor === -1) rotateLeft(node.left); +// return rotateRight(node); +// } - case 2: - return doVisitHalf(lo, this._compare, visit, this.root) - break - case 3: - if(this._compare(lo, hi) >= 0) { - return - } - return doVisit(lo, hi, this._compare, visit, this.root) - break - } -} +// function rightBalance (node) { +// if (node.right.balanceFactor === 1) rotateRight(node.right); +// return rotateLeft(node); +// } -//First item in list -Object.defineProperty(proto, "begin", { - get: function() { - var stack = [] - var n = this.root - while(n) { - stack.push(n) - n = n.left - } - return new RedBlackTreeIterator(this, stack) - } -}) - -//Last item in list -Object.defineProperty(proto, "end", { - get: function() { - var stack = [] - var n = this.root - while(n) { - stack.push(n) - n = n.right - } - return new RedBlackTreeIterator(this, stack) - } -}) - -//Find the ith item in the tree -proto.at = function(idx) { - if(idx < 0) { - return new RedBlackTreeIterator(this, []) - } - var n = this.root - var stack = [] - while(true) { - stack.push(n) - if(n.left) { - if(idx < n.left._count) { - n = n.left - continue - } - idx -= n.left._count - } - if(!idx) { - return new RedBlackTreeIterator(this, stack) - } - idx -= 1 - if(n.right) { - if(idx >= n.right._count) { - break - } - n = n.right - } else { - break + +var AVLTree = function AVLTree (comparator, noDuplicates) { + if ( noDuplicates === void 0 ) noDuplicates = false; + + this._comparator = comparator || DEFAULT_COMPARE; + this._root = null; + this._size = 0; + this._noDuplicates = !!noDuplicates; +}; + +var prototypeAccessors = { size: {} }; + + +/** + * Clear the tree + * @return {AVLTree} + */ +AVLTree.prototype.destroy = function destroy () { + this._root = null; + return this; +}; + +/** + * Number of nodes + * @return {number} + */ +prototypeAccessors.size.get = function () { + return this._size; +}; + + +/** + * Whether the tree contains a node with the given key + * @param{Key} key + * @return {boolean} true/false + */ +AVLTree.prototype.contains = function contains (key) { + if (this._root){ + var node = this._root; + var comparator = this._comparator; + while (node){ + var cmp = comparator(key, node.key); + if (cmp === 0) { return true; } + else if (cmp < 0) { node = node.left; } + else { node = node.right; } } } - return new RedBlackTreeIterator(this, []) -} + return false; +}; -proto.ge = function(key) { - var cmp = this._compare - var n = this.root - var stack = [] - var last_ptr = 0 - while(n) { - var d = cmp(key, n.key) - stack.push(n) - if(d <= 0) { - last_ptr = stack.length - } - if(d <= 0) { - n = n.left + +/* eslint-disable class-methods-use-this */ + +/** + * Successor node + * @param{Node} node + * @return {?Node} + */ +AVLTree.prototype.next = function next (node) { + var successor = node; + if (successor) { + if (successor.right) { + successor = successor.right; + while (successor && successor.left) { successor = successor.left; } } else { - n = n.right + successor = node.parent; + while (successor && successor.right === node) { + node = successor; successor = successor.parent; + } } } - stack.length = last_ptr - return new RedBlackTreeIterator(this, stack) -} + return successor; +}; -proto.gt = function(key) { - var cmp = this._compare - var n = this.root - var stack = [] - var last_ptr = 0 - while(n) { - var d = cmp(key, n.key) - stack.push(n) - if(d < 0) { - last_ptr = stack.length - } - if(d < 0) { - n = n.left + +/** + * Predecessor node + * @param{Node} node + * @return {?Node} + */ +AVLTree.prototype.prev = function prev (node) { + var predecessor = node; + if (predecessor) { + if (predecessor.left) { + predecessor = predecessor.left; + while (predecessor && predecessor.right) { predecessor = predecessor.right; } } else { - n = n.right + predecessor = node.parent; + while (predecessor && predecessor.left === node) { + node = predecessor; + predecessor = predecessor.parent; + } } } - stack.length = last_ptr - return new RedBlackTreeIterator(this, stack) -} + return predecessor; +}; +/* eslint-enable class-methods-use-this */ -proto.lt = function(key) { - var cmp = this._compare - var n = this.root - var stack = [] - var last_ptr = 0 - while(n) { - var d = cmp(key, n.key) - stack.push(n) - if(d > 0) { - last_ptr = stack.length - } - if(d <= 0) { - n = n.left + +/** + * Callback for forEach + * @callback forEachCallback + * @param {Node} node + * @param {number} index + */ + +/** + * @param{forEachCallback} callback + * @return {AVLTree} + */ +AVLTree.prototype.forEach = function forEach (callback) { + var current = this._root; + var s = [], done = false, i = 0; + + while (!done) { + // Reach the left most Node of the current Node + if (current) { + // Place pointer to a tree node on the stack + // before traversing the node's left subtree + s.push(current); + current = current.left; } else { - n = n.right + // BackTrack from the empty subtree and visit the Node + // at the top of the stack; however, if the stack is + // empty you are done + if (s.length > 0) { + current = s.pop(); + callback(current, i++); + + // We have visited the node and its left + // subtree. Now, it's right subtree's turn + current = current.right; + } else { done = true; } } } - stack.length = last_ptr - return new RedBlackTreeIterator(this, stack) -} + return this; +}; -proto.le = function(key) { - var cmp = this._compare - var n = this.root - var stack = [] - var last_ptr = 0 - while(n) { - var d = cmp(key, n.key) - stack.push(n) - if(d >= 0) { - last_ptr = stack.length - } - if(d < 0) { - n = n.left + +/** + * Returns all keys in order + * @return {Array} + */ +AVLTree.prototype.keys = function keys () { + var current = this._root; + var s = [], r = [], done = false; + + while (!done) { + if (current) { + s.push(current); + current = current.left; } else { - n = n.right + if (s.length > 0) { + current = s.pop(); + r.push(current.key); + current = current.right; + } else { done = true; } } } - stack.length = last_ptr - return new RedBlackTreeIterator(this, stack) -} + return r; +}; -//Finds the item with key if it exists -proto.find = function(key) { - var cmp = this._compare - var n = this.root - var stack = [] - while(n) { - var d = cmp(key, n.key) - stack.push(n) - if(d === 0) { - return new RedBlackTreeIterator(this, stack) - } - if(d <= 0) { - n = n.left + +/** + * Returns `data` fields of all nodes in order. + * @return {Array} + */ +AVLTree.prototype.values = function values () { + var current = this._root; + var s = [], r = [], done = false; + + while (!done) { + if (current) { + s.push(current); + current = current.left; } else { - n = n.right + if (s.length > 0) { + current = s.pop(); + r.push(current.data); + current = current.right; + } else { done = true; } } } - return new RedBlackTreeIterator(this, []) -} + return r; +}; -//Removes item with key from tree -proto.remove = function(key) { - var iter = this.find(key) - if(iter) { - return iter.remove() - } - return this -} -//Returns the item at `key` -proto.get = function(key) { - var cmp = this._compare - var n = this.root - while(n) { - var d = cmp(key, n.key) - if(d === 0) { - return n.value - } - if(d <= 0) { - n = n.left +/** + * Returns node at given index + * @param{number} index + * @return {?Node} + */ +AVLTree.prototype.at = function at (index) { + // removed after a consideration, more misleading than useful + // index = index % this.size; + // if (index < 0) index = this.size - index; + + var current = this._root; + var s = [], done = false, i = 0; + + while (!done) { + if (current) { + s.push(current); + current = current.left; } else { - n = n.right + if (s.length > 0) { + current = s.pop(); + if (i === index) { return current; } + i++; + current = current.right; + } else { done = true; } } } - return -} + return null; +}; -//Iterator for red black tree -function RedBlackTreeIterator(tree, stack) { - this.tree = tree - this._stack = stack -} -var iproto = RedBlackTreeIterator.prototype +/** + * Returns node with the minimum key + * @return {?Node} + */ +AVLTree.prototype.minNode = function minNode () { + var node = this._root; + if (!node) { return null; } + while (node.left) { node = node.left; } + return node; +}; -//Test if iterator is valid -Object.defineProperty(iproto, "valid", { - get: function() { - return this._stack.length > 0 - } -}) -//Node of the iterator -Object.defineProperty(iproto, "node", { - get: function() { - if(this._stack.length > 0) { - return this._stack[this._stack.length-1] - } - return null - }, - enumerable: true -}) +/** + * Returns node with the max key + * @return {?Node} + */ +AVLTree.prototype.maxNode = function maxNode () { + var node = this._root; + if (!node) { return null; } + while (node.right) { node = node.right; } + return node; +}; -//Makes a copy of an iterator -iproto.clone = function() { - return new RedBlackTreeIterator(this.tree, this._stack.slice()) -} -//Swaps two nodes -function swapNode(n, v) { - n.key = v.key - n.value = v.value - n.left = v.left - n.right = v.right - n._color = v._color - n._count = v._count -} +/** + * Min key + * @return {?Key} + */ +AVLTree.prototype.min = function min () { + var node = this._root; + if (!node) { return null; } + while (node.left) { node = node.left; } + return node.key; +}; -//Fix up a double black node in a tree -function fixDoubleBlack(stack) { - var n, p, s, z - for(var i=stack.length-1; i>=0; --i) { - n = stack[i] - if(i === 0) { - n._color = BLACK - return - } - //console.log("visit node:", n.key, i, stack[i].key, stack[i-1].key) - p = stack[i-1] - if(p.left === n) { - //console.log("left child") - s = p.right - if(s.right && s.right._color === RED) { - //console.log("case 1: right sibling child red") - s = p.right = cloneNode(s) - z = s.right = cloneNode(s.right) - p.right = s.left - s.left = p - s.right = z - s._color = p._color - n._color = BLACK - p._color = BLACK - z._color = BLACK - recount(p) - recount(s) - if(i > 1) { - var pp = stack[i-2] - if(pp.left === p) { - pp.left = s - } else { - pp.right = s - } - } - stack[i-1] = s - return - } else if(s.left && s.left._color === RED) { - //console.log("case 1: left sibling child red") - s = p.right = cloneNode(s) - z = s.left = cloneNode(s.left) - p.right = z.left - s.left = z.right - z.left = p - z.right = s - z._color = p._color - p._color = BLACK - s._color = BLACK - n._color = BLACK - recount(p) - recount(s) - recount(z) - if(i > 1) { - var pp = stack[i-2] - if(pp.left === p) { - pp.left = z - } else { - pp.right = z - } - } - stack[i-1] = z - return - } - if(s._color === BLACK) { - if(p._color === RED) { - //console.log("case 2: black sibling, red parent", p.right.value) - p._color = BLACK - p.right = repaint(RED, s) - return - } else { - //console.log("case 2: black sibling, black parent", p.right.value) - p.right = repaint(RED, s) - continue - } - } else { - //console.log("case 3: red sibling") - s = cloneNode(s) - p.right = s.left - s.left = p - s._color = p._color - p._color = RED - recount(p) - recount(s) - if(i > 1) { - var pp = stack[i-2] - if(pp.left === p) { - pp.left = s - } else { - pp.right = s - } - } - stack[i-1] = s - stack[i] = p - if(i+1 < stack.length) { - stack[i+1] = n - } else { - stack.push(n) - } - i = i+2 - } - } else { - //console.log("right child") - s = p.left - if(s.left && s.left._color === RED) { - //console.log("case 1: left sibling child red", p.value, p._color) - s = p.left = cloneNode(s) - z = s.left = cloneNode(s.left) - p.left = s.right - s.right = p - s.left = z - s._color = p._color - n._color = BLACK - p._color = BLACK - z._color = BLACK - recount(p) - recount(s) - if(i > 1) { - var pp = stack[i-2] - if(pp.right === p) { - pp.right = s - } else { - pp.left = s - } - } - stack[i-1] = s - return - } else if(s.right && s.right._color === RED) { - //console.log("case 1: right sibling child red") - s = p.left = cloneNode(s) - z = s.right = cloneNode(s.right) - p.left = z.right - s.right = z.left - z.right = p - z.left = s - z._color = p._color - p._color = BLACK - s._color = BLACK - n._color = BLACK - recount(p) - recount(s) - recount(z) - if(i > 1) { - var pp = stack[i-2] - if(pp.right === p) { - pp.right = z - } else { - pp.left = z - } - } - stack[i-1] = z - return - } - if(s._color === BLACK) { - if(p._color === RED) { - //console.log("case 2: black sibling, red parent") - p._color = BLACK - p.left = repaint(RED, s) - return - } else { - //console.log("case 2: black sibling, black parent") - p.left = repaint(RED, s) - continue - } - } else { - //console.log("case 3: red sibling") - s = cloneNode(s) - p.left = s.right - s.right = p - s._color = p._color - p._color = RED - recount(p) - recount(s) - if(i > 1) { - var pp = stack[i-2] - if(pp.right === p) { - pp.right = s - } else { - pp.left = s - } - } - stack[i-1] = s - stack[i] = p - if(i+1 < stack.length) { - stack[i+1] = n - } else { - stack.push(n) - } - i = i+2 - } - } - } -} -//Removes item at iterator from tree -iproto.remove = function() { - var stack = this._stack - if(stack.length === 0) { - return this.tree - } - //First copy path to node - var cstack = new Array(stack.length) - var n = stack[stack.length-1] - cstack[cstack.length-1] = new RBNode(n._color, n.key, n.value, n.left, n.right, n._count) - for(var i=stack.length-2; i>=0; --i) { - var n = stack[i] - if(n.left === stack[i+1]) { - cstack[i] = new RBNode(n._color, n.key, n.value, cstack[i+1], n.right, n._count) - } else { - cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) - } +/** + * Max key + * @return {?Key} + */ +AVLTree.prototype.max = function max () { + var node = this._root; + if (!node) { return null; } + while (node.right) { node = node.right; } + return node.key; +}; + + +/** + * @return {boolean} true/false + */ +AVLTree.prototype.isEmpty = function isEmpty () { + return !this._root; +}; + + +/** + * Removes and returns the node with smallest key + * @return {?Node} + */ +AVLTree.prototype.pop = function pop () { + var node = this._root, returnValue = null; + if (node) { + while (node.left) { node = node.left; } + returnValue = { key: node.key, data: node.data }; + this.remove(node.key); + } + return returnValue; +}; + + +/** + * Find node by key + * @param{Key} key + * @return {?Node} + */ +AVLTree.prototype.find = function find (key) { + var root = this._root; + // if (root === null) return null; + // if (key === root.key) return root; + + var subtree = root, cmp; + var compare = this._comparator; + while (subtree) { + cmp = compare(key, subtree.key); + if (cmp === 0) { return subtree; } + else if (cmp < 0) { subtree = subtree.left; } + else { subtree = subtree.right; } } - //Get node - n = cstack[cstack.length-1] - //console.log("start remove: ", n.value) + return null; +}; - //If not leaf, then swap with previous node - if(n.left && n.right) { - //console.log("moving to leaf") - //First walk to previous leaf - var split = cstack.length - n = n.left - while(n.right) { - cstack.push(n) - n = n.right - } - //Copy path to leaf - var v = cstack[split-1] - cstack.push(new RBNode(n._color, v.key, v.value, n.left, n.right, n._count)) - cstack[split-1].key = n.key - cstack[split-1].value = n.value - - //Fix up stack - for(var i=cstack.length-2; i>=split; --i) { - n = cstack[i] - cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) - } - cstack[split-1].left = cstack[split] - } - //console.log("stack=", cstack.map(function(v) { return v.value })) - - //Remove leaf node - n = cstack[cstack.length-1] - if(n._color === RED) { - //Easy case: removing red leaf - //console.log("RED leaf") - var p = cstack[cstack.length-2] - if(p.left === n) { - p.left = null - } else if(p.right === n) { - p.right = null - } - cstack.pop() - for(var i=0; i 1) { + // inlined + // var newRoot = leftBalance(parent); + if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } + newRoot = rotateRight(parent); + + if (parent === this$1._root) { this$1._root = newRoot; } + break; } + parent = parent.parent; } - return new RedBlackTree(this.tree._compare, cstack[0]) -} -//Returns key -Object.defineProperty(iproto, "key", { - get: function() { - if(this._stack.length > 0) { - return this._stack[this._stack.length-1].key - } - return - }, - enumerable: true -}) - -//Returns value -Object.defineProperty(iproto, "value", { - get: function() { - if(this._stack.length > 0) { - return this._stack[this._stack.length-1].value - } - return - }, - enumerable: true -}) - - -//Returns the position of this iterator in the sorted list -Object.defineProperty(iproto, "index", { - get: function() { - var idx = 0 - var stack = this._stack - if(stack.length === 0) { - var r = this.tree.root - if(r) { - return r._count - } - return 0 - } else if(stack[stack.length-1].left) { - idx = stack[stack.length-1].left._count - } - for(var s=stack.length-2; s>=0; --s) { - if(stack[s+1] === stack[s].right) { - ++idx - if(stack[s].left) { - idx += stack[s].left._count - } - } - } - return idx - }, - enumerable: true -}) - -//Advances iterator to next element in list -iproto.next = function() { - var stack = this._stack - if(stack.length === 0) { - return - } - var n = stack[stack.length-1] - if(n.right) { - n = n.right - while(n) { - stack.push(n) - n = n.left - } - } else { - stack.pop() - while(stack.length > 0 && stack[stack.length-1].right === n) { - n = stack[stack.length-1] - stack.pop() - } + this._size++; + return newNode; +}; + + +/** + * Removes the node from the tree. If not found, returns null. + * @param{Key} key + * @return {?Node} + */ +AVLTree.prototype.remove = function remove (key) { + var this$1 = this; + + if (!this._root) { return null; } + + var node = this._root; + var compare = this._comparator; + var cmp = 0; + + while (node) { + cmp = compare(key, node.key); + if (cmp === 0) { break; } + else if (cmp < 0) { node = node.left; } + else { node = node.right; } } -} + if (!node) { return null; } -//Checks if iterator is at end of tree -Object.defineProperty(iproto, "hasNext", { - get: function() { - var stack = this._stack - if(stack.length === 0) { - return false - } - if(stack[stack.length-1].right) { - return true - } - for(var s=stack.length-1; s>0; --s) { - if(stack[s-1].left === stack[s]) { - return true + var returnValue = node.key; + var max, min; + + if (node.left) { + max = node.left; + + while (max.left || max.right) { + while (max.right) { max = max.right; } + + node.key = max.key; + node.data = max.data; + if (max.left) { + node = max; + max = max.left; } } - return false - } -}) - -//Update value -iproto.update = function(value) { - var stack = this._stack - if(stack.length === 0) { - throw new Error("Can't update empty node!") - } - var cstack = new Array(stack.length) - var n = stack[stack.length-1] - cstack[cstack.length-1] = new RBNode(n._color, n.key, value, n.left, n.right, n._count) - for(var i=stack.length-2; i>=0; --i) { - n = stack[i] - if(n.left === stack[i+1]) { - cstack[i] = new RBNode(n._color, n.key, n.value, cstack[i+1], n.right, n._count) - } else { - cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) - } + + node.key= max.key; + node.data = max.data; + node = max; } - return new RedBlackTree(this.tree._compare, cstack[0]) -} -//Moves iterator backward one element -iproto.prev = function() { - var stack = this._stack - if(stack.length === 0) { - return - } - var n = stack[stack.length-1] - if(n.left) { - n = n.left - while(n) { - stack.push(n) - n = n.right - } - } else { - stack.pop() - while(stack.length > 0 && stack[stack.length-1].left === n) { - n = stack[stack.length-1] - stack.pop() + if (node.right) { + min = node.right; + + while (min.left || min.right) { + while (min.left) { min = min.left; } + + node.key= min.key; + node.data = min.data; + if (min.right) { + node = min; + min = min.right; + } } + + node.key= min.key; + node.data = min.data; + node = min; } -} -//Checks if iterator is at start of tree -Object.defineProperty(iproto, "hasPrev", { - get: function() { - var stack = this._stack - if(stack.length === 0) { - return false - } - if(stack[stack.length-1].left) { - return true - } - for(var s=stack.length-1; s>0; --s) { - if(stack[s-1].right === stack[s]) { - return true - } + var parent = node.parent; + var pp = node; + var newRoot; + + while (parent) { + if (parent.left === pp) { parent.balanceFactor -= 1; } + else { parent.balanceFactor += 1; } + + if (parent.balanceFactor < -1) { + // inlined + //var newRoot = rightBalance(parent); + if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } + newRoot = rotateLeft(parent); + + if (parent === this$1._root) { this$1._root = newRoot; } + parent = newRoot; + } else if (parent.balanceFactor > 1) { + // inlined + // var newRoot = leftBalance(parent); + if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } + newRoot = rotateRight(parent); + + if (parent === this$1._root) { this$1._root = newRoot; } + parent = newRoot; } - return false + + if (parent.balanceFactor === -1 || parent.balanceFactor === 1) { break; } + + pp = parent; + parent = parent.parent; } -}) -//Default comparison function -function defaultCompare(a, b) { - if(a < b) { - return -1 + if (node.parent) { + if (node.parent.left === node) { node.parent.left= null; } + else { node.parent.right = null; } } - if(a > b) { - return 1 + + if (node === this._root) { this._root = null; } + + this._size--; + return returnValue; +}; + + +/** + * Bulk-load items + * @param{Array}keys + * @param{Array}[values] + * @return {AVLTree} + */ +AVLTree.prototype.load = function load (keys, values) { + var this$1 = this; + if ( keys === void 0 ) keys = []; + if ( values === void 0 ) values = []; + + if (Array.isArray(keys)) { + for (var i = 0, len = keys.length; i < len; i++) { + this$1.insert(keys[i], values[i]); + } } - return 0 -} + return this; +}; + + +/** + * Returns true if the tree is balanced + * @return {boolean} + */ +AVLTree.prototype.isBalanced = function isBalanced$1 () { + return isBalanced(this._root); +}; + + +/** + * String representation of the tree - primitive horizontal print-out + * @param{Function(Node):string} [printNode] + * @return {string} + */ +AVLTree.prototype.toString = function toString (printNode) { + return print(this._root, printNode); +}; + +Object.defineProperties( AVLTree.prototype, prototypeAccessors ); + +return AVLTree; + +}))); + -//Build a tree -function createRBTree(compare) { - return new RedBlackTree(compare || defaultCompare, null) -} },{}],3:[function(require,module,exports){ 'use strict'; @@ -1223,7 +951,7 @@ module.exports = function equals(p1, p2) { 'use strict'; var Queue = require('tinyqueue'); -var Tree = require('functional-red-black-tree'); +var Tree = require('avl'); var edgeType = require('./edge_type'); var SweepEvent = require('./sweep_event'); var compareEvents = require('./compare_events'); @@ -1315,9 +1043,7 @@ function fillQueue(subject, clipping, sbbox, cbbox) { /** * @param {SweepEvent} event * @param {SweepEvent} prev - * @param {Tree} sweepLine * @param {Operation} operation - * @return {[type]} */ function computeFields(event, prev, operation) { // compute inOut and otherInOut fields @@ -1562,7 +1288,7 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio var rightbound = min(sbbox[2], cbbox[2]); - var prev, next; + var prev, next, begin, end; while (eventQueue.length) { var event = eventQueue.pop(); @@ -1575,69 +1301,55 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio } if (event.left) { - sweepLine = sweepLine.insert(event); + next = prev = sweepLine.insert(event); //_renderSweepLine(sweepLine, event.point, event); + begin = sweepLine.minNode(); - next = sweepLine.find(event); - prev = sweepLine.find(event); - event.iterator = sweepLine.find(event); + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; - if (prev.node !== sweepLine.begin) { - prev.prev(); - } else { - prev = sweepLine.begin; - prev.prev(); - prev.next(); - } - next.next(); + next = sweepLine.next(next); - var prevEvent = (prev.key || null), prevprevEvent; + var prevEvent = prev ? prev.key : null; + var prevprevEvent; computeFields(event, prevEvent, operation); - if (next.node) { + if (next) { if (possibleIntersection(event, next.key, eventQueue) === 2) { computeFields(event, prevEvent, operation); computeFields(event, next.key, operation); } } - - if (prev.node) { + if (prev) { if (possibleIntersection(prev.key, event, eventQueue) === 2) { - var prevprev = sweepLine.find(prev.key); - if (prevprev.node !== sweepLine.begin) { - prevprev.prev(); - } else { - prevprev = sweepLine.find(sweepLine.end); - prevprev.next(); - } - prevprevEvent = prevprev.key || null; + var prevprev = prev; + if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); + else prevprev = null; + + prevprevEvent = prevprev ? prevprev.key : null; computeFields(prevEvent, prevprevEvent, operation); computeFields(event, prevEvent, operation); } } } else { event = event.otherEvent; - next = sweepLine.find(event); - prev = sweepLine.find(event); + next = prev = sweepLine.find(event); // _renderSweepLine(sweepLine, event.otherEvent.point, event); - if (!(prev && next)) continue; + if (prev && next) { - if (prev.node !== sweepLine.begin) { - prev.prev(); - } else { - prev = sweepLine.begin; - prev.prev(); - prev.next(); - } - next.next(); - sweepLine = sweepLine.remove(event); + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; - // _renderSweepLine(sweepLine, event.otherEvent.point, event); + next = sweepLine.next(next); + sweepLine.remove(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); - if (next.node && prev.node) { - if (typeof prev.node.value !== 'undefined' && typeof next.node.value !== 'undefined') { - possibleIntersection(prev.key, next.key, eventQueue); + if (next && prev) { + //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + possibleIntersection(prev.key, next.key, eventQueue); + //} } } } @@ -1895,7 +1607,7 @@ module.exports.subdivideSegments = subdivideSegments; module.exports.divideSegment = divideSegment; module.exports.possibleIntersection = possibleIntersection; -},{"./compare_events":4,"./compare_segments":5,"./edge_type":6,"./equals":7,"./segment_intersection":9,"./sweep_event":11,"functional-red-black-tree":2,"tinyqueue":3}],9:[function(require,module,exports){ +},{"./compare_events":4,"./compare_segments":5,"./edge_type":6,"./equals":7,"./segment_intersection":9,"./sweep_event":11,"avl":2,"tinyqueue":3}],9:[function(require,module,exports){ 'use strict'; var EPSILON = 1e-9; diff --git a/package-lock.json b/package-lock.json index d463376..7e33c30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,5930 +5,6127 @@ "requires": true, "dependencies": { "@types/geojson": { - "version": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.2.tgz", - "integrity": "sha1-sC0QqwKOKSisWSoFGqpJgaGUHQM=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.3.tgz", + "integrity": "sha512-unWrGQhXRrNTk/MabfBLCM/rWT6zxR1OSK0GIPxsP8NX8mJcsNWkERPp4z0pTyHLiANy+Nwczf8Q2I16Pth1FA==", "dev": true }, "abbrev": { - "version": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", "dev": true }, "acorn": { - "version": "https://registry.npmjs.org/acorn/-/acorn-4.0.11.tgz", - "integrity": "sha1-7c2jvZN+dVZBDULtWGD2c5nHlMA=", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", "dev": true }, "acorn-jsx": { - "version": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { - "acorn": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz" + "acorn": "3.3.0" }, "dependencies": { "acorn": { - "version": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", "dev": true } } }, "ajv": { - "version": "https://registry.npmjs.org/ajv/-/ajv-4.11.7.tgz", - "integrity": "sha1-hlWl2G0IJJhcxHGh2RP7Zymg7Eg=", + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "dev": true, "requires": { - "co": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "json-stable-stringify": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz" + "co": "4.6.0", + "json-stable-stringify": "1.0.1" }, "dependencies": { "json-stable-stringify": { - "version": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "dev": true, "requires": { - "jsonify": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" + "jsonify": "0.0.0" } } } }, "ajv-keywords": { - "version": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", "dev": true }, "amdefine": { - "version": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, "ansi-escapes": { - "version": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", "dev": true }, "ansi-regex": { - "version": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { - "version": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, "anymatch": { - "version": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", - "integrity": "sha1-o+Uvo5FoyCX/V7AkgSbOWo/5VQc=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", "dev": true, "requires": { - "arrify": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "micromatch": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz" + "micromatch": "2.3.11", + "normalize-path": "2.1.1" } }, "archiver": { - "version": "https://registry.npmjs.org/archiver/-/archiver-0.14.4.tgz", + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-0.14.4.tgz", "integrity": "sha1-W53bn17hzu8hy487Ag5iQOy0MVw=", "dev": true, "requires": { - "async": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "buffer-crc32": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", - "lazystream": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "tar-stream": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.1.5.tgz", - "zip-stream": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.5.2.tgz" + "async": "0.9.0", + "buffer-crc32": "0.2.13", + "glob": "4.3.5", + "lazystream": "0.1.0", + "lodash": "3.2.0", + "readable-stream": "1.0.34", + "tar-stream": "1.1.5", + "zip-stream": "0.5.2" }, "dependencies": { - "async": { - "version": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", - "dev": true - }, "glob": { - "version": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", "integrity": "sha1-gPuwjKVA8jiszl0R0em8QedRc9M=", "dev": true, "requires": { - "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "2.0.10", + "once": "1.4.0" } }, "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "lodash": { - "version": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", "integrity": "sha1-S/UKMkP5rrC6xBpV09WZBnWkYvs=", "dev": true }, "minimatch": { - "version": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", "dev": true, "requires": { - "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + "brace-expansion": "1.1.8" } }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true } } }, "argparse": { - "version": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", "dev": true, "requires": { - "sprintf-js": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" + "sprintf-js": "1.0.3" } }, "arr-diff": { - "version": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "dev": true, "requires": { - "arr-flatten": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz" + "arr-flatten": "1.1.0" } }, "arr-flatten": { - "version": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz", - "integrity": "sha1-5f/lTUXhnzLyFukeuZyM6JK7YEs=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, "array-filter": { - "version": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", "dev": true }, "array-map": { - "version": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", "dev": true }, "array-reduce": { - "version": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", "dev": true }, "array-union": { - "version": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { - "array-uniq": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz" + "array-uniq": "1.0.3" } }, "array-uniq": { - "version": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", "dev": true }, "array-unique": { - "version": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", "dev": true }, "arrify": { - "version": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "asn1": { - "version": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", "dev": true }, "asn1.js": { - "version": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz", "integrity": "sha1-SLokC0WpKA6UdImQull9IWYX/UA=", "dev": true, "requires": { - "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimalistic-assert": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz" + "bn.js": "4.11.8", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" } }, "assert": { - "version": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", "dev": true, "requires": { - "util": "https://registry.npmjs.org/util/-/util-0.10.3.tgz" + "util": "0.10.3" } }, "assert-plus": { - "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", "dev": true }, "astw": { - "version": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", "integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=", "dev": true, "requires": { - "acorn": "https://registry.npmjs.org/acorn/-/acorn-4.0.11.tgz" + "acorn": "4.0.13" } }, "async": { - "version": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", - "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz", + "integrity": "sha1-rDYTsdqb7RtHUQu0ZRuJMeRxRsc=", "dev": true }, "async-each": { - "version": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", "dev": true }, "asynckit": { - "version": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, "avl": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/avl/-/avl-1.3.0.tgz", - "integrity": "sha512-KIl7yrh+ZSBOBBFD+Ovuh9mMEJuPrLmpYN6tynqWIZSP/r0odVmZBIBGs/JMbRx4qIfegoCoe0Q3byQy95nhjA==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/avl/-/avl-1.4.0.tgz", + "integrity": "sha512-ils0pCduuDOvKf7BwOreJc6SYDUioy8GKiF7y38L55pdT1csrLxyMp0BZJL+6yyZsjCWls18qPJjRmpOh+oZyA==" }, "aws-sign2": { - "version": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", "dev": true }, "aws4": { - "version": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", "dev": true }, "babel-cli": { - "version": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.23.0.tgz", - "integrity": "sha1-Uv+UaisPZGRcNee9XuomeqCUjA8=", - "dev": true, - "requires": { - "babel-core": "https://registry.npmjs.org/babel-core/-/babel-core-6.23.1.tgz", - "babel-polyfill": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", - "babel-register": "https://registry.npmjs.org/babel-register/-/babel-register-6.23.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "chokidar": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz", - "commander": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "convert-source-map": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.4.0.tgz", - "fs-readdir-recursive": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "output-file-sync": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "slash": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "v8flags": "https://registry.npmjs.org/v8flags/-/v8flags-2.0.11.tgz" + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz", + "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", + "dev": true, + "requires": { + "babel-core": "6.26.0", + "babel-polyfill": "6.26.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "chokidar": "1.7.0", + "commander": "2.11.0", + "convert-source-map": "1.5.0", + "fs-readdir-recursive": "1.0.0", + "glob": "7.1.2", + "lodash": "4.17.4", + "output-file-sync": "1.1.2", + "path-is-absolute": "1.0.1", + "slash": "1.0.0", + "source-map": "0.5.7", + "v8flags": "2.1.1" } }, "babel-code-frame": { - "version": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", - "integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { - "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "js-tokens": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz" + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" } }, "babel-core": { - "version": "https://registry.npmjs.org/babel-core/-/babel-core-6.23.1.tgz", - "integrity": "sha1-wUPLYhuy9iFxDCIMXVedFbikQt8=", - "dev": true, - "requires": { - "babel-code-frame": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", - "babel-generator": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.23.0.tgz", - "babel-helpers": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.23.0.tgz", - "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "babel-register": "https://registry.npmjs.org/babel-register/-/babel-register-6.23.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", - "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", - "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.16.1.tgz", - "convert-source-map": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.4.0.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", - "json5": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "private": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "slash": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", + "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-generator": "6.26.0", + "babel-helpers": "6.24.1", + "babel-messages": "6.23.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "convert-source-map": "1.5.0", + "debug": "2.6.8", + "json5": "0.5.1", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "path-is-absolute": "1.0.1", + "private": "0.1.7", + "slash": "1.0.0", + "source-map": "0.5.7" } }, "babel-generator": { - "version": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.23.0.tgz", - "integrity": "sha1-a47auVbvMRb3nYyExaPAXzKnS8U=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz", + "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=", "dev": true, "requires": { - "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", - "detect-indent": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "jsesc": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "trim-right": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz" + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.4", + "source-map": "0.5.7", + "trim-right": "1.0.1" } }, "babel-helper-call-delegate": { - "version": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz", - "integrity": "sha1-EZkhtWEg8X6drj90tPXMe8wbN+8=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", "dev": true, "requires": { - "babel-helper-hoist-variables": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-helper-hoist-variables": "6.24.1", + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" } }, "babel-helper-define-map": { - "version": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.23.0.tgz", - "integrity": "sha1-FET5YMlpHWmiztaiBTFfj9AIBOc=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", "dev": true, "requires": { - "babel-helper-function-name": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "lodash": "4.17.4" } }, "babel-helper-function-name": { - "version": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz", - "integrity": "sha1-JXQtZxdciQPb5LbLnZ4fy43PI6Y=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", "dev": true, "requires": { - "babel-helper-get-function-arity": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", - "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-helper-get-function-arity": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" } }, "babel-helper-get-function-arity": { - "version": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz", - "integrity": "sha1-C+tGStadxzR0EKxq3p8DpQY09c4=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" } }, "babel-helper-hoist-variables": { - "version": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz", - "integrity": "sha1-Pqy/cx2AcFhF3S6XGPYAz7m0unI=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" } }, "babel-helper-optimise-call-expression": { - "version": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz", - "integrity": "sha1-8+5+7TVbQoITizPQK3g2nkcGIvU=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" } }, "babel-helper-regex": { - "version": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz", - "integrity": "sha1-efUyvhZHsfDuNHS19cPaWAAdJH0=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "lodash": "4.17.4" } }, "babel-helper-replace-supers": { - "version": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz", - "integrity": "sha1-7q+K2bWOxDN8qUIjus3KH42bS/0=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", "dev": true, "requires": { - "babel-helper-optimise-call-expression": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz", - "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", - "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-helper-optimise-call-expression": "6.24.1", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" } }, "babel-helpers": { - "version": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.23.0.tgz", - "integrity": "sha1-T48uCS0LaogIpL3nnCfx4uzw2ZI=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz" + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" } }, "babel-messages": { - "version": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + "babel-runtime": "6.26.0" } }, "babel-plugin-check-es2015-constants": { - "version": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-arrow-functions": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-block-scoping": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz", - "integrity": "sha1-5IiVzws3W+FIzXyIebQicHoFO1E=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", - "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "lodash": "4.17.4" } }, "babel-plugin-transform-es2015-classes": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz", - "integrity": "sha1-SbU/MmICov0bO7ql4u3YpPeGQ8E=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", "dev": true, "requires": { - "babel-helper-define-map": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.23.0.tgz", - "babel-helper-function-name": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz", - "babel-helper-optimise-call-expression": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz", - "babel-helper-replace-supers": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz", - "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", - "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-helper-define-map": "6.26.0", + "babel-helper-function-name": "6.24.1", + "babel-helper-optimise-call-expression": "6.24.1", + "babel-helper-replace-supers": "6.24.1", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" } }, "babel-plugin-transform-es2015-computed-properties": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz", - "integrity": "sha1-fDg+lim7pIIMEbBCW91ikPfwV+c=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz" + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" } }, "babel-plugin-transform-es2015-destructuring": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-duplicate-keys": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz", - "integrity": "sha1-ZyOXAxwhYQ1y3Su7C6n7Ynfhw2s=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" } }, "babel-plugin-transform-es2015-for-of": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-function-name": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz", - "integrity": "sha1-9fzIsJCT+aI8dqw9njksPsS3cQQ=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", "dev": true, "requires": { - "babel-helper-function-name": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" } }, "babel-plugin-transform-es2015-literals": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-modules-amd": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.22.0.tgz", - "integrity": "sha1-v2nNNIiaQcM9kN+3QOAJHM/1LyE=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", "dev": true, "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.23.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz" + "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" } }, "babel-plugin-transform-es2015-modules-commonjs": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.23.0.tgz", - "integrity": "sha1-y6eqY3n7fsmSUObUbeKXOq/6e5I=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz", + "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=", "dev": true, "requires": { - "babel-plugin-transform-strict-mode": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.22.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-plugin-transform-strict-mode": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-types": "6.26.0" } }, "babel-plugin-transform-es2015-modules-systemjs": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.23.0.tgz", - "integrity": "sha1-rjRpIn/6w5sDENkP7HO/3E9jF7A=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", "dev": true, "requires": { - "babel-helper-hoist-variables": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz" + "babel-helper-hoist-variables": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" } }, "babel-plugin-transform-es2015-modules-umd": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.23.0.tgz", - "integrity": "sha1-jShK4uGe2P4h0rGybW5+D82U8PE=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", "dev": true, "requires": { - "babel-plugin-transform-es2015-modules-amd": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.22.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz" + "babel-plugin-transform-es2015-modules-amd": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" } }, "babel-plugin-transform-es2015-object-super": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz", - "integrity": "sha1-2qYOEUoELqdp3VP+Uo/IIxHrmPw=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", "dev": true, "requires": { - "babel-helper-replace-supers": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + "babel-helper-replace-supers": "6.24.1", + "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-parameters": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz", - "integrity": "sha1-OiqrtwyK+UXVzjhvGkJQYlqDrjs=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", "dev": true, "requires": { - "babel-helper-call-delegate": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz", - "babel-helper-get-function-arity": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", - "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-helper-call-delegate": "6.24.1", + "babel-helper-get-function-arity": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" } }, "babel-plugin-transform-es2015-shorthand-properties": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz", - "integrity": "sha1-i6d24K/6pgv/IekhQDuKZSov9yM=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" } }, "babel-plugin-transform-es2015-spread": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-sticky-regex": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz", - "integrity": "sha1-qzFoKehm7j9LnrlpOXV9GaW8RZM=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", "dev": true, "requires": { - "babel-helper-regex": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-helper-regex": "6.26.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" } }, "babel-plugin-transform-es2015-template-literals": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-typeof-symbol": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz" + "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-unicode-regex": { - "version": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz", - "integrity": "sha1-jZzCfn7h3s/mVFT7mGRSoEphPSA=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", "dev": true, "requires": { - "babel-helper-regex": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "regexpu-core": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz" + "babel-helper-regex": "6.26.0", + "babel-runtime": "6.26.0", + "regexpu-core": "2.0.0" } }, "babel-plugin-transform-regenerator": { - "version": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz", - "integrity": "sha1-ZXQFk6MZxEUiFXU41pC4QJRhfqY=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", "dev": true, "requires": { - "regenerator-transform": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.9.8.tgz" + "regenerator-transform": "0.10.1" } }, "babel-plugin-transform-strict-mode": { - "version": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.22.0.tgz", - "integrity": "sha1-4AjfATQP3IfpWdplmRt+BZcMjHw=", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz" + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" } }, "babel-polyfill": { - "version": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", - "integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "core-js": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", - "regenerator-runtime": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz" + "babel-runtime": "6.26.0", + "core-js": "2.5.0", + "regenerator-runtime": "0.10.5" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true + } } }, "babel-preset-es2015": { - "version": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.22.0.tgz", - "integrity": "sha1-r1qY7LNeuK92StiloF6zbcQ4aDU=", - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "babel-plugin-transform-es2015-arrow-functions": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "babel-plugin-transform-es2015-block-scoped-functions": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "babel-plugin-transform-es2015-block-scoping": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz", - "babel-plugin-transform-es2015-classes": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz", - "babel-plugin-transform-es2015-computed-properties": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz", - "babel-plugin-transform-es2015-destructuring": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "babel-plugin-transform-es2015-duplicate-keys": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz", - "babel-plugin-transform-es2015-for-of": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "babel-plugin-transform-es2015-function-name": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz", - "babel-plugin-transform-es2015-literals": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "babel-plugin-transform-es2015-modules-amd": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.22.0.tgz", - "babel-plugin-transform-es2015-modules-commonjs": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.23.0.tgz", - "babel-plugin-transform-es2015-modules-systemjs": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.23.0.tgz", - "babel-plugin-transform-es2015-modules-umd": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.23.0.tgz", - "babel-plugin-transform-es2015-object-super": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz", - "babel-plugin-transform-es2015-parameters": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz", - "babel-plugin-transform-es2015-shorthand-properties": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz", - "babel-plugin-transform-es2015-spread": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "babel-plugin-transform-es2015-sticky-regex": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz", - "babel-plugin-transform-es2015-template-literals": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "babel-plugin-transform-es2015-typeof-symbol": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", - "babel-plugin-transform-es2015-unicode-regex": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz", - "babel-plugin-transform-regenerator": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz" + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", + "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoping": "6.26.0", + "babel-plugin-transform-es2015-classes": "6.24.1", + "babel-plugin-transform-es2015-computed-properties": "6.24.1", + "babel-plugin-transform-es2015-destructuring": "6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "6.24.1", + "babel-plugin-transform-es2015-for-of": "6.23.0", + "babel-plugin-transform-es2015-function-name": "6.24.1", + "babel-plugin-transform-es2015-literals": "6.22.0", + "babel-plugin-transform-es2015-modules-amd": "6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", + "babel-plugin-transform-es2015-modules-umd": "6.24.1", + "babel-plugin-transform-es2015-object-super": "6.24.1", + "babel-plugin-transform-es2015-parameters": "6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", + "babel-plugin-transform-es2015-spread": "6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "6.24.1", + "babel-plugin-transform-es2015-template-literals": "6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "6.24.1", + "babel-plugin-transform-regenerator": "6.26.0" } }, "babel-register": { - "version": "https://registry.npmjs.org/babel-register/-/babel-register-6.23.0.tgz", - "integrity": "sha1-yao9TMqUtR2jSCbEoPnggUXXT/M=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", "dev": true, "requires": { - "babel-core": "https://registry.npmjs.org/babel-core/-/babel-core-6.23.1.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "core-js": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", - "home-or-tmp": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "source-map-support": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.11.tgz" + "babel-core": "6.26.0", + "babel-runtime": "6.26.0", + "core-js": "2.5.0", + "home-or-tmp": "2.0.0", + "lodash": "4.17.4", + "mkdirp": "0.5.1", + "source-map-support": "0.4.16" } }, "babel-runtime": { - "version": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "integrity": "sha1-CpSJ8UTecO+zzkMArM2zKeL8VDs=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { - "core-js": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", - "regenerator-runtime": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz" + "core-js": "2.5.0", + "regenerator-runtime": "0.11.0" } }, "babel-template": { - "version": "https://registry.npmjs.org/babel-template/-/babel-template-6.23.0.tgz", - "integrity": "sha1-BNTycK27OqcEqBQ64m+qUpI45jg=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", - "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.16.1.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "lodash": "4.17.4" } }, "babel-traverse": { - "version": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.23.1.tgz", - "integrity": "sha1-08tZAQ7NBql9gTEAZflmtpnhT0g=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", "dev": true, "requires": { - "babel-code-frame": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", - "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", - "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.16.1.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", - "globals": "https://registry.npmjs.org/globals/-/globals-9.16.0.tgz", - "invariant": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.8", + "globals": "9.18.0", + "invariant": "2.2.2", + "lodash": "4.17.4" } }, "babel-types": { - "version": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", - "integrity": "sha1-uxcXnXU4utOM0MnhFdNA935+ms8=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "to-fast-properties": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.2.tgz" + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.4", + "to-fast-properties": "1.0.3" } }, "babelify": { - "version": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", "dev": true, "requires": { - "babel-core": "https://registry.npmjs.org/babel-core/-/babel-core-6.23.1.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + "babel-core": "6.26.0", + "object-assign": "4.1.1" } }, "babylon": { - "version": "https://registry.npmjs.org/babylon/-/babylon-6.16.1.tgz", - "integrity": "sha1-MMWiL0gZeKnn+M399JaxHZS0BNM=", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", "dev": true }, "balanced-match": { - "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "base64-js": { - "version": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", - "integrity": "sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", + "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", "dev": true }, "bcrypt-pbkdf": { - "version": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", "dev": true, "optional": true, "requires": { - "tweetnacl": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" + "tweetnacl": "0.14.5" } }, "binary-extensions": { - "version": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz", - "integrity": "sha1-SOyNFt9Dd+rl+liEaCSAr02Vx3Q=", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz", + "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=", "dev": true }, "bl": { - "version": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", "integrity": "sha1-wGt5evCF6gC8Unr8jvzxHeIjIFQ=", "dev": true, "requires": { - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + "readable-stream": "1.0.34" }, "dependencies": { "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true } } }, "bluebird": { - "version": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=", "dev": true }, "bn.js": { - "version": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", "dev": true }, "boom": { - "version": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "dev": true, "requires": { - "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + "hoek": "2.16.3" } }, "brace-expansion": { - "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", - "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "dev": true, "requires": { - "balanced-match": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "1.0.0", + "concat-map": "0.0.1" } }, "braces": { - "version": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "dev": true, "requires": { - "expand-range": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "preserve": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "repeat-element": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz" + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" } }, "brorand": { - "version": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", "dev": true }, "browser-pack": { - "version": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.2.tgz", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.2.tgz", "integrity": "sha1-+GzWzvT1MAyOY+B6TVEvZfv/RTE=", "dev": true, "requires": { - "combine-source-map": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz", - "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", - "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "umd": "https://registry.npmjs.org/umd/-/umd-3.0.1.tgz" + "combine-source-map": "0.7.2", + "defined": "1.0.0", + "JSONStream": "1.3.1", + "through2": "2.0.3", + "umd": "3.0.1" } }, "browser-resolve": { - "version": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", "dev": true, "requires": { - "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz" + "resolve": "1.1.7" }, "dependencies": { "resolve": { - "version": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", "dev": true } } }, "browserify": { - "version": "https://registry.npmjs.org/browserify/-/browserify-13.3.0.tgz", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-13.3.0.tgz", "integrity": "sha1-tanJAgJD8McORnW+yCI7xifkFc4=", "dev": true, "requires": { - "assert": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "browser-pack": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.2.tgz", - "browser-resolve": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", - "browserify-zlib": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "buffer": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "cached-path-relative": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", - "concat-stream": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "console-browserify": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "constants-browserify": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "crypto-browserify": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.0.tgz", - "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "deps-sort": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", - "domain-browser": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", - "duplexer2": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "events": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "has": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", - "htmlescape": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "https-browserify": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "insert-module-globals": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.1.tgz", - "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", - "labeled-stream-splicer": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz", - "module-deps": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", - "os-browserify": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", - "parents": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "path-browserify": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", - "process": "https://registry.npmjs.org/process/-/process-0.11.9.tgz", - "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "querystring-es3": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "read-only-stream": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", - "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.2.tgz", - "shasum": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", - "shell-quote": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", - "stream-browserify": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", - "stream-http": "https://registry.npmjs.org/stream-http/-/stream-http-2.6.3.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "subarg": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "syntax-error": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.3.0.tgz", - "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "timers-browserify": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "tty-browserify": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "url": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "util": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "vm-browserify": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "assert": "1.4.1", + "browser-pack": "6.0.2", + "browser-resolve": "1.11.2", + "browserify-zlib": "0.1.4", + "buffer": "4.9.1", + "cached-path-relative": "1.0.1", + "concat-stream": "1.5.2", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.11.1", + "defined": "1.0.0", + "deps-sort": "2.0.0", + "domain-browser": "1.1.7", + "duplexer2": "0.1.4", + "events": "1.1.1", + "glob": "7.1.2", + "has": "1.0.1", + "htmlescape": "1.1.1", + "https-browserify": "0.0.1", + "inherits": "2.0.3", + "insert-module-globals": "7.0.1", + "JSONStream": "1.3.1", + "labeled-stream-splicer": "2.0.0", + "module-deps": "4.1.1", + "os-browserify": "0.1.2", + "parents": "1.0.1", + "path-browserify": "0.0.0", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "read-only-stream": "2.0.0", + "readable-stream": "2.3.3", + "resolve": "1.4.0", + "shasum": "1.0.2", + "shell-quote": "1.6.1", + "stream-browserify": "2.0.1", + "stream-http": "2.7.2", + "string_decoder": "0.10.31", + "subarg": "1.0.0", + "syntax-error": "1.3.0", + "through2": "2.0.3", + "timers-browserify": "1.4.2", + "tty-browserify": "0.0.0", + "url": "0.11.0", + "util": "0.10.3", + "vm-browserify": "0.0.4", + "xtend": "4.0.1" + }, + "dependencies": { + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } } }, "browserify-aes": { - "version": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", "integrity": "sha1-Xncl297x/Vkw1OurSFZ85FHEigo=", "dev": true, "requires": { - "buffer-xor": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "cipher-base": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.3.tgz", - "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", - "evp_bytestokey": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.2", + "inherits": "2.0.3" } }, "browserify-cipher": { - "version": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", "dev": true, "requires": { - "browserify-aes": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", - "browserify-des": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", - "evp_bytestokey": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz" + "browserify-aes": "1.0.6", + "browserify-des": "1.0.0", + "evp_bytestokey": "1.0.2" } }, "browserify-des": { - "version": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", "dev": true, "requires": { - "cipher-base": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.3.tgz", - "des.js": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + "cipher-base": "1.0.4", + "des.js": "1.0.0", + "inherits": "2.0.3" } }, "browserify-rsa": { - "version": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { - "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "randombytes": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz" + "bn.js": "4.11.8", + "randombytes": "2.0.5" } }, "browserify-sign": { - "version": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.0.tgz", - "integrity": "sha1-EHc5EMPCBtVCCkaq2GlPgguFlo8=", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", "dev": true, "requires": { - "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "browserify-rsa": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", - "create-hmac": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.4.tgz", - "elliptic": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "parse-asn1": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.0.0.tgz" + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "elliptic": "6.4.0", + "inherits": "2.0.3", + "parse-asn1": "5.1.0" } }, "browserify-zlib": { - "version": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", "dev": true, "requires": { - "pako": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz" + "pako": "0.2.9" } }, "buffer": { - "version": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { - "base64-js": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", - "ieee754": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + "base64-js": "1.2.1", + "ieee754": "1.1.8", + "isarray": "1.0.0" } }, "buffer-crc32": { - "version": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", "dev": true }, - "buffer-shims": { - "version": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", - "dev": true - }, "buffer-xor": { - "version": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", "dev": true }, "builtin-status-codes": { - "version": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", "dev": true }, "cached-path-relative": { - "version": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=", "dev": true }, "caller-path": { - "version": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "dev": true, "requires": { - "callsites": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz" + "callsites": "0.2.0" } }, "callsites": { - "version": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, "camelcase": { - "version": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", "dev": true }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, "chalk": { - "version": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "has-ansi": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "supports-color": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" } }, "chokidar": { - "version": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz", - "integrity": "sha1-L0RHq16W5Q+z14n9kNTHLg5McMI=", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", "dev": true, "requires": { - "anymatch": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", - "async-each": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "fsevents": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.1.tgz", - "glob-parent": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "is-binary-path": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "readdirp": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz" + "anymatch": "1.3.2", + "async-each": "1.0.1", + "fsevents": "1.1.2", + "glob-parent": "2.0.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "2.0.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.1.0" } }, "chrome-launch": { - "version": "https://registry.npmjs.org/chrome-launch/-/chrome-launch-1.1.4.tgz", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chrome-launch/-/chrome-launch-1.1.4.tgz", "integrity": "sha1-yJhb0CJjWlzIlwmbr9GYMYOKclI=", "dev": true, "requires": { - "chrome-location": "https://registry.npmjs.org/chrome-location/-/chrome-location-1.2.1.tgz", - "quick-tmp": "https://registry.npmjs.org/quick-tmp/-/quick-tmp-0.0.0.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", - "shallow-copy": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz" + "chrome-location": "1.2.1", + "quick-tmp": "0.0.0", + "rimraf": "2.6.1", + "shallow-copy": "0.0.1" } }, "chrome-location": { - "version": "https://registry.npmjs.org/chrome-location/-/chrome-location-1.2.1.tgz", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/chrome-location/-/chrome-location-1.2.1.tgz", "integrity": "sha1-aRFRGk6sVQJ2Jcc7k3ylynq5SZU=", "dev": true, "requires": { - "userhome": "https://registry.npmjs.org/userhome/-/userhome-1.0.0.tgz", - "which": "https://registry.npmjs.org/which/-/which-1.2.12.tgz" + "userhome": "1.0.0", + "which": "1.3.0" } }, "cipher-base": { - "version": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.3.tgz", - "integrity": "sha1-7qvxlEGc6QDaMBjCB9IS8qbfCgc=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + "inherits": "2.0.3", + "safe-buffer": "5.1.1" } }, "circular-json": { - "version": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.1.tgz", - "integrity": "sha1-vos2rvzN6LPKeqLWr8B6NyQsDS0=", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, "clean-yaml-object": { - "version": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", "dev": true }, "cli-cursor": { - "version": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", "dev": true, "requires": { - "restore-cursor": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz" + "restore-cursor": "1.0.1" } }, "cli-width": { - "version": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", - "integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + } + }, "co": { - "version": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, "code-point-at": { - "version": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "color-support": { - "version": "https://registry.npmjs.org/color-support/-/color-support-1.1.2.tgz", - "integrity": "sha1-ScyZuJ0b3vEpLp2TI8ZpcaM+uJ0=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", "dev": true }, "colors": { - "version": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", "dev": true }, "combine-source-map": { - "version": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz", "integrity": "sha1-CHAxKFazB6h8xKxIbzqaYq7MwJ4=", "dev": true, "requires": { - "convert-source-map": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "inline-source-map": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "lodash.memoize": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + "convert-source-map": "1.1.3", + "inline-source-map": "0.6.2", + "lodash.memoize": "3.0.4", + "source-map": "0.5.7" }, "dependencies": { "convert-source-map": { - "version": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", "dev": true } } }, "combined-stream": { - "version": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", "dev": true, "requires": { - "delayed-stream": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + "delayed-stream": "1.0.0" } }, "commander": { - "version": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", - "dev": true, - "requires": { - "graceful-readlink": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" - } + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true }, "component-emitter": { - "version": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", "dev": true }, "compress-commons": { - "version": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.2.9.tgz", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.2.9.tgz", "integrity": "sha1-Qi2SdDDAGr0GzUVbbfwEy0z4ADw=", "dev": true, "requires": { - "buffer-crc32": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "crc32-stream": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.3.4.tgz", - "node-int64": "https://registry.npmjs.org/node-int64/-/node-int64-0.3.3.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + "buffer-crc32": "0.2.13", + "crc32-stream": "0.3.4", + "node-int64": "0.3.3", + "readable-stream": "1.0.34" }, "dependencies": { "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true } } }, "concat-map": { - "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "concat-stream": { - "version": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "typedarray": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" + "inherits": "2.0.3", + "readable-stream": "2.0.6", + "typedarray": "0.0.6" }, "dependencies": { "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", "dev": true, "requires": { - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true } } }, "configstore": { - "version": "https://registry.npmjs.org/configstore/-/configstore-1.4.0.tgz", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-1.4.0.tgz", "integrity": "sha1-w1eB0FAdJowlxUuLF/YkDopPsCE=", "dev": true, "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "os-tmpdir": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "osenv": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", - "uuid": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", - "write-file-atomic": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.1.tgz", - "xdg-basedir": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz" + "graceful-fs": "4.1.11", + "mkdirp": "0.5.1", + "object-assign": "4.1.1", + "os-tmpdir": "1.0.2", + "osenv": "0.1.4", + "uuid": "2.0.3", + "write-file-atomic": "1.3.4", + "xdg-basedir": "2.0.0" } }, "console-browserify": { - "version": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", "dev": true, "requires": { - "date-now": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz" + "date-now": "0.1.4" } }, "constants-browserify": { - "version": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", "dev": true }, "convert-source-map": { - "version": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.4.0.tgz", - "integrity": "sha1-49rRlb9hv+E6ejxz6YduwUoCaPM=", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", + "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", "dev": true }, "cookiejar": { - "version": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.0.tgz", - "integrity": "sha1-hlSWiVObbQ4mm2Y3owS+UIGU2Jg=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.1.tgz", + "integrity": "sha1-Qa1XsbVVlR7BcUEqgZQrHoIA00o=", "dev": true }, "core-js": { - "version": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", - "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.0.tgz", + "integrity": "sha1-VpwFCRi+ZIazg3VSAorgRmtxcIY=", "dev": true }, "core-util-is": { - "version": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, "corser": { - "version": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=", "dev": true }, "coveralls": { - "version": "https://registry.npmjs.org/coveralls/-/coveralls-2.12.0.tgz", - "integrity": "sha1-s9BkEI4pcoOFtW5C/C0Rn0Pg5Rc=", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-2.13.1.tgz", + "integrity": "sha1-1wu5rMGDXsTwY/+drFQjwXsR8Xg=", "dev": true, "requires": { - "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz", - "lcov-parse": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", - "log-driver": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", - "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "request": "https://registry.npmjs.org/request/-/request-2.79.0.tgz" + "js-yaml": "3.6.1", + "lcov-parse": "0.0.10", + "log-driver": "1.2.5", + "minimist": "1.2.0", + "request": "2.79.0" }, "dependencies": { "caseless": { - "version": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", "dev": true }, "esprima": { - "version": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", "dev": true }, "har-validator": { - "version": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", "dev": true, "requires": { - "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "commander": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "is-my-json-valid": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", - "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + "chalk": "1.1.3", + "commander": "2.11.0", + "is-my-json-valid": "2.16.1", + "pinkie-promise": "2.0.1" } }, "js-yaml": { - "version": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz", "integrity": "sha1-bl/mfYsgXOTSL60Ft3geja3MSzA=", "dev": true, "requires": { - "argparse": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", - "esprima": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz" + "argparse": "1.0.9", + "esprima": "2.7.3" } }, "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "qs": { - "version": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", "dev": true }, "request": { - "version": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "version": "2.79.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", "dev": true, "requires": { - "aws-sign2": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "aws4": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "caseless": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "extend": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "forever-agent": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "form-data": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", - "har-validator": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "hawk": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "http-signature": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "is-typedarray": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "isstream": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "json-stringify-safe": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", - "oauth-sign": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "qs": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", - "stringstream": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "tough-cookie": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "tunnel-agent": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "uuid": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz" + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.11.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "2.0.6", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.16", + "oauth-sign": "0.8.2", + "qs": "6.3.2", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.4.3", + "uuid": "3.1.0" } }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true + }, "uuid": { - "version": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", - "integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", "dev": true } } }, "crc32-stream": { - "version": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.3.4.tgz", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.3.4.tgz", "integrity": "sha1-c7wltF+sHbZjIjGnv86JJ+nwZVI=", "dev": true, "requires": { - "buffer-crc32": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + "buffer-crc32": "0.2.13", + "readable-stream": "1.0.34" }, "dependencies": { "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true } } }, "create-ecdh": { - "version": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", "dev": true, "requires": { - "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "elliptic": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz" + "bn.js": "4.11.8", + "elliptic": "6.4.0" } }, "create-hash": { - "version": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", - "integrity": "sha1-USEAYte7dHn2xlu0GpIgix1hq60=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", + "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", "dev": true, "requires": { - "cipher-base": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.3.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "ripemd160": "https://registry.npmjs.org/ripemd160/-/ripemd160-1.0.1.tgz", - "sha.js": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz" + "cipher-base": "1.0.4", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "sha.js": "2.4.8" } }, "create-hmac": { - "version": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.4.tgz", - "integrity": "sha1-0/tLolPriz9W456i+8uK90e9MXA=", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", + "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", "dev": true, "requires": { - "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.8" } }, "cross-spawn": { - "version": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", "dev": true, "requires": { - "lru-cache": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", - "which": "https://registry.npmjs.org/which/-/which-1.2.12.tgz" + "lru-cache": "4.1.1", + "which": "1.3.0" } }, "cryptiles": { - "version": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", "dev": true, "requires": { - "boom": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + "boom": "2.10.1" } }, "crypto-browserify": { - "version": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.0.tgz", - "integrity": "sha1-NlKgkGq5sqfgw85mpAjpV6JIVSI=", + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.1.tgz", + "integrity": "sha512-Na7ZlwCOqoaW5RwUK1WpXws2kv8mNhWdTlzob0UXulk6G9BDbyiJaGTYBIX61Ozn9l1EPPJpICZb4DaOpT9NlQ==", "dev": true, "requires": { - "browserify-cipher": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", - "browserify-sign": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.0.tgz", - "create-ecdh": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", - "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", - "create-hmac": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.4.tgz", - "diffie-hellman": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "pbkdf2": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.9.tgz", - "public-encrypt": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", - "randombytes": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz" + "browserify-cipher": "1.0.0", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.0", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "diffie-hellman": "5.0.2", + "inherits": "2.0.3", + "pbkdf2": "3.0.13", + "public-encrypt": "4.0.0", + "randombytes": "2.0.5" } }, "ctype": { - "version": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", "integrity": "sha1-gsGMJGH3QRTvFsE1IkrQuRRMoS8=", "dev": true }, "d": { - "version": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", - "integrity": "sha1-2hhMU10Y2O57oqoim5FACfrhEwk=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "dev": true, "requires": { - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz" + "es5-ext": "0.10.30" } }, "dashdash": { - "version": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, "requires": { - "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + "assert-plus": "1.0.0" }, "dependencies": { "assert-plus": { - "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true } } }, "date-now": { - "version": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", "dev": true }, "debug": { - "version": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", - "integrity": "sha1-eYVQkLosTjEVzH2HaUkdWPBJE1E=", + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", "dev": true, "requires": { - "ms": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz" + "ms": "2.0.0" } }, "decamelize": { - "version": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "deep-equal": { - "version": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", "dev": true }, "deep-extend": { - "version": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.1.tgz", - "integrity": "sha1-7+QRPQgIX05vlod1mBD4B0aeIlM=", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", "dev": true }, "deep-is": { - "version": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, "deeper": { - "version": "https://registry.npmjs.org/deeper/-/deeper-2.1.0.tgz", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/deeper/-/deeper-2.1.0.tgz", "integrity": "sha1-vFZOX3MXT98gHgiwADDooU2nQ2g=", "dev": true }, "define-properties": { - "version": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", "dev": true, "requires": { - "foreach": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "object-keys": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz" + "foreach": "2.0.5", + "object-keys": "1.0.11" } }, "defined": { - "version": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", "dev": true }, "del": { - "version": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", "dev": true, "requires": { - "globby": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", - "is-path-cwd": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", - "is-path-in-cwd": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "pify": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz" + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.1" } }, "delayed-stream": { - "version": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, "deps-sort": { - "version": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", "dev": true, "requires": { - "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", - "shasum": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", - "subarg": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz" + "JSONStream": "1.3.1", + "shasum": "1.0.2", + "subarg": "1.0.0", + "through2": "2.0.3" } }, "des.js": { - "version": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimalistic-assert": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz" + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" } }, "detect-indent": { - "version": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", "dev": true, "requires": { - "repeating": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz" + "repeating": "2.0.1" } }, "detective": { - "version": "https://registry.npmjs.org/detective/-/detective-4.5.0.tgz", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-4.5.0.tgz", "integrity": "sha1-blqMaybmx6JUsca210kNmOyR7dE=", "dev": true, "requires": { - "acorn": "https://registry.npmjs.org/acorn/-/acorn-4.0.11.tgz", - "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz" + "acorn": "4.0.13", + "defined": "1.0.0" } }, "diff": { - "version": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=", "dev": true }, "diffie-hellman": { - "version": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", "dev": true, "requires": { - "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "miller-rabin": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.0.tgz", - "randombytes": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz" + "bn.js": "4.11.8", + "miller-rabin": "4.0.0", + "randombytes": "2.0.5" } }, "doctrine": { - "version": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", "dev": true, "requires": { - "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + "esutils": "2.0.2", + "isarray": "1.0.0" } }, "dom-walk": { - "version": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=", "dev": true }, "domain-browser": { - "version": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", "dev": true }, "duplexer": { - "version": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", "dev": true }, "duplexer2": { - "version": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", "dev": true, "requires": { - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + "readable-stream": "2.3.3" } }, "duplexify": { - "version": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", - "integrity": "sha1-GqdzAC4VeEV+nZ1KULDMquvL1gQ=", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.1.tgz", + "integrity": "sha512-j5goxHTwVED1Fpe5hh3q9R93Kip0Bg2KVAt4f8CEYM3UEwYcPSvWbXaUQOzdX/HtiNomipv+gU7ASQPDbV7pGQ==", "dev": true, "requires": { - "end-of-stream": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", - "stream-shift": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz" + "end-of-stream": "1.4.0", + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "stream-shift": "1.0.0" } }, "ecc-jsbn": { - "version": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", "dev": true, "optional": true, "requires": { - "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" + "jsbn": "0.1.1" } }, "ecstatic": { - "version": "https://registry.npmjs.org/ecstatic/-/ecstatic-1.4.1.tgz", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-1.4.1.tgz", "integrity": "sha1-Mst7b6LikNWGaGdNEV6PDD1WfWo=", "dev": true, "requires": { - "he": "https://registry.npmjs.org/he/-/he-0.5.0.tgz", - "mime": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "url-join": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz" + "he": "0.5.0", + "mime": "1.4.0", + "minimist": "1.2.0", + "url-join": "1.1.0" }, "dependencies": { - "mime": { - "version": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=", - "dev": true - }, "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } } }, "elliptic": { - "version": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", "dev": true, "requires": { - "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "brorand": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "hash.js": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz", - "hmac-drbg": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.0.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimalistic-assert": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", - "minimalistic-crypto-utils": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz" + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "hmac-drbg": "1.0.1", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" } }, "end-of-stream": { - "version": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", - "integrity": "sha1-1FlucCc0qT5A6a+GQxnqvZn/Lw4=", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", + "integrity": "sha1-epDYM+/abPpurA9JSduw+tOmMgY=", "dev": true, "requires": { - "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz" - }, - "dependencies": { - "once": { - "version": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", - "dev": true, - "requires": { - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - } - } + "once": "1.4.0" } }, "error-ex": { - "version": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", "dev": true, "requires": { - "is-arrayish": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" + "is-arrayish": "0.2.1" } }, "es-abstract": { - "version": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.7.0.tgz", - "integrity": "sha1-363ndOAb/Nl/lhgCmMRJyGI/uUw=", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.8.0.tgz", + "integrity": "sha512-Cf9/h5MrXtExM20gSS55YFrGKCyPrRBjIVBtVyy8vmlsDfe0NPKMWj65tPLgzyfPuapWxh5whpXCtW4+AW5mRg==", "dev": true, "requires": { - "es-to-primitive": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", - "function-bind": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", - "is-callable": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", - "is-regex": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz" + "es-to-primitive": "1.1.1", + "function-bind": "1.1.1", + "has": "1.0.1", + "is-callable": "1.1.3", + "is-regex": "1.0.4" } }, "es-to-primitive": { - "version": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", "dev": true, "requires": { - "is-callable": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", - "is-date-object": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "is-symbol": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz" + "is-callable": "1.1.3", + "is-date-object": "1.0.1", + "is-symbol": "1.0.1" } }, "es5-ext": { - "version": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz", - "integrity": "sha1-qoRkHU23a2Krul5F/YBey6sUAEc=", + "version": "0.10.30", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.30.tgz", + "integrity": "sha1-cUGhaDZpfbq/qq7uQUlc4p9SyTk=", "dev": true, "requires": { - "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz" + "es6-iterator": "2.0.1", + "es6-symbol": "3.1.1" } }, "es6-iterator": { - "version": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", - "integrity": "sha1-vZaFZ9YWNeM8C4BydhPJy0sJa6w=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", "dev": true, "requires": { - "d": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz" + "d": "1.0.0", + "es5-ext": "0.10.30", + "es6-symbol": "3.1.1" } }, "es6-map": { - "version": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", "dev": true, "requires": { - "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", - "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "es6-set": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "event-emitter": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz" - }, - "dependencies": { - "d": { - "version": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "dev": true, - "requires": { - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" - } - }, - "es5-ext": { - "version": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", - "integrity": "sha1-wzClk0we4hKEp8CBqG5f2TfJHqY=", - "dev": true, - "requires": { - "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" - } - }, - "es6-iterator": { - "version": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", - "dev": true, - "requires": { - "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" - } - }, - "es6-symbol": { - "version": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" - } - } + "d": "1.0.0", + "es5-ext": "0.10.30", + "es6-iterator": "2.0.1", + "es6-set": "0.1.5", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" } }, "es6-promise": { - "version": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=", "dev": true }, "es6-set": { - "version": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", "dev": true, "requires": { - "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", - "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "event-emitter": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz" - }, - "dependencies": { - "d": { - "version": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "dev": true, - "requires": { - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" - } - }, - "es5-ext": { - "version": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", - "integrity": "sha1-wzClk0we4hKEp8CBqG5f2TfJHqY=", - "dev": true, - "requires": { - "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" - } - }, - "es6-iterator": { - "version": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", - "dev": true, - "requires": { - "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" - } - }, - "es6-symbol": { - "version": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" - } - } + "d": "1.0.0", + "es5-ext": "0.10.30", + "es6-iterator": "2.0.1", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" } }, "es6-symbol": { - "version": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz", - "integrity": "sha1-lEgcZV56fK2C66gy2X1UM0ltf/o=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", "dev": true, "requires": { - "d": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz" + "d": "1.0.0", + "es5-ext": "0.10.30" } }, "es6-weak-map": { - "version": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", "dev": true, "requires": { - "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", - "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" - }, - "dependencies": { - "d": { - "version": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "dev": true, - "requires": { - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" - } - }, - "es5-ext": { - "version": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", - "integrity": "sha1-wzClk0we4hKEp8CBqG5f2TfJHqY=", - "dev": true, - "requires": { - "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" - } - }, - "es6-iterator": { - "version": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", - "dev": true, - "requires": { - "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz" - } - }, - "es6-symbol": { - "version": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" - } - } + "d": "1.0.0", + "es5-ext": "0.10.30", + "es6-iterator": "2.0.1", + "es6-symbol": "3.1.1" } }, "escape-string-regexp": { - "version": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, "escope": { - "version": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", "dev": true, "requires": { - "es6-map": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", - "es6-weak-map": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", - "esrecurse": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.1.0.tgz", - "estraverse": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz" + "es6-map": "0.1.5", + "es6-weak-map": "2.0.2", + "esrecurse": "4.2.0", + "estraverse": "4.2.0" } }, "eslint": { - "version": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", "dev": true, "requires": { - "babel-code-frame": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", - "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "concat-stream": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", - "doctrine": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", - "escope": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "espree": "https://registry.npmjs.org/espree/-/espree-3.4.2.tgz", - "esquery": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", - "estraverse": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "file-entry-cache": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "globals": "https://registry.npmjs.org/globals/-/globals-9.16.0.tgz", - "ignore": "https://registry.npmjs.org/ignore/-/ignore-3.2.7.tgz", - "imurmurhash": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "inquirer": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", - "is-my-json-valid": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", - "is-resolvable": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", - "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", - "json-stable-stringify": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "levn": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "natural-compare": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "optionator": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "path-is-inside": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "pluralize": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", - "progress": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "require-uncached": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "shelljs": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.7.tgz", - "strip-bom": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "strip-json-comments": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "table": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", - "text-table": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "user-home": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz" + "babel-code-frame": "6.26.0", + "chalk": "1.1.3", + "concat-stream": "1.5.2", + "debug": "2.6.8", + "doctrine": "2.0.0", + "escope": "3.6.0", + "espree": "3.5.0", + "esquery": "1.0.0", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "glob": "7.1.2", + "globals": "9.18.0", + "ignore": "3.3.5", + "imurmurhash": "0.1.4", + "inquirer": "0.12.0", + "is-my-json-valid": "2.16.1", + "is-resolvable": "1.0.0", + "js-yaml": "3.9.1", + "json-stable-stringify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "1.2.1", + "progress": "1.1.8", + "require-uncached": "1.0.3", + "shelljs": "0.7.8", + "strip-bom": "3.0.0", + "strip-json-comments": "2.0.1", + "table": "3.8.3", + "text-table": "0.2.0", + "user-home": "2.0.0" }, "dependencies": { "json-stable-stringify": { - "version": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "dev": true, "requires": { - "jsonify": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" + "jsonify": "0.0.0" } }, "user-home": { - "version": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", "dev": true, "requires": { - "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" + "os-homedir": "1.0.2" } } } }, "eslint-config-mourner": { - "version": "https://registry.npmjs.org/eslint-config-mourner/-/eslint-config-mourner-2.0.1.tgz", - "integrity": "sha1-hOAPRMo3Mki02Nh/w7uqOyp2mp0=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/eslint-config-mourner/-/eslint-config-mourner-2.0.2.tgz", + "integrity": "sha512-togtcP30k+0k5ipHOw9pv0MGUlyKPju6qGnFYtRt10iNxW1rv1PdppDN0dDKdk+sKCrDAIuZ9wdyTU322vQCrg==", "dev": true }, "espree": { - "version": "https://registry.npmjs.org/espree/-/espree-3.4.2.tgz", - "integrity": "sha1-ONve2+3JW4lhofvwRzSo9qnIxZI=", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.0.tgz", + "integrity": "sha1-mDWGJb3QVYYeon4oZ+pyn69GPY0=", "dev": true, "requires": { - "acorn": "https://registry.npmjs.org/acorn/-/acorn-5.0.3.tgz", - "acorn-jsx": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz" + "acorn": "5.1.1", + "acorn-jsx": "3.0.1" }, "dependencies": { "acorn": { - "version": "https://registry.npmjs.org/acorn/-/acorn-5.0.3.tgz", - "integrity": "sha1-xGDfCEkUY/AozLguqzcwvwEIez0=", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz", + "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==", "dev": true } } }, "esprima": { - "version": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, "esquery": { - "version": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", "dev": true, "requires": { - "estraverse": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz" + "estraverse": "4.2.0" } }, "esrecurse": { - "version": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.1.0.tgz", - "integrity": "sha1-RxO2U2rffyrE8yfVWed1a/9kgiA=", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", "dev": true, "requires": { - "estraverse": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" - }, - "dependencies": { - "estraverse": { - "version": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz", - "integrity": "sha1-9srKcokzqFDvkGYdDheYK6RxEaI=", - "dev": true - } + "estraverse": "4.2.0", + "object-assign": "4.1.1" } }, "estraverse": { - "version": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", "dev": true }, "esutils": { - "version": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, "event-emitter": { - "version": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", "dev": true, "requires": { - "d": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" - }, - "dependencies": { - "d": { - "version": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "dev": true, - "requires": { - "es5-ext": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz" - } - }, - "es5-ext": { - "version": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", - "integrity": "sha1-wzClk0we4hKEp8CBqG5f2TfJHqY=", - "dev": true, - "requires": { - "es6-iterator": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", - "es6-symbol": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz" - } - } + "d": "1.0.0", + "es5-ext": "0.10.30" } }, "event-stream": { - "version": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", "dev": true, "requires": { - "duplexer": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "from": "https://registry.npmjs.org/from/-/from-0.1.3.tgz", - "map-stream": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "pause-stream": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "split": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "stream-combiner": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "duplexer": "0.1.1", + "from": "0.1.7", + "map-stream": "0.1.0", + "pause-stream": "0.0.11", + "split": "0.3.3", + "stream-combiner": "0.0.4", + "through": "2.3.8" } }, "eventemitter3": { - "version": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", "integrity": "sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg=", "dev": true }, "events": { - "version": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", "dev": true }, "events-to-array": { - "version": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.0.2.tgz", - "integrity": "sha1-s0hEZVNP5P9m+90ag7d3cTukBKo=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.1.2.tgz", + "integrity": "sha1-LUH1Y+H+QA7Uli/hpNXGp1Od9/Y=", "dev": true }, - "eventsource": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-0.1.6.tgz", - "integrity": "sha1-Cs7ehJ7X3RzMMsgRuxG5RNTykjI=", - "dev": true, - "requires": { - "original": "1.0.0" - } - }, "evp_bytestokey": { - "version": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz", - "integrity": "sha1-SXtmrZ/vZc18CKYYCCS6FHa2blM=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.2.tgz", + "integrity": "sha512-ni0r0lrm7AOzsh2qC5mi9sj8S0gmj5fLNjfFpxN05FB4tAVZEKotbkjOtLPqTCX/CXT7NsUr6juZb4IFJeNNdA==", "dev": true, "requires": { - "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz" + "md5.js": "1.3.4", + "safe-buffer": "5.1.1" } }, "exit-hook": { - "version": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", "dev": true }, "expand-brackets": { - "version": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "dev": true, "requires": { - "is-posix-bracket": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz" + "is-posix-bracket": "0.1.1" } }, "expand-range": { - "version": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "dev": true, "requires": { - "fill-range": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" + "fill-range": "2.2.3" } }, "extend": { - "version": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "integrity": "sha1-WkdDU7nzNT3dgXbf03uRyDpG8dQ=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", "dev": true }, "extglob": { - "version": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "dev": true, "requires": { - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + "is-extglob": "1.0.0" } }, "extsprintf": { - "version": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", - "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", "dev": true }, "fast-levenshtein": { - "version": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, "faye-websocket": { - "version": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.4.4.tgz", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.4.4.tgz", "integrity": "sha1-wUxbO/FNdBf/v9mQwKdJXNnzN7w=", "dev": true }, "figures": { - "version": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "dev": true, "requires": { - "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" } }, "file-entry-cache": { - "version": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { - "flat-cache": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + "flat-cache": "1.2.2", + "object-assign": "4.1.1" } }, "filename-regex": { - "version": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz", - "integrity": "sha1-mW4+gEebmLmJfxWopYs9CE6SZ3U=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", "dev": true }, "fill-range": { - "version": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", "dev": true, "requires": { - "is-number": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "isobject": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "randomatic": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.6.tgz", - "repeat-element": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "repeat-string": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" } }, "firefox-launch": { - "version": "https://registry.npmjs.org/firefox-launch/-/firefox-launch-1.0.2.tgz", - "integrity": "sha1-hE5tdiIAY4flikGcAzPDC0iYaCc=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/firefox-launch/-/firefox-launch-1.1.0.tgz", + "integrity": "sha1-c24XocOtsvDSeBdVpKDqSHBUnJU=", "dev": true, "requires": { - "firefox-location": "https://registry.npmjs.org/firefox-location/-/firefox-location-1.0.2.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "quick-tmp": "https://registry.npmjs.org/quick-tmp/-/quick-tmp-0.0.0.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", - "shallow-copy": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz" + "firefox-location": "1.0.2", + "mkdirp": "0.5.1", + "quick-tmp": "0.0.0", + "rimraf": "2.6.1", + "shallow-copy": "0.0.1" } }, "firefox-location": { - "version": "https://registry.npmjs.org/firefox-location/-/firefox-location-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/firefox-location/-/firefox-location-1.0.2.tgz", "integrity": "sha1-S+5a+TewR5Qf8glkTK/479MrK0c=", "dev": true, "requires": { - "userhome": "https://registry.npmjs.org/userhome/-/userhome-1.0.0.tgz", - "which": "https://registry.npmjs.org/which/-/which-1.2.12.tgz" + "userhome": "1.0.0", + "which": "1.3.0" } }, "first-match": { - "version": "https://registry.npmjs.org/first-match/-/first-match-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/first-match/-/first-match-0.0.1.tgz", "integrity": "sha1-pg7GQnAPD0NyNOu37D84JHblQv0=", "dev": true }, "flat-cache": { - "version": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", "dev": true, "requires": { - "circular-json": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.1.tgz", - "del": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "write": "https://registry.npmjs.org/write/-/write-0.2.1.tgz" + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" } }, "for-each": { - "version": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", "dev": true, "requires": { - "is-function": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz" + "is-function": "1.0.1" } }, "for-in": { - "version": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, "for-own": { - "version": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", "dev": true, "requires": { - "for-in": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" + "for-in": "1.0.2" } }, "foreach": { - "version": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", "dev": true }, "foreground-child": { - "version": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", "dev": true, "requires": { - "cross-spawn": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", - "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz" + "cross-spawn": "4.0.2", + "signal-exit": "3.0.2" } }, "forever-agent": { - "version": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", "dev": true }, "form-data": { - "version": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", - "integrity": "sha1-icNTQAi5fq2ky7FX1Y9vXfAl6uQ=", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", "dev": true, "requires": { - "asynckit": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz" + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.16" } }, + "formidable": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.1.1.tgz", + "integrity": "sha1-lriIb3w8NQi5Mta9cMTTqI818ak=", + "dev": true + }, "from": { - "version": "https://registry.npmjs.org/from/-/from-0.1.3.tgz", - "integrity": "sha1-72OsIGKsMqz3hi4NQLRLiW8i87w=", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", "dev": true }, "fs-readdir-recursive": { - "version": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz", "integrity": "sha1-jNF0XItPiinIyuw5JHaSG6GV9WA=", "dev": true }, "fs.realpath": { - "version": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, "fsevents": { - "version": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.1.tgz", - "integrity": "sha1-8Z/Sj0Pur3YWgOUZogPE0LPTGv8=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", + "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", "dev": true, "optional": true, "requires": { - "nan": "https://registry.npmjs.org/nan/-/nan-2.5.1.tgz", - "node-pre-gyp": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz" + "nan": "2.7.0", + "node-pre-gyp": "0.6.36" }, "dependencies": { "abbrev": { - "version": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", - "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", + "version": "1.1.0", + "bundled": true, "dev": true, "optional": true }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, "ansi-regex": { - "version": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "2.1.1", + "bundled": true, "dev": true }, - "ansi-styles": { - "version": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true, - "optional": true - }, "aproba": { - "version": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", - "integrity": "sha1-ldNgDwdxCqDpKYxyatXs8urLq6s=", + "version": "1.1.1", + "bundled": true, "dev": true, "optional": true }, "are-we-there-yet": { - "version": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz", - "integrity": "sha1-gORw6VoIR5T+GJkmLFZnxuiN4bM=", + "version": "1.1.4", + "bundled": true, "dev": true, "optional": true, "requires": { - "delegates": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz" + "delegates": "1.0.0", + "readable-stream": "2.2.9" } }, "asn1": { - "version": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "version": "0.2.3", + "bundled": true, "dev": true, "optional": true }, "assert-plus": { - "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "version": "0.2.0", + "bundled": true, "dev": true, "optional": true }, "asynckit": { - "version": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "version": "0.4.0", + "bundled": true, "dev": true, "optional": true }, "aws-sign2": { - "version": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "version": "0.6.0", + "bundled": true, "dev": true, "optional": true }, "aws4": { - "version": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "version": "1.6.0", + "bundled": true, "dev": true, "optional": true }, "balanced-match": { - "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "version": "0.4.2", + "bundled": true, "dev": true }, "bcrypt-pbkdf": { - "version": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "version": "1.0.1", + "bundled": true, "dev": true, "optional": true, "requires": { - "tweetnacl": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" + "tweetnacl": "0.14.5" } }, "block-stream": { - "version": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "version": "0.0.9", + "bundled": true, "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + "inherits": "2.0.3" } }, "boom": { - "version": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "version": "2.10.1", + "bundled": true, "dev": true, "requires": { - "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + "hoek": "2.16.3" } }, "brace-expansion": { - "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", - "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", + "version": "1.1.7", + "bundled": true, "dev": true, "requires": { - "balanced-match": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "0.4.2", + "concat-map": "0.0.1" } }, "buffer-shims": { - "version": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", + "version": "1.0.0", + "bundled": true, "dev": true }, "caseless": { - "version": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "version": "0.12.0", + "bundled": true, "dev": true, "optional": true }, - "chalk": { - "version": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "co": { + "version": "4.6.0", + "bundled": true, "dev": true, - "optional": true, - "requires": { - "ansi-styles": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "has-ansi": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "supports-color": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" - } + "optional": true }, "code-point-at": { - "version": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "version": "1.1.0", + "bundled": true, "dev": true }, "combined-stream": { - "version": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", - "dev": true, - "requires": { - "delayed-stream": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" - } - }, - "commander": { - "version": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "version": "1.0.5", + "bundled": true, "dev": true, - "optional": true, "requires": { - "graceful-readlink": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" + "delayed-stream": "1.0.0" } }, "concat-map": { - "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "version": "0.0.1", + "bundled": true, "dev": true }, "console-control-strings": { - "version": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "version": "1.1.0", + "bundled": true, "dev": true }, "core-util-is": { - "version": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "version": "1.0.2", + "bundled": true, "dev": true }, "cryptiles": { - "version": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "version": "2.0.5", + "bundled": true, "dev": true, "optional": true, "requires": { - "boom": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + "boom": "2.10.1" } }, "dashdash": { - "version": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "version": "1.14.1", + "bundled": true, "dev": true, "optional": true, "requires": { - "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + "assert-plus": "1.0.0" }, "dependencies": { "assert-plus": { - "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "version": "1.0.0", + "bundled": true, "dev": true, "optional": true } } }, "debug": { - "version": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "version": "2.6.8", + "bundled": true, "dev": true, "optional": true, "requires": { - "ms": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + "ms": "2.0.0" } }, "deep-extend": { - "version": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.1.tgz", - "integrity": "sha1-7+QRPQgIX05vlod1mBD4B0aeIlM=", + "version": "0.4.2", + "bundled": true, "dev": true, "optional": true }, "delayed-stream": { - "version": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "version": "1.0.0", + "bundled": true, "dev": true }, "delegates": { - "version": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "version": "1.0.0", + "bundled": true, "dev": true, "optional": true }, "ecc-jsbn": { - "version": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "version": "0.1.1", + "bundled": true, "dev": true, "optional": true, "requires": { - "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" + "jsbn": "0.1.1" } }, - "escape-string-regexp": { - "version": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "optional": true - }, "extend": { - "version": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "integrity": "sha1-WkdDU7nzNT3dgXbf03uRyDpG8dQ=", + "version": "3.0.1", + "bundled": true, "dev": true, "optional": true }, "extsprintf": { - "version": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", - "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", + "version": "1.0.2", + "bundled": true, "dev": true }, "forever-agent": { - "version": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "version": "0.6.1", + "bundled": true, "dev": true, "optional": true }, "form-data": { - "version": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", - "integrity": "sha1-icNTQAi5fq2ky7FX1Y9vXfAl6uQ=", + "version": "2.1.4", + "bundled": true, "dev": true, "optional": true, "requires": { - "asynckit": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz" + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" } }, "fs.realpath": { - "version": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "version": "1.0.0", + "bundled": true, "dev": true }, "fstream": { - "version": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz", - "integrity": "sha1-YE6Kkv4m/9n2+uMDmdSYThqyKCI=", + "version": "1.0.11", + "bundled": true, "dev": true, "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz" + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" } }, "fstream-ignore": { - "version": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", - "integrity": "sha1-nDHa40dnAY/h0kmyTa2mfQktoQU=", + "version": "1.0.5", + "bundled": true, "dev": true, "optional": true, "requires": { - "fstream": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" } }, "gauge": { - "version": "https://registry.npmjs.org/gauge/-/gauge-2.7.3.tgz", - "integrity": "sha1-HCOFX5YvF7OtPQ3HRD8wRULt/gk=", + "version": "2.7.4", + "bundled": true, "dev": true, "optional": true, "requires": { - "aproba": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", - "console-control-strings": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "has-unicode": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "wide-align": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz" - } - }, - "generate-function": { - "version": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", - "dev": true, - "optional": true - }, - "generate-object-property": { - "version": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", - "dev": true, - "optional": true, - "requires": { - "is-property": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" } }, "getpass": { - "version": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", - "integrity": "sha1-KD/9n8ElaECHUxHBtg6MQBhxEOY=", + "version": "0.1.7", + "bundled": true, "dev": true, "optional": true, "requires": { - "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + "assert-plus": "1.0.0" }, "dependencies": { "assert-plus": { - "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "version": "1.0.0", + "bundled": true, "dev": true, "optional": true } } }, "glob": { - "version": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "version": "7.1.2", + "bundled": true, "dev": true, "requires": { - "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, "graceful-fs": { - "version": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "version": "4.1.11", + "bundled": true, "dev": true }, - "graceful-readlink": { - "version": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "har-schema": { + "version": "1.0.5", + "bundled": true, "dev": true, "optional": true }, "har-validator": { - "version": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", - "dev": true, - "optional": true, - "requires": { - "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "commander": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "is-my-json-valid": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz", - "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" - } - }, - "has-ansi": { - "version": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "version": "4.2.1", + "bundled": true, "dev": true, "optional": true, "requires": { - "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + "ajv": "4.11.8", + "har-schema": "1.0.5" } }, "has-unicode": { - "version": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "version": "2.0.1", + "bundled": true, "dev": true, "optional": true }, "hawk": { - "version": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "version": "3.1.3", + "bundled": true, "dev": true, "optional": true, "requires": { - "boom": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "cryptiles": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "sntp": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" } }, "hoek": { - "version": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "version": "2.16.3", + "bundled": true, "dev": true }, "http-signature": { - "version": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "version": "1.1.1", + "bundled": true, "dev": true, "optional": true, "requires": { - "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "jsprim": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", - "sshpk": "https://registry.npmjs.org/sshpk/-/sshpk-1.10.2.tgz" + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" } }, "inflight": { - "version": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "version": "1.0.6", + "bundled": true, "dev": true, "requires": { - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "once": "1.4.0", + "wrappy": "1.0.2" } }, "inherits": { - "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.3", + "bundled": true, "dev": true }, "ini": { - "version": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "version": "1.3.4", + "bundled": true, "dev": true, "optional": true }, "is-fullwidth-code-point": { - "version": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" - } - }, - "is-my-json-valid": { - "version": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz", - "integrity": "sha1-k27do8o8IR/ZjzstPgjaQ/eykVs=", + "version": "1.0.0", + "bundled": true, "dev": true, - "optional": true, "requires": { - "generate-function": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "generate-object-property": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "jsonpointer": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "number-is-nan": "1.0.1" } }, - "is-property": { - "version": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", - "dev": true, - "optional": true - }, "is-typedarray": { - "version": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "version": "1.0.0", + "bundled": true, "dev": true, "optional": true }, "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "version": "1.0.0", + "bundled": true, "dev": true }, "isstream": { - "version": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "version": "0.1.2", + "bundled": true, "dev": true, "optional": true }, "jodid25519": { - "version": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", - "integrity": "sha1-BtSRIlUJNBlHfUJWM2BuDpB4KWc=", + "version": "1.0.2", + "bundled": true, "dev": true, "optional": true, "requires": { - "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" + "jsbn": "0.1.1" } }, "jsbn": { - "version": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "version": "0.1.1", + "bundled": true, "dev": true, "optional": true }, "json-schema": { - "version": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "version": "0.2.3", + "bundled": true, "dev": true, "optional": true }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, "json-stringify-safe": { - "version": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "version": "5.0.1", + "bundled": true, "dev": true, "optional": true }, - "jsonpointer": { - "version": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "jsonify": { + "version": "0.0.0", + "bundled": true, "dev": true, "optional": true }, "jsprim": { - "version": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", - "integrity": "sha1-KnJW9wQSop7jZwqspiWZTE3P8lI=", + "version": "1.4.0", + "bundled": true, "dev": true, "optional": true, "requires": { - "extsprintf": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", - "json-schema": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "verror": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz" + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } } }, "mime-db": { - "version": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz", - "integrity": "sha1-6v/NDk/Gk1z4E02iRuLmw1MFrf8=", + "version": "1.27.0", + "bundled": true, "dev": true }, "mime-types": { - "version": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", - "integrity": "sha1-9+99l1g/yvO30oK2+LVnnaselO4=", + "version": "2.1.15", + "bundled": true, "dev": true, "requires": { - "mime-db": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz" + "mime-db": "1.27.0" } }, "minimatch": { - "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", + "version": "3.0.4", + "bundled": true, "dev": true, "requires": { - "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + "brace-expansion": "1.1.7" } }, "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "0.0.8", + "bundled": true, "dev": true }, "mkdirp": { - "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.1", + "bundled": true, "dev": true, "requires": { - "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "minimist": "0.0.8" } }, "ms": { - "version": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "version": "2.0.0", + "bundled": true, "dev": true, "optional": true }, "node-pre-gyp": { - "version": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz", - "integrity": "sha1-ZArFUZj2qSWXLgwWxKwmoDTV7Mk=", + "version": "0.6.36", + "bundled": true, "dev": true, "optional": true, "requires": { - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "nopt": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "npmlog": "https://registry.npmjs.org/npmlog/-/npmlog-4.0.2.tgz", - "rc": "https://registry.npmjs.org/rc/-/rc-1.1.7.tgz", - "request": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "semver": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "tar": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "tar-pack": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.3.0.tgz" + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" } }, "nopt": { - "version": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "version": "4.0.1", + "bundled": true, "dev": true, "optional": true, "requires": { - "abbrev": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz" + "abbrev": "1.1.0", + "osenv": "0.1.4" } }, "npmlog": { - "version": "https://registry.npmjs.org/npmlog/-/npmlog-4.0.2.tgz", - "integrity": "sha1-0DlQ4OeM4VJ7om0qdZLpNIrD518=", + "version": "4.1.0", + "bundled": true, "dev": true, "optional": true, "requires": { - "are-we-there-yet": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz", - "console-control-strings": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "gauge": "https://registry.npmjs.org/gauge/-/gauge-2.7.3.tgz", - "set-blocking": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" } }, "number-is-nan": { - "version": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "version": "1.0.1", + "bundled": true, "dev": true }, "oauth-sign": { - "version": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "version": "0.8.2", + "bundled": true, "dev": true, "optional": true }, "object-assign": { - "version": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "version": "4.1.1", + "bundled": true, "dev": true, "optional": true }, "once": { - "version": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "version": "1.4.0", + "bundled": true, "dev": true, "requires": { - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "wrappy": "1.0.2" } }, - "path-is-absolute": { - "version": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true }, - "pinkie": { - "version": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, "dev": true, "optional": true }, - "pinkie-promise": { - "version": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "osenv": { + "version": "0.1.4", + "bundled": true, "dev": true, "optional": true, "requires": { - "pinkie": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" } }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, "process-nextick-args": { - "version": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "version": "1.0.7", + "bundled": true, "dev": true }, "punycode": { - "version": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "version": "1.4.1", + "bundled": true, "dev": true, "optional": true }, "qs": { - "version": "https://registry.npmjs.org/qs/-/qs-6.3.1.tgz", - "integrity": "sha1-kYwLO802Z5dyuvE1say0wWUe150=", + "version": "6.4.0", + "bundled": true, "dev": true, "optional": true }, "rc": { - "version": "https://registry.npmjs.org/rc/-/rc-1.1.7.tgz", - "integrity": "sha1-xepWS7B6/5/TpbMukGwdOmWUD+o=", + "version": "1.2.1", + "bundled": true, "dev": true, "optional": true, "requires": { - "deep-extend": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.1.tgz", - "ini": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "strip-json-comments": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" }, "dependencies": { "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.0", + "bundled": true, "dev": true, "optional": true } } }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz", - "integrity": "sha1-qeb+w8fdqF+LsbO6cChgRVb8gl4=", + "version": "2.2.9", + "bundled": true, "dev": true, - "optional": true, "requires": { - "buffer-shims": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" } }, "request": { - "version": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", - "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "version": "2.81.0", + "bundled": true, "dev": true, "optional": true, "requires": { - "aws-sign2": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "aws4": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "caseless": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "extend": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "forever-agent": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "form-data": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", - "har-validator": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "hawk": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "http-signature": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "is-typedarray": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "isstream": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "json-stringify-safe": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", - "oauth-sign": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "qs": "https://registry.npmjs.org/qs/-/qs-6.3.1.tgz", - "stringstream": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "tough-cookie": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "tunnel-agent": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "uuid": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz" + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" } }, "rimraf": { - "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "integrity": "sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ=", + "version": "2.6.1", + "bundled": true, "dev": true, "requires": { - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz" + "glob": "7.1.2" } }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true, + "dev": true + }, "semver": { - "version": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "version": "5.3.0", + "bundled": true, "dev": true, "optional": true }, "set-blocking": { - "version": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "version": "2.0.0", + "bundled": true, "dev": true, "optional": true }, "signal-exit": { - "version": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.2", + "bundled": true, "dev": true, "optional": true }, "sntp": { - "version": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "version": "1.0.9", + "bundled": true, "dev": true, "optional": true, "requires": { - "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + "hoek": "2.16.3" } }, "sshpk": { - "version": "https://registry.npmjs.org/sshpk/-/sshpk-1.10.2.tgz", - "integrity": "sha1-1agEziJpVRVjjnmNviMnPeBwpfo=", + "version": "1.13.0", + "bundled": true, "dev": true, "optional": true, "requires": { - "asn1": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "bcrypt-pbkdf": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "dashdash": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "ecc-jsbn": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "getpass": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", - "jodid25519": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", - "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "tweetnacl": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" }, "dependencies": { "assert-plus": { - "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "version": "1.0.0", + "bundled": true, "dev": true, "optional": true } } }, "string_decoder": { - "version": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } }, "string-width": { - "version": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "1.0.2", + "bundled": true, "dev": true, "requires": { - "code-point-at": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "is-fullwidth-code-point": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" } }, "stringstream": { - "version": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "version": "0.0.5", + "bundled": true, "dev": true, "optional": true }, "strip-ansi": { - "version": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "3.0.1", + "bundled": true, "dev": true, "requires": { - "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + "ansi-regex": "2.1.1" } }, "strip-json-comments": { - "version": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, - "optional": true - }, - "supports-color": { - "version": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "version": "2.0.1", + "bundled": true, "dev": true, "optional": true }, "tar": { - "version": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "version": "2.2.1", + "bundled": true, "dev": true, "requires": { - "block-stream": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "fstream": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" } }, "tar-pack": { - "version": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.3.0.tgz", - "integrity": "sha1-MJMYFkGPVa/E0hd1r91nIM7kXa4=", + "version": "3.4.0", + "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "fstream": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz", - "fstream-ignore": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", - "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "tar": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "uid-number": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz" - }, - "dependencies": { - "once": { - "version": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", - "dev": true, - "optional": true, - "requires": { - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - } - }, - "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", - "integrity": "sha1-ZvqLcg4UOLNkaB8q0aY8YYRIydA=", - "dev": true, - "optional": true, - "requires": { - "buffer-shims": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - } - } + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" } }, "tough-cookie": { - "version": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "version": "2.3.2", + "bundled": true, "dev": true, "optional": true, "requires": { - "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz" + "punycode": "1.4.1" } }, "tunnel-agent": { - "version": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "version": "0.6.0", + "bundled": true, "dev": true, - "optional": true + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } }, "tweetnacl": { - "version": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "version": "0.14.5", + "bundled": true, "dev": true, "optional": true }, "uid-number": { - "version": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", - "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", + "version": "0.0.6", + "bundled": true, "dev": true, "optional": true }, "util-deprecate": { - "version": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "version": "1.0.2", + "bundled": true, "dev": true }, "uuid": { - "version": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", - "integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=", + "version": "3.0.1", + "bundled": true, "dev": true, "optional": true }, "verror": { - "version": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", - "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", + "version": "1.3.6", + "bundled": true, "dev": true, "optional": true, "requires": { - "extsprintf": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" + "extsprintf": "1.0.2" } }, "wide-align": { - "version": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz", - "integrity": "sha1-QO3egCpx/qHwcNo+YtzaLnrdlq0=", + "version": "1.1.2", + "bundled": true, "dev": true, "optional": true, "requires": { - "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" + "string-width": "1.0.2" } }, "wrappy": { - "version": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "version": "1.0.2", + "bundled": true, "dev": true - }, - "xtend": { - "version": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true, - "optional": true } } }, "function-bind": { - "version": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", - "integrity": "sha1-FhdnFMgBeY5Ojyz391KUZ7tKV3E=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "functional-red-black-tree": { - "version": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, "generate-function": { - "version": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", "dev": true }, "generate-object-property": { - "version": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", "dev": true, "requires": { - "is-property": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" + "is-property": "1.0.2" } }, "geojson-project": { - "version": "https://registry.npmjs.org/geojson-project/-/geojson-project-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/geojson-project/-/geojson-project-1.0.1.tgz", "integrity": "sha1-qpNGWGVYo2XETWaY/80L/FffRAY=", "dev": true }, "getpass": { - "version": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", - "integrity": "sha1-KD/9n8ElaECHUxHBtg6MQBhxEOY=", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "dev": true, "requires": { - "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + "assert-plus": "1.0.0" }, "dependencies": { "assert-plus": { - "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true } } }, "glob": { - "version": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, "glob-base": { - "version": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", "dev": true, "requires": { - "glob-parent": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + "glob-parent": "2.0.0", + "is-glob": "2.0.1" } }, "glob-parent": { - "version": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", "dev": true, "requires": { - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + "is-glob": "2.0.1" } }, "global": { - "version": "https://registry.npmjs.org/global/-/global-4.3.1.tgz", - "integrity": "sha1-X3V5CMfLq85U84auRA4R4mt5Ft8=", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", + "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", "dev": true, "requires": { - "min-document": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "process": "https://registry.npmjs.org/process/-/process-0.5.2.tgz" + "min-document": "2.19.0", + "process": "0.5.2" }, "dependencies": { "process": { - "version": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", "dev": true } } }, "globals": { - "version": "https://registry.npmjs.org/globals/-/globals-9.16.0.tgz", - "integrity": "sha1-Y+kDZYFx7C2fUbHTHeXiuNwB+4A=", + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, "globby": { - "version": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { - "array-union": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "arrify": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "pify": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" } }, "got": { - "version": "https://registry.npmjs.org/got/-/got-3.3.1.tgz", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/got/-/got-3.3.1.tgz", "integrity": "sha1-5dDtSvVfw+701WAHdp2YGSvLLso=", "dev": true, "requires": { - "duplexify": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", - "infinity-agent": "https://registry.npmjs.org/infinity-agent/-/infinity-agent-2.0.3.tgz", - "is-redirect": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "is-stream": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "lowercase-keys": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", - "nested-error-stacks": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "prepend-http": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "read-all-stream": "https://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz", - "timed-out": "https://registry.npmjs.org/timed-out/-/timed-out-2.0.0.tgz" + "duplexify": "3.5.1", + "infinity-agent": "2.0.3", + "is-redirect": "1.0.0", + "is-stream": "1.1.0", + "lowercase-keys": "1.0.0", + "nested-error-stacks": "1.0.2", + "object-assign": "3.0.0", + "prepend-http": "1.0.4", + "read-all-stream": "3.1.0", + "timed-out": "2.0.0" }, "dependencies": { "object-assign": { - "version": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", "dev": true } } }, "graceful-fs": { - "version": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, - "graceful-readlink": { - "version": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "har-schema": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", + "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", "dev": true }, + "har-validator": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", + "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", + "dev": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, "has": { - "version": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", "dev": true, "requires": { - "function-bind": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz" + "function-bind": "1.1.1" } }, "has-ansi": { - "version": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + "ansi-regex": "2.1.1" + } + }, + "hash-base": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", + "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "dev": true, + "requires": { + "inherits": "2.0.3" } }, "hash.js": { - "version": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz", - "integrity": "sha1-EzL/ABVsCg/92CNgE9B7d6BFFXM=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" } }, "hawk": { - "version": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", "dev": true, "requires": { - "boom": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "cryptiles": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "sntp": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" } }, "he": { - "version": "https://registry.npmjs.org/he/-/he-0.5.0.tgz", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/he/-/he-0.5.0.tgz", "integrity": "sha1-LAX/rvkLaOhg8/0rVO9YCYknfuI=", "dev": true }, "hmac-drbg": { - "version": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.0.tgz", - "integrity": "sha1-PbRx9FquSplKBogyIXH1G4uRvuU=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "dev": true, "requires": { - "hash.js": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz", - "minimalistic-assert": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", - "minimalistic-crypto-utils": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz" + "hash.js": "1.1.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" } }, "hoek": { - "version": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", "dev": true }, "home-or-tmp": { - "version": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", "dev": true, "requires": { - "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "os-tmpdir": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" } }, "htmlescape": { - "version": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", "dev": true }, "http-proxy": { - "version": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz", "integrity": "sha1-Bt/ykpUr9k2+hHH6nfcwZtTzd0I=", "dev": true, "requires": { - "eventemitter3": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", - "requires-port": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" + "eventemitter3": "1.2.0", + "requires-port": "1.0.0" } }, "http-server": { - "version": "https://registry.npmjs.org/http-server/-/http-server-0.9.0.tgz", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/http-server/-/http-server-0.9.0.tgz", "integrity": "sha1-jxsGvcczYY1NxCgxx7oa/04GABo=", "dev": true, "requires": { - "colors": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", - "corser": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", - "ecstatic": "https://registry.npmjs.org/ecstatic/-/ecstatic-1.4.1.tgz", - "http-proxy": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz", - "opener": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz", - "optimist": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "portfinder": "https://registry.npmjs.org/portfinder/-/portfinder-0.4.0.tgz", - "union": "https://registry.npmjs.org/union/-/union-0.4.6.tgz" - }, - "dependencies": { - "optimist": { - "version": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "wordwrap": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" - } - }, - "wordwrap": { - "version": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - } + "colors": "1.0.3", + "corser": "2.0.1", + "ecstatic": "1.4.1", + "http-proxy": "1.16.2", + "opener": "1.4.3", + "optimist": "0.6.1", + "portfinder": "0.4.0", + "union": "0.4.6" } }, "http-signature": { - "version": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", "dev": true, "requires": { - "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "jsprim": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", - "sshpk": "https://registry.npmjs.org/sshpk/-/sshpk-1.11.0.tgz" + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" } }, "https-browserify": { - "version": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", "dev": true }, "ieee754": { - "version": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", "dev": true }, "ignore": { - "version": "https://registry.npmjs.org/ignore/-/ignore-3.2.7.tgz", - "integrity": "sha1-SBDKXx2OylWVITo0uU8utO2Sa70=", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.5.tgz", + "integrity": "sha512-JLH93mL8amZQhh/p6mfQgVBH3M6epNq3DfsXsTSuSrInVjwyYlFE1nv2AgfRCC8PoOhM0jwQ5v8s9LgbK7yGDw==", "dev": true }, "ignore-by-default": { - "version": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, "imurmurhash": { - "version": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, "indexof": { - "version": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", "dev": true }, "infinity-agent": { - "version": "https://registry.npmjs.org/infinity-agent/-/infinity-agent-2.0.3.tgz", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/infinity-agent/-/infinity-agent-2.0.3.tgz", "integrity": "sha1-ReDi/3qesDCyfWK3SzdEt6esQhY=", "dev": true }, "inflight": { - "version": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "once": "1.4.0", + "wrappy": "1.0.2" } }, "inherits": { - "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "ini": { - "version": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", "dev": true }, "inline-source-map": { - "version": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", "dev": true, "requires": { - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + "source-map": "0.5.7" } }, "inquirer": { - "version": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", "dev": true, "requires": { - "ansi-escapes": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "cli-cursor": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "cli-width": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", - "figures": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "readline2": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", - "run-async": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", - "rx-lite": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", - "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "ansi-escapes": "1.4.0", + "ansi-regex": "2.1.1", + "chalk": "1.1.3", + "cli-cursor": "1.0.2", + "cli-width": "2.2.0", + "figures": "1.7.0", + "lodash": "4.17.4", + "readline2": "1.0.1", + "run-async": "0.1.0", + "rx-lite": "3.1.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "through": "2.3.8" } }, "insert-module-globals": { - "version": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.1.tgz", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.1.tgz", "integrity": "sha1-wDv04BywhtW15azorQr+eInWOMM=", "dev": true, "requires": { - "combine-source-map": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz", - "concat-stream": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "is-buffer": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz", - "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", - "lexical-scope": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", - "process": "https://registry.npmjs.org/process/-/process-0.11.9.tgz", - "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "combine-source-map": "0.7.2", + "concat-stream": "1.5.2", + "is-buffer": "1.1.5", + "JSONStream": "1.3.1", + "lexical-scope": "1.2.0", + "process": "0.11.10", + "through2": "2.0.3", + "xtend": "4.0.1" } }, "interpret": { - "version": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=", "dev": true }, "invariant": { - "version": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", "dev": true, "requires": { - "loose-envify": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz" + "loose-envify": "1.3.1" } }, "invert-kv": { - "version": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "dev": true }, "is-arrayish": { - "version": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, "is-binary-path": { - "version": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { - "binary-extensions": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz" + "binary-extensions": "1.10.0" } }, "is-buffer": { - "version": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz", - "integrity": "sha1-z8hszV3FpS+oBIkRHGkgxFfi2Ys=", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", + "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", "dev": true }, "is-callable": { - "version": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", "dev": true }, "is-date-object": { - "version": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", "dev": true }, "is-dom": { - "version": "https://registry.npmjs.org/is-dom/-/is-dom-1.0.9.tgz", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/is-dom/-/is-dom-1.0.9.tgz", "integrity": "sha1-SDgy1SlyBz3hK5/j9gMghw2oNw0=", "dev": true }, "is-dotfile": { - "version": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz", - "integrity": "sha1-LBMjg/ORmfjtwmjKAbmwB9IFzE0=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", "dev": true }, "is-equal-shallow": { - "version": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", "dev": true, "requires": { - "is-primitive": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + "is-primitive": "2.0.0" } }, "is-extendable": { - "version": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", "dev": true }, "is-extglob": { - "version": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", "dev": true }, "is-finite": { - "version": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "dev": true, "requires": { - "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" + "number-is-nan": "1.0.1" } }, "is-fullwidth-code-point": { - "version": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" + "number-is-nan": "1.0.1" } }, "is-function": { - "version": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", "dev": true }, "is-glob": { - "version": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, "requires": { - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + "is-extglob": "1.0.0" } }, "is-my-json-valid": { - "version": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", - "integrity": "sha1-8Hndm/2uZe4gOKrorLyGqxCeNpM=", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz", + "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", "dev": true, "requires": { - "generate-function": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "generate-object-property": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "jsonpointer": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "generate-function": "2.0.0", + "generate-object-property": "1.2.0", + "jsonpointer": "4.0.1", + "xtend": "4.0.1" } }, "is-npm": { - "version": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", "dev": true }, "is-number": { - "version": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", "dev": true, "requires": { - "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz" + "kind-of": "3.2.2" } }, "is-path-cwd": { - "version": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", "dev": true }, "is-path-in-cwd": { - "version": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", "dev": true, "requires": { - "is-path-inside": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz" + "is-path-inside": "1.0.0" } }, "is-path-inside": { - "version": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", "dev": true, "requires": { - "path-is-inside": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz" + "path-is-inside": "1.0.2" } }, "is-posix-bracket": { - "version": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", "dev": true }, "is-primitive": { - "version": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", "dev": true }, "is-property": { - "version": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", "dev": true }, "is-redirect": { - "version": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", "dev": true }, "is-regex": { - "version": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "dev": true, "requires": { - "has": "https://registry.npmjs.org/has/-/has-1.0.1.tgz" + "has": "1.0.1" } }, "is-resolvable": { - "version": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", "integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI=", "dev": true, "requires": { - "tryit": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz" + "tryit": "1.0.3" } }, "is-stream": { - "version": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, "is-symbol": { - "version": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", "dev": true }, "is-typedarray": { - "version": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "isexe": { - "version": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz", - "integrity": "sha1-NvPiLmB1CSD15yQaR2qMakInWtA=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "isobject": { - "version": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", "dev": true, "requires": { - "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + "isarray": "1.0.0" } }, "isstream": { - "version": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, - "jodid25519": { - "version": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", - "integrity": "sha1-BtSRIlUJNBlHfUJWM2BuDpB4KWc=", - "dev": true, - "optional": true, - "requires": { - "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" - } - }, "js-tokens": { - "version": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz", - "integrity": "sha1-COnxMkhKLEWjCQfp3E1VZ7fxFNc=", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, "js-yaml": { - "version": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", - "integrity": "sha1-AtPiwPa+qyAkjUEsNSIDgn14ZyE=", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.1.tgz", + "integrity": "sha512-CbcG379L1e+mWBnLvHWWeLs8GyV/EMw862uLI3c+GxVyDHWZcjZinwuBd3iW2pgxgIlksW/1vNJa4to+RvDOww==", "dev": true, "requires": { - "argparse": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", - "esprima": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz" + "argparse": "1.0.9", + "esprima": "4.0.0" } }, "jsbn": { - "version": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true, "optional": true }, "jsesc": { - "version": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", "dev": true }, "json-schema": { - "version": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", "dev": true }, "json-stable-stringify": { - "version": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", "dev": true, "requires": { - "jsonify": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" + "jsonify": "0.0.0" } }, "json-stringify-safe": { - "version": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, - "json3": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", - "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", - "dev": true - }, "json5": { - "version": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "dev": true }, "jsonify": { - "version": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", "dev": true }, "jsonparse": { - "version": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.0.tgz", - "integrity": "sha1-hfwkWx2SWazGlBlguQWt9k594Og=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "dev": true }, "jsonpointer": { - "version": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", "dev": true }, "JSONStream": { - "version": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", "dev": true, "requires": { - "jsonparse": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.0.tgz", - "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "jsonparse": "1.3.1", + "through": "2.3.8" } }, "jsprim": { - "version": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", - "integrity": "sha1-KnJW9wQSop7jZwqspiWZTE3P8lI=", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", "dev": true, "requires": { - "extsprintf": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", - "json-schema": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "verror": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz" + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } } }, "kind-of": { - "version": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz", - "integrity": "sha1-R11pil5J/15T0U4+cyQp3Iv0z0c=", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz" + "is-buffer": "1.1.5" } }, "labeled-stream-splicer": { - "version": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz", "integrity": "sha1-pS4dE4AkwAuGscDJH2d5GLiuClk=", "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "stream-splicer": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz" + "inherits": "2.0.3", + "isarray": "0.0.1", + "stream-splicer": "2.0.0" }, "dependencies": { "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true } } }, "latest-version": { - "version": "https://registry.npmjs.org/latest-version/-/latest-version-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-1.0.1.tgz", "integrity": "sha1-cs/Ebj6NG+ZR4eu1Tqn26pbzdLs=", "dev": true, "requires": { - "package-json": "https://registry.npmjs.org/package-json/-/package-json-1.2.0.tgz" + "package-json": "1.2.0" } }, "lazystream": { - "version": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz", "integrity": "sha1-GyXWPHcqTCDwpe0KnXf0hLbhaSA=", "dev": true, "requires": { - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + "readable-stream": "1.0.34" }, "dependencies": { "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true } } }, "lcid": { - "version": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { - "invert-kv": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz" + "invert-kv": "1.0.0" } }, "lcov-parse": { - "version": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", "dev": true }, "levn": { - "version": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "type-check": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" + "prelude-ls": "1.1.2", + "type-check": "0.3.2" } }, "lexical-scope": { - "version": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", "integrity": "sha1-/Ope3HBKSzqHls3KQZw6CvryLfQ=", "dev": true, "requires": { - "astw": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz" + "astw": "2.2.0" } }, "load-json-file": { - "version": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "parse-json": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "pify": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "strip-bom": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz" + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" } }, "localtunnel": { - "version": "https://registry.npmjs.org/localtunnel/-/localtunnel-1.8.2.tgz", - "integrity": "sha1-kTBR6DKLUfda2KIq0fXFuMWZo1k=", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-1.8.3.tgz", + "integrity": "sha1-3MWSL9hWUQN9S94k/ZMkjQsk6wU=", "dev": true, "requires": { - "debug": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "openurl": "https://registry.npmjs.org/openurl/-/openurl-1.1.0.tgz", - "request": "https://registry.npmjs.org/request/-/request-2.78.0.tgz", - "yargs": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz" - }, - "dependencies": { - "caseless": { - "version": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", - "dev": true - }, - "cliui": { - "version": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "requires": { - "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "wrap-ansi": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz" - } - }, - "debug": { - "version": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", - "dev": true, - "requires": { - "ms": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" - } - }, - "har-validator": { - "version": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", - "dev": true, - "requires": { - "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "commander": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "is-my-json-valid": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", - "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" - } - }, - "ms": { - "version": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", - "dev": true - }, - "qs": { - "version": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", - "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", - "dev": true - }, - "request": { - "version": "https://registry.npmjs.org/request/-/request-2.78.0.tgz", - "integrity": "sha1-4cjew0bhyBkjskrNszfxHeyr6cw=", - "dev": true, - "requires": { - "aws-sign2": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "aws4": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "caseless": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "extend": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "forever-agent": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "form-data": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", - "har-validator": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "hawk": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "http-signature": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "is-typedarray": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "isstream": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "json-stringify-safe": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", - "node-uuid": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", - "oauth-sign": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "qs": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", - "stringstream": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "tough-cookie": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "tunnel-agent": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz" - } - }, - "window-size": { - "version": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", - "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", - "dev": true - }, - "yargs": { - "version": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz", - "integrity": "sha1-GquWYOrnnYuPZ1vK7qtu40ws9pw=", - "dev": true, - "requires": { - "camelcase": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "cliui": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "decamelize": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "os-locale": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "window-size": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", - "y18n": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz" - } - } + "debug": "2.6.8", + "openurl": "1.1.1", + "request": "2.81.0", + "yargs": "3.29.0" } }, "lodash": { - "version": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", "dev": true }, "lodash._baseassign": { - "version": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", "dev": true, "requires": { - "lodash._basecopy": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "lodash.keys": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz" + "lodash._basecopy": "3.0.1", + "lodash.keys": "3.1.2" } }, "lodash._basecopy": { - "version": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", "dev": true }, "lodash._bindcallback": { - "version": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", "integrity": "sha1-5THCdkTPi1epnhftlbNcdIeJOS4=", "dev": true }, "lodash._createassigner": { - "version": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", "integrity": "sha1-g4pbri/aymOsIt7o4Z+k5taXCxE=", "dev": true, "requires": { - "lodash._bindcallback": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", - "lodash._isiterateecall": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "lodash.restparam": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz" + "lodash._bindcallback": "3.0.1", + "lodash._isiterateecall": "3.0.9", + "lodash.restparam": "3.6.1" } }, "lodash._getnative": { - "version": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", "dev": true }, "lodash._isiterateecall": { - "version": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", "dev": true }, "lodash.assign": { - "version": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", "integrity": "sha1-POnwI0tLIiPilrj6CsH+6OvKZPo=", "dev": true, "requires": { - "lodash._baseassign": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "lodash._createassigner": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", - "lodash.keys": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz" + "lodash._baseassign": "3.2.0", + "lodash._createassigner": "3.1.1", + "lodash.keys": "3.1.2" } }, "lodash.defaults": { - "version": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-3.1.2.tgz", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-3.1.2.tgz", "integrity": "sha1-xzCLGNv4vJNy1wGnNJPGEZK9Liw=", "dev": true, "requires": { - "lodash.assign": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", - "lodash.restparam": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz" + "lodash.assign": "3.2.0", + "lodash.restparam": "3.6.1" } }, "lodash.isarguments": { - "version": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", "dev": true }, "lodash.isarray": { - "version": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", "dev": true }, "lodash.keys": { - "version": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", "dev": true, "requires": { - "lodash._getnative": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "lodash.isarguments": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "lodash.isarray": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz" + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" } }, "lodash.memoize": { - "version": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", "dev": true }, "lodash.restparam": { - "version": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", "dev": true }, "log-driver": { - "version": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", "integrity": "sha1-euTsJXMC/XkNVXyxDJcQDYV7AFY=", "dev": true }, "loose-envify": { - "version": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", "dev": true, "requires": { - "js-tokens": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz" + "js-tokens": "3.0.2" } }, "lowercase-keys": { - "version": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", "dev": true }, "lru-cache": { - "version": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", - "integrity": "sha1-HRdnnAac2l0ECZGgnbwsDbN35V4=", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", "dev": true, "requires": { - "pseudomap": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "yallist": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz" + "pseudomap": "1.0.2", + "yallist": "2.1.2" } }, "map-stream": { - "version": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", "dev": true }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "dev": true, + "requires": { + "hash-base": "3.0.4", + "inherits": "2.0.3" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + } + } + }, "methods": { - "version": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", "dev": true }, "micromatch": { - "version": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "dev": true, "requires": { - "arr-diff": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "array-unique": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "braces": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "expand-brackets": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "extglob": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "filename-regex": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz", - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz", - "normalize-path": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz", - "object.omit": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "parse-glob": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "regex-cache": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz" + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.3" } }, "miller-rabin": { - "version": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.0.tgz", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.0.tgz", "integrity": "sha1-SmL7HUKTPAVYOYL0xxb2+55sbT0=", "dev": true, "requires": { - "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "brorand": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz" + "bn.js": "4.11.8", + "brorand": "1.1.0" } }, + "mime": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.0.tgz", + "integrity": "sha512-n9ChLv77+QQEapYz8lV+rIZAW3HhAPW2CXnzb1GN5uMkuczshwvkW7XPsbzU0ZQN3sP47Er2KVkp2p3KyqZKSQ==", + "dev": true + }, "mime-db": { - "version": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz", - "integrity": "sha1-6v/NDk/Gk1z4E02iRuLmw1MFrf8=", + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.29.0.tgz", + "integrity": "sha1-SNJtI1WJZRcErFkWygYAGRQmaHg=", "dev": true }, "mime-types": { - "version": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", - "integrity": "sha1-9+99l1g/yvO30oK2+LVnnaselO4=", + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz", + "integrity": "sha1-K4WKUuXs1RbbiXrCvodIeDBpjiM=", "dev": true, "requires": { - "mime-db": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz" + "mime-db": "1.29.0" } }, "min-document": { - "version": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", "dev": true, "requires": { - "dom-walk": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz" + "dom-walk": "0.1.1" } }, "minimalistic-assert": { - "version": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", "dev": true }, "minimalistic-crypto-utils": { - "version": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", "dev": true }, "minimatch": { - "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + "brace-expansion": "1.1.8" } }, "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mkdirp": { - "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { - "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "minimist": "0.0.8" } }, "module-deps": { - "version": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", "dev": true, "requires": { - "browser-resolve": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", - "cached-path-relative": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", - "concat-stream": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "detective": "https://registry.npmjs.org/detective/-/detective-4.5.0.tgz", - "duplexer2": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", - "parents": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", - "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.2.tgz", - "stream-combiner2": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "subarg": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "browser-resolve": "1.11.2", + "cached-path-relative": "1.0.1", + "concat-stream": "1.5.2", + "defined": "1.0.0", + "detective": "4.5.0", + "duplexer2": "0.1.4", + "inherits": "2.0.3", + "JSONStream": "1.3.1", + "parents": "1.0.1", + "readable-stream": "2.3.3", + "resolve": "1.4.0", + "stream-combiner2": "1.1.1", + "subarg": "1.0.0", + "through2": "2.0.3", + "xtend": "4.0.1" } }, "ms": { - "version": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", - "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, "mute-stream": { - "version": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", "dev": true }, "nan": { - "version": "https://registry.npmjs.org/nan/-/nan-2.5.1.tgz", - "integrity": "sha1-1bAWkSUzJql6K77p5hxV2NYDUeI=", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", + "integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=", "dev": true, "optional": true }, "natural-compare": { - "version": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, "nested-error-stacks": { - "version": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz", "integrity": "sha1-GfYZWRUZ8JZ2mlupqG5u7sgjw88=", "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + "inherits": "2.0.3" } }, "node-int64": { - "version": "https://registry.npmjs.org/node-int64/-/node-int64-0.3.3.tgz", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.3.3.tgz", "integrity": "sha1-LW5rLs5d6FiLQ9iNG8QbJs0fqE0=", "dev": true }, "node-uuid": { - "version": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", - "integrity": "sha1-baWhdmjEs91ZYjvaEc9/pMH2Cm8=", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.3.3.tgz", + "integrity": "sha1-09tNe1aBDZ5AMjQnZigq8HORcps=", "dev": true }, "nodemon": { - "version": "https://registry.npmjs.org/nodemon/-/nodemon-1.11.0.tgz", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.11.0.tgz", "integrity": "sha1-ImxWK9KnsT09dRi0mtSCijYj0Gw=", "dev": true, "requires": { - "chokidar": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", - "es6-promise": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", - "ignore-by-default": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "lodash.defaults": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-3.1.2.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "ps-tree": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", - "touch": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", - "undefsafe": "https://registry.npmjs.org/undefsafe/-/undefsafe-0.0.3.tgz", - "update-notifier": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.5.0.tgz" + "chokidar": "1.7.0", + "debug": "2.6.8", + "es6-promise": "3.3.1", + "ignore-by-default": "1.0.1", + "lodash.defaults": "3.1.2", + "minimatch": "3.0.4", + "ps-tree": "1.1.0", + "touch": "1.0.0", + "undefsafe": "0.0.3", + "update-notifier": "0.5.0" } }, "nopt": { - "version": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", "dev": true, "requires": { - "abbrev": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz" + "abbrev": "1.1.0" } }, "normalize-path": { - "version": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz", - "integrity": "sha1-R4hqwWYnYNQmG32XnSQXCdPOP3o=", - "dev": true + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } }, "number-is-nan": { - "version": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "nyc": { - "version": "https://registry.npmjs.org/nyc/-/nyc-7.1.0.tgz", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-7.1.0.tgz", "integrity": "sha1-jhSXHzoV0au+x6xhDvVMuInp/7Q=", "dev": true, "requires": { - "arrify": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "caching-transform": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", - "convert-source-map": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.3.0.tgz", - "default-require-extensions": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", - "find-cache-dir": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", - "find-up": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "foreground-child": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.3.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz", - "istanbul-lib-coverage": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0-alpha.4.tgz", - "istanbul-lib-hook": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.0.0-alpha.4.tgz", - "istanbul-lib-instrument": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.1.0-alpha.4.tgz", - "istanbul-lib-report": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.0.0-alpha.3.tgz", - "istanbul-lib-source-maps": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.0.0-alpha.10.tgz", - "istanbul-reports": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.0.0-alpha.8.tgz", - "md5-hex": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", - "micromatch": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "pkg-up": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", - "resolve-from": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz", - "spawn-wrap": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.2.4.tgz", - "test-exclude": "https://registry.npmjs.org/test-exclude/-/test-exclude-1.1.0.tgz", - "yargs": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "yargs-parser": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz" + "arrify": "1.0.1", + "caching-transform": "1.0.1", + "convert-source-map": "1.3.0", + "default-require-extensions": "1.0.0", + "find-cache-dir": "0.1.1", + "find-up": "1.1.2", + "foreground-child": "1.5.3", + "glob": "7.0.5", + "istanbul-lib-coverage": "1.0.0-alpha.4", + "istanbul-lib-hook": "1.0.0-alpha.4", + "istanbul-lib-instrument": "1.1.0-alpha.4", + "istanbul-lib-report": "1.0.0-alpha.3", + "istanbul-lib-source-maps": "1.0.0-alpha.10", + "istanbul-reports": "1.0.0-alpha.8", + "md5-hex": "1.3.0", + "micromatch": "2.3.11", + "mkdirp": "0.5.1", + "pkg-up": "1.0.0", + "resolve-from": "2.0.0", + "rimraf": "2.5.4", + "signal-exit": "3.0.0", + "spawn-wrap": "1.2.4", + "test-exclude": "1.1.0", + "yargs": "4.8.1", + "yargs-parser": "2.4.1" }, "dependencies": { "align-text": { - "version": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "version": "0.1.4", + "bundled": true, "dev": true, "requires": { - "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz", - "longest": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "repeat-string": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz" + "kind-of": "3.0.3", + "longest": "1.0.1", + "repeat-string": "1.5.4" } }, "amdefine": { - "version": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz", - "integrity": "sha1-/RdHRwDLXMnCtwnwvp0jzjwZjDM=", + "version": "1.0.0", + "bundled": true, "dev": true }, "ansi-regex": { - "version": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", - "integrity": "sha1-xQYbbg74qBd15Q9dZhUb9r83EQc=", + "version": "2.0.0", + "bundled": true, "dev": true }, "ansi-styles": { - "version": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "version": "2.2.1", + "bundled": true, "dev": true }, "append-transform": { - "version": "https://registry.npmjs.org/append-transform/-/append-transform-0.3.0.tgz", - "integrity": "sha1-1pM85KhfCURdnMxMwRkFG3OBqBM=", + "version": "0.3.0", + "bundled": true, "dev": true }, "arr-diff": { - "version": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "version": "2.0.0", + "bundled": true, "dev": true, "requires": { - "arr-flatten": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz" + "arr-flatten": "1.0.1" } }, "arr-flatten": { - "version": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz", - "integrity": "sha1-5f/lTUXhnzLyFukeuZyM6JK7YEs=", + "version": "1.0.1", + "bundled": true, "dev": true }, "array-unique": { - "version": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "version": "0.2.1", + "bundled": true, "dev": true }, "arrify": { - "version": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "version": "1.0.1", + "bundled": true, "dev": true }, "async": { - "version": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "version": "1.5.2", + "bundled": true, "dev": true }, "babel-code-frame": { - "version": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.11.0.tgz", - "integrity": "sha1-kHLdI1P7D4W2tX0sl/DRNNGIrtg=", + "version": "6.11.0", + "bundled": true, "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", - "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "js-tokens": "https://registry.npmjs.org/js-tokens/-/js-tokens-2.0.0.tgz" + "babel-runtime": "6.9.2", + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "2.0.0" } }, "babel-generator": { - "version": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.11.4.tgz", - "integrity": "sha1-FPaTOrsgxiZm0n47e59bncBxKpo=", + "version": "6.11.4", + "bundled": true, "dev": true, "requires": { - "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.8.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.11.1.tgz", - "detect-indent": "https://registry.npmjs.org/detect-indent/-/detect-indent-3.0.1.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz", - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + "babel-messages": "6.8.0", + "babel-runtime": "6.9.2", + "babel-types": "6.11.1", + "detect-indent": "3.0.1", + "lodash": "4.13.1", + "source-map": "0.5.6" } }, "babel-messages": { - "version": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.8.0.tgz", - "integrity": "sha1-v1BHNsqWfm1l7wrbWipflHyODrk=", + "version": "6.8.0", + "bundled": true, "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz" + "babel-runtime": "6.9.2" } }, "babel-runtime": { - "version": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", - "integrity": "sha1-1/45G8LMKbgIfB2bOYeJEun8/Vk=", + "version": "6.9.2", + "bundled": true, "dev": true, "requires": { - "core-js": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", - "regenerator-runtime": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.9.5.tgz" + "core-js": "2.4.1", + "regenerator-runtime": "0.9.5" } }, "babel-template": { - "version": "https://registry.npmjs.org/babel-template/-/babel-template-6.9.0.tgz", - "integrity": "sha1-lwkPz2vBVoW08FvmXAqUOKp+I+M=", + "version": "6.9.0", + "bundled": true, "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", - "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.11.4.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.11.1.tgz", - "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.8.4.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz" + "babel-runtime": "6.9.2", + "babel-traverse": "6.11.4", + "babel-types": "6.11.1", + "babylon": "6.8.4", + "lodash": "4.13.1" } }, "babel-traverse": { - "version": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.11.4.tgz", - "integrity": "sha1-On3vakwf6fWLWcmiK+gfYZ+Cl2w=", + "version": "6.11.4", + "bundled": true, "dev": true, "requires": { - "babel-code-frame": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.11.0.tgz", - "babel-messages": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.8.0.tgz", - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.11.1.tgz", - "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.8.4.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "globals": "https://registry.npmjs.org/globals/-/globals-8.18.0.tgz", - "invariant": "https://registry.npmjs.org/invariant/-/invariant-2.2.1.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz" + "babel-code-frame": "6.11.0", + "babel-messages": "6.8.0", + "babel-runtime": "6.9.2", + "babel-types": "6.11.1", + "babylon": "6.8.4", + "debug": "2.2.0", + "globals": "8.18.0", + "invariant": "2.2.1", + "lodash": "4.13.1" } }, "babel-types": { - "version": "https://registry.npmjs.org/babel-types/-/babel-types-6.11.1.tgz", - "integrity": "sha1-o981W6uQ3c9mMYZAcXzywVTmZIo=", + "version": "6.11.1", + "bundled": true, "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz", - "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.11.4.tgz", - "esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz", - "to-fast-properties": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.2.tgz" + "babel-runtime": "6.9.2", + "babel-traverse": "6.11.4", + "esutils": "2.0.2", + "lodash": "4.13.1", + "to-fast-properties": "1.0.2" } }, "babylon": { - "version": "https://registry.npmjs.org/babylon/-/babylon-6.8.4.tgz", - "integrity": "sha1-CXMGuNq66VFZIlzymz6lWRIFMYA=", + "version": "6.8.4", + "bundled": true, "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz" + "babel-runtime": "6.9.2" } }, "balanced-match": { - "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "version": "0.4.2", + "bundled": true, "dev": true }, "brace-expansion": { - "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", - "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", + "version": "1.1.6", + "bundled": true, "dev": true, "requires": { - "balanced-match": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "0.4.2", + "concat-map": "0.0.1" } }, "braces": { - "version": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "version": "1.8.5", + "bundled": true, "dev": true, "requires": { - "expand-range": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "preserve": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "repeat-element": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz" + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" } }, "builtin-modules": { - "version": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "version": "1.1.1", + "bundled": true, "dev": true }, "caching-transform": { - "version": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", - "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", + "version": "1.0.1", + "bundled": true, "dev": true, "requires": { - "md5-hex": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "write-file-atomic": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.4.tgz" + "md5-hex": "1.3.0", + "mkdirp": "0.5.1", + "write-file-atomic": "1.1.4" } }, "camelcase": { - "version": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "version": "1.2.1", + "bundled": true, "dev": true, "optional": true }, "center-align": { - "version": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "version": "0.1.3", + "bundled": true, "dev": true, "optional": true, "requires": { - "align-text": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "lazy-cache": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz" + "align-text": "0.1.4", + "lazy-cache": "1.0.4" } }, "chalk": { - "version": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "version": "1.1.3", + "bundled": true, "dev": true, "requires": { - "ansi-styles": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "has-ansi": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "supports-color": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" } }, "cliui": { - "version": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "version": "2.1.0", + "bundled": true, "dev": true, "optional": true, "requires": { - "center-align": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "right-align": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "wordwrap": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" }, "dependencies": { "wordwrap": { - "version": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "version": "0.0.2", + "bundled": true, "dev": true, "optional": true } } }, "code-point-at": { - "version": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", - "integrity": "sha1-9psZLT99keOC5Lcb3bd4eGGasMY=", + "version": "1.0.0", + "bundled": true, "dev": true, "requires": { - "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + "number-is-nan": "1.0.0" } }, "commondir": { - "version": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "version": "1.0.1", + "bundled": true, "dev": true }, "concat-map": { - "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "version": "0.0.1", + "bundled": true, "dev": true }, "convert-source-map": { - "version": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.3.0.tgz", - "integrity": "sha1-6fPpxuJyjvwmdmlqcOs4L3MQamc=", + "version": "1.3.0", + "bundled": true, "dev": true }, "core-js": { - "version": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", - "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=", + "version": "2.4.1", + "bundled": true, "dev": true }, "cross-spawn": { - "version": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.0.tgz", - "integrity": "sha1-glR3SrR4a4xbPPTfumbOVjkywlI=", + "version": "4.0.0", + "bundled": true, "dev": true, "requires": { - "lru-cache": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz", - "which": "https://registry.npmjs.org/which/-/which-1.2.10.tgz" + "lru-cache": "4.0.1", + "which": "1.2.10" } }, "debug": { - "version": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "version": "2.2.0", + "bundled": true, "dev": true, "requires": { - "ms": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + "ms": "0.7.1" } }, "decamelize": { - "version": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "version": "1.2.0", + "bundled": true, "dev": true }, "default-require-extensions": { - "version": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", - "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", + "version": "1.0.0", + "bundled": true, "dev": true, "requires": { - "strip-bom": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz" + "strip-bom": "2.0.0" } }, "detect-indent": { - "version": "https://registry.npmjs.org/detect-indent/-/detect-indent-3.0.1.tgz", - "integrity": "sha1-ncXl3bzu+DJXZLlFGwK8bVQIT3U=", + "version": "3.0.1", + "bundled": true, "dev": true, "requires": { - "get-stdin": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "repeating": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz" + "get-stdin": "4.0.1", + "minimist": "1.2.0", + "repeating": "1.1.3" }, "dependencies": { "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.0", + "bundled": true, "dev": true } } }, "error-ex": { - "version": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.0.tgz", - "integrity": "sha1-5ntD8+gsluo6WE/+4Ln8MyXYAtk=", + "version": "1.3.0", + "bundled": true, "dev": true, "requires": { - "is-arrayish": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" + "is-arrayish": "0.2.1" } }, "escape-string-regexp": { - "version": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "version": "1.0.5", + "bundled": true, "dev": true }, "esutils": { - "version": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "version": "2.0.2", + "bundled": true, "dev": true }, "expand-brackets": { - "version": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "version": "0.1.5", + "bundled": true, "dev": true, "requires": { - "is-posix-bracket": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz" + "is-posix-bracket": "0.1.1" } }, "expand-range": { - "version": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "version": "1.8.2", + "bundled": true, "dev": true, "requires": { - "fill-range": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" + "fill-range": "2.2.3" } }, "extglob": { - "version": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "version": "0.3.2", + "bundled": true, "dev": true, "requires": { - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + "is-extglob": "1.0.0" } }, "filename-regex": { - "version": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz", - "integrity": "sha1-mW4+gEebmLmJfxWopYs9CE6SZ3U=", + "version": "2.0.0", + "bundled": true, "dev": true }, "fill-range": { - "version": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "version": "2.2.3", + "bundled": true, "dev": true, "requires": { - "is-number": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "isobject": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "randomatic": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.5.tgz", - "repeat-element": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "repeat-string": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz" + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.5", + "repeat-element": "1.1.2", + "repeat-string": "1.5.4" } }, "find-cache-dir": { - "version": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", - "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", + "version": "0.1.1", + "bundled": true, "dev": true, "requires": { - "commondir": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "pkg-dir": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz" + "commondir": "1.0.1", + "mkdirp": "0.5.1", + "pkg-dir": "1.0.0" } }, "find-up": { - "version": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "version": "1.1.2", + "bundled": true, "dev": true, "requires": { - "path-exists": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" } }, "for-in": { - "version": "https://registry.npmjs.org/for-in/-/for-in-0.1.5.tgz", - "integrity": "sha1-AHN04rbVxnQgoUeb23WgSHK3OMQ=", + "version": "0.1.5", + "bundled": true, "dev": true }, "for-own": { - "version": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz", - "integrity": "sha1-AUm0GjkIjHUV9R6+HBOG1F+TUHI=", + "version": "0.1.4", + "bundled": true, "dev": true, "requires": { - "for-in": "https://registry.npmjs.org/for-in/-/for-in-0.1.5.tgz" + "for-in": "0.1.5" } }, "foreground-child": { - "version": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.3.tgz", - "integrity": "sha1-lN1qumcTiYZ96OV+mfHC7PsVwBo=", + "version": "1.5.3", + "bundled": true, "dev": true, "requires": { - "cross-spawn": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.0.tgz", - "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz" + "cross-spawn": "4.0.0", + "signal-exit": "3.0.0" } }, "fs.realpath": { - "version": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "version": "1.0.0", + "bundled": true, "dev": true }, "get-caller-file": { - "version": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.1.tgz", - "integrity": "sha1-qm/3uYobItwMizuQX6sytVL1rEE=", + "version": "1.0.1", + "bundled": true, "dev": true }, "get-stdin": { - "version": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "version": "4.0.1", + "bundled": true, "dev": true }, "glob": { - "version": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz", - "integrity": "sha1-tCAqaQmbu00pKnwblbZoK2fr3JU=", + "version": "7.0.5", + "bundled": true, "dev": true, "requires": { - "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", - "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + "fs.realpath": "1.0.0", + "inflight": "1.0.5", + "inherits": "2.0.1", + "minimatch": "3.0.2", + "once": "1.3.3", + "path-is-absolute": "1.0.0" } }, "glob-base": { - "version": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "version": "0.3.0", + "bundled": true, "dev": true, "requires": { - "glob-parent": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + "glob-parent": "2.0.0", + "is-glob": "2.0.1" } }, "glob-parent": { - "version": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "version": "2.0.0", + "bundled": true, "dev": true, "requires": { - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + "is-glob": "2.0.1" } }, "globals": { - "version": "https://registry.npmjs.org/globals/-/globals-8.18.0.tgz", - "integrity": "sha1-k9SmK9ysOM+vr8R9awNHaMsP/LQ=", + "version": "8.18.0", + "bundled": true, "dev": true }, "graceful-fs": { - "version": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz", - "integrity": "sha1-7widKIDwM7ARgjzlyPrnmNp3Xb0=", + "version": "4.1.4", + "bundled": true, "dev": true }, "handlebars": { - "version": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.5.tgz", - "integrity": "sha1-ksbta7FkEQxQ1NjQ+93HCAbG+Oc=", + "version": "4.0.5", + "bundled": true, "dev": true, "requires": { - "async": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "optimist": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "uglify-js": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.7.0.tgz" + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.7.0" }, "dependencies": { "source-map": { - "version": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "version": "0.4.4", + "bundled": true, "dev": true, "requires": { - "amdefine": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz" + "amdefine": "1.0.0" } } } }, "has-ansi": { - "version": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "version": "2.0.0", + "bundled": true, "dev": true, "requires": { - "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + "ansi-regex": "2.0.0" } }, "has-flag": { - "version": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "version": "1.0.0", + "bundled": true, "dev": true }, "hosted-git-info": { - "version": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.5.tgz", - "integrity": "sha1-C6gdkNouJas0ozLm7HeTbhWYEYs=", + "version": "2.1.5", + "bundled": true, "dev": true }, "imurmurhash": { - "version": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "version": "0.1.4", + "bundled": true, "dev": true }, "inflight": { - "version": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", - "integrity": "sha1-2zIEzVqd4ubNiQuFxuL2a89PYgo=", + "version": "1.0.5", + "bundled": true, "dev": true, "requires": { - "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "once": "1.3.3", + "wrappy": "1.0.2" } }, "inherits": { - "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "version": "2.0.1", + "bundled": true, "dev": true }, "invariant": { - "version": "https://registry.npmjs.org/invariant/-/invariant-2.2.1.tgz", - "integrity": "sha1-sJcBBUdmjH4zcCjr6Bbr42yKjVQ=", + "version": "2.2.1", + "bundled": true, "dev": true, "requires": { - "loose-envify": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.2.0.tgz" + "loose-envify": "1.2.0" } }, "invert-kv": { - "version": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "version": "1.0.0", + "bundled": true, "dev": true }, "is-arrayish": { - "version": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "version": "0.2.1", + "bundled": true, "dev": true }, "is-buffer": { - "version": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.3.tgz", - "integrity": "sha1-24l/w/esotUN6UtsjCiWpHcWJ68=", + "version": "1.1.3", + "bundled": true, "dev": true }, "is-builtin-module": { - "version": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "version": "1.0.0", + "bundled": true, "dev": true, "requires": { - "builtin-modules": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz" + "builtin-modules": "1.1.1" } }, "is-dotfile": { - "version": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz", - "integrity": "sha1-LBMjg/ORmfjtwmjKAbmwB9IFzE0=", + "version": "1.0.2", + "bundled": true, "dev": true }, "is-equal-shallow": { - "version": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "version": "0.1.3", + "bundled": true, "dev": true, "requires": { - "is-primitive": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + "is-primitive": "2.0.0" } }, "is-extendable": { - "version": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "version": "0.1.1", + "bundled": true, "dev": true }, "is-extglob": { - "version": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "version": "1.0.0", + "bundled": true, "dev": true }, "is-finite": { - "version": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.1.tgz", - "integrity": "sha1-ZDhgPq6+J5OUj/SkJi7I2z1iWXs=", + "version": "1.0.1", + "bundled": true, "dev": true, "requires": { - "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + "number-is-nan": "1.0.0" } }, "is-fullwidth-code-point": { - "version": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "version": "1.0.0", + "bundled": true, "dev": true, "requires": { - "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + "number-is-nan": "1.0.0" } }, "is-glob": { - "version": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "version": "2.0.1", + "bundled": true, "dev": true, "requires": { - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + "is-extglob": "1.0.0" } }, "is-number": { - "version": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "version": "2.1.0", + "bundled": true, "dev": true, "requires": { - "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz" + "kind-of": "3.0.3" } }, "is-posix-bracket": { - "version": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "version": "0.1.1", + "bundled": true, "dev": true }, "is-primitive": { - "version": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "version": "2.0.0", + "bundled": true, "dev": true }, "is-utf8": { - "version": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "version": "0.2.1", + "bundled": true, "dev": true }, "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "version": "1.0.0", + "bundled": true, "dev": true }, "isexe": { - "version": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz", - "integrity": "sha1-NvPiLmB1CSD15yQaR2qMakInWtA=", + "version": "1.1.2", + "bundled": true, "dev": true }, "isobject": { - "version": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "version": "2.1.0", + "bundled": true, "dev": true, "requires": { - "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + "isarray": "1.0.0" } }, "istanbul-lib-coverage": { - "version": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0-alpha.4.tgz", - "integrity": "sha1-Ym9/2c+Am2479+1CqAn44LZK6XY=", + "version": "1.0.0-alpha.4", + "bundled": true, "dev": true }, "istanbul-lib-hook": { - "version": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.0.0-alpha.4.tgz", - "integrity": "sha1-jFu59vvYUm4K5s9jmvKCZpBrk48=", + "version": "1.0.0-alpha.4", + "bundled": true, "dev": true, "requires": { - "append-transform": "https://registry.npmjs.org/append-transform/-/append-transform-0.3.0.tgz" + "append-transform": "0.3.0" } }, "istanbul-lib-instrument": { - "version": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.1.0-alpha.4.tgz", - "integrity": "sha1-d9mxE+n3YaqEmIM5ATpyA6zJitw=", + "version": "1.1.0-alpha.4", + "bundled": true, "dev": true, "requires": { - "babel-generator": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.11.4.tgz", - "babel-template": "https://registry.npmjs.org/babel-template/-/babel-template-6.9.0.tgz", - "babel-traverse": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.11.4.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.11.1.tgz", - "babylon": "https://registry.npmjs.org/babylon/-/babylon-6.8.4.tgz", - "istanbul-lib-coverage": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0-alpha.4.tgz" + "babel-generator": "6.11.4", + "babel-template": "6.9.0", + "babel-traverse": "6.11.4", + "babel-types": "6.11.1", + "babylon": "6.8.4", + "istanbul-lib-coverage": "1.0.0-alpha.4" } }, "istanbul-lib-report": { - "version": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.0.0-alpha.3.tgz", - "integrity": "sha1-MtX27H8zyjpgIgnieLLm/xQ0mK8=", + "version": "1.0.0-alpha.3", + "bundled": true, "dev": true, "requires": { - "async": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "istanbul-lib-coverage": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0-alpha.4.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "path-parse": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "supports-color": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz" + "async": "1.5.2", + "istanbul-lib-coverage": "1.0.0-alpha.4", + "mkdirp": "0.5.1", + "path-parse": "1.0.5", + "rimraf": "2.5.4", + "supports-color": "3.1.2" }, "dependencies": { "supports-color": { - "version": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", - "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "version": "3.1.2", + "bundled": true, "dev": true, "requires": { - "has-flag": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz" + "has-flag": "1.0.0" } } } }, "istanbul-lib-source-maps": { - "version": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.0.0-alpha.10.tgz", - "integrity": "sha1-mxWlyLWdG5EBviy33VTHA9hq3vE=", + "version": "1.0.0-alpha.10", + "bundled": true, "dev": true, "requires": { - "istanbul-lib-coverage": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0-alpha.4.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + "istanbul-lib-coverage": "1.0.0-alpha.4", + "mkdirp": "0.5.1", + "rimraf": "2.5.4", + "source-map": "0.5.6" } }, "istanbul-reports": { - "version": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.0.0-alpha.8.tgz", - "integrity": "sha1-CUgw9Mfz1ILkZqrIq9oklfmuRok=", + "version": "1.0.0-alpha.8", + "bundled": true, "dev": true, "requires": { - "handlebars": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.5.tgz" + "handlebars": "4.0.5" } }, "js-tokens": { - "version": "https://registry.npmjs.org/js-tokens/-/js-tokens-2.0.0.tgz", - "integrity": "sha1-eZA/VWPud4zBFi5tzxoAJ8l/nLU=", + "version": "2.0.0", + "bundled": true, "dev": true }, "kind-of": { - "version": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz", - "integrity": "sha1-xhYIdH2BWwNiVW2zJ2Nip6OK3tM=", + "version": "3.0.3", + "bundled": true, "dev": true, "requires": { - "is-buffer": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.3.tgz" + "is-buffer": "1.1.3" } }, "lazy-cache": { - "version": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "version": "1.0.4", + "bundled": true, "dev": true, "optional": true }, "lcid": { - "version": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "version": "1.0.0", + "bundled": true, "dev": true, "requires": { - "invert-kv": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz" + "invert-kv": "1.0.0" } }, "load-json-file": { - "version": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "version": "1.1.0", + "bundled": true, "dev": true, "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz", - "parse-json": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "pify": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "strip-bom": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz" + "graceful-fs": "4.1.4", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" } }, "lodash": { - "version": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz", - "integrity": "sha1-g+SxCRP0hJbU0W/sSlYK8u50S2g=", + "version": "4.13.1", + "bundled": true, "dev": true }, "lodash.assign": { - "version": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.0.9.tgz", - "integrity": "sha1-Cgcx2TWQ3dm6RYn61lqvbuCSF+M=", + "version": "4.0.9", + "bundled": true, "dev": true, "requires": { - "lodash.keys": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.0.7.tgz", - "lodash.rest": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz" + "lodash.keys": "4.0.7", + "lodash.rest": "4.0.3" } }, "lodash.keys": { - "version": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.0.7.tgz", - "integrity": "sha1-MOGzvZjlTWoGEZkYEmhba8R8tjs=", + "version": "4.0.7", + "bundled": true, "dev": true }, "lodash.rest": { - "version": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz", - "integrity": "sha1-TBwyxAAoCHJQ+r9w1C4BUVSPSMU=", + "version": "4.0.3", + "bundled": true, "dev": true }, "longest": { - "version": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "version": "1.0.1", + "bundled": true, "dev": true }, "loose-envify": { - "version": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.2.0.tgz", - "integrity": "sha1-aaZarT3lQs9O4PT+dOjjPHCcyw8=", + "version": "1.2.0", + "bundled": true, "dev": true, "requires": { - "js-tokens": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.3.tgz" + "js-tokens": "1.0.3" }, "dependencies": { "js-tokens": { - "version": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.3.tgz", - "integrity": "sha1-FOVutoyPGpLEPVn1AU7CncIPKuE=", + "version": "1.0.3", + "bundled": true, "dev": true } } }, "lru-cache": { - "version": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz", - "integrity": "sha1-E0OVXtry432bnn7nJB4nxLn7cr4=", + "version": "4.0.1", + "bundled": true, "dev": true, "requires": { - "pseudomap": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "yallist": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz" + "pseudomap": "1.0.2", + "yallist": "2.0.0" } }, "md5-hex": { - "version": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", - "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", + "version": "1.3.0", + "bundled": true, "dev": true, "requires": { - "md5-o-matic": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz" + "md5-o-matic": "0.1.1" } }, "md5-o-matic": { - "version": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", - "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", + "version": "0.1.1", + "bundled": true, "dev": true }, "micromatch": { - "version": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "version": "2.3.11", + "bundled": true, "dev": true, "requires": { - "arr-diff": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "array-unique": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "braces": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "expand-brackets": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "extglob": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "filename-regex": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz", - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz", - "normalize-path": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz", - "object.omit": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.0.tgz", - "parse-glob": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "regex-cache": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz" + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.0", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.0.3", + "normalize-path": "2.0.1", + "object.omit": "2.0.0", + "parse-glob": "3.0.4", + "regex-cache": "0.4.3" } }, "minimatch": { - "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", - "integrity": "sha1-DzmKcwDqRB6cNIyD2Yq4ydv5xAo=", + "version": "3.0.2", + "bundled": true, "dev": true, "requires": { - "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + "brace-expansion": "1.1.6" } }, "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "0.0.8", + "bundled": true, "dev": true }, "mkdirp": { - "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.1", + "bundled": true, "dev": true, "requires": { - "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "minimist": "0.0.8" } }, "ms": { - "version": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "version": "0.7.1", + "bundled": true, "dev": true }, "normalize-package-data": { - "version": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz", - "integrity": "sha1-jZJPFClg4Xd+f/4XBUNjHMfLAt8=", + "version": "2.3.5", + "bundled": true, "dev": true, "requires": { - "hosted-git-info": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.5.tgz", - "is-builtin-module": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "semver": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "validate-npm-package-license": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz" + "hosted-git-info": "2.1.5", + "is-builtin-module": "1.0.0", + "semver": "5.3.0", + "validate-npm-package-license": "3.0.1" } }, "normalize-path": { - "version": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz", - "integrity": "sha1-R4hqwWYnYNQmG32XnSQXCdPOP3o=", + "version": "2.0.1", + "bundled": true, "dev": true }, "number-is-nan": { - "version": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", - "integrity": "sha1-wCD1KcUoKt/dIz2R1LGBw9aG3Es=", + "version": "1.0.0", + "bundled": true, "dev": true }, "object.omit": { - "version": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.0.tgz", - "integrity": "sha1-hoWXMz1U5gZilAu0WGBd1q4S/pQ=", + "version": "2.0.0", + "bundled": true, "dev": true, "requires": { - "for-own": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz", - "is-extendable": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + "for-own": "0.1.4", + "is-extendable": "0.1.1" } }, "once": { - "version": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "version": "1.3.3", + "bundled": true, "dev": true, "requires": { - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "wrappy": "1.0.2" } }, "optimist": { - "version": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "version": "0.6.1", + "bundled": true, "dev": true, "requires": { - "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "wordwrap": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" + "minimist": "0.0.8", + "wordwrap": "0.0.3" } }, "os-homedir": { - "version": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", - "integrity": "sha1-DWK99EuRb9O73PLKsZGUj7CU8Ac=", + "version": "1.0.1", + "bundled": true, "dev": true }, "os-locale": { - "version": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "version": "1.4.0", + "bundled": true, "dev": true, "requires": { - "lcid": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz" + "lcid": "1.0.0" } }, "parse-glob": { - "version": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "version": "3.0.4", + "bundled": true, "dev": true, "requires": { - "glob-base": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "is-dotfile": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz", - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + "glob-base": "0.3.0", + "is-dotfile": "1.0.2", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" } }, "parse-json": { - "version": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "version": "2.2.0", + "bundled": true, "dev": true, "requires": { - "error-ex": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.0.tgz" + "error-ex": "1.3.0" } }, "path-exists": { - "version": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "version": "2.1.0", + "bundled": true, "dev": true, "requires": { - "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + "pinkie-promise": "2.0.1" } }, "path-is-absolute": { - "version": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "integrity": "sha1-Jj2tpmqz8vsQv3+dJN2PPlcO+RI=", + "version": "1.0.0", + "bundled": true, "dev": true }, "path-parse": { - "version": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "version": "1.0.5", + "bundled": true, "dev": true }, "path-type": { - "version": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "version": "1.1.0", + "bundled": true, "dev": true, "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz", - "pify": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + "graceful-fs": "4.1.4", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" } }, "pify": { - "version": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "version": "2.3.0", + "bundled": true, "dev": true }, "pinkie": { - "version": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "version": "2.0.4", + "bundled": true, "dev": true }, "pinkie-promise": { - "version": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "version": "2.0.1", + "bundled": true, "dev": true, "requires": { - "pinkie": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + "pinkie": "2.0.4" } }, "pkg-dir": { - "version": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", - "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "version": "1.0.0", + "bundled": true, "dev": true, "requires": { - "find-up": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz" + "find-up": "1.1.2" } }, "pkg-up": { - "version": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", - "integrity": "sha1-Pgj7RhUlxEIWJKM7n35tCvWwWiY=", + "version": "1.0.0", + "bundled": true, "dev": true, "requires": { - "find-up": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz" + "find-up": "1.1.2" } }, "preserve": { - "version": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "version": "0.2.0", + "bundled": true, "dev": true }, "pseudomap": { - "version": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "version": "1.0.2", + "bundled": true, "dev": true }, "randomatic": { - "version": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.5.tgz", - "integrity": "sha1-Xp718tVzxnvSuBJK6QtRVuRXhAs=", + "version": "1.1.5", + "bundled": true, "dev": true, "requires": { - "is-number": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz" + "is-number": "2.1.0", + "kind-of": "3.0.3" } }, "read-pkg": { - "version": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "version": "1.1.0", + "bundled": true, "dev": true, "requires": { - "load-json-file": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "normalize-package-data": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz", - "path-type": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz" + "load-json-file": "1.1.0", + "normalize-package-data": "2.3.5", + "path-type": "1.1.0" } }, "read-pkg-up": { - "version": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "version": "1.0.1", + "bundled": true, "dev": true, "requires": { - "find-up": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "read-pkg": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz" + "find-up": "1.1.2", + "read-pkg": "1.1.0" } }, "regenerator-runtime": { - "version": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.9.5.tgz", - "integrity": "sha1-QD1tQKS9/5wzDdk5Lcuy2ai7ofw=", + "version": "0.9.5", + "bundled": true, "dev": true }, "regex-cache": { - "version": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", - "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", + "version": "0.4.3", + "bundled": true, "dev": true, "requires": { - "is-equal-shallow": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "is-primitive": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + "is-equal-shallow": "0.1.3", + "is-primitive": "2.0.0" } }, "repeat-element": { - "version": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "version": "1.1.2", + "bundled": true, "dev": true }, "repeat-string": { - "version": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz", - "integrity": "sha1-ZOwMkeD0tHX5DVtkNlHj5uW2wtU=", + "version": "1.5.4", + "bundled": true, "dev": true }, "repeating": { - "version": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", - "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=", + "version": "1.1.3", + "bundled": true, "dev": true, "requires": { - "is-finite": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.1.tgz" + "is-finite": "1.0.1" } }, "require-directory": { - "version": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "version": "2.1.1", + "bundled": true, "dev": true }, "require-main-filename": { - "version": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "version": "1.0.1", + "bundled": true, "dev": true }, "resolve-from": { - "version": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", - "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=", + "version": "2.0.0", + "bundled": true, "dev": true }, "right-align": { - "version": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "version": "0.1.3", + "bundled": true, "dev": true, "optional": true, "requires": { - "align-text": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz" + "align-text": "0.1.4" } }, "rimraf": { - "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "integrity": "sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ=", + "version": "2.5.4", + "bundled": true, "dev": true, "requires": { - "glob": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz" + "glob": "7.0.5" } }, "semver": { - "version": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "version": "5.3.0", + "bundled": true, "dev": true }, "set-blocking": { - "version": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "version": "2.0.0", + "bundled": true, "dev": true }, "signal-exit": { - "version": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz", - "integrity": "sha1-PAVDtl17T7xgts2UWT2b9DZzm+g=", + "version": "3.0.0", + "bundled": true, "dev": true }, "slide": { - "version": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "version": "1.1.6", + "bundled": true, "dev": true }, "source-map": { - "version": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", + "version": "0.5.6", + "bundled": true, "dev": true }, "spawn-wrap": { - "version": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.2.4.tgz", - "integrity": "sha1-kg6yEadpwJPuv71bDnpdLmirLkA=", + "version": "1.2.4", + "bundled": true, "dev": true, "requires": { - "foreground-child": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.3.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-2.1.2.tgz", - "which": "https://registry.npmjs.org/which/-/which-1.2.10.tgz" + "foreground-child": "1.5.3", + "mkdirp": "0.5.1", + "os-homedir": "1.0.1", + "rimraf": "2.5.4", + "signal-exit": "2.1.2", + "which": "1.2.10" }, "dependencies": { "signal-exit": { - "version": "https://registry.npmjs.org/signal-exit/-/signal-exit-2.1.2.tgz", - "integrity": "sha1-N1h5sfkuvDszRIDQONxUam1VhWQ=", + "version": "2.1.2", + "bundled": true, "dev": true } } }, "spdx-correct": { - "version": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", - "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "version": "1.0.2", + "bundled": true, "dev": true, "requires": { - "spdx-license-ids": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.1.tgz" + "spdx-license-ids": "1.2.1" } }, "spdx-exceptions": { - "version": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.5.tgz", - "integrity": "sha1-nSGsTaS9tx0GD7dOWmdTHQMsu6Y=", + "version": "1.0.5", + "bundled": true, "dev": true }, "spdx-expression-parse": { - "version": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz", - "integrity": "sha1-1SsUtelnB3FECvIlvLVjEirEUvY=", + "version": "1.0.2", + "bundled": true, "dev": true, "requires": { - "spdx-exceptions": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.5.tgz", - "spdx-license-ids": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.1.tgz" + "spdx-exceptions": "1.0.5", + "spdx-license-ids": "1.2.1" } }, "spdx-license-ids": { - "version": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.1.tgz", - "integrity": "sha1-0H6hek0v2TUfnZTi/5zsdBgP6PM=", + "version": "1.2.1", + "bundled": true, "dev": true }, "string-width": { - "version": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", - "integrity": "sha1-ySEptvHX9SrPmvQkom44ZKBc6wo=", + "version": "1.0.1", + "bundled": true, "dev": true, "requires": { - "code-point-at": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", - "is-fullwidth-code-point": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "code-point-at": "1.0.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" } }, "strip-ansi": { - "version": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "3.0.1", + "bundled": true, "dev": true, "requires": { - "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + "ansi-regex": "2.0.0" } }, "strip-bom": { - "version": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "version": "2.0.0", + "bundled": true, "dev": true, "requires": { - "is-utf8": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz" + "is-utf8": "0.2.1" } }, "supports-color": { - "version": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "version": "2.0.0", + "bundled": true, "dev": true }, "test-exclude": { - "version": "https://registry.npmjs.org/test-exclude/-/test-exclude-1.1.0.tgz", - "integrity": "sha1-9d3XGJJ7Ev0C8nCgqpOc627qQVE=", + "version": "1.1.0", + "bundled": true, "dev": true, "requires": { - "arrify": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "lodash.assign": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.0.9.tgz", - "micromatch": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "read-pkg-up": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "require-main-filename": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz" + "arrify": "1.0.1", + "lodash.assign": "4.0.9", + "micromatch": "2.3.11", + "read-pkg-up": "1.0.1", + "require-main-filename": "1.0.1" } }, "to-fast-properties": { - "version": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.2.tgz", - "integrity": "sha1-8/XAw7pymafvmUJ+RGMyV63kMyA=", + "version": "1.0.2", + "bundled": true, "dev": true }, "uglify-js": { - "version": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.7.0.tgz", - "integrity": "sha1-8CHji6LKdAhg9b1caVwqgXNF8Ow=", + "version": "2.7.0", + "bundled": true, "dev": true, "optional": true, "requires": { - "async": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "uglify-to-browserify": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "yargs": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz" + "async": "0.2.10", + "source-map": "0.5.6", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" }, "dependencies": { "async": { - "version": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", - "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "version": "0.2.10", + "bundled": true, "dev": true, "optional": true }, "yargs": { - "version": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "version": "3.10.0", + "bundled": true, "dev": true, "optional": true, "requires": { - "camelcase": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "cliui": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "decamelize": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "window-size": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz" + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" } } } }, "uglify-to-browserify": { - "version": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "version": "1.0.2", + "bundled": true, "dev": true, "optional": true }, "validate-npm-package-license": { - "version": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", - "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "version": "3.0.1", + "bundled": true, "dev": true, "requires": { - "spdx-correct": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", - "spdx-expression-parse": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz" + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.2" } }, "which": { - "version": "https://registry.npmjs.org/which/-/which-1.2.10.tgz", - "integrity": "sha1-kc2b0HUTIkEbZZtA8FSyHelXqy0=", + "version": "1.2.10", + "bundled": true, "dev": true, "requires": { - "isexe": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz" + "isexe": "1.1.2" } }, "which-module": { - "version": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "version": "1.0.0", + "bundled": true, "dev": true }, "window-size": { - "version": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "version": "0.1.0", + "bundled": true, "dev": true, "optional": true }, "wordwrap": { - "version": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "version": "0.0.3", + "bundled": true, "dev": true }, "wrap-ansi": { - "version": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.0.0.tgz", - "integrity": "sha1-fTD4+HP5pbvDpk2ryNF34HGuQm8=", + "version": "2.0.0", + "bundled": true, "dev": true, "requires": { - "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz" + "string-width": "1.0.1" } }, "wrappy": { - "version": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "version": "1.0.2", + "bundled": true, "dev": true }, "write-file-atomic": { - "version": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.4.tgz", - "integrity": "sha1-sfUtwujcDjywTRh6JfdYo4qQyjs=", + "version": "1.1.4", + "bundled": true, "dev": true, "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz", - "imurmurhash": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "slide": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" + "graceful-fs": "4.1.4", + "imurmurhash": "0.1.4", + "slide": "1.1.6" } }, "y18n": { - "version": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "version": "3.2.1", + "bundled": true, "dev": true }, "yallist": { - "version": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz", - "integrity": "sha1-MGxUODXwnuGkyyO3vOmrNByRzdQ=", + "version": "2.0.0", + "bundled": true, "dev": true }, "yargs": { - "version": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", - "dev": true, - "requires": { - "cliui": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "decamelize": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "get-caller-file": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.1.tgz", - "lodash.assign": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.0.9.tgz", - "os-locale": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "read-pkg-up": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "require-directory": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "require-main-filename": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "set-blocking": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", - "which-module": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "window-size": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "y18n": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "yargs-parser": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz" + "version": "4.8.1", + "bundled": true, + "dev": true, + "requires": { + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.1", + "lodash.assign": "4.0.9", + "os-locale": "1.4.0", + "read-pkg-up": "1.0.1", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "1.0.1", + "which-module": "1.0.0", + "window-size": "0.2.0", + "y18n": "3.2.1", + "yargs-parser": "2.4.1" }, "dependencies": { "cliui": { - "version": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "version": "3.2.0", + "bundled": true, "dev": true, "requires": { - "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "wrap-ansi": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.0.0.tgz" + "string-width": "1.0.1", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.0.0" } }, "window-size": { - "version": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", + "version": "0.2.0", + "bundled": true, "dev": true } } }, "yargs-parser": { - "version": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "version": "2.4.1", + "bundled": true, "dev": true, "requires": { - "camelcase": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "lodash.assign": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.0.9.tgz" + "camelcase": "3.0.0", + "lodash.assign": "4.0.9" }, "dependencies": { "camelcase": { - "version": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "version": "3.0.0", + "bundled": true, "dev": true } } @@ -5936,1297 +6133,1542 @@ } }, "oauth-sign": { - "version": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", "dev": true }, "object-assign": { - "version": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, "object-inspect": { - "version": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.2.1.tgz", - "integrity": "sha1-O2Iibrj21EF1HH2PIqIP+ArJ3D8=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.3.0.tgz", + "integrity": "sha512-OHHnLgLNXpM++GnJRyyhbr2bwl3pPVm4YvaraHrRvDt/N3r+s/gDVHciA7EJBTkijKXj61ssgSAikq1fb0IBRg==", "dev": true }, "object-keys": { - "version": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", "dev": true }, "object.omit": { - "version": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", "dev": true, "requires": { - "for-own": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "is-extendable": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + "for-own": "0.1.5", + "is-extendable": "0.1.1" } }, "once": { - "version": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "wrappy": "1.0.2" } }, "onetime": { - "version": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", "dev": true }, "only-shallow": { - "version": "https://registry.npmjs.org/only-shallow/-/only-shallow-1.2.0.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/only-shallow/-/only-shallow-1.2.0.tgz", "integrity": "sha1-cc7O26kyS8BRiu8Q7AgNMkncJGU=", "dev": true }, "opener": { - "version": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz", "integrity": "sha1-XG2ixdflgx6P+jlklQ+NZnSskLg=", "dev": true }, "openurl": { - "version": "https://registry.npmjs.org/openurl/-/openurl-1.1.0.tgz", - "integrity": "sha1-4vIYnZmcBIIyAfCD8PGnzYkDGHo=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz", + "integrity": "sha1-OHW0sO96UsFW8NtB1GCduw+Us4c=", "dev": true }, - "optionator": { - "version": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "deep-is": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "fast-levenshtein": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "levn": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "prelude-ls": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "type-check": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "wordwrap": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" + "minimist": "0.0.8", + "wordwrap": "0.0.3" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } } }, - "original": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/original/-/original-1.0.0.tgz", - "integrity": "sha1-kUf5P6FpbQS+YeAb1QuurKZWvTs=", + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "url-parse": "1.0.5" - }, - "dependencies": { - "url-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.0.5.tgz", - "integrity": "sha1-CFSGBCKv3P7+tsllxmLUgAFpkns=", - "dev": true, - "requires": { - "querystringify": "0.0.4", - "requires-port": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" - } - } + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" } }, "os-browserify": { - "version": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", "integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=", "dev": true }, "os-homedir": { - "version": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, "os-locale": { - "version": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "dev": true, "requires": { - "lcid": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz" + "lcid": "1.0.0" } }, "os-tmpdir": { - "version": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, "osenv": { - "version": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", "dev": true, "requires": { - "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "os-tmpdir": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" } }, "outpipe": { - "version": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", "integrity": "sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I=", "dev": true, "requires": { - "shell-quote": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz" + "shell-quote": "1.6.1" } }, "output-file-sync": { - "version": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", "dev": true, "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + "graceful-fs": "4.1.11", + "mkdirp": "0.5.1", + "object-assign": "4.1.1" } }, "package-json": { - "version": "https://registry.npmjs.org/package-json/-/package-json-1.2.0.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-1.2.0.tgz", "integrity": "sha1-yOysCUInzfdqMWh07QXifMk5oOA=", "dev": true, "requires": { - "got": "https://registry.npmjs.org/got/-/got-3.3.1.tgz", - "registry-url": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz" + "got": "3.3.1", + "registry-url": "3.1.0" } }, "pako": { - "version": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", "dev": true }, "parents": { - "version": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", "dev": true, "requires": { - "path-platform": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz" + "path-platform": "0.11.15" } }, "parse-asn1": { - "version": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.0.0.tgz", - "integrity": "sha1-NQYPbVAV03Yox3D04JGgtaJ4vCM=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", + "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", "dev": true, "requires": { - "asn1.js": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz", - "browserify-aes": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", - "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", - "evp_bytestokey": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz", - "pbkdf2": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.9.tgz" + "asn1.js": "4.9.1", + "browserify-aes": "1.0.6", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.2", + "pbkdf2": "3.0.13" } }, "parse-glob": { - "version": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", "dev": true, "requires": { - "glob-base": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "is-dotfile": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz", - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" } }, "parse-headers": { - "version": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", "dev": true, "requires": { - "for-each": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", - "trim": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz" + "for-each": "0.3.2", + "trim": "0.0.1" } }, "parse-json": { - "version": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "error-ex": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz" + "error-ex": "1.3.1" } }, "path-browserify": { - "version": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", "dev": true }, "path-is-absolute": { - "version": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "path-is-inside": { - "version": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, "path-parse": { - "version": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", "dev": true }, "path-platform": { - "version": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", "dev": true }, "pause-stream": { - "version": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", "dev": true, "requires": { - "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "through": "2.3.8" } }, "pbkdf2": { - "version": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.9.tgz", - "integrity": "sha1-8sSyWmAAWLPDdzwIbDfbvuH/5pM=", + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.13.tgz", + "integrity": "sha512-+dCHxDH+djNtjgWmvVC/my3SYBAKpKNqKSjLkp+GtWWYe4XPE+e/PSD2aCanlEZZnqPk2uekTKNC/ccbwd2X2Q==", "dev": true, "requires": { - "create-hmac": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.4.tgz" + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.8" } }, + "performance-now": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", + "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", + "dev": true + }, "pify": { - "version": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "pinkie": { - "version": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { - "version": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + "pinkie": "2.0.4" } }, "pluralize": { - "version": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", "dev": true }, "portfinder": { - "version": "https://registry.npmjs.org/portfinder/-/portfinder-0.4.0.tgz", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-0.4.0.tgz", "integrity": "sha1-o/+t/6/k+5jgYBqF7aJ8J86Eyh4=", "dev": true, "requires": { - "async": "https://registry.npmjs.org/async/-/async-0.9.0.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" - }, - "dependencies": { - "async": { - "version": "https://registry.npmjs.org/async/-/async-0.9.0.tgz", - "integrity": "sha1-rDYTsdqb7RtHUQu0ZRuJMeRxRsc=", - "dev": true - } + "async": "0.9.0", + "mkdirp": "0.5.1" } }, "prelude-ls": { - "version": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, "prepend-http": { - "version": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", "dev": true }, "preserve": { - "version": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", "dev": true }, "private": { - "version": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=", "dev": true }, "process": { - "version": "https://registry.npmjs.org/process/-/process-0.11.9.tgz", - "integrity": "sha1-e9WtIapiU+fahoImTx4R0RwDGME=", + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", "dev": true }, "process-nextick-args": { - "version": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", "dev": true }, "progress": { - "version": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", "dev": true }, "ps-tree": { - "version": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=", "dev": true, "requires": { - "event-stream": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz" + "event-stream": "3.3.4" } }, "pseudomap": { - "version": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, "public-encrypt": { - "version": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", "dev": true, "requires": { - "bn.js": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "browserify-rsa": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "create-hash": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", - "parse-asn1": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.0.0.tgz", - "randombytes": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz" + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "parse-asn1": "5.1.0", + "randombytes": "2.0.5" } }, "punycode": { - "version": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true }, "q": { - "version": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", "dev": true }, + "qs": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", + "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=", + "dev": true + }, "querystring": { - "version": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", "dev": true }, "querystring-es3": { - "version": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, - "querystringify": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-0.0.4.tgz", - "integrity": "sha1-DPf4T5Rj/wrlHExLFC2VvjdyTZw=", - "dev": true - }, "quick-tmp": { - "version": "https://registry.npmjs.org/quick-tmp/-/quick-tmp-0.0.0.tgz", + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/quick-tmp/-/quick-tmp-0.0.0.tgz", "integrity": "sha1-QWXmYyDqBfnLzM874fj9X9sF998=", "dev": true, "requires": { - "first-match": "https://registry.npmjs.org/first-match/-/first-match-0.0.1.tgz", - "osenv": "https://registry.npmjs.org/osenv/-/osenv-0.0.3.tgz" + "first-match": "0.0.1", + "osenv": "0.0.3" }, "dependencies": { "osenv": { - "version": "https://registry.npmjs.org/osenv/-/osenv-0.0.3.tgz", + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.0.3.tgz", "integrity": "sha1-zWrY3bKQkVrZ4idlV2Al1BHynLY=", "dev": true } } }, "randomatic": { - "version": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.6.tgz", - "integrity": "sha1-EQ3Kv/OX6dz/fAeJzMCkmt8exbs=", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", "dev": true, "requires": { - "is-number": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz" + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.5" + } + } } }, "randombytes": { - "version": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz", - "integrity": "sha1-Z0yZdgkBw8QRJ3GjHlIdw0nMCew=", - "dev": true + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.5.tgz", + "integrity": "sha512-8T7Zn1AhMsQ/HI1SjcCfT/t4ii3eAqco3yOcSzS4mozsOz69lHLsoMXmF9nZgnFanYscnSlUSgs8uZyKzpE6kg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } }, "rc": { - "version": "https://registry.npmjs.org/rc/-/rc-1.1.7.tgz", - "integrity": "sha1-xepWS7B6/5/TpbMukGwdOmWUD+o=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz", + "integrity": "sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU=", "dev": true, "requires": { - "deep-extend": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.1.tgz", - "ini": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "strip-json-comments": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" }, "dependencies": { "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } } }, "read-all-stream": { - "version": "https://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz", "integrity": "sha1-NcPhd/IHjveJ7kv6+kNzB06u9Po=", "dev": true, "requires": { - "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + "pinkie-promise": "2.0.1", + "readable-stream": "2.3.3" } }, "read-only-stream": { - "version": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", "dev": true, "requires": { - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + "readable-stream": "2.3.3" } }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", - "integrity": "sha1-nPSUY5hd8BbIrogTCXqSk6mzNyk=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", "dev": true, "requires": { - "buffer-shims": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" } }, "readdirp": { - "version": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", "dev": true, "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", - "set-immediate-shim": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz" + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "readable-stream": "2.3.3", + "set-immediate-shim": "1.0.1" } }, "readline2": { - "version": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", "dev": true, "requires": { - "code-point-at": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "is-fullwidth-code-point": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "mute-stream": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz" + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "mute-stream": "0.0.5" } }, "rechoir": { - "version": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { - "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.2.tgz" + "resolve": "1.4.0" } }, "regenerate": { - "version": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.2.tgz", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.2.tgz", "integrity": "sha1-0ZQcZ7rUN+G+dkM63Vs4X5WxkmA=", "dev": true }, "regenerator-runtime": { - "version": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz", - "integrity": "sha1-jENnqQS1HqYqkIrDEL+Z/5CoKj4=", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", + "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==", "dev": true }, "regenerator-transform": { - "version": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.9.8.tgz", - "integrity": "sha1-D4i7K8A5Mt23trcxLmgHjwECbWw=", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", "dev": true, "requires": { - "babel-runtime": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "babel-types": "https://registry.npmjs.org/babel-types/-/babel-types-6.23.0.tgz", - "private": "https://registry.npmjs.org/private/-/private-0.1.7.tgz" + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "private": "0.1.7" } }, "regex-cache": { - "version": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", "dev": true, "requires": { - "is-equal-shallow": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "is-primitive": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + "is-equal-shallow": "0.1.3", + "is-primitive": "2.0.0" } }, "regexpu-core": { - "version": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", "dev": true, "requires": { - "regenerate": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.2.tgz", - "regjsgen": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "regjsparser": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz" + "regenerate": "1.3.2", + "regjsgen": "0.2.0", + "regjsparser": "0.1.5" } }, "registry-url": { - "version": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", "dev": true, "requires": { - "rc": "https://registry.npmjs.org/rc/-/rc-1.1.7.tgz" + "rc": "1.2.1" } }, "regjsgen": { - "version": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", "dev": true }, "regjsparser": { - "version": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", "dev": true, "requires": { - "jsesc": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" + "jsesc": "0.5.0" }, "dependencies": { "jsesc": { - "version": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } } }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, "repeat-element": { - "version": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", "dev": true }, "repeat-string": { - "version": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, "repeating": { - "version": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "dev": true, "requires": { - "is-finite": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz" + "is-finite": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "dev": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.16", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.1.0" + }, + "dependencies": { + "qs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", + "dev": true + }, + "uuid": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", + "dev": true + } } }, "require-uncached": { - "version": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { - "caller-path": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "resolve-from": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz" + "caller-path": "0.1.0", + "resolve-from": "1.0.1" } }, "requires-port": { - "version": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "dev": true }, "resolve": { - "version": "https://registry.npmjs.org/resolve/-/resolve-1.3.2.tgz", - "integrity": "sha1-HwRCyeDLuBNuh7kwX5MvRsfygjU=", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", + "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", "dev": true, "requires": { - "path-parse": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz" + "path-parse": "1.0.5" } }, "resolve-from": { - "version": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "dev": true }, "restore-cursor": { - "version": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", "dev": true, "requires": { - "exit-hook": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "onetime": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz" + "exit-hook": "1.1.1", + "onetime": "1.1.0" } }, "resumer": { - "version": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", "dev": true, "requires": { - "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "through": "2.3.8" } }, "rimraf": { - "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", "dev": true, "requires": { - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz" + "glob": "7.1.2" } }, "ripemd160": { - "version": "https://registry.npmjs.org/ripemd160/-/ripemd160-1.0.1.tgz", - "integrity": "sha1-k6S71JQrxXS2mo+lfHHeEOzKfW4=", - "dev": true + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", + "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", + "dev": true, + "requires": { + "hash-base": "2.0.2", + "inherits": "2.0.3" + } }, "run-async": { - "version": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", "dev": true, "requires": { - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + "once": "1.4.0" } }, "rx-lite": { - "version": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", "dev": true }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, "semver": { - "version": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", "dev": true }, "semver-diff": { - "version": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", "dev": true, "requires": { - "semver": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz" + "semver": "5.4.1" } }, "set-immediate-shim": { - "version": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", "dev": true }, "sha.js": { - "version": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz", + "version": "2.4.8", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz", "integrity": "sha1-NwaMLEdra69ALRSknGf1l5IfY08=", "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + "inherits": "2.0.3" } }, "shallow-copy": { - "version": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", "integrity": "sha1-QV9CcC1z2BAzApLMXuhurhoRoXA=", "dev": true }, "shasum": { - "version": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", "dev": true, "requires": { - "json-stable-stringify": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", - "sha.js": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz" + "json-stable-stringify": "0.0.1", + "sha.js": "2.4.8" } }, "shell-quote": { - "version": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", "dev": true, "requires": { - "array-filter": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", - "array-map": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", - "array-reduce": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", - "jsonify": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" } }, "shelljs": { - "version": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.7.tgz", - "integrity": "sha1-svXHfvlxSPS09uImguELuoZnz/E=", + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", + "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "dev": true, "requires": { - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "interpret": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", - "rechoir": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" + "glob": "7.1.2", + "interpret": "1.0.3", + "rechoir": "0.6.2" } }, "shoe": { - "version": "https://registry.npmjs.org/shoe/-/shoe-0.0.15.tgz", + "version": "0.0.15", + "resolved": "https://registry.npmjs.org/shoe/-/shoe-0.0.15.tgz", "integrity": "sha1-uu2PGn8I9TC2bwkUKH/KplsSRDo=", "dev": true, "requires": { - "sockjs": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.7.tgz", - "sockjs-client": "1.1.4" + "sockjs": "0.3.7", + "sockjs-client": "0.0.0-unreleasable" + }, + "dependencies": { + "sockjs-client": { + "version": "0.0.0-unreleasable", + "bundled": true, + "dev": true + } } }, "signal-exit": { - "version": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, "slash": { - "version": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", "dev": true }, "slice-ansi": { - "version": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true }, "slide": { - "version": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", "dev": true }, "smokestack": { - "version": "https://registry.npmjs.org/smokestack/-/smokestack-3.4.1.tgz", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/smokestack/-/smokestack-3.4.1.tgz", "integrity": "sha1-yw2V+kVbzkIU3SdQp6zlJAOmD/E=", "dev": true, "requires": { - "bl": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", - "chrome-launch": "https://registry.npmjs.org/chrome-launch/-/chrome-launch-1.1.4.tgz", - "convert-source-map": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.4.0.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", - "firefox-launch": "https://registry.npmjs.org/firefox-launch/-/firefox-launch-1.0.2.tgz", - "is-dom": "https://registry.npmjs.org/is-dom/-/is-dom-1.0.9.tgz", - "localtunnel": "https://registry.npmjs.org/localtunnel/-/localtunnel-1.8.2.tgz", - "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.3.4.tgz", - "shoe": "https://registry.npmjs.org/shoe/-/shoe-0.0.15.tgz", - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "source-map-support": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz", - "split": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "synthetic-dom-events": "https://registry.npmjs.org/synthetic-dom-events/-/synthetic-dom-events-0.2.2.tgz", - "tap-finished": "https://registry.npmjs.org/tap-finished/-/tap-finished-0.0.1.tgz", - "through2": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "wd": "https://registry.npmjs.org/wd/-/wd-0.3.12.tgz", - "xhr": "https://registry.npmjs.org/xhr/-/xhr-2.4.0.tgz" + "bl": "0.9.5", + "chrome-launch": "1.1.4", + "convert-source-map": "1.5.0", + "debug": "2.6.8", + "firefox-launch": "1.1.0", + "is-dom": "1.0.9", + "localtunnel": "1.8.3", + "minimist": "1.1.3", + "mkdirp": "0.5.1", + "rimraf": "2.3.4", + "shoe": "0.0.15", + "source-map": "0.4.4", + "source-map-support": "0.2.10", + "split": "0.3.3", + "synthetic-dom-events": "0.2.2", + "tap-finished": "0.0.1", + "through2": "0.6.5", + "wd": "0.3.12", + "xhr": "2.4.0" }, "dependencies": { "glob": { - "version": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", "dev": true, "requires": { - "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "2.0.10", + "once": "1.4.0" } }, "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "minimatch": { - "version": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", "dev": true, "requires": { - "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + "brace-expansion": "1.1.8" } }, "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", "integrity": "sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=", "dev": true }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" } }, "rimraf": { - "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.3.4.tgz", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.3.4.tgz", "integrity": "sha1-gtm8Gy/PMeIFrHsoE4oCXQjpFZo=", "dev": true, "requires": { - "glob": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz" + "glob": "4.5.3" } }, "source-map": { - "version": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { - "amdefine": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz" + "amdefine": "1.0.1" } }, "source-map-support": { - "version": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz", + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz", "integrity": "sha1-6lo5AKHByyUJagrozFwrSxDe09w=", "dev": true, "requires": { - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz" + "source-map": "0.1.32" }, "dependencies": { "source-map": { - "version": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz", + "version": "0.1.32", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz", "integrity": "sha1-yLbBZ3l7pHQKjqMyUhYv8IWRsmY=", "dev": true, "requires": { - "amdefine": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz" + "amdefine": "1.0.1" } } } }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, "through2": { - "version": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", "dev": true, "requires": { - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "readable-stream": "1.0.34", + "xtend": "4.0.1" } } } }, "sntp": { - "version": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", "dev": true, "requires": { - "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + "hoek": "2.16.3" } }, "sockjs": { - "version": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.7.tgz", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.7.tgz", "integrity": "sha1-KVDgWG2KnTBElYqDGt5o2xl3Scs=", "dev": true, "requires": { - "faye-websocket": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.4.4.tgz", - "node-uuid": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.3.3.tgz" - }, - "dependencies": { - "node-uuid": { - "version": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.3.3.tgz", - "integrity": "sha1-09tNe1aBDZ5AMjQnZigq8HORcps=", - "dev": true - } - } - }, - "sockjs-client": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.1.4.tgz", - "integrity": "sha1-W6vjhrd15M8U51IJEUUmVAFsixI=", - "dev": true, - "requires": { - "debug": "2.6.8", - "eventsource": "0.1.6", - "faye-websocket": "0.11.1", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "json3": "3.3.2", - "url-parse": "1.1.9" - }, - "dependencies": { - "debug": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "faye-websocket": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", - "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", - "dev": true, - "requires": { - "websocket-driver": "0.6.5" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } + "faye-websocket": "0.4.4", + "node-uuid": "1.3.3" } }, "source-map": { - "version": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, "source-map-support": { - "version": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.11.tgz", - "integrity": "sha1-ZH+TmXizhTWQlTCIUwPa8jJ58yI=", + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.16.tgz", + "integrity": "sha512-A6vlydY7H/ljr4L2UOhDSajQdZQ6dMD7cLH0pzwcmwLyc9u8PNI4WGtnfDDzX7uzGL6c/T+ORL97Zlh+S4iOrg==", "dev": true, "requires": { - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" + "source-map": "0.5.7" } }, "split": { - "version": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", "dev": true, "requires": { - "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "through": "2.3.8" } }, "sprintf-js": { - "version": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, "sshpk": { - "version": "https://registry.npmjs.org/sshpk/-/sshpk-1.11.0.tgz", - "integrity": "sha1-LY1eu0pvqyj/ujf6YqkPSj6lnXc=", - "dev": true, - "requires": { - "asn1": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "bcrypt-pbkdf": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "dashdash": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "ecc-jsbn": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "getpass": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", - "jodid25519": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", - "jsbn": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "tweetnacl": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "dev": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" }, "dependencies": { "assert-plus": { - "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true } } }, "stack-utils": { - "version": "https://registry.npmjs.org/stack-utils/-/stack-utils-0.4.0.tgz", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-0.4.0.tgz", "integrity": "sha1-lAy4L8z6hOj/Lz/fKT/ngBa+zNE=", "dev": true }, "stream-browserify": { - "version": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + "inherits": "2.0.3", + "readable-stream": "2.3.3" } }, "stream-combiner": { - "version": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", "dev": true, "requires": { - "duplexer": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz" + "duplexer": "0.1.1" } }, "stream-combiner2": { - "version": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", "dev": true, "requires": { - "duplexer2": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + "duplexer2": "0.1.4", + "readable-stream": "2.3.3" } }, "stream-http": { - "version": "https://registry.npmjs.org/stream-http/-/stream-http-2.6.3.tgz", - "integrity": "sha1-TD3b+WNZaOos/U5I1D3l3vJiWsM=", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", + "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", "dev": true, "requires": { - "builtin-status-codes": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", - "to-arraybuffer": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "builtin-status-codes": "3.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "to-arraybuffer": "1.0.1", + "xtend": "4.0.1" } }, "stream-shift": { - "version": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", "dev": true }, "stream-splicer": { - "version": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + "inherits": "2.0.3", + "readable-stream": "2.3.3" } }, "string_decoder": { - "version": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } }, "string-length": { - "version": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", "integrity": "sha1-VpcPscOFWOnnC3KL894mmsRa36w=", "dev": true, "requires": { - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "strip-ansi": "3.0.1" } }, "string-width": { - "version": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "code-point-at": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "is-fullwidth-code-point": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" } }, "string.prototype.trim": { - "version": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", "dev": true, "requires": { - "define-properties": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", - "es-abstract": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.7.0.tgz", - "function-bind": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz" + "define-properties": "1.1.2", + "es-abstract": "1.8.0", + "function-bind": "1.1.1" } }, "stringstream": { - "version": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", "dev": true }, "strip-ansi": { - "version": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + "ansi-regex": "2.1.1" } }, "strip-bom": { - "version": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, "strip-json-comments": { - "version": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, "subarg": { - "version": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", "dev": true, "requires": { - "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz" + "minimist": "1.2.0" }, "dependencies": { "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } } }, "superagent": { - "version": "https://registry.npmjs.org/superagent/-/superagent-2.3.0.tgz", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-2.3.0.tgz", "integrity": "sha1-cDUpoHFOV+EjlZ3e+84ZOy5Q0RU=", "dev": true, "requires": { - "component-emitter": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "cookiejar": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.0.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", - "extend": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "form-data": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz", - "formidable": "https://registry.npmjs.org/formidable/-/formidable-1.1.1.tgz", - "methods": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "mime": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "qs": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + "component-emitter": "1.2.1", + "cookiejar": "2.1.1", + "debug": "2.6.8", + "extend": "3.0.1", + "form-data": "1.0.0-rc4", + "formidable": "1.1.1", + "methods": "1.1.2", + "mime": "1.4.0", + "qs": "6.5.0", + "readable-stream": "2.3.3" }, "dependencies": { "async": { - "version": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, "form-data": { - "version": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz", + "version": "1.0.0-rc4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz", "integrity": "sha1-BaxrwiIntD5EYfSIFhVUaZ1Pi14=", "dev": true, "requires": { - "async": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz" + "async": "1.5.2", + "combined-stream": "1.0.5", + "mime-types": "2.1.16" } }, - "formidable": { - "version": "https://registry.npmjs.org/formidable/-/formidable-1.1.1.tgz", - "integrity": "sha1-lriIb3w8NQi5Mta9cMTTqI818ak=", - "dev": true - }, - "mime": { - "version": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=", - "dev": true - }, "qs": { - "version": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.0.tgz", + "integrity": "sha512-fjVFjW9yhqMhVGwRExCXLhJKrLlkYSaxNWdyc9rmHlrVZbk35YHH312dFd7191uQeXkI3mKLZTIbSvIeFwFemg==", "dev": true } } }, "supports-color": { - "version": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, "syntax-error": { - "version": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.3.0.tgz", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.3.0.tgz", "integrity": "sha1-HtkmbE1AvnXcVb+bsct3Biu5bKE=", "dev": true, "requires": { - "acorn": "https://registry.npmjs.org/acorn/-/acorn-4.0.11.tgz" + "acorn": "4.0.13" } }, "synthetic-dom-events": { - "version": "https://registry.npmjs.org/synthetic-dom-events/-/synthetic-dom-events-0.2.2.tgz", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/synthetic-dom-events/-/synthetic-dom-events-0.2.2.tgz", "integrity": "sha1-fsfRPz87wMmXAbWsvLrMRZw/jAw=", "dev": true }, "table": { - "version": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", "dev": true, "requires": { - "ajv": "https://registry.npmjs.org/ajv/-/ajv-4.11.7.tgz", - "ajv-keywords": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "slice-ansi": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "string-width": "https://registry.npmjs.org/string-width/-/string-width-2.0.0.tgz" + "ajv": "4.11.8", + "ajv-keywords": "1.5.1", + "chalk": "1.1.3", + "lodash": "4.17.4", + "slice-ansi": "0.0.4", + "string-width": "2.1.1" }, "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, "is-fullwidth-code-point": { - "version": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "string-width": { - "version": "https://registry.npmjs.org/string-width/-/string-width-2.0.0.tgz", - "integrity": "sha1-Y1xUNsxypuDDh87KJ41OLuxSaH4=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "is-fullwidth-code-point": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "ansi-regex": "3.0.0" } } } }, "tap": { - "version": "https://registry.npmjs.org/tap/-/tap-6.3.2.tgz", + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/tap/-/tap-6.3.2.tgz", "integrity": "sha1-4RTImqqqHAp3fiWnHLExT9BGpV4=", "dev": true, "requires": { - "bluebird": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", - "clean-yaml-object": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", - "color-support": "https://registry.npmjs.org/color-support/-/color-support-1.1.2.tgz", - "coveralls": "https://registry.npmjs.org/coveralls/-/coveralls-2.12.0.tgz", - "deeper": "https://registry.npmjs.org/deeper/-/deeper-2.1.0.tgz", - "foreground-child": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "isexe": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz", - "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", - "nyc": "https://registry.npmjs.org/nyc/-/nyc-7.1.0.tgz", - "only-shallow": "https://registry.npmjs.org/only-shallow/-/only-shallow-1.2.0.tgz", - "opener": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz", - "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", - "signal-exit": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "stack-utils": "https://registry.npmjs.org/stack-utils/-/stack-utils-0.4.0.tgz", - "tap-mocha-reporter": "https://registry.npmjs.org/tap-mocha-reporter/-/tap-mocha-reporter-0.0.27.tgz", - "tap-parser": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.2.2.tgz", - "tmatch": "https://registry.npmjs.org/tmatch/-/tmatch-2.0.1.tgz" + "bluebird": "3.5.0", + "clean-yaml-object": "0.1.0", + "color-support": "1.1.3", + "coveralls": "2.13.1", + "deeper": "2.1.0", + "foreground-child": "1.5.6", + "glob": "7.1.2", + "isexe": "1.1.2", + "js-yaml": "3.9.1", + "nyc": "7.1.0", + "only-shallow": "1.2.0", + "opener": "1.4.3", + "os-homedir": "1.0.1", + "readable-stream": "2.3.3", + "signal-exit": "3.0.2", + "stack-utils": "0.4.0", + "tap-mocha-reporter": "0.0.27", + "tap-parser": "1.2.2", + "tmatch": "2.0.1" }, "dependencies": { "bluebird": { - "version": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=", "dev": true }, + "isexe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz", + "integrity": "sha1-NvPiLmB1CSD15yQaR2qMakInWtA=", + "dev": true + }, "os-homedir": { - "version": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", "integrity": "sha1-DWK99EuRb9O73PLKsZGUj7CU8Ac=", "dev": true }, "tap-parser": { - "version": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.2.2.tgz", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.2.2.tgz", "integrity": "sha1-Xi9pcGEfB5x8+FfeHceqG0gN56U=", "dev": true, "requires": { - "events-to-array": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + "events-to-array": "1.1.2", + "inherits": "2.0.3", + "js-yaml": "3.9.1", + "readable-stream": "2.3.3" } } } }, "tap-finished": { - "version": "https://registry.npmjs.org/tap-finished/-/tap-finished-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tap-finished/-/tap-finished-0.0.1.tgz", "integrity": "sha1-CLW1Q/3ASDApDGxWEnlVLnHEvWc=", "dev": true, "requires": { - "tap-parser": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.2.1.tgz", - "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "tap-parser": "0.2.1", + "through": "2.3.8" } }, "tap-mocha-reporter": { - "version": "https://registry.npmjs.org/tap-mocha-reporter/-/tap-mocha-reporter-0.0.27.tgz", + "version": "0.0.27", + "resolved": "https://registry.npmjs.org/tap-mocha-reporter/-/tap-mocha-reporter-0.0.27.tgz", "integrity": "sha1-svcvPh6Lp4DuApGPzes6QNqAGPc=", "dev": true, "requires": { - "color-support": "https://registry.npmjs.org/color-support/-/color-support-1.1.2.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", - "diff": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", - "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "tap-parser": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.3.2.tgz", - "unicode-length": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz" + "color-support": "1.1.3", + "debug": "2.6.8", + "diff": "1.4.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "js-yaml": "3.9.1", + "readable-stream": "1.1.14", + "tap-parser": "1.3.2", + "unicode-length": "1.0.3" }, "dependencies": { "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true, "optional": true }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "optional": true, "requires": { - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" } }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true, + "optional": true + }, "tap-parser": { - "version": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.3.2.tgz", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.3.2.tgz", "integrity": "sha1-EgxQiciMPIp5PvKIhn3jIeGPjCI=", "dev": true, "requires": { - "events-to-array": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + "events-to-array": "1.1.2", + "inherits": "2.0.3", + "js-yaml": "3.9.1", + "readable-stream": "2.3.3" }, "dependencies": { "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", - "integrity": "sha1-nPSUY5hd8BbIrogTCXqSk6mzNyk=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "optional": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", "dev": true, "optional": true, "requires": { - "buffer-shims": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + "safe-buffer": "5.1.1" } } } @@ -7234,783 +7676,863 @@ } }, "tap-parser": { - "version": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.2.1.tgz", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.2.1.tgz", "integrity": "sha1-jh6CPyEU7iHQMuLzHk+2QqKW9Qs=", "dev": true, "requires": { - "split": "https://registry.npmjs.org/split/-/split-0.1.2.tgz" + "split": "0.1.2" }, "dependencies": { "split": { - "version": "https://registry.npmjs.org/split/-/split-0.1.2.tgz", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/split/-/split-0.1.2.tgz", "integrity": "sha1-8HEHRMRT1VH8cUPq2YPaYBTjNsw=", "dev": true, "requires": { - "through": "https://registry.npmjs.org/through/-/through-1.1.2.tgz" + "through": "1.1.2" } }, "through": { - "version": "https://registry.npmjs.org/through/-/through-1.1.2.tgz", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/through/-/through-1.1.2.tgz", "integrity": "sha1-NEpUJaN3MxTKfg62US+6+vdsC/4=", "dev": true } } }, "tap-status": { - "version": "https://registry.npmjs.org/tap-status/-/tap-status-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tap-status/-/tap-status-1.0.1.tgz", "integrity": "sha1-r7nUGYzD00BqW8OvuxxwcuiA5fk=", "dev": true, "requires": { - "tap-parser": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.3.2.tgz", - "tape": "https://registry.npmjs.org/tape/-/tape-4.6.3.tgz" + "tap-parser": "1.3.2", + "tape": "4.8.0" }, "dependencies": { "tap-parser": { - "version": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.3.2.tgz", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-1.3.2.tgz", "integrity": "sha1-EgxQiciMPIp5PvKIhn3jIeGPjCI=", "dev": true, "requires": { - "events-to-array": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "js-yaml": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz" + "events-to-array": "1.1.2", + "inherits": "2.0.3", + "js-yaml": "3.9.1", + "readable-stream": "2.3.3" } } } }, "tape": { - "version": "https://registry.npmjs.org/tape/-/tape-4.6.3.tgz", - "integrity": "sha1-Y353WB6ass4XV36b1M5PV1gG2LY=", - "dev": true, - "requires": { - "deep-equal": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "for-each": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", - "function-bind": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "has": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "object-inspect": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.2.1.tgz", - "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "resumer": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", - "string.prototype.trim": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", - "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.8.0.tgz", + "integrity": "sha512-TWILfEnvO7I8mFe35d98F6T5fbLaEtbFTG/lxWvid8qDfFTxt19EBijWmB4j3+Hoh5TfHE2faWs73ua+EphuBA==", + "dev": true, + "requires": { + "deep-equal": "1.0.1", + "defined": "1.0.0", + "for-each": "0.3.2", + "function-bind": "1.1.1", + "glob": "7.1.2", + "has": "1.0.1", + "inherits": "2.0.3", + "minimist": "1.2.0", + "object-inspect": "1.3.0", + "resolve": "1.4.0", + "resumer": "0.0.0", + "string.prototype.trim": "1.1.2", + "through": "2.3.8" }, "dependencies": { "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true - }, - "resolve": { - "version": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true } } }, "tar-stream": { - "version": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.1.5.tgz", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.1.5.tgz", "integrity": "sha1-vpIYwTDCACnhB7D5Z/sj3gV50Tw=", "dev": true, "requires": { - "bl": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", - "end-of-stream": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "bl": "0.9.5", + "end-of-stream": "1.4.0", + "readable-stream": "1.0.34", + "xtend": "4.0.1" }, "dependencies": { "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true } } }, "text-table": { - "version": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, "through": { - "version": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, "through2": { - "version": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "dev": true, "requires": { - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "readable-stream": "2.3.3", + "xtend": "4.0.1" } }, "timed-out": { - "version": "https://registry.npmjs.org/timed-out/-/timed-out-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-2.0.0.tgz", "integrity": "sha1-84sK6B03R9YoAB9B2vxlKs5nHAo=", "dev": true }, "timers-browserify": { - "version": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", "dev": true, "requires": { - "process": "https://registry.npmjs.org/process/-/process-0.11.9.tgz" + "process": "0.11.10" } }, "tinyqueue": { - "version": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-1.1.0.tgz", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-1.1.0.tgz", "integrity": "sha1-nF929UqEX0kU51T1qo1z72wBH3s=" }, "tmatch": { - "version": "https://registry.npmjs.org/tmatch/-/tmatch-2.0.1.tgz", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/tmatch/-/tmatch-2.0.1.tgz", "integrity": "sha1-DFYkbzPzDaG409colauvFmYPOM8=", "dev": true }, "to-arraybuffer": { - "version": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", "dev": true }, "to-fast-properties": { - "version": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.2.tgz", - "integrity": "sha1-8/XAw7pymafvmUJ+RGMyV63kMyA=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, "touch": { - "version": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", "integrity": "sha1-RJy+LbrlqMgDjjDXH6D/RklHxN4=", "dev": true, "requires": { - "nopt": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz" + "nopt": "1.0.10" } }, "tough-cookie": { - "version": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", "dev": true, "requires": { - "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz" + "punycode": "1.4.1" } }, "trim": { - "version": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=", "dev": true }, "trim-right": { - "version": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, "tryit": { - "version": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", "dev": true }, "tty-browserify": { - "version": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, "tunnel-agent": { - "version": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", - "dev": true + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } }, "tweetnacl": { - "version": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "dev": true, "optional": true }, "type-check": { - "version": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" + "prelude-ls": "1.1.2" } }, "typedarray": { - "version": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, "typescript": { - "version": "https://registry.npmjs.org/typescript/-/typescript-2.3.1.tgz", - "integrity": "sha1-4zYfs5XGw/nGn67qvJUD+L3srqE=", - "dev": true - }, - "uglify-to-browserify": { - "version": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.4.2.tgz", + "integrity": "sha1-+DlfhdRZJ2BnyYiqQYN6j4KHCEQ=", "dev": true }, "uglifyjs": { - "version": "https://registry.npmjs.org/uglifyjs/-/uglifyjs-2.4.10.tgz", - "integrity": "sha1-YyknMZ+mo9o/yR+Xc6wnv+bD7pI=", - "dev": true, - "requires": { - "async": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz", - "uglify-to-browserify": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "yargs": "https://registry.npmjs.org/yargs/-/yargs-1.3.3.tgz" - }, - "dependencies": { - "async": { - "version": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", - "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", - "dev": true - }, - "source-map": { - "version": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz", - "integrity": "sha1-p8/omux7FoLDsZjQrPtH19CQVms=", - "dev": true, - "requires": { - "amdefine": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz" - } - }, - "yargs": { - "version": "https://registry.npmjs.org/yargs/-/yargs-1.3.3.tgz", - "integrity": "sha1-BU3oth8i7v23IHBZ6u+da4P7kxo=", - "dev": true - } - } + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/uglifyjs/-/uglifyjs-2.4.11.tgz", + "integrity": "sha1-NEDWTgRXWViVJEGOtkHGi7kNET4=", + "dev": true }, "umd": { - "version": "https://registry.npmjs.org/umd/-/umd-3.0.1.tgz", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.1.tgz", "integrity": "sha1-iuVW4RAR9jwllnCKiDclnwGz1g4=", "dev": true }, "undefsafe": { - "version": "https://registry.npmjs.org/undefsafe/-/undefsafe-0.0.3.tgz", + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-0.0.3.tgz", "integrity": "sha1-7Mo6A+VrmvFzhbqsgSrIO5lKli8=", "dev": true }, "underscore.string": { - "version": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.0.3.tgz", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.0.3.tgz", "integrity": "sha1-Rhe4waJQz25QZPu7Nj0PqWzxRVI=", "dev": true }, "unicode-length": { - "version": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz", "integrity": "sha1-Wtp6f+1RhBpBijKM8UlHisg1irs=", "dev": true, "requires": { - "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "punycode": "1.4.1", + "strip-ansi": "3.0.1" } }, "union": { - "version": "https://registry.npmjs.org/union/-/union-0.4.6.tgz", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz", "integrity": "sha1-GY+9rrolTniLDvy2MLwR8kopWeA=", "dev": true, "requires": { - "qs": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz" - }, - "dependencies": { - "qs": { - "version": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", - "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=", - "dev": true - } + "qs": "2.3.3" } }, "update-notifier": { - "version": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.5.0.tgz", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.5.0.tgz", "integrity": "sha1-B7XcIGazYnqztPUwEw9+3doHpMw=", "dev": true, "requires": { - "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "configstore": "https://registry.npmjs.org/configstore/-/configstore-1.4.0.tgz", - "is-npm": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", - "latest-version": "https://registry.npmjs.org/latest-version/-/latest-version-1.0.1.tgz", - "repeating": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", - "semver-diff": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "string-length": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz" + "chalk": "1.1.3", + "configstore": "1.4.0", + "is-npm": "1.0.0", + "latest-version": "1.0.1", + "repeating": "1.1.3", + "semver-diff": "2.1.0", + "string-length": "1.0.1" }, "dependencies": { "repeating": { - "version": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=", "dev": true, "requires": { - "is-finite": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz" + "is-finite": "1.0.2" } } } }, "url": { - "version": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", "dev": true, "requires": { - "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "querystring": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz" + "punycode": "1.3.2", + "querystring": "0.2.0" }, "dependencies": { "punycode": { - "version": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", "dev": true } } }, "url-join": { - "version": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz", "integrity": "sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg=", "dev": true }, - "url-parse": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.1.9.tgz", - "integrity": "sha1-xn8dd11R8KGJEd17P/rSe7nlvRk=", - "dev": true, - "requires": { - "querystringify": "1.0.0", - "requires-port": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" - }, - "dependencies": { - "querystringify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-1.0.0.tgz", - "integrity": "sha1-YoYkIRLFtxL6ZU5SZlK/ahP/Bcs=", - "dev": true - } - } - }, "user-home": { - "version": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", "dev": true }, "userhome": { - "version": "https://registry.npmjs.org/userhome/-/userhome-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/userhome/-/userhome-1.0.0.tgz", "integrity": "sha1-tkkf8S0hpecmcd+czIcX4cZojAs=", "dev": true }, "util": { - "version": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + "inherits": "2.0.1" }, "dependencies": { "inherits": { - "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", "dev": true } } }, "util-deprecate": { - "version": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, "uuid": { - "version": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=", "dev": true }, "v8flags": { - "version": "https://registry.npmjs.org/v8flags/-/v8flags-2.0.11.tgz", - "integrity": "sha1-vKjzDw1tYGEswsAGQeaWLUKuaIE=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", "dev": true, "requires": { - "user-home": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz" + "user-home": "1.1.1" } }, "vargs": { - "version": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz", "integrity": "sha1-a2GE2mUgzDIEzhtAfKwm2SYJ6/8=", "dev": true }, "verror": { - "version": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", - "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "dev": true, "requires": { - "extsprintf": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } } }, "vm-browserify": { - "version": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", "dev": true, "requires": { - "indexof": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz" + "indexof": "0.0.1" } }, "watchify": { - "version": "https://registry.npmjs.org/watchify/-/watchify-3.9.0.tgz", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/watchify/-/watchify-3.9.0.tgz", "integrity": "sha1-8HX9LoqGrN6Eztum5cKgvt1SPZ4=", "dev": true, "requires": { - "anymatch": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", - "browserify": "https://registry.npmjs.org/browserify/-/browserify-14.1.0.tgz", - "chokidar": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz", - "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "outpipe": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", - "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "anymatch": "1.3.2", + "browserify": "14.4.0", + "chokidar": "1.7.0", + "defined": "1.0.0", + "outpipe": "1.1.1", + "through2": "2.0.3", + "xtend": "4.0.1" }, "dependencies": { "browserify": { - "version": "https://registry.npmjs.org/browserify/-/browserify-14.1.0.tgz", - "integrity": "sha1-BQjMHnv0wVIxLC+lI+Z2wLC5IxE=", - "dev": true, - "requires": { - "assert": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "browser-pack": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.2.tgz", - "browser-resolve": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", - "browserify-zlib": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "buffer": "https://registry.npmjs.org/buffer/-/buffer-5.0.5.tgz", - "cached-path-relative": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", - "concat-stream": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "console-browserify": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "constants-browserify": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "crypto-browserify": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.0.tgz", - "defined": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "deps-sort": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", - "domain-browser": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", - "duplexer2": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "events": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "has": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", - "htmlescape": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "https-browserify": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "insert-module-globals": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.1.tgz", - "JSONStream": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", - "labeled-stream-splicer": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz", - "module-deps": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", - "os-browserify": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", - "parents": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "path-browserify": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", - "process": "https://registry.npmjs.org/process/-/process-0.11.9.tgz", - "punycode": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "querystring-es3": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "read-only-stream": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.3.tgz", - "resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.2.tgz", - "shasum": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", - "shell-quote": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", - "stream-browserify": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", - "stream-http": "https://registry.npmjs.org/stream-http/-/stream-http-2.6.3.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "subarg": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "syntax-error": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.3.0.tgz", - "through2": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "timers-browserify": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "tty-browserify": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "url": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "util": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "vm-browserify": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "version": "14.4.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-14.4.0.tgz", + "integrity": "sha1-CJo0Y69Y0OSNjNQHCz90ZU1avKk=", + "dev": true, + "requires": { + "assert": "1.4.1", + "browser-pack": "6.0.2", + "browser-resolve": "1.11.2", + "browserify-zlib": "0.1.4", + "buffer": "5.0.7", + "cached-path-relative": "1.0.1", + "concat-stream": "1.5.2", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.11.1", + "defined": "1.0.0", + "deps-sort": "2.0.0", + "domain-browser": "1.1.7", + "duplexer2": "0.1.4", + "events": "1.1.1", + "glob": "7.1.2", + "has": "1.0.1", + "htmlescape": "1.1.1", + "https-browserify": "1.0.0", + "inherits": "2.0.3", + "insert-module-globals": "7.0.1", + "JSONStream": "1.3.1", + "labeled-stream-splicer": "2.0.0", + "module-deps": "4.1.1", + "os-browserify": "0.1.2", + "parents": "1.0.1", + "path-browserify": "0.0.0", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "read-only-stream": "2.0.0", + "readable-stream": "2.3.3", + "resolve": "1.4.0", + "shasum": "1.0.2", + "shell-quote": "1.6.1", + "stream-browserify": "2.0.1", + "stream-http": "2.7.2", + "string_decoder": "1.0.3", + "subarg": "1.0.0", + "syntax-error": "1.3.0", + "through2": "2.0.3", + "timers-browserify": "1.4.2", + "tty-browserify": "0.0.0", + "url": "0.11.0", + "util": "0.10.3", + "vm-browserify": "0.0.4", + "xtend": "4.0.1" } }, "buffer": { - "version": "https://registry.npmjs.org/buffer/-/buffer-5.0.5.tgz", - "integrity": "sha1-Nck5MkSpCv+DWBBj0W8Igs7MlBg=", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.0.7.tgz", + "integrity": "sha512-NeeHXWh5pCbPQCt2/6rLvXqapZfVsqw/YgRgaHpT3H9Uzgs+S0lSg5SQzouIuDvcmlQRqBe8hOO2scKCu3cxrg==", "dev": true, "requires": { - "base64-js": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", - "ieee754": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz" + "base64-js": "1.2.1", + "ieee754": "1.1.8" } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true } } }, "wd": { - "version": "https://registry.npmjs.org/wd/-/wd-0.3.12.tgz", + "version": "0.3.12", + "resolved": "https://registry.npmjs.org/wd/-/wd-0.3.12.tgz", "integrity": "sha1-P7Tx11n4yF3eU5PRczT/4D6bsyk=", "dev": true, "requires": { - "archiver": "https://registry.npmjs.org/archiver/-/archiver-0.14.4.tgz", - "async": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz", - "q": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", - "request": "https://registry.npmjs.org/request/-/request-2.55.0.tgz", - "underscore.string": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.0.3.tgz", - "vargs": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz" + "archiver": "0.14.4", + "async": "1.0.0", + "lodash": "3.9.3", + "q": "1.4.1", + "request": "2.55.0", + "underscore.string": "3.0.3", + "vargs": "0.1.0" }, "dependencies": { "asn1": { - "version": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", "integrity": "sha1-VZvhg3bQik7E2+gId9J4GGObLfc=", "dev": true }, "assert-plus": { - "version": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", "integrity": "sha1-7nQAlBMALYTOxyGcasgRgS5yMWA=", "dev": true }, + "async": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", + "dev": true + }, "aws-sign2": { - "version": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", "integrity": "sha1-xXED96F/wDfwLXwuZLYC6iI/fWM=", "dev": true }, "caseless": { - "version": "https://registry.npmjs.org/caseless/-/caseless-0.9.0.tgz", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.9.0.tgz", "integrity": "sha1-t7Zc5r8UE4hlOc/VM/CzDv+pz4g=", "dev": true }, "combined-stream": { - "version": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", "dev": true, "requires": { - "delayed-stream": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz" + "delayed-stream": "0.0.5" } }, "delayed-stream": { - "version": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", "integrity": "sha1-1LH0OpPoKW3+AmlPRoC8N6MTxz8=", "dev": true }, "form-data": { - "version": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", "integrity": "sha1-Jvi8JtpkQOKZy9z7aQNcT3em5GY=", "dev": true, "requires": { - "async": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", - "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz" + "async": "0.9.2", + "combined-stream": "0.0.7", + "mime-types": "2.0.14" }, "dependencies": { "async": { - "version": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", "dev": true } } }, "har-validator": { - "version": "https://registry.npmjs.org/har-validator/-/har-validator-1.8.0.tgz", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-1.8.0.tgz", "integrity": "sha1-2DhCsOtMQ1lgrrEIoGejqpTA7rI=", "dev": true, "requires": { - "bluebird": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", - "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "commander": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "is-my-json-valid": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz" + "bluebird": "2.11.0", + "chalk": "1.1.3", + "commander": "2.11.0", + "is-my-json-valid": "2.16.1" } }, "hawk": { - "version": "https://registry.npmjs.org/hawk/-/hawk-2.3.1.tgz", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-2.3.1.tgz", "integrity": "sha1-HnMc45RH+h0PbXB/e87r7A/R7B8=", "dev": true, "requires": { - "boom": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "cryptiles": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "hoek": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "sntp": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" } }, "http-signature": { - "version": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", "integrity": "sha1-T72sEyVZqoMjEh5UB3nAoBKyfmY=", "dev": true, "requires": { - "asn1": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", - "assert-plus": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", - "ctype": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz" + "asn1": "0.1.11", + "assert-plus": "0.1.5", + "ctype": "0.5.3" } }, "lodash": { - "version": "https://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz", + "version": "3.9.3", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz", "integrity": "sha1-AVnoaDL+/8bWHYUrEqlTuZSWvTI=", "dev": true }, "mime-db": { - "version": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz", "integrity": "sha1-PQxjGA9FjrENMlqqN9fFiuMS6dc=", "dev": true }, "mime-types": { - "version": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", "integrity": "sha1-MQ4VnbI+B3+Lsit0jav6SVcUCqY=", "dev": true, "requires": { - "mime-db": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz" + "mime-db": "1.12.0" } }, + "node-uuid": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", + "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=", + "dev": true + }, "oauth-sign": { - "version": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.6.0.tgz", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.6.0.tgz", "integrity": "sha1-fb6uRPbKRU4fFoRR1jB0ZzWBPOM=", "dev": true }, "qs": { - "version": "https://registry.npmjs.org/qs/-/qs-2.4.2.tgz", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.4.2.tgz", "integrity": "sha1-9854jld33wtQENp/fE5zujJHD1o=", "dev": true }, "request": { - "version": "https://registry.npmjs.org/request/-/request-2.55.0.tgz", + "version": "2.55.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.55.0.tgz", "integrity": "sha1-11wc32eddrsQD5v/4f5VG1wk6T0=", "dev": true, "requires": { - "aws-sign2": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", - "bl": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", - "caseless": "https://registry.npmjs.org/caseless/-/caseless-0.9.0.tgz", - "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", - "forever-agent": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "form-data": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", - "har-validator": "https://registry.npmjs.org/har-validator/-/har-validator-1.8.0.tgz", - "hawk": "https://registry.npmjs.org/hawk/-/hawk-2.3.1.tgz", - "http-signature": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", - "isstream": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "json-stringify-safe": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", - "node-uuid": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", - "oauth-sign": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.6.0.tgz", - "qs": "https://registry.npmjs.org/qs/-/qs-2.4.2.tgz", - "stringstream": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "tough-cookie": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "tunnel-agent": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz" + "aws-sign2": "0.5.0", + "bl": "0.9.5", + "caseless": "0.9.0", + "combined-stream": "0.0.7", + "forever-agent": "0.6.1", + "form-data": "0.2.0", + "har-validator": "1.8.0", + "hawk": "2.3.1", + "http-signature": "0.10.1", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.0.14", + "node-uuid": "1.4.8", + "oauth-sign": "0.6.0", + "qs": "2.4.2", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.4.3" } + }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true } } }, - "websocket-driver": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.6.5.tgz", - "integrity": "sha1-XLJVbOuF9Dc8bYI4qmkchFThOjY=", + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", "dev": true, "requires": { - "websocket-extensions": "0.1.1" + "isexe": "2.0.0" } }, - "websocket-extensions": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.1.tgz", - "integrity": "sha1-domUmcGEtu91Q3fC27DNbLVdKec=", + "window-size": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", "dev": true }, - "which": { - "version": "https://registry.npmjs.org/which/-/which-1.2.12.tgz", - "integrity": "sha1-3me15FAmnxlJCe8j7OTr5Bb6EZI=", - "dev": true, - "requires": { - "isexe": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz" - } - }, "wordwrap": { - "version": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, "wrap-ansi": { - "version": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { - "string-width": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "string-width": "1.0.2", + "strip-ansi": "3.0.1" } }, "wrappy": { - "version": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "write": { - "version": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", "dev": true, "requires": { - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" + "mkdirp": "0.5.1" } }, "write-file-atomic": { - "version": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.1.tgz", - "integrity": "sha1-fUW6MjFjKN0ex9kPYOvA2EW7dZo=", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", "dev": true, "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "imurmurhash": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "slide": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "slide": "1.1.6" } }, "xdg-basedir": { - "version": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz", "integrity": "sha1-7byQPMOF/ARSPZZqM1UEtVBNG9I=", "dev": true, "requires": { - "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" + "os-homedir": "1.0.2" } }, "xhr": { - "version": "https://registry.npmjs.org/xhr/-/xhr-2.4.0.tgz", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.4.0.tgz", "integrity": "sha1-4W5mpF+GmGHu76tBbV7/ci3ECZM=", "dev": true, "requires": { - "global": "https://registry.npmjs.org/global/-/global-4.3.1.tgz", - "is-function": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", - "parse-headers": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", - "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "global": "4.3.2", + "is-function": "1.0.1", + "parse-headers": "2.0.1", + "xtend": "4.0.1" } }, "xtend": { - "version": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", "dev": true }, "y18n": { - "version": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", "dev": true }, "yallist": { - "version": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz", - "integrity": "sha1-MGxUODXwnuGkyyO3vOmrNByRzdQ=", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true }, + "yargs": { + "version": "3.29.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz", + "integrity": "sha1-GquWYOrnnYuPZ1vK7qtu40ws9pw=", + "dev": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "os-locale": "1.4.0", + "window-size": "0.1.4", + "y18n": "3.2.1" + } + }, "zip-stream": { - "version": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.5.2.tgz", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.5.2.tgz", "integrity": "sha1-Mty8UG0Nq00hNyYlvX66rDwv/1Y=", "dev": true, "requires": { - "compress-commons": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.2.9.tgz", - "lodash": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + "compress-commons": "0.2.9", + "lodash": "3.2.0", + "readable-stream": "1.0.34" }, "dependencies": { "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "lodash": { - "version": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", "integrity": "sha1-S/UKMkP5rrC6xBpV09WZBnWkYvs=", "dev": true }, "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true } } } diff --git a/src/index.js b/src/index.js index a5999d3..11bae72 100644 --- a/src/index.js +++ b/src/index.js @@ -93,9 +93,7 @@ function fillQueue(subject, clipping, sbbox, cbbox) { /** * @param {SweepEvent} event * @param {SweepEvent} prev - * @param {Tree} sweepLine * @param {Operation} operation - * @return {[type]} */ function computeFields(event, prev, operation) { // compute inOut and otherInOut fields @@ -340,7 +338,7 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio var rightbound = min(sbbox[2], cbbox[2]); - var prev, next; + var prev, next, begin, end; while (eventQueue.length) { var event = eventQueue.pop(); @@ -353,19 +351,13 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio } if (event.left) { - sweepLine.insert(event); + next = prev = sweepLine.insert(event); //_renderSweepLine(sweepLine, event.point, event); - next = sweepLine.find(event); - prev = sweepLine.find(event); - event.iterator = sweepLine.find(event); + begin = sweepLine.minNode(); + + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; - if (prev !== sweepLine.minNode()) { - prev = sweepLine.prev(prev); - } else { - prev = sweepLine.minNode(); - prev = sweepLine.prev(prev); - prev = sweepLine.next(prev); - } next = sweepLine.next(next); var prevEvent = prev ? prev.key : null; @@ -379,42 +371,35 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio } if (prev) { if (possibleIntersection(prev.key, event, eventQueue) === 2) { - var prevprev = sweepLine.find(prev); - if (prevprev !== sweepLine.minNode()) { - prevprev = sweepLine.prev(prevprev); - } else { - prevprev = sweepLine.find(sweepLine.maxNode()); - prevprev = sweepLine.next(prevprev); - } - prevprevEvent = prevprev.key || null; + var prevprev = prev; + if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); + else prevprev = null; + + prevprevEvent = prevprev ? prevprev.key : null; computeFields(prevEvent, prevprevEvent, operation); computeFields(event, prevEvent, operation); } } } else { event = event.otherEvent; - next = sweepLine.find(event); - prev = sweepLine.find(event); + next = prev = sweepLine.find(event); // _renderSweepLine(sweepLine, event.otherEvent.point, event); - if (!(prev && next)) continue; + if (prev && next) { - if (prev !== sweepLine.minNode()) { - prev = sweepLine.prev(prev); - } else { - prev = sweepLine.minNode(); - prev = sweepLine.prev(prev); - prev = sweepLine.next(prev); - } - next = sweepLine.next(next); - sweepLine.remove(event); + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; - // _renderSweepLine(sweepLine, event.otherEvent.point, event); + next = sweepLine.next(next); + sweepLine.remove(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); - if (next && prev) { - if (typeof prev !== 'undefined' && typeof next !== 'undefined') { - possibleIntersection(prev.key, next.key, eventQueue); + if (next && prev) { + //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + possibleIntersection(prev.key, next.key, eventQueue); + //} } } } From a1fd1b42ba037fdd2d5e80507ecdef40665bcf88 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Tue, 5 Sep 2017 21:35:51 +1000 Subject: [PATCH 05/42] Potential fix --- src/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 11bae72..56444f1 100644 --- a/src/index.js +++ b/src/index.js @@ -398,7 +398,7 @@ function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operatio if (next && prev) { //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { - possibleIntersection(prev.key, next.key, eventQueue); + possibleIntersection(prev.key, next.key, eventQueue); //} } } @@ -458,7 +458,7 @@ function orderEvents(sortedEvents) { * @param {Array.} sortedEvents * @return {Array.<*>} polygons */ -function connectEdges(sortedEvents) { +function connectEdges(sortedEvents, operation) { var i, len; var resultEvents = orderEvents(sortedEvents); @@ -474,7 +474,11 @@ function connectEdges(sortedEvents) { if (result.length === 0) { result.push([[contour]]); } else { - result[result.length - 1].push([contour]); + if (operation === 1) { + result.push(contour) + } else { + result[result.length - 1].push(contour); + } } } else { result.push(contour); @@ -612,7 +616,7 @@ function boolean(subject, clipping, operation) { return trivial === EMPTY ? null : trivial; } var sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); - return connectEdges(sortedEvents); + return connectEdges(sortedEvents, operation); } From 117118dd059c300cf65729dc798defcf8e3fca7f Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Tue, 5 Sep 2017 22:13:05 +1000 Subject: [PATCH 06/42] Add benchmark tests --- bench.js | 35 + package.json | 3 + test/fixtures/asiaOld.geojson | 119600 ------------------------ test/fixtures/asia_unionPoly.geojson | 31 + 4 files changed, 69 insertions(+), 119600 deletions(-) create mode 100644 bench.js delete mode 100644 test/fixtures/asiaOld.geojson create mode 100644 test/fixtures/asia_unionPoly.geojson diff --git a/bench.js b/bench.js new file mode 100644 index 0000000..ab9f630 --- /dev/null +++ b/bench.js @@ -0,0 +1,35 @@ +const path = require('path'); +const load = require('load-json-file'); +const Benchmark = require('benchmark'); +const jstsUnion = require('@turf/union'); +const fs = require('fs'); +const martinez = require('./src/index'); + + +/** + * Benmark Results + * + * Hole_Hole x 13,345 ops/sec ±2.13% (91 runs sampled) + * Hole_Hole - JSTS x 1,724 ops/sec ±4.80% (87 runs sampled) + * Asia x 6.32 ops/sec ±3.16% (20 runs sampled) + * Asia - JSTS x 6.62 ops/sec ±2.74% (21 runs sampled) + */ + + + +// Define benchmark +const suite = new Benchmark.Suite('martinez'); + +var hole_hole = load.sync('./test/fixtures/hole_hole.geojson') +suite.add('Hole_Hole', () => martinez.union(hole_hole.features[0].geometry.coordinates, hole_hole.features[1].geometry.coordinates)); +suite.add('Hole_Hole - JSTS', () => jstsUnion(hole_hole.features[0], hole_hole.features[1])) + +var asia = load.sync('./test/fixtures/asia.geojson') +var unionPoly = load.sync('./test/fixtures/asia_unionPoly.geojson') +suite.add('Asia', () => martinez.union(asia.features[0].geometry.coordinates, unionPoly.geometry.coordinates)); +suite.add('Asia - JSTS', () => jstsUnion(asia.features[0], unionPoly)) + +suite + .on('cycle', e => console.log(String(e.target))) + .on('complete', () => {}) + .run(); \ No newline at end of file diff --git a/package.json b/package.json index addd2c3..755a94c 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ ], "scripts": { "test": "tap test/*.test.js -R spec", + "bench": "node bench.js", "lint": "eslint ./src/", "test:watch": "nodemon --exec 'npm run test && npm run lint'", "start": "watchify ./demo/js/index.js -o ./demo/js/bundle.js -dv & http-server -p 3000", @@ -51,10 +52,12 @@ "author": "Alex Milevski ", "license": "MIT", "devDependencies": { + "@turf/union": "^4.6.0", "@types/geojson": "^1.0.2", "babel-cli": "^6.10.1", "babel-preset-es2015": "^6.9.0", "babelify": "^7.3.0", + "benchmark": "^2.1.4", "browserify": "^13.0.1", "eslint": "^3.19.0", "eslint-config-mourner": "^2.0.1", diff --git a/test/fixtures/asiaOld.geojson b/test/fixtures/asiaOld.geojson deleted file mode 100644 index 6173443..0000000 --- a/test/fixtures/asiaOld.geojson +++ /dev/null @@ -1,119600 +0,0 @@ -{ - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "properties": { - "scalerank": 0, - "featurecla": "Admin-0 country", - "LABELRANK": 2, - "SOVEREIGNT": "Indonesia", - "SOV_A3": "IDN", - "ADM0_DIF": 0, - "LEVEL": 2, - "TYPE": "Sovereign country", - "ADMIN": "Indonesia", - "ADM0_A3": "IDN", - "GEOU_DIF": 0, - "GEOUNIT": "Indonesia", - "GU_A3": "IDN", - "SU_DIF": 0, - "SUBUNIT": "Indonesia", - "SU_A3": "IDN", - "BRK_DIFF": 0, - "NAME": "Indonesia", - "NAME_LONG": "Indonesia", - "BRK_A3": "IDN", - "BRK_NAME": "Indonesia", - "BRK_GROUP": null, - "ABBREV": "Indo.", - "POSTAL": "INDO", - "FORMAL_EN": "Republic of Indonesia", - "FORMAL_FR": null, - "NOTE_ADM0": null, - "NOTE_BRK": null, - "NAME_SORT": "Indonesia", - "NAME_ALT": null, - "MAPCOLOR7": 6, - "MAPCOLOR8": 6, - "MAPCOLOR9": 6, - "MAPCOLOR13": 11, - "POP_EST": 240271522, - "GDP_MD_EST": 914600, - "POP_YEAR": -99, - "LASTCENSUS": 2010, - "GDP_YEAR": -99, - "ECONOMY": "4. Emerging region: MIKT", - "INCOME_GRP": "4. Lower middle income", - "WIKIPEDIA": -99, - "FIPS_10_": "ID", - "ISO_A2": "ID", - "ISO_A3": "IDN", - "ISO_N3": "360", - "UN_A3": "360", - "WB_A2": "ID", - "WB_A3": "IDN", - "WOE_ID": 23424846, - "WOE_ID_EH": 23424846, - "WOE_NOTE": "Exact WOE match as country", - "ADM0_A3_IS": "IDN", - "ADM0_A3_US": "IDN", - "ADM0_A3_UN": -99, - "ADM0_A3_WB": -99, - "CONTINENT": "Asia", - "REGION_UN": "Asia", - "SUBREGION": "South-Eastern Asia", - "REGION_WB": "East Asia & Pacific", - "NAME_LEN": 9, - "LONG_LEN": 9, - "ABBREV_LEN": 5, - "TINY": -99, - "HOMEPART": 1 - }, - "geometry": { - "type": "MultiPolygon", - "coordinates": [ - [ - [ - [ - 121.59742272200018, - -10.60116952899989 - ], - [ - 121.61410566500004, - -10.602471612999892 - ], - [ - 121.62159264400006, - -10.60133228999986 - ], - [ - 121.63331139400006, - -10.604180596999896 - ], - [ - 121.63111412900017, - -10.61532968499992 - ], - [ - 121.615000847, - -10.626641533999901 - ], - [ - 121.59522545700005, - -10.634535414999874 - ], - [ - 121.57455488400015, - -10.639825127999856 - ], - [ - 121.55274498800011, - -10.640394789999917 - ], - [ - 121.53142337300002, - -10.638441664999874 - ], - [ - 121.52719160200004, - -10.629571221999825 - ], - [ - 121.54102623800023, - -10.614841403999932 - ], - [ - 121.56495201900006, - -10.603692315999822 - ], - [ - 121.59742272200018, - -10.60116952899989 - ] - ] - ], - [ - [ - [ - 123.37159264400012, - -10.571709893999824 - ], - [ - 123.36133873800017, - -10.58033619599982 - ], - [ - 123.35596764400012, - -10.581231377999913 - ], - [ - 123.35938561300011, - -10.590752862999821 - ], - [ - 123.36768639400012, - -10.591973565999837 - ], - [ - 123.37875410200004, - -10.590427341999884 - ], - [ - 123.39014733200011, - -10.591485283999845 - ], - [ - 123.41309655000006, - -10.604587497999901 - ], - [ - 123.42042076900012, - -10.619073174999855 - ], - [ - 123.41732832100004, - -10.663506768999866 - ], - [ - 123.40919030000006, - -10.679131768999852 - ], - [ - 123.38941491000017, - -10.680108330999829 - ], - [ - 123.36654707100016, - -10.675469658999901 - ], - [ - 123.34864342500012, - -10.674086195999834 - ], - [ - 123.33155358200017, - -10.682305596999825 - ], - [ - 123.27686608200011, - -10.725030205999843 - ], - [ - 123.26742597699999, - -10.729424737999821 - ], - [ - 123.25473066500004, - -10.733086846999868 - ], - [ - 123.24341881600006, - -10.737725518999895 - ], - [ - 123.23878014400023, - -10.745375257999825 - ], - [ - 123.23780358200023, - -10.768812757999811 - ], - [ - 123.23585045700011, - -10.778985283999845 - ], - [ - 123.23194420700011, - -10.789483330999829 - ], - [ - 123.20915774800008, - -10.813083591999856 - ], - [ - 123.177012566, - -10.820407809999864 - ], - [ - 123.13982181100002, - -10.822686455999843 - ], - [ - 122.98804772200006, - -10.865004164999931 - ], - [ - 122.96753991000011, - -10.875909112999821 - ], - [ - 122.95769290500019, - -10.888116143999895 - ], - [ - 122.97169030000023, - -10.899346612999892 - ], - [ - 122.97169030000023, - -10.906182549999912 - ], - [ - 122.88021894600004, - -10.922621351999808 - ], - [ - 122.84180748800011, - -10.92107512799987 - ], - [ - 122.82097415500013, - -10.893243096999896 - ], - [ - 122.81470787900017, - -10.803806247999901 - ], - [ - 122.81006920700023, - -10.784844658999887 - ], - [ - 122.81251061300006, - -10.778415622999873 - ], - [ - 122.83334394600016, - -10.773207289999888 - ], - [ - 122.85499108200023, - -10.755303643999838 - ], - [ - 122.91765384200002, - -10.737481377999856 - ], - [ - 122.94141686300023, - -10.734958591999842 - ], - [ - 122.96265709700006, - -10.736016533999887 - ], - [ - 122.97364342500006, - -10.735121351999808 - ], - [ - 122.981700066, - -10.731540622999916 - ], - [ - 122.99415123800023, - -10.723565362999878 - ], - [ - 123.00505618600013, - -10.722100518999824 - ], - [ - 123.01531009200002, - -10.722914320999834 - ], - [ - 123.02637780000006, - -10.72185637799987 - ], - [ - 123.04916425900004, - -10.7113583309999 - ], - [ - 123.098399285, - -10.663506768999866 - ], - [ - 123.11947675900015, - -10.650648695999848 - ], - [ - 123.16163170700005, - -10.633396091999842 - ], - [ - 123.17725670700005, - -10.618829033999901 - ], - [ - 123.18116295700017, - -10.609063408999873 - ], - [ - 123.18433678500006, - -10.588962497999916 - ], - [ - 123.19092858200011, - -10.577813408999901 - ], - [ - 123.20036868600013, - -10.573500257999811 - ], - [ - 123.20915774800008, - -10.575941664999931 - ], - [ - 123.21558678500011, - -10.574965101999865 - ], - [ - 123.21810957100004, - -10.560479424999826 - ], - [ - 123.22510826900012, - -10.543633721999825 - ], - [ - 123.24195397200018, - -10.528903903999918 - ], - [ - 123.28028405000012, - -10.508965752999842 - ], - [ - 123.33545983200023, - -10.49032968499985 - ], - [ - 123.35230553500006, - -10.478204033999859 - ], - [ - 123.37403405000012, - -10.44353606599988 - ], - [ - 123.38648522200006, - -10.433038018999909 - ], - [ - 123.39625084700018, - -10.447523695999863 - ], - [ - 123.39714603000019, - -10.46347421699987 - ], - [ - 123.39226321700019, - -10.475681247999844 - ], - [ - 123.37582441500004, - -10.495863539999874 - ], - [ - 123.39389082100004, - -10.50920989399988 - ], - [ - 123.38803144599999, - -10.529717705999843 - ], - [ - 123.37525475400005, - -10.548435153999904 - ], - [ - 123.372813347, - -10.556817315999865 - ], - [ - 123.37818444100017, - -10.561618747999859 - ], - [ - 123.37159264400012, - -10.571709893999824 - ] - ] - ], - [ - [ - [ - 121.94019616000006, - -10.430108330999886 - ], - [ - 121.95980879000004, - -10.440118096999868 - ], - [ - 121.97950280000023, - -10.437920830999872 - ], - [ - 121.99594160200016, - -10.441338799999883 - ], - [ - 122.00538170700005, - -10.467950127999828 - ], - [ - 121.99789472699999, - -10.508965752999842 - ], - [ - 121.99089603000013, - -10.521579684999907 - ], - [ - 121.95281009200002, - -10.553399346999853 - ], - [ - 121.93002363400004, - -10.566664320999877 - ], - [ - 121.91968834700018, - -10.574395440999893 - ], - [ - 121.91504967500018, - -10.577080987999878 - ], - [ - 121.90992272200006, - -10.578057549999855 - ], - [ - 121.89893639400012, - -10.577813408999901 - ], - [ - 121.89185631600006, - -10.580743096999825 - ], - [ - 121.88746178500006, - -10.587497653999861 - ], - [ - 121.88453209700006, - -10.594414971999868 - ], - [ - 121.88184655000023, - -10.598321221999853 - ], - [ - 121.8597111340001, - -10.604099216999913 - ], - [ - 121.79688561300011, - -10.598321221999853 - ], - [ - 121.75318444100006, - -10.601006768999838 - ], - [ - 121.73210696700019, - -10.597344658999887 - ], - [ - 121.71045983200011, - -10.584649346999825 - ], - [ - 121.69906660200016, - -10.575778903999876 - ], - [ - 121.69434655000023, - -10.571058851999865 - ], - [ - 121.69011478000002, - -10.564222914999945 - ], - [ - 121.70622806100019, - -10.552422783999873 - ], - [ - 121.82642662900017, - -10.493829033999845 - ], - [ - 121.86133873800011, - -10.440606377999856 - ], - [ - 121.87964928500017, - -10.42888762799987 - ], - [ - 121.90162194100017, - -10.420993747999887 - ], - [ - 121.923106316, - -10.420342705999843 - ], - [ - 121.94019616000006, - -10.430108330999886 - ] - ] - ], - [ - [ - [ - 123.459239129, - -10.21461353999986 - ], - [ - 123.45167076900023, - -10.224379164999888 - ], - [ - 123.44662519600004, - -10.239678643999852 - ], - [ - 123.43506920700011, - -10.242771091999842 - ], - [ - 123.42156009200002, - -10.235935153999918 - ], - [ - 123.41065514400023, - -10.220961195999891 - ], - [ - 123.39625084700018, - -10.227797132999811 - ], - [ - 123.41863040500019, - -10.273044528999932 - ], - [ - 123.42448978000007, - -10.299004815999837 - ], - [ - 123.41065514400023, - -10.310316664999903 - ], - [ - 123.41675866000006, - -10.324639580999886 - ], - [ - 123.41342207100004, - -10.332614841999856 - ], - [ - 123.40357506600017, - -10.334405205999843 - ], - [ - 123.39014733200011, - -10.330824476999865 - ], - [ - 123.38738040500002, - -10.324639580999886 - ], - [ - 123.37745201900023, - -10.310804945999806 - ], - [ - 123.36703535200016, - -10.301202080999829 - ], - [ - 123.3621525400001, - -10.306898695999806 - ], - [ - 123.35474694100017, - -10.322442315999893 - ], - [ - 123.33838951900006, - -10.337497653999918 - ], - [ - 123.32178795700011, - -10.338962497999873 - ], - [ - 123.31430097700016, - -10.313409112999892 - ], - [ - 123.31519616000006, - -10.283949476999823 - ], - [ - 123.31999759200002, - -10.267754815999865 - ], - [ - 123.33228600400017, - -10.25457122199991 - ], - [ - 123.35596764400012, - -10.234633070999834 - ], - [ - 123.36980228000019, - -10.21689218499992 - ], - [ - 123.38941491000017, - -10.175225518999866 - ], - [ - 123.40381920700023, - -10.157647393999838 - ], - [ - 123.41724694100006, - -10.149672132999882 - ], - [ - 123.43824303500017, - -10.141289971999825 - ], - [ - 123.45753014400012, - -10.139336846999882 - ], - [ - 123.46583092500006, - -10.149834893999852 - ], - [ - 123.47380618600002, - -10.162855726999837 - ], - [ - 123.50464928500011, - -10.17131926899988 - ], - [ - 123.50611412900017, - -10.186781507999811 - ], - [ - 123.49496504000015, - -10.198174737999864 - ], - [ - 123.459239129, - -10.21461353999986 - ] - ] - ], - [ - [ - [ - 120.01172936300023, - -9.357598565999893 - ], - [ - 120.07097415500002, - -9.44101327899989 - ], - [ - 120.09424889400023, - -9.46119557099982 - ], - [ - 120.11085045700011, - -9.47063567499984 - ], - [ - 120.12940514400012, - -9.47812265399989 - ], - [ - 120.14828535200004, - -9.479668877999842 - ], - [ - 120.165293816, - -9.47087981599988 - ], - [ - 120.18311608200005, - -9.466892184999892 - ], - [ - 120.20679772200012, - -9.476169528999847 - ], - [ - 120.22925866, - -9.49228280999992 - ], - [ - 120.243907097, - -9.50904713299984 - ], - [ - 120.243907097, - -9.54998137799987 - ], - [ - 120.25114993600002, - -9.575372002999885 - ], - [ - 120.25342858200011, - -9.613864841999884 - ], - [ - 120.25896243600002, - -9.630791924999869 - ], - [ - 120.27116946700019, - -9.642510674999855 - ], - [ - 120.330332879, - -9.669366143999838 - ], - [ - 120.34693444100017, - -9.67050546699987 - ], - [ - 120.35377037900017, - -9.655857028999861 - ], - [ - 120.36475670700023, - -9.645277601999823 - ], - [ - 120.39014733200005, - -9.637953382999811 - ], - [ - 120.43628991000017, - -9.631280205999857 - ], - [ - 120.45850670700023, - -9.632500908999873 - ], - [ - 120.47828209700018, - -9.641045830999886 - ], - [ - 120.4923608730002, - -9.657647393999852 - ], - [ - 120.49773196700008, - -9.683200778999847 - ], - [ - 120.50855553500017, - -9.696954033999859 - ], - [ - 120.58033287900005, - -9.734958591999856 - ], - [ - 120.60678144600004, - -9.769463799999869 - ], - [ - 120.645762566, - -9.852308851999808 - ], - [ - 120.66968834700018, - -9.885186455999886 - ], - [ - 120.69760175900004, - -9.904473565999837 - ], - [ - 120.76441491000006, - -9.938897393999866 - ], - [ - 120.79249108200017, - -9.960870049999883 - ], - [ - 120.81226647200018, - -9.983575127999828 - ], - [ - 120.83155358200011, - -10.01441822699988 - ], - [ - 120.83985436300011, - -10.051364841999842 - ], - [ - 120.82667076900023, - -10.091241143999909 - ], - [ - 120.81739342500006, - -10.101820570999863 - ], - [ - 120.78516686300023, - -10.124769789999945 - ], - [ - 120.74187259200008, - -10.170993747999859 - ], - [ - 120.72461998800017, - -10.196872653999861 - ], - [ - 120.71119225400017, - -10.206719658999887 - ], - [ - 120.6505639980002, - -10.223565362999878 - ], - [ - 120.64161217500006, - -10.231215101999823 - ], - [ - 120.63054446700002, - -10.235935153999918 - ], - [ - 120.56609134200008, - -10.227797132999811 - ], - [ - 120.54737389400006, - -10.233330987999835 - ], - [ - 120.50074303500017, - -10.256768487999892 - ], - [ - 120.491465691, - -10.265883070999806 - ], - [ - 120.48975670700011, - -10.285251559999907 - ], - [ - 120.48316491000006, - -10.30095794099988 - ], - [ - 120.47046959700018, - -10.310316664999903 - ], - [ - 120.44996178500006, - -10.310316664999903 - ], - [ - 120.43230228000013, - -10.300062757999882 - ], - [ - 120.40935306100002, - -10.26962655999992 - ], - [ - 120.39161217500012, - -10.263116143999838 - ], - [ - 120.24187259200008, - -10.241631768999895 - ], - [ - 120.23023522200018, - -10.245212497999873 - ], - [ - 120.22046959700006, - -10.239434502999913 - ], - [ - 120.15560957100016, - -10.220961195999891 - ], - [ - 120.150157097, - -10.21445077899989 - ], - [ - 120.13990319100017, - -10.193942966999842 - ], - [ - 120.13461347699999, - -10.186781507999811 - ], - [ - 120.09310957100004, - -10.168389580999857 - ], - [ - 120.08692467500023, - -10.162855726999837 - ], - [ - 120.05941816500004, - -10.11858489399988 - ], - [ - 120.04835045700005, - -10.113213799999826 - ], - [ - 120.03980553500006, - -10.11467864399988 - ], - [ - 120.03419030000023, - -10.11207447699988 - ], - [ - 120.02719160200016, - -10.067640882999868 - ], - [ - 120.014903191, - -10.04322682099982 - ], - [ - 119.97632897200006, - -9.992445570999877 - ], - [ - 119.96729576900012, - -9.983575127999828 - ], - [ - 119.95728600400005, - -9.976983330999857 - ], - [ - 119.94654381600006, - -9.974541924999826 - ], - [ - 119.93148847700004, - -9.97356536299985 - ], - [ - 119.92066491, - -9.96949635199988 - ], - [ - 119.91325931100002, - -9.961358330999872 - ], - [ - 119.90870201900006, - -9.94719817499984 - ], - [ - 119.89625084700018, - -9.955336195999863 - ], - [ - 119.89047285199999, - -9.951267184999892 - ], - [ - 119.88689212300002, - -9.94158294099985 - ], - [ - 119.88070722700016, - -9.933526299999897 - ], - [ - 119.86036217500006, - -9.922539971999853 - ], - [ - 119.85084069100017, - -9.920098565999822 - ], - [ - 119.81137129000004, - -9.917168877999885 - ], - [ - 119.79395592500023, - -9.910577080999829 - ], - [ - 119.75782311300011, - -9.885186455999886 - ], - [ - 119.69711347700016, - -9.852634372999916 - ], - [ - 119.68897545700023, - -9.841078382999811 - ], - [ - 119.68506920700023, - -9.812758070999863 - ], - [ - 119.67408287900017, - -9.800225518999852 - ], - [ - 119.63445071700008, - -9.789646091999899 - ], - [ - 119.63363691500015, - -9.786228122999887 - ], - [ - 119.63502037900005, - -9.772637627999842 - ], - [ - 119.63445071700008, - -9.769138278999847 - ], - [ - 119.62810306100002, - -9.768649997999859 - ], - [ - 119.62208092500012, - -9.771172783999873 - ], - [ - 119.61687259200014, - -9.77418385199988 - ], - [ - 119.61312910199999, - -9.775323174999826 - ], - [ - 119.58887780000012, - -9.77027760199988 - ], - [ - 119.54004967500012, - -9.765883070999806 - ], - [ - 119.49903405000006, - -9.75212981599988 - ], - [ - 119.477305535, - -9.748630466999899 - ], - [ - 119.46029707100016, - -9.750095309999864 - ], - [ - 119.43978925900004, - -9.754652601999808 - ], - [ - 119.42253665500019, - -9.762139580999872 - ], - [ - 119.41529381600017, - -9.772230726999837 - ], - [ - 119.40609785199999, - -9.790134372999887 - ], - [ - 119.38559004000015, - -9.782891533999873 - ], - [ - 119.34693444100017, - -9.755466403999904 - ], - [ - 119.33838951900006, - -9.755059502999899 - ], - [ - 119.32789147200012, - -9.76181405999985 - ], - [ - 119.31910241000006, - -9.761651299999883 - ], - [ - 119.31080162900005, - -9.75807057099982 - ], - [ - 119.28484134200008, - -9.741143487999835 - ], - [ - 119.26148522200018, - -9.745782158999859 - ], - [ - 119.21973717500012, - -9.746189059999864 - ], - [ - 119.17709394599999, - -9.74138762799987 - ], - [ - 119.13672936300023, - -9.72405364399988 - ], - [ - 119.09685306100008, - -9.717543226999894 - ], - [ - 119.08253014400006, - -9.710544528999904 - ], - [ - 119.03736412900005, - -9.67587655999992 - ], - [ - 119.02475019600016, - -9.659274997999873 - ], - [ - 119.00717207100004, - -9.628106377999885 - ], - [ - 118.99781334700018, - -9.616794528999904 - ], - [ - 118.98389733200011, - -9.604668877999913 - ], - [ - 118.95573978000002, - -9.585056247999859 - ], - [ - 118.9415796230002, - -9.570489190999822 - ], - [ - 118.93539472700004, - -9.553399346999882 - ], - [ - 118.94190514400012, - -9.525567315999822 - ], - [ - 118.95801842500012, - -9.499607028999918 - ], - [ - 118.97917728000019, - -9.47625090899983 - ], - [ - 119.02466881600017, - -9.437676690999865 - ], - [ - 119.05079186300023, - -9.424004815999822 - ], - [ - 119.07894941500004, - -9.415622653999861 - ], - [ - 119.11011803500011, - -9.412774346999825 - ], - [ - 119.12354576900006, - -9.409356377999913 - ], - [ - 119.15333092500012, - -9.392266533999873 - ], - [ - 119.16871178500006, - -9.385511976999837 - ], - [ - 119.20687910199999, - -9.379001559999935 - ], - [ - 119.24024498800006, - -9.378106377999842 - ], - [ - 119.24634850400017, - -9.37590911299985 - ], - [ - 119.25977623800017, - -9.36646900799984 - ], - [ - 119.267832879, - -9.364434502999899 - ], - [ - 119.30543053500011, - -9.364434502999899 - ], - [ - 119.38453209700018, - -9.378106377999842 - ], - [ - 119.39429772200006, - -9.37590911299985 - ], - [ - 119.40756269600016, - -9.36646900799984 - ], - [ - 119.45679772200018, - -9.357598565999893 - ], - [ - 119.47608483200011, - -9.361097914999874 - ], - [ - 119.51734459700006, - -9.374932549999883 - ], - [ - 119.52857506600006, - -9.374932549999883 - ], - [ - 119.54753665500007, - -9.362888278999861 - ], - [ - 119.57081139400006, - -9.354099216999899 - ], - [ - 119.62924238400015, - -9.34189218499992 - ], - [ - 119.64747155000023, - -9.342217705999857 - ], - [ - 119.66236412900011, - -9.347914320999834 - ], - [ - 119.66846764400006, - -9.361016533999901 - ], - [ - 119.680430535, - -9.370782158999845 - ], - [ - 119.79948978000007, - -9.38372161299985 - ], - [ - 119.82129967500012, - -9.37859465899983 - ], - [ - 119.94597415500007, - -9.288262627999842 - ], - [ - 119.95875084700012, - -9.290459893999838 - ], - [ - 119.96387780000012, - -9.313164971999868 - ], - [ - 119.97071373800023, - -9.323011976999808 - ], - [ - 120.01172936300023, - -9.357598565999893 - ] - ] - ], - [ - [ - [ - 124.93302494300022, - -9.074483743999863 - ], - [ - 124.94785608000015, - -9.078514505999848 - ], - [ - 124.96589115400016, - -9.077274271999912 - ], - [ - 124.9789136150001, - -9.072003274999886 - ], - [ - 125.00444177300014, - -9.0555701699999 - ], - [ - 125.05182906100012, - -9.035002949999836 - ], - [ - 125.06531661000017, - -9.023220723999827 - ], - [ - 125.06857222500017, - -9.01588266999984 - ], - [ - 125.07301639900007, - -8.996452331999862 - ], - [ - 125.07647871900011, - -8.990767923999911 - ], - [ - 125.0868140060002, - -8.986220397999872 - ], - [ - 125.09151656100019, - -8.98859751399982 - ], - [ - 125.09528894100012, - -8.994798684999807 - ], - [ - 125.10252364200008, - -9.001309915999869 - ], - [ - 125.12133386200017, - -9.01185190799984 - ], - [ - 125.1394206140001, - -9.024771015999846 - ], - [ - 125.15399336800024, - -9.040790709999897 - ], - [ - 125.16236495000024, - -9.060634460999893 - ], - [ - 125.16200321400007, - -9.08233856199989 - ], - [ - 125.14500166900021, - -9.14517710399987 - ], - [ - 125.14696537300009, - -9.154478861999806 - ], - [ - 125.15120284100013, - -9.16502085299986 - ], - [ - 125.15265373200018, - -9.1708244189999 - ], - [ - 125.15389001500014, - -9.175769550999874 - ], - [ - 125.15063440000014, - -9.18538136799988 - ], - [ - 125.14252120000006, - -9.189102070999809 - ], - [ - 125.11792321800024, - -9.187551777999872 - ], - [ - 125.10696781400011, - -9.18848195399984 - ], - [ - 125.09146488400009, - -9.196750182999878 - ], - [ - 125.08257653800015, - -9.20553517699986 - ], - [ - 125.07394657400013, - -9.211322936999835 - ], - [ - 125.05968387900023, - -9.210496113999824 - ], - [ - 125.05337935400021, - -9.206672057999867 - ], - [ - 125.04144209800009, - -9.193236185999822 - ], - [ - 125.03451745600003, - -9.188171895999844 - ], - [ - 125.02769616800006, - -9.18631154399985 - ], - [ - 125.00723230100019, - -9.186104837999878 - ], - [ - 124.97446944200018, - -9.191892598999857 - ], - [ - 124.95793298400011, - -9.211943053999903 - ], - [ - 124.95410892800024, - -9.241501973999931 - ], - [ - 124.96015507000018, - -9.27602182999982 - ], - [ - 124.96599450700009, - -9.29338511199984 - ], - [ - 124.97281579600022, - -9.30465057299989 - ], - [ - 124.99669030800013, - -9.325837910999851 - ], - [ - 125.01787764500008, - -9.338963724999829 - ], - [ - 125.02340702400019, - -9.345578307999816 - ], - [ - 125.02480228700009, - -9.35198618499986 - ], - [ - 125.02278690600022, - -9.367695820999828 - ], - [ - 125.0237687580001, - -9.374723815999843 - ], - [ - 125.04629968300011, - -9.409863788999886 - ], - [ - 125.05093075400012, - -9.424696842999893 - ], - [ - 125.06162548343505, - -9.485765301020919 - ], - [ - 125.06161543100009, - -9.485772393999838 - ], - [ - 125.06128991000006, - -9.486016533999873 - ], - [ - 125.03077233200011, - -9.507500908999901 - ], - [ - 125.00196373800006, - -9.536309502999842 - ], - [ - 124.98658287900005, - -9.577325127999842 - ], - [ - 124.97974694100006, - -9.649021091999856 - ], - [ - 124.97071373800011, - -9.662367445999863 - ], - [ - 124.874766472, - -9.72470468499992 - ], - [ - 124.84693444100017, - -9.748223565999893 - ], - [ - 124.75847415500002, - -9.850762627999856 - ], - [ - 124.74781334700012, - -9.886163018999866 - ], - [ - 124.73454837300008, - -9.899509372999873 - ], - [ - 124.67847741000006, - -9.9301083309999 - ], - [ - 124.64128665500007, - -9.956638278999861 - ], - [ - 124.60808353000002, - -9.986748955999886 - ], - [ - 124.56031334700018, - -10.01523202899989 - ], - [ - 124.540782097, - -10.036553643999866 - ], - [ - 124.52466881600006, - -10.083428643999824 - ], - [ - 124.51002037900005, - -10.096286716999842 - ], - [ - 124.49935957099999, - -10.111993096999896 - ], - [ - 124.45199629000015, - -10.14641692499984 - ], - [ - 124.41846764400012, - -10.163832289999903 - ], - [ - 124.38086998800011, - -10.17050546699987 - ], - [ - 124.27198326900012, - -10.166192315999865 - ], - [ - 124.19678795700023, - -10.173760674999912 - ], - [ - 124.16480553500006, - -10.180596612999835 - ], - [ - 124.15365644599999, - -10.178806247999844 - ], - [ - 124.13412519600004, - -10.172133070999891 - ], - [ - 124.12240644600004, - -10.172539971999896 - ], - [ - 124.10767662900005, - -10.184340101999865 - ], - [ - 124.08741295700023, - -10.225681247999887 - ], - [ - 124.07813561300006, - -10.234633070999834 - ], - [ - 124.05738366000017, - -10.238946221999825 - ], - [ - 124.04851321700002, - -10.249607028999861 - ], - [ - 124.04346764400012, - -10.263116143999838 - ], - [ - 124.03386478000002, - -10.276136976999823 - ], - [ - 124.01978600400017, - -10.281019789999888 - ], - [ - 123.93279056100013, - -10.294854424999883 - ], - [ - 123.82634524800008, - -10.363946221999896 - ], - [ - 123.79932701900012, - -10.374688408999901 - ], - [ - 123.78736412900017, - -10.368340752999885 - ], - [ - 123.77816816499998, - -10.358330987999892 - ], - [ - 123.75709069100017, - -10.360446872999901 - ], - [ - 123.7190861340001, - -10.371758721999882 - ], - [ - 123.698985222, - -10.367364190999908 - ], - [ - 123.67872155000012, - -10.356622002999885 - ], - [ - 123.65886478000019, - -10.349297783999887 - ], - [ - 123.63965905000023, - -10.355075778999847 - ], - [ - 123.61744225400011, - -10.366306247999859 - ], - [ - 123.60206139400023, - -10.361423434999878 - ], - [ - 123.57447350400005, - -10.337660414999874 - ], - [ - 123.55941816500004, - -10.333754164999888 - ], - [ - 123.53646894600004, - -10.331963799999897 - ], - [ - 123.515391472, - -10.335544528999876 - ], - [ - 123.50220787900017, - -10.353204033999887 - ], - [ - 123.492930535, - -10.360772393999838 - ], - [ - 123.48161868600002, - -10.366143487999892 - ], - [ - 123.47201582100016, - -10.364922783999873 - ], - [ - 123.46859785200004, - -10.35621510199988 - ], - [ - 123.47242272200006, - -10.345147393999852 - ], - [ - 123.48568769599999, - -10.323907158999859 - ], - [ - 123.49341881600012, - -10.301934502999856 - ], - [ - 123.49496504000015, - -10.282159112999835 - ], - [ - 123.49252363400004, - -10.245212497999873 - ], - [ - 123.49952233200011, - -10.230726820999834 - ], - [ - 123.515391472, - -10.213067315999822 - ], - [ - 123.54712975400017, - -10.186781507999811 - ], - [ - 123.597911004, - -10.166680596999853 - ], - [ - 123.61231530000006, - -10.156426690999822 - ], - [ - 123.620371941, - -10.153008721999825 - ], - [ - 123.65699303500006, - -10.14641692499984 - ], - [ - 123.66570071700002, - -10.143161716999884 - ], - [ - 123.74854576900023, - -10.097751559999892 - ], - [ - 123.76465905000012, - -10.07496510199988 - ], - [ - 123.74577884200019, - -10.050388278999861 - ], - [ - 123.72608483200023, - -10.03923919099985 - ], - [ - 123.70582116000006, - -10.030694268999824 - ], - [ - 123.684336785, - -10.024997653999847 - ], - [ - 123.66041100400005, - -10.02304452899989 - ], - [ - 123.63835696700008, - -10.029961846999882 - ], - [ - 123.60564212300014, - -10.054294528999861 - ], - [ - 123.58814537900017, - -10.050388278999861 - ], - [ - 123.57740319100017, - -10.03435637799987 - ], - [ - 123.57618248800023, - -10.013929945999806 - ], - [ - 123.58375084700018, - -9.944024346999882 - ], - [ - 123.59229576900012, - -9.928806247999901 - ], - [ - 123.6290796230002, - -9.906345309999892 - ], - [ - 123.650157097, - -9.889418226999823 - ], - [ - 123.66041100400005, - -9.871270440999822 - ], - [ - 123.66374759200008, - -9.85084400799984 - ], - [ - 123.66382897200006, - -9.827243747999901 - ], - [ - 123.66041100400005, - -9.816582940999865 - ], - [ - 123.64576256600006, - -9.796807549999855 - ], - [ - 123.64332116, - -9.78281015399989 - ], - [ - 123.64649498800006, - -9.77499765399989 - ], - [ - 123.65259850400017, - -9.77027760199988 - ], - [ - 123.65919030000023, - -9.76653411299985 - ], - [ - 123.66382897200006, - -9.761651299999883 - ], - [ - 123.66993248800023, - -9.740492445999877 - ], - [ - 123.67156009200008, - -9.650160414999888 - ], - [ - 123.67660566500004, - -9.629652601999837 - ], - [ - 123.6888126960001, - -9.61142343499985 - ], - [ - 123.71168053500017, - -9.591566664999931 - ], - [ - 123.74691816500004, - -9.573988539999903 - ], - [ - 123.75635826900023, - -9.567071221999825 - ], - [ - 123.78394616000017, - -9.525811455999857 - ], - [ - 123.79379316499998, - -9.517022393999895 - ], - [ - 123.80111738399998, - -9.514418226999808 - ], - [ - 123.80933678500017, - -9.513278903999861 - ], - [ - 123.82154381600017, - -9.50904713299984 - ], - [ - 123.82699628999998, - -9.504652601999865 - ], - [ - 123.83668053500017, - -9.492608330999843 - ], - [ - 123.842051629, - -9.48796965899983 - ], - [ - 123.84669030000023, - -9.487237237999892 - ], - [ - 123.85865319100017, - -9.48902760199988 - ], - [ - 123.86304772200006, - -9.48796965899983 - ], - [ - 123.89576256600017, - -9.440524997999901 - ], - [ - 123.90723717500023, - -9.433282158999873 - ], - [ - 123.91260826900006, - -9.425957940999865 - ], - [ - 123.95866946700002, - -9.385511976999837 - ], - [ - 123.97950280000012, - -9.358493747999887 - ], - [ - 123.99146569100006, - -9.348077080999886 - ], - [ - 124.01010175900004, - -9.34392669099985 - ], - [ - 124.03003991000011, - -9.341973565499856 - ], - [ - 124.06269047000015, - -9.397874856999834 - ], - [ - 124.09028568500005, - -9.421542662999855 - ], - [ - 124.12108483900013, - -9.426917012999823 - ], - [ - 124.13374556500017, - -9.419268899999835 - ], - [ - 124.1537960210002, - -9.391880391999806 - ], - [ - 124.16723189300015, - -9.380614928999833 - ], - [ - 124.18361332300012, - -9.373896992999903 - ], - [ - 124.19746260600007, - -9.37317352299982 - ], - [ - 124.21069177300015, - -9.378857930999857 - ], - [ - 124.22578129100017, - -9.391570332999905 - ], - [ - 124.23715010600014, - -9.405212910999822 - ], - [ - 124.24686527500009, - -9.421542662999855 - ], - [ - 124.25399662300006, - -9.438699238999916 - ], - [ - 124.2575106210002, - -9.455442402999864 - ], - [ - 124.25689050300005, - -9.46288380899989 - ], - [ - 124.25337650600008, - -9.480557148999893 - ], - [ - 124.25337650600008, - -9.486448261999882 - ], - [ - 124.25658044500014, - -9.499367370999892 - ], - [ - 124.2575106210002, - -9.501227721999896 - ], - [ - 124.26159305900009, - -9.497920429999809 - ], - [ - 124.27384037300013, - -9.494923196999892 - ], - [ - 124.29306400600015, - -9.493062844999884 - ], - [ - 124.31006555200017, - -9.488722025999905 - ], - [ - 124.32355310100004, - -9.48035044399984 - ], - [ - 124.33233809500021, - -9.46660451199989 - ], - [ - 124.3333716230002, - -9.457199401999844 - ], - [ - 124.32882409700008, - -9.439836119999825 - ], - [ - 124.32861739100011, - -9.43301483199987 - ], - [ - 124.33207971200014, - -9.425470071999825 - ], - [ - 124.34174320500009, - -9.411827493999823 - ], - [ - 124.34541223200009, - -9.404179381999839 - ], - [ - 124.34789270000024, - -9.374620462999815 - ], - [ - 124.35455896000016, - -9.364181823999871 - ], - [ - 124.35807295800012, - -9.362218118999834 - ], - [ - 124.36262048400025, - -9.36201141399988 - ], - [ - 124.37187056500008, - -9.357050475999841 - ], - [ - 124.40168786600023, - -9.331832376999884 - ], - [ - 124.42091149900008, - -9.306924336999913 - ], - [ - 124.42478723200023, - -9.303513691999797 - ], - [ - 124.42793949400019, - -9.299482929999883 - ], - [ - 124.43181522700016, - -9.290801289999834 - ], - [ - 124.43662113400015, - -9.255868021999845 - ], - [ - 124.45150394800018, - -9.20057423899982 - ], - [ - 124.4505314460001, - -9.180189710999855 - ], - [ - 124.46583092500023, - -9.179375908999845 - ], - [ - 124.51783287900005, - -9.177829684999892 - ], - [ - 124.563243035, - -9.170830987999821 - ], - [ - 124.60434004000004, - -9.156345309999864 - ], - [ - 124.66797936300006, - -9.113051039999888 - ], - [ - 124.67115319100006, - -9.107517184999864 - ], - [ - 124.67318769600016, - -9.099297783999873 - ], - [ - 124.68360436300017, - -9.074802341999842 - ], - [ - 124.68799889400023, - -9.069512627999856 - ], - [ - 124.6915796230002, - -9.067803643999852 - ], - [ - 124.75806725400005, - -9.047946872999859 - ], - [ - 124.76734459700018, - -9.042901299999826 - ], - [ - 124.788828972, - -9.018975518999852 - ], - [ - 124.82496178500006, - -9.008070570999877 - ], - [ - 124.84034264400006, - -9.001071872999901 - ], - [ - 124.86988366000006, - -8.994398695999848 - ], - [ - 124.89714603000007, - -8.97454192499984 - ], - [ - 124.91928144600004, - -8.962090752999828 - ], - [ - 124.91950720677639, - -8.962015499916774 - ], - [ - 124.92248295100015, - -8.986323750999901 - ], - [ - 124.90915043100014, - -9.02032684299985 - ], - [ - 124.90791019700012, - -9.037483418999898 - ], - [ - 124.91297448700018, - -9.052779641999862 - ], - [ - 124.92129439300007, - -9.065492044999814 - ], - [ - 124.93302494300022, - -9.074483743999863 - ] - ] - ], - [ - [ - [ - 115.57309004000015, - -8.671970309999864 - ], - [ - 115.58915338800008, - -8.69566550599994 - ], - [ - 115.59774535300008, - -8.71872608999982 - ], - [ - 115.61573089800007, - -8.739627448999912 - ], - [ - 115.62420393700009, - -8.76890868999989 - ], - [ - 115.60694420700011, - -8.786553643999852 - ], - [ - 115.58887780000012, - -8.80730559699984 - ], - [ - 115.56080162900011, - -8.799004815999865 - ], - [ - 115.50538170700011, - -8.76091887799987 - ], - [ - 115.48878014400023, - -8.740655205999872 - ], - [ - 115.47461998800023, - -8.73658619599982 - ], - [ - 115.46827233200011, - -8.731866143999895 - ], - [ - 115.47136478000019, - -8.72380950299987 - ], - [ - 115.50700931100002, - -8.67896900799984 - ], - [ - 115.51758873800011, - -8.670179945999877 - ], - [ - 115.53505544700025, - -8.673678329999873 - ], - [ - 115.55014082100016, - -8.666192315999893 - ], - [ - 115.57309004000015, - -8.671970309999864 - ] - ] - ], - [ - [ - [ - 119.67530358200011, - -8.658786716999913 - ], - [ - 119.69548587300002, - -8.667087497999887 - ], - [ - 119.71062259200002, - -8.65976327899989 - ], - [ - 119.71989993600008, - -8.642510674999883 - ], - [ - 119.72299238400015, - -8.621189059999907 - ], - [ - 119.73780358200023, - -8.617120049999855 - ], - [ - 119.76758873800023, - -8.617120049999855 - ], - [ - 119.79151451900012, - -8.624200127999828 - ], - [ - 119.78858483200005, - -8.641534112999906 - ], - [ - 119.75806725400005, - -8.661065362999878 - ], - [ - 119.74732506600006, - -8.672133070999834 - ], - [ - 119.75049889400012, - -8.685967705999829 - ], - [ - 119.73560631600006, - -8.689222914999874 - ], - [ - 119.72095787900005, - -8.689711195999863 - ], - [ - 119.70915774800008, - -8.693536065999865 - ], - [ - 119.70264733200005, - -8.70647551899988 - ], - [ - 119.70508873800011, - -8.724053643999909 - ], - [ - 119.72339928500017, - -8.741794528999904 - ], - [ - 119.72299238400015, - -8.761814059999864 - ], - [ - 119.71876061300023, - -8.770440362999878 - ], - [ - 119.70264733200005, - -8.79241301899988 - ], - [ - 119.69825280000006, - -8.80152760199988 - ], - [ - 119.68864993600019, - -8.7992489559999 - ], - [ - 119.67920983200011, - -8.79265715899983 - ], - [ - 119.66895592500018, - -8.781996351999808 - ], - [ - 119.66293379000015, - -8.772556247999887 - ], - [ - 119.65552819100017, - -8.766859632999811 - ], - [ - 119.64454186300011, - -8.771661065999893 - ], - [ - 119.63477623800006, - -8.778415622999916 - ], - [ - 119.62484785200016, - -8.78053150799984 - ], - [ - 119.61524498800011, - -8.777520440999837 - ], - [ - 119.60629316500015, - -8.768649997999887 - ], - [ - 119.61426842500012, - -8.739841403999861 - ], - [ - 119.62061608200017, - -8.730075778999904 - ], - [ - 119.63445071700008, - -8.726983330999829 - ], - [ - 119.62924238400015, - -8.717543226999823 - ], - [ - 119.62680097700004, - -8.713962497999844 - ], - [ - 119.64210045700005, - -8.706149997999859 - ], - [ - 119.65699303500006, - -8.695489190999822 - ], - [ - 119.66041100400005, - -8.68547942499984 - ], - [ - 119.64128665500007, - -8.679131768999895 - ], - [ - 119.646739129, - -8.657159112999892 - ], - [ - 119.62720787900005, - -8.61834075299987 - ], - [ - 119.63445071700008, - -8.596612237999892 - ], - [ - 119.65512129000015, - -8.611586195999834 - ], - [ - 119.66098066500004, - -8.617771091999899 - ], - [ - 119.66480553500006, - -8.627373955999886 - ], - [ - 119.66895592500018, - -8.649672132999825 - ], - [ - 119.67530358200011, - -8.658786716999913 - ] - ] - ], - [ - [ - [ - 122.40919030000012, - -8.486748955999829 - ], - [ - 122.37680097700004, - -8.50172291499986 - ], - [ - 122.35222415500019, - -8.480157158999859 - ], - [ - 122.3439233730002, - -8.448418877999899 - ], - [ - 122.36085045700011, - -8.432875257999896 - ], - [ - 122.38705488400015, - -8.43564218499985 - ], - [ - 122.41016686300011, - -8.443942966999842 - ], - [ - 122.42074629000015, - -8.460137627999885 - ], - [ - 122.40919030000012, - -8.486748955999829 - ] - ] - ], - [ - [ - [ - 113.37191816500015, - -8.494724216999884 - ], - [ - 113.29249108200023, - -8.494805596999868 - ], - [ - 113.28199303500017, - -8.488213799999883 - ], - [ - 113.27800540500019, - -8.47332122199984 - ], - [ - 113.28199303500017, - -8.457207940999865 - ], - [ - 113.29590905000023, - -8.447035414999917 - ], - [ - 113.29175866, - -8.43971119599982 - ], - [ - 113.28907311300023, - -8.432793877999913 - ], - [ - 113.33985436300006, - -8.444024346999825 - ], - [ - 113.39519290500007, - -8.447035414999917 - ], - [ - 113.40609785200004, - -8.453220309999878 - ], - [ - 113.41211998800023, - -8.46689218499992 - ], - [ - 113.41309655000012, - -8.480564059999864 - ], - [ - 113.40919030000012, - -8.486748955999829 - ], - [ - 113.39665774800014, - -8.48837655999985 - ], - [ - 113.37191816500015, - -8.494724216999884 - ] - ] - ], - [ - [ - [ - 119.46876061300011, - -8.479180596999882 - ], - [ - 119.48031660200004, - -8.486748955999829 - ], - [ - 119.52881920700011, - -8.479261976999865 - ], - [ - 119.54566491, - -8.481133721999825 - ], - [ - 119.55453535200016, - -8.484551690999837 - ], - [ - 119.56023196700002, - -8.487969658999845 - ], - [ - 119.56983483200011, - -8.497979424999826 - ], - [ - 119.57471764400006, - -8.507012627999842 - ], - [ - 119.57048587300008, - -8.512139580999857 - ], - [ - 119.56299889400006, - -8.515313408999916 - ], - [ - 119.55925540500007, - -8.518161716999856 - ], - [ - 119.56177819100017, - -8.532159112999821 - ], - [ - 119.56836998800023, - -8.54029713299984 - ], - [ - 119.57740319100006, - -8.548435153999847 - ], - [ - 119.58716881600012, - -8.562432549999912 - ], - [ - 119.57260175900015, - -8.56560637799987 - ], - [ - 119.57056725400005, - -8.575372002999828 - ], - [ - 119.5724389980002, - -8.585625908999845 - ], - [ - 119.56983483200011, - -8.590427341999842 - ], - [ - 119.53785241, - -8.593682549999883 - ], - [ - 119.52515709700006, - -8.590427341999842 - ], - [ - 119.51587975400011, - -8.572686455999843 - ], - [ - 119.50668379000004, - -8.565850518999824 - ], - [ - 119.49398847700016, - -8.573011976999865 - ], - [ - 119.47999108200011, - -8.59172942499984 - ], - [ - 119.47095787900011, - -8.596774997999859 - ], - [ - 119.45679772200018, - -8.596612237999892 - ], - [ - 119.46273847699999, - -8.609307549999869 - ], - [ - 119.47071373800023, - -8.61541106599985 - ], - [ - 119.47828209700018, - -8.614027601999865 - ], - [ - 119.48357181100008, - -8.60409921699987 - ], - [ - 119.49097741000006, - -8.61093515399989 - ], - [ - 119.48023522200006, - -8.635430596999825 - ], - [ - 119.47315514400006, - -8.64723072699988 - ], - [ - 119.46648196700002, - -8.648532809999878 - ], - [ - 119.455332879, - -8.64430103999986 - ], - [ - 119.44825280000023, - -8.653578382999825 - ], - [ - 119.44255618600008, - -8.679131768999895 - ], - [ - 119.443614129, - -8.690606377999856 - ], - [ - 119.44849694100017, - -8.70916106599985 - ], - [ - 119.45736738400004, - -8.728122653999861 - ], - [ - 119.46989993600002, - -8.740655205999872 - ], - [ - 119.44662519600004, - -8.746351820999848 - ], - [ - 119.39909915500002, - -8.72649504999984 - ], - [ - 119.38111412900017, - -8.740655205999872 - ], - [ - 119.37370853000019, - -8.734470309999892 - ], - [ - 119.38111412900017, - -8.734470309999892 - ], - [ - 119.37720787900017, - -8.722426039999888 - ], - [ - 119.38119550900015, - -8.708916924999912 - ], - [ - 119.40015709700018, - -8.67498137799987 - ], - [ - 119.402110222, - -8.667575778999876 - ], - [ - 119.40154056100008, - -8.641534112999906 - ], - [ - 119.39844811300006, - -8.634372653999861 - ], - [ - 119.391368035, - -8.632094007999882 - ], - [ - 119.38428795700023, - -8.63111744599982 - ], - [ - 119.38111412900017, - -8.62802499799993 - ], - [ - 119.38111412900017, - -8.600355726999837 - ], - [ - 119.37818444100006, - -8.573988539999931 - ], - [ - 119.379649285, - -8.565850518999824 - ], - [ - 119.38795006600012, - -8.55632903399983 - ], - [ - 119.39356530000012, - -8.554945570999848 - ], - [ - 119.40943444100006, - -8.55738697699988 - ], - [ - 119.41529381600017, - -8.55632903399983 - ], - [ - 119.41504967500012, - -8.553155205999857 - ], - [ - 119.42156009200014, - -8.535739841999884 - ], - [ - 119.42212975400011, - -8.535251559999892 - ], - [ - 119.42237389400023, - -8.526462497999844 - ], - [ - 119.41846764400023, - -8.494805596999868 - ], - [ - 119.42701256600006, - -8.488051039999917 - ], - [ - 119.42481530000018, - -8.472588799999897 - ], - [ - 119.41529381600017, - -8.443291924999883 - ], - [ - 119.42156009200014, - -8.441501559999892 - ], - [ - 119.45679772200018, - -8.425957940999893 - ], - [ - 119.46078535200004, - -8.441094658999887 - ], - [ - 119.46338951900023, - -8.461195570999848 - ], - [ - 119.46876061300011, - -8.479180596999882 - ] - ] - ], - [ - [ - [ - 123.16976972699999, - -8.431329033999859 - ], - [ - 123.17994225400005, - -8.444431247999916 - ], - [ - 123.177500847, - -8.460219007999868 - ], - [ - 123.16358483200023, - -8.473728122999844 - ], - [ - 123.12175540500019, - -8.48626067499984 - ], - [ - 123.03785241000006, - -8.491875908999845 - ], - [ - 123.00660241000017, - -8.50790780999992 - ], - [ - 122.95525149800002, - -8.585625908999845 - ], - [ - 122.93083743600019, - -8.60409921699987 - ], - [ - 122.91391035200004, - -8.608330987999892 - ], - [ - 122.90259850400005, - -8.604587497999859 - ], - [ - 122.88298587300008, - -8.582940362999864 - ], - [ - 122.91041100400005, - -8.514743747999844 - ], - [ - 122.99984785200004, - -8.448663018999838 - ], - [ - 123.00904381600017, - -8.44817473799985 - ], - [ - 123.01832116000006, - -8.451267184999935 - ], - [ - 123.02979576900012, - -8.453220309999878 - ], - [ - 123.04249108200023, - -8.451429945999806 - ], - [ - 123.07422936300011, - -8.439629815999837 - ], - [ - 123.08578535200004, - -8.438571872999873 - ], - [ - 123.10474694100006, - -8.440687757999882 - ], - [ - 123.11589603000007, - -8.439629815999837 - ], - [ - 123.12435957100004, - -8.436293226999808 - ], - [ - 123.14039147200018, - -8.427666924999897 - ], - [ - 123.14625084700006, - -8.425957940999893 - ], - [ - 123.16976972699999, - -8.431329033999859 - ] - ] - ], - [ - [ - [ - 121.73145592500023, - -8.350762627999899 - ], - [ - 121.70899498800023, - -8.354750257999868 - ], - [ - 121.69385826900023, - -8.344333591999884 - ], - [ - 121.67611738400015, - -8.309258721999896 - ], - [ - 121.68531334700006, - -8.303806247999859 - ], - [ - 121.69166100400017, - -8.297784112999864 - ], - [ - 121.69874108200023, - -8.29225025799984 - ], - [ - 121.71029707100016, - -8.288750908999845 - ], - [ - 121.73406009200008, - -8.293145440999837 - ], - [ - 121.74529056100008, - -8.311700127999842 - ], - [ - 121.74439537900017, - -8.334405205999886 - ], - [ - 121.73145592500023, - -8.350762627999899 - ] - ] - ], - [ - [ - [ - 123.28785241000017, - -8.246351820999863 - ], - [ - 123.31430097700016, - -8.261407158999873 - ], - [ - 123.32154381600017, - -8.255629164999903 - ], - [ - 123.33082116000006, - -8.254652601999837 - ], - [ - 123.34058678500017, - -8.258884372999859 - ], - [ - 123.34864342500012, - -8.268812757999868 - ], - [ - 123.35027103000002, - -8.280043226999865 - ], - [ - 123.34538821700008, - -8.287774346999868 - ], - [ - 123.33871503999998, - -8.293715101999808 - ], - [ - 123.33545983200023, - -8.299248955999829 - ], - [ - 123.32748457099999, - -8.3676083309999 - ], - [ - 123.32113691500015, - -8.38494231599988 - ], - [ - 123.28931725400005, - -8.404473565999865 - ], - [ - 123.24488366, - -8.4047177059999 - ], - [ - 123.16358483200023, - -8.391778252999899 - ], - [ - 123.08155358200011, - -8.4086239559999 - ], - [ - 123.04102623800011, - -8.410821221999896 - ], - [ - 123.01954186300017, - -8.391778252999899 - ], - [ - 123.02084394600016, - -8.35833098799985 - ], - [ - 123.03646894600016, - -8.332289320999877 - ], - [ - 123.12582441500015, - -8.258721612999892 - ], - [ - 123.14161217500012, - -8.24993254999984 - ], - [ - 123.15650475400017, - -8.243584893999895 - ], - [ - 123.18824303500006, - -8.234958591999899 - ], - [ - 123.20443769600016, - -8.233493747999844 - ], - [ - 123.23731530000018, - -8.234063408999901 - ], - [ - 123.26368248800017, - -8.237888278999918 - ], - [ - 123.28785241000017, - -8.246351820999863 - ] - ] - ], - [ - [ - [ - 116.74317467500018, - -8.391778252999899 - ], - [ - 116.73511803500006, - -8.408868096999853 - ], - [ - 116.70215905000023, - -8.4574520809999 - ], - [ - 116.69166100400017, - -8.467461846999882 - ], - [ - 116.68523196700008, - -8.480564059999864 - ], - [ - 116.68100019600016, - -8.55632903399983 - ], - [ - 116.6687931650001, - -8.573825778999876 - ], - [ - 116.62777754000015, - -8.614841403999876 - ], - [ - 116.61898847699999, - -8.63486093499985 - ], - [ - 116.59952836700003, - -8.666385866999832 - ], - [ - 116.58161992600006, - -8.697813045999808 - ], - [ - 116.55530487600012, - -8.744972475999859 - ], - [ - 116.51940387400018, - -8.778563501999898 - ], - [ - 116.50043781400015, - -8.802687801999866 - ], - [ - 116.50831139400012, - -8.832940362999821 - ], - [ - 116.50611412900005, - -8.847588799999826 - ], - [ - 116.50912519600004, - -8.858005466999899 - ], - [ - 116.52003014400012, - -8.859470309999864 - ], - [ - 116.52915414500009, - -8.842353687999918 - ], - [ - 116.54079663800005, - -8.836037974999869 - ], - [ - 116.54718187800009, - -8.845433179999901 - ], - [ - 116.5599064460001, - -8.848809502999842 - ], - [ - 116.57178795700023, - -8.858819268999824 - ], - [ - 116.58887780000006, - -8.863213799999897 - ], - [ - 116.56536852100012, - -8.895582838999829 - ], - [ - 116.52404660199997, - -8.902006540999835 - ], - [ - 116.50917661100002, - -8.896829057999824 - ], - [ - 116.47559655000006, - -8.920017184999864 - ], - [ - 116.44661086600016, - -8.920080377999852 - ], - [ - 116.43278890000013, - -8.910705027999867 - ], - [ - 116.45290485600017, - -8.886558814999859 - ], - [ - 116.46026020200011, - -8.864555973999842 - ], - [ - 116.47187992400004, - -8.839399234999902 - ], - [ - 116.45557701900012, - -8.833672783999845 - ], - [ - 116.42311581200013, - -8.836406400999891 - ], - [ - 116.3976997460002, - -8.855322488999875 - ], - [ - 116.39772762900012, - -8.8825445639999 - ], - [ - 116.40200819700007, - -8.916042998999927 - ], - [ - 116.40308678500017, - -8.954196872999844 - ], - [ - 116.38917076900006, - -8.949151299999826 - ], - [ - 116.38819420700011, - -8.937595309999892 - ], - [ - 116.38868248800011, - -8.923516533999845 - ], - [ - 116.37956790500019, - -8.911879164999931 - ], - [ - 116.37012780000012, - -8.911065362999835 - ], - [ - 116.36060631600012, - -8.924493096999825 - ], - [ - 116.35141035200004, - -8.926202080999829 - ], - [ - 116.34742272200006, - -8.921319268999852 - ], - [ - 116.34310957100016, - -8.912041924999897 - ], - [ - 116.337168816, - -8.903008721999896 - ], - [ - 116.32789147200018, - -8.898858330999857 - ], - [ - 116.31006920700011, - -8.90243905999992 - ], - [ - 116.27230879000004, - -8.917250257999811 - ], - [ - 116.25521894599999, - -8.920017184999864 - ], - [ - 116.24935957100016, - -8.917413018999866 - ], - [ - 116.24268639400006, - -8.907891533999859 - ], - [ - 116.236094597, - -8.905694268999866 - ], - [ - 116.224864129, - -8.907972914999931 - ], - [ - 116.21192467500012, - -8.917738539999888 - ], - [ - 116.20476321700008, - -8.920017184999864 - ], - [ - 116.19646243600019, - -8.914320570999877 - ], - [ - 116.17847741000006, - -8.887790622999916 - ], - [ - 116.16724694100006, - -8.878513278999861 - ], - [ - 116.15235436300011, - -8.875664971999825 - ], - [ - 116.10572350400017, - -8.874688408999845 - ], - [ - 116.10132897200012, - -8.888929945999848 - ], - [ - 116.09066816500015, - -8.895928643999838 - ], - [ - 116.07715905000012, - -8.89462655999992 - ], - [ - 116.06421959700018, - -8.883965752999899 - ], - [ - 116.07553144600016, - -8.879489841999842 - ], - [ - 116.08253014400023, - -8.872735283999901 - ], - [ - 116.08375084700018, - -8.865004164999888 - ], - [ - 116.07781009200002, - -8.858005466999899 - ], - [ - 116.06861412900017, - -8.855726820999834 - ], - [ - 116.05925540500002, - -8.858493747999887 - ], - [ - 116.04981530000012, - -8.862725518999824 - ], - [ - 116.04029381600006, - -8.864678643999866 - ], - [ - 116.03614342500006, - -8.870538018999909 - ], - [ - 116.036875847, - -8.88307057099982 - ], - [ - 116.04029381600006, - -8.902276299999869 - ], - [ - 116.02995853000013, - -8.908135674999897 - ], - [ - 116.01929772200018, - -8.908135674999897 - ], - [ - 116.00953209700006, - -8.90447356599985 - ], - [ - 116.00212649800008, - -8.898858330999857 - ], - [ - 115.9964298840001, - -8.889743747999859 - ], - [ - 115.988536004, - -8.867282809999864 - ], - [ - 115.98161868600019, - -8.858005466999899 - ], - [ - 115.96924889400017, - -8.849379164999903 - ], - [ - 115.96436608200011, - -8.850274346999896 - ], - [ - 115.95875084700018, - -8.85507577899989 - ], - [ - 115.94434655000023, - -8.858005466999899 - ], - [ - 115.92823326900023, - -8.854913018999824 - ], - [ - 115.86744225400005, - -8.821221612999821 - ], - [ - 115.8392618410002, - -8.816856514999884 - ], - [ - 115.8286378070002, - -8.791785517999841 - ], - [ - 115.83069647400006, - -8.769811756999914 - ], - [ - 115.83382133900002, - -8.74887354299986 - ], - [ - 115.84859164500008, - -8.724792571999942 - ], - [ - 115.86890709700018, - -8.73064544099988 - ], - [ - 115.87940514400023, - -8.724786065999837 - ], - [ - 115.88445071700019, - -8.732842705999872 - ], - [ - 115.88746178500011, - -8.745782158999873 - ], - [ - 115.89226321700019, - -8.754815362999892 - ], - [ - 115.91846409200011, - -8.753740461999854 - ], - [ - 115.94175943600013, - -8.754876932999835 - ], - [ - 115.95444947000007, - -8.753719628999903 - ], - [ - 115.96820292200002, - -8.747449558999904 - ], - [ - 115.9830258960001, - -8.737059159999873 - ], - [ - 115.99301191500015, - -8.742364190999865 - ], - [ - 116.00261478000007, - -8.74277109199987 - ], - [ - 116.01384524800002, - -8.74667734199987 - ], - [ - 116.02320397200018, - -8.74814218499992 - ], - [ - 116.02784264400012, - -8.744724216999913 - ], - [ - 116.03370201900023, - -8.738864841999884 - ], - [ - 116.0411889980002, - -8.734144789999874 - ], - [ - 116.05054772200006, - -8.734470309999892 - ], - [ - 116.05323326900023, - -8.73951588299984 - ], - [ - 116.05746504000015, - -8.749932549999826 - ], - [ - 116.06566998700012, - -8.759974082999861 - ], - [ - 116.07728005000016, - -8.74319823199987 - ], - [ - 116.08757571700019, - -8.737237237999864 - ], - [ - 116.09148196700008, - -8.726983330999829 - ], - [ - 116.06027107900016, - -8.713907240999887 - ], - [ - 116.06334853100023, - -8.67305882199986 - ], - [ - 116.07067293000009, - -8.638494197999904 - ], - [ - 116.07264452500013, - -8.57778369099988 - ], - [ - 116.06299408200002, - -8.521300971999892 - ], - [ - 116.03859148100005, - -8.500403088999818 - ], - [ - 116.02793675600017, - -8.445007651999916 - ], - [ - 116.05004674600016, - -8.414638435999805 - ], - [ - 116.06908823800015, - -8.40623698899985 - ], - [ - 116.09791100400011, - -8.408461195999848 - ], - [ - 116.10572350400017, - -8.405450127999842 - ], - [ - 116.11060631600006, - -8.399183851999894 - ], - [ - 116.11719811300023, - -8.38201262799987 - ], - [ - 116.12281334700006, - -8.374444268999824 - ], - [ - 116.138438347, - -8.362969658999873 - ], - [ - 116.16797936300006, - -8.346937757999882 - ], - [ - 116.18091881600017, - -8.33717213299984 - ], - [ - 116.26970462300002, - -8.247735283999845 - ], - [ - 116.28638756600017, - -8.236260674999897 - ], - [ - 116.37623131600017, - -8.201836846999868 - ], - [ - 116.393809441, - -8.20110442499984 - ], - [ - 116.4246525400001, - -8.217705987999892 - ], - [ - 116.49740644600004, - -8.23739999799993 - ], - [ - 116.53907311300011, - -8.243829033999845 - ], - [ - 116.55445397200006, - -8.25123463299984 - ], - [ - 116.57300866000006, - -8.264092705999857 - ], - [ - 116.59099368600019, - -8.26970794099985 - ], - [ - 116.63331139400006, - -8.275079033999901 - ], - [ - 116.668223504, - -8.289239190999837 - ], - [ - 116.70622806100013, - -8.317071221999896 - ], - [ - 116.73511803500006, - -8.35295989399988 - ], - [ - 116.74317467500018, - -8.391778252999899 - ] - ] - ], - [ - [ - [ - 128.221934441, - -8.208916924999826 - ], - [ - 128.22641035200016, - -8.239678643999895 - ], - [ - 128.23121178500017, - -8.25123463299984 - ], - [ - 128.23764082100016, - -8.264092705999857 - ], - [ - 128.23145592500012, - -8.272881768999824 - ], - [ - 128.21900475400017, - -8.278578382999811 - ], - [ - 128.2072860040001, - -8.28191497199984 - ], - [ - 128.18197675900015, - -8.285088799999897 - ], - [ - 128.15162194100017, - -8.284600518999909 - ], - [ - 128.12330162900005, - -8.280938408999859 - ], - [ - 128.10368899800008, - -8.275079033999901 - ], - [ - 128.09685306100008, - -8.270928643999866 - ], - [ - 128.08822675900015, - -8.263848565999822 - ], - [ - 128.08326256600012, - -8.254571221999853 - ], - [ - 128.08716881600017, - -8.244317315999837 - ], - [ - 128.0945744150001, - -8.232354424999897 - ], - [ - 128.09799238399998, - -8.220961195999834 - ], - [ - 128.10377037900005, - -8.21184661299985 - ], - [ - 128.11793053500017, - -8.206801039999903 - ], - [ - 128.13917076900023, - -8.216485283999873 - ], - [ - 128.16602623800023, - -8.210544528999847 - ], - [ - 128.19271894600016, - -8.200941664999874 - ], - [ - 128.21355228000007, - -8.199395440999837 - ], - [ - 128.221934441, - -8.208916924999826 - ] - ] - ], - [ - [ - [ - 123.94117272200018, - -8.243747653999861 - ], - [ - 123.93751061300023, - -8.26523202899989 - ], - [ - 123.93238366, - -8.271416924999855 - ], - [ - 123.92058353000007, - -8.276136976999865 - ], - [ - 123.87647545700023, - -8.28622812299993 - ], - [ - 123.81128991000006, - -8.288750908999845 - ], - [ - 123.78988691499998, - -8.293633721999825 - ], - [ - 123.77540123800023, - -8.305840752999885 - ], - [ - 123.76587975400005, - -8.321709893999824 - ], - [ - 123.75098717500006, - -8.356377862999892 - ], - [ - 123.72885175900004, - -8.393324476999851 - ], - [ - 123.68751061300006, - -8.436211846999825 - ], - [ - 123.67676842500018, - -8.438164971999868 - ], - [ - 123.66879316500004, - -8.427422783999859 - ], - [ - 123.66277103000019, - -8.413344007999825 - ], - [ - 123.65699303500006, - -8.405450127999842 - ], - [ - 123.64307701900017, - -8.411228122999901 - ], - [ - 123.62468509200014, - -8.427666924999897 - ], - [ - 123.60865319100006, - -8.445896091999884 - ], - [ - 123.601817254, - -8.456963799999826 - ], - [ - 123.59620201900012, - -8.461846612999892 - ], - [ - 123.58383222700016, - -8.465997002999828 - ], - [ - 123.5721134770001, - -8.471612237999835 - ], - [ - 123.567637566, - -8.481133721999825 - ], - [ - 123.57374108200011, - -8.491875908999845 - ], - [ - 123.60922285199999, - -8.535251559999892 - ], - [ - 123.597911004, - -8.555352471999853 - ], - [ - 123.58301842500023, - -8.565524997999887 - ], - [ - 123.564707879, - -8.568942966999899 - ], - [ - 123.54346764400012, - -8.569268487999835 - ], - [ - 123.53386478000002, - -8.563083591999856 - ], - [ - 123.511485222, - -8.532810153999861 - ], - [ - 123.50001061300006, - -8.521579684999864 - ], - [ - 123.45508873800006, - -8.569268487999835 - ], - [ - 123.44532311300023, - -8.572523695999877 - ], - [ - 123.43051191500015, - -8.587090752999899 - ], - [ - 123.42074629000004, - -8.590427341999842 - ], - [ - 123.40674889400023, - -8.589450778999861 - ], - [ - 123.39942467500023, - -8.58603280999985 - ], - [ - 123.38331139400006, - -8.569268487999835 - ], - [ - 123.34685306100013, - -8.543226820999863 - ], - [ - 123.3243921230002, - -8.534600518999852 - ], - [ - 123.31080162900017, - -8.549248955999857 - ], - [ - 123.30201256600017, - -8.55282968499992 - ], - [ - 123.29175866000017, - -8.555352471999853 - ], - [ - 123.2833764980002, - -8.55632903399983 - ], - [ - 123.2791447270001, - -8.554945570999848 - ], - [ - 123.26685631600006, - -8.54827239399988 - ], - [ - 123.26319420700005, - -8.545505466999927 - ], - [ - 123.256114129, - -8.541924737999864 - ], - [ - 123.25074303500017, - -8.544691664999917 - ], - [ - 123.2454533210001, - -8.548760674999869 - ], - [ - 123.23878014400023, - -8.548923434999935 - ], - [ - 123.22730553500017, - -8.52605559699984 - ], - [ - 123.25269616, - -8.49700286299985 - ], - [ - 123.31430097700016, - -8.453220309999878 - ], - [ - 123.35759524800002, - -8.411309502999885 - ], - [ - 123.372813347, - -8.405450127999842 - ], - [ - 123.38705488400004, - -8.40178801899988 - ], - [ - 123.46810957100016, - -8.36598072699988 - ], - [ - 123.48015384200008, - -8.358086846999896 - ], - [ - 123.48568769599999, - -8.350762627999899 - ], - [ - 123.48365319100006, - -8.330173434999864 - ], - [ - 123.47331790500007, - -8.320977471999882 - ], - [ - 123.43783613400015, - -8.316664320999891 - ], - [ - 123.36963951900023, - -8.316664320999891 - ], - [ - 123.36638431100019, - -8.304457289999903 - ], - [ - 123.38005618600002, - -8.288262627999856 - ], - [ - 123.39966881600017, - -8.273858330999886 - ], - [ - 123.41423587300014, - -8.267185153999847 - ], - [ - 123.42758222700004, - -8.270277601999823 - ], - [ - 123.44288170700011, - -8.276950778999876 - ], - [ - 123.45679772200018, - -8.279066664999888 - ], - [ - 123.46583092500006, - -8.268812757999868 - ], - [ - 123.48015384200008, - -8.267510674999869 - ], - [ - 123.50220787900017, - -8.24627044099988 - ], - [ - 123.51612389400023, - -8.240899346999825 - ], - [ - 123.54273522200018, - -8.242771091999884 - ], - [ - 123.567637566, - -8.247735283999845 - ], - [ - 123.56234785200016, - -8.255059502999842 - ], - [ - 123.56348717500006, - -8.271905205999843 - ], - [ - 123.560801629, - -8.28191497199984 - ], - [ - 123.552989129, - -8.291761976999851 - ], - [ - 123.526621941, - -8.316664320999891 - ], - [ - 123.51710045700011, - -8.337497653999861 - ], - [ - 123.51791425900004, - -8.35295989399988 - ], - [ - 123.52849368600019, - -8.364027601999837 - ], - [ - 123.54712975400017, - -8.37127044099985 - ], - [ - 123.56836998800023, - -8.374932549999897 - ], - [ - 123.58912194100006, - -8.373630466999899 - ], - [ - 123.60466556100008, - -8.364190362999892 - ], - [ - 123.60922285199999, - -8.343357028999904 - ], - [ - 123.60059655000012, - -8.32927825299987 - ], - [ - 123.58676191499998, - -8.31715260199988 - ], - [ - 123.58228600400005, - -8.306084893999838 - ], - [ - 123.601817254, - -8.295586846999868 - ], - [ - 123.61402428500017, - -8.309258721999896 - ], - [ - 123.62794030000018, - -8.307305596999853 - ], - [ - 123.63917076900017, - -8.294122002999899 - ], - [ - 123.64332116, - -8.275079033999901 - ], - [ - 123.63892662900005, - -8.261407158999873 - ], - [ - 123.63086998800011, - -8.252699476999894 - ], - [ - 123.62533613400015, - -8.244886976999808 - ], - [ - 123.6290796230002, - -8.233493747999844 - ], - [ - 123.63428795700011, - -8.228122653999876 - ], - [ - 123.64161217500012, - -8.223077080999843 - ], - [ - 123.64966881600006, - -8.219984632999868 - ], - [ - 123.65699303500006, - -8.220472914999945 - ], - [ - 123.66570071700002, - -8.226983330999843 - ], - [ - 123.66749108200011, - -8.234551690999893 - ], - [ - 123.66724694100017, - -8.241957289999874 - ], - [ - 123.67066491000017, - -8.247735283999845 - ], - [ - 123.68409264400006, - -8.251560153999861 - ], - [ - 123.70134524800008, - -8.25123463299984 - ], - [ - 123.71168053500017, - -8.245538018999852 - ], - [ - 123.70484459700018, - -8.233493747999844 - ], - [ - 123.70484459700018, - -8.227308851999865 - ], - [ - 123.73072350400017, - -8.223321221999882 - ], - [ - 123.75049889400012, - -8.20875416499986 - ], - [ - 123.76710045700017, - -8.193047783999887 - ], - [ - 123.78394616000017, - -8.185723565999893 - ], - [ - 123.78882897200006, - -8.184665622999844 - ], - [ - 123.79818769600016, - -8.179945570999834 - ], - [ - 123.804453972, - -8.17888762799987 - ], - [ - 123.81031334700006, - -8.181247653999918 - ], - [ - 123.81316165500019, - -8.185967705999843 - ], - [ - 123.81495201900006, - -8.191013278999861 - ], - [ - 123.81812584700006, - -8.193129164999874 - ], - [ - 123.82309004000004, - -8.195733330999872 - ], - [ - 123.83985436300023, - -8.208428643999838 - ], - [ - 123.84880618600008, - -8.213636976999837 - ], - [ - 123.86402428500006, - -8.218682549999869 - ], - [ - 123.88404381600012, - -8.222914320999877 - ], - [ - 123.92798912900005, - -8.227308851999865 - ], - [ - 123.93881269600004, - -8.232191664999931 - ], - [ - 123.94117272200018, - -8.243747653999861 - ] - ] - ], - [ - [ - [ - 124.23218834700006, - -8.381280205999843 - ], - [ - 124.21876061300023, - -8.401543877999842 - ], - [ - 124.20883222700004, - -8.42302825299987 - ], - [ - 124.20134524800008, - -8.465590101999823 - ], - [ - 124.191661004, - -8.489353122999916 - ], - [ - 124.17872155000012, - -8.511325778999847 - ], - [ - 124.16480553500006, - -8.528252862999821 - ], - [ - 124.14958743600008, - -8.539320570999863 - ], - [ - 124.12989342500012, - -8.54827239399988 - ], - [ - 124.10759524800008, - -8.554131768999838 - ], - [ - 124.08497155000012, - -8.55632903399983 - ], - [ - 124.05933678500006, - -8.551527601999837 - ], - [ - 124.05128014400012, - -8.539157809999892 - ], - [ - 124.05494225400005, - -8.501071872999901 - ], - [ - 124.05062910200016, - -8.482110283999901 - ], - [ - 124.03126061300023, - -8.456475518999838 - ], - [ - 124.02702884200019, - -8.443291924999883 - ], - [ - 124.018809441, - -8.429945570999877 - ], - [ - 123.99952233200005, - -8.430271091999899 - ], - [ - 123.97689863400004, - -8.437920830999829 - ], - [ - 123.93897545700011, - -8.457777601999837 - ], - [ - 123.93116295700011, - -8.460056247999901 - ], - [ - 123.921153191, - -8.460625908999873 - ], - [ - 123.90723717500023, - -8.454847914999903 - ], - [ - 123.91285241000006, - -8.442152601999851 - ], - [ - 123.92530358200023, - -8.430271091999899 - ], - [ - 123.93140709700006, - -8.425957940999893 - ], - [ - 123.9669702480002, - -8.36077239399988 - ], - [ - 123.985118035, - -8.338311455999872 - ], - [ - 124.02328535200016, - -8.31340911299985 - ], - [ - 124.04420006600006, - -8.304864190999822 - ], - [ - 124.05836022200006, - -8.306084893999838 - ], - [ - 124.06910241000017, - -8.315606377999842 - ], - [ - 124.07374108200011, - -8.320977471999882 - ], - [ - 124.08301842500023, - -8.349867445999806 - ], - [ - 124.08253014400017, - -8.352471612999892 - ], - [ - 124.08326256600017, - -8.3558895809999 - ], - [ - 124.09717858200005, - -8.377211195999877 - ], - [ - 124.10206139400023, - -8.381442966999899 - ], - [ - 124.10938561300023, - -8.38494231599988 - ], - [ - 124.11036217500012, - -8.3637020809999 - ], - [ - 124.12208092500012, - -8.349786065999822 - ], - [ - 124.1505639980002, - -8.329766533999859 - ], - [ - 124.18441816499998, - -8.271172783999916 - ], - [ - 124.20411217500012, - -8.251722914999917 - ], - [ - 124.23178144600004, - -8.209079684999878 - ], - [ - 124.24708092500006, - -8.196221612999864 - ], - [ - 124.251231316, - -8.189141533999901 - ], - [ - 124.25814863400004, - -8.182061455999843 - ], - [ - 124.270274285, - -8.17888762799987 - ], - [ - 124.28467858200005, - -8.183282158999859 - ], - [ - 124.29493248800011, - -8.193942966999884 - ], - [ - 124.30811608200017, - -8.220472914999945 - ], - [ - 124.29379316500015, - -8.257989190999865 - ], - [ - 124.29102623800011, - -8.280531507999854 - ], - [ - 124.29761803500017, - -8.299248955999829 - ], - [ - 124.29997806100002, - -8.319268487999878 - ], - [ - 124.28345787900017, - -8.338555596999825 - ], - [ - 124.24675540500007, - -8.364515882999825 - ], - [ - 124.23218834700006, - -8.381280205999843 - ] - ] - ], - [ - [ - [ - 129.03614342500006, - -8.22031015399989 - ], - [ - 129.03500410200004, - -8.236097914999931 - ], - [ - 129.02767988400015, - -8.250909112999906 - ], - [ - 129.01596113400015, - -8.261407158999873 - ], - [ - 129.00619550900004, - -8.263604424999869 - ], - [ - 128.99341881600017, - -8.26148853999986 - ], - [ - 128.97901451900012, - -8.255059502999842 - ], - [ - 128.96461022200006, - -8.244317315999837 - ], - [ - 128.94922936300011, - -8.236016533999859 - ], - [ - 128.93913821700002, - -8.240655205999872 - ], - [ - 128.92969811300011, - -8.249688408999887 - ], - [ - 128.91635175900004, - -8.254652601999837 - ], - [ - 128.88770592500023, - -8.244886976999808 - ], - [ - 128.85230553500006, - -8.222914320999877 - ], - [ - 128.83448326900023, - -8.199802341999842 - ], - [ - 128.85840905000012, - -8.185723565999893 - ], - [ - 128.88949629000004, - -8.177829684999907 - ], - [ - 128.98536217500023, - -8.185723565999893 - ], - [ - 128.98951256600017, - -8.188897393999852 - ], - [ - 129.02963300899998, - -8.206801039999903 - ], - [ - 129.03614342500006, - -8.22031015399989 - ] - ] - ], - [ - [ - [ - 138.9044702480002, - -8.351739190999865 - ], - [ - 138.91089928500006, - -8.374769789999931 - ], - [ - 138.90984134200008, - -8.396091403999904 - ], - [ - 138.89405358200023, - -8.405450127999842 - ], - [ - 138.69996178500006, - -8.39462655999985 - ], - [ - 138.65406334700006, - -8.376153252999828 - ], - [ - 138.62989342500023, - -8.37127044099985 - ], - [ - 138.58236738400015, - -8.372979424999855 - ], - [ - 138.558360222, - -8.366631768999824 - ], - [ - 138.5480249360002, - -8.347100518999852 - ], - [ - 138.55225670700023, - -8.322686455999886 - ], - [ - 138.56421959700006, - -8.307305596999853 - ], - [ - 138.63998457100004, - -8.257012627999885 - ], - [ - 138.65723717500012, - -8.241143487999864 - ], - [ - 138.6647241550002, - -8.223890882999854 - ], - [ - 138.66716556100002, - -8.203057549999883 - ], - [ - 138.67505944100012, - -8.189141533999901 - ], - [ - 138.68881269600004, - -8.181329033999901 - ], - [ - 138.72852623800023, - -8.176690362999878 - ], - [ - 138.78532962300008, - -8.15894947699988 - ], - [ - 138.81690514400006, - -8.161879164999903 - ], - [ - 138.83139082100004, - -8.185642184999907 - ], - [ - 138.83529707100004, - -8.219008070999891 - ], - [ - 138.83529707100004, - -8.25123463299984 - ], - [ - 138.84197024800008, - -8.276950778999876 - ], - [ - 138.85816491000006, - -8.297458591999842 - ], - [ - 138.89730879000015, - -8.33717213299984 - ], - [ - 138.9044702480002, - -8.351739190999865 - ] - ] - ], - [ - [ - [ - 127.68913821700019, - -8.237888278999918 - ], - [ - 127.669200066, - -8.240899346999825 - ], - [ - 127.64812259200019, - -8.235772393999909 - ], - [ - 127.62077884200002, - -8.21266041499986 - ], - [ - 127.60401451900012, - -8.206801039999903 - ], - [ - 127.68295332100004, - -8.15520598799985 - ], - [ - 127.70264733200005, - -8.151462497999916 - ], - [ - 127.72291100400011, - -8.153008721999868 - ], - [ - 127.74187259200019, - -8.15894947699988 - ], - [ - 127.76059004000015, - -8.17392343499992 - ], - [ - 127.77198326900023, - -8.194431247999873 - ], - [ - 127.76880944100017, - -8.212579033999873 - ], - [ - 127.74488366, - -8.220472914999945 - ], - [ - 127.72437584700006, - -8.223728122999887 - ], - [ - 127.68913821700019, - -8.237888278999918 - ] - ] - ], - [ - [ - [ - 117.55372155000006, - -8.379001559999864 - ], - [ - 117.53394616000017, - -8.38494231599988 - ], - [ - 117.52613366000017, - -8.381768487999821 - ], - [ - 117.49252363400015, - -8.36101653399983 - ], - [ - 117.48487389400012, - -8.350192966999927 - ], - [ - 117.48560631600006, - -8.343031507999882 - ], - [ - 117.49594160200016, - -8.329766533999859 - ], - [ - 117.51124108200011, - -8.295505466999884 - ], - [ - 117.51075280000012, - -8.281019789999931 - ], - [ - 117.49976647200018, - -8.26523202899989 - ], - [ - 117.48975670700011, - -8.25741952899989 - ], - [ - 117.48462975400017, - -8.255059502999842 - ], - [ - 117.48267662900005, - -8.250664971999868 - ], - [ - 117.48047936300023, - -8.209161065999865 - ], - [ - 117.48161868600008, - -8.195000908999845 - ], - [ - 117.48682701900017, - -8.182875257999854 - ], - [ - 117.493907097, - -8.176202080999886 - ], - [ - 117.54835045700023, - -8.149021091999884 - ], - [ - 117.56348717500012, - -8.145196221999868 - ], - [ - 117.66431725400011, - -8.148125908999887 - ], - [ - 117.67310631600006, - -8.154066664999917 - ], - [ - 117.68336022200018, - -8.158623955999857 - ], - [ - 117.69174238400015, - -8.164727471999853 - ], - [ - 117.69532311300011, - -8.175876559999864 - ], - [ - 117.69255618600008, - -8.183526299999897 - ], - [ - 117.68539472700004, - -8.189222914999874 - ], - [ - 117.66732832099999, - -8.199395440999837 - ], - [ - 117.64031009200002, - -8.224053643999824 - ], - [ - 117.62061608200011, - -8.253594658999887 - ], - [ - 117.5665796230002, - -8.363946221999853 - ], - [ - 117.55372155000006, - -8.379001559999864 - ] - ] - ], - [ - [ - [ - 119.10035241000006, - -8.251560153999861 - ], - [ - 119.07878665500007, - -8.2621395809999 - ], - [ - 119.05152428500006, - -8.261407158999873 - ], - [ - 119.02279707099999, - -8.234307549999855 - ], - [ - 119.02027428500017, - -8.189711195999863 - ], - [ - 119.04200280000023, - -8.148532809999892 - ], - [ - 119.08643639400006, - -8.13152434699984 - ], - [ - 119.113047722, - -8.146661065999837 - ], - [ - 119.13152103000007, - -8.166273695999806 - ], - [ - 119.13746178500017, - -8.190606377999856 - ], - [ - 119.12720787900005, - -8.220472914999945 - ], - [ - 119.11654707100004, - -8.235609632999854 - ], - [ - 119.10035241000006, - -8.251560153999861 - ] - ] - ], - [ - [ - [ - 124.56869550900015, - -8.13103606599985 - ], - [ - 124.585703972, - -8.14576588299984 - ], - [ - 124.58920332100004, - -8.190606377999856 - ], - [ - 124.60303795700011, - -8.206801039999903 - ], - [ - 124.64340254000015, - -8.180433851999823 - ], - [ - 124.66504967500023, - -8.169691664999903 - ], - [ - 124.68799889400023, - -8.165215752999842 - ], - [ - 124.77361087300002, - -8.15894947699988 - ], - [ - 124.89828535200016, - -8.168145440999865 - ], - [ - 124.93816165500007, - -8.15894947699988 - ], - [ - 124.94532311300011, - -8.154554945999806 - ], - [ - 124.94776451900023, - -8.151136976999808 - ], - [ - 124.95232181100008, - -8.149834893999895 - ], - [ - 124.96607506600017, - -8.151543877999899 - ], - [ - 124.97087649800008, - -8.154229424999883 - ], - [ - 124.97624759200002, - -8.158868096999896 - ], - [ - 124.98422285199999, - -8.163262627999885 - ], - [ - 124.99675540500019, - -8.165215752999842 - ], - [ - 125.04656009200008, - -8.157810153999847 - ], - [ - 125.08082116000006, - -8.159437757999868 - ], - [ - 125.08692467500012, - -8.158786716999913 - ], - [ - 125.09253991000006, - -8.16155364399988 - ], - [ - 125.10320071700008, - -8.172621351999823 - ], - [ - 125.12452233200023, - -8.205824476999837 - ], - [ - 125.134043816, - -8.217054945999848 - ], - [ - 125.13917076900023, - -8.233575127999828 - ], - [ - 125.13746178500006, - -8.321384372999887 - ], - [ - 125.13428795700017, - -8.339043877999899 - ], - [ - 125.123301629, - -8.352308851999837 - ], - [ - 125.09978274800002, - -8.357598565999822 - ], - [ - 125.07886803500017, - -8.359307549999826 - ], - [ - 125.021250847, - -8.37127044099985 - ], - [ - 124.93238366000017, - -8.377373955999843 - ], - [ - 124.76612389400017, - -8.408461195999848 - ], - [ - 124.72535241000011, - -8.409763278999847 - ], - [ - 124.6700952480002, - -8.40309010199988 - ], - [ - 124.66163170700023, - -8.403415622999901 - ], - [ - 124.65015709700012, - -8.405450127999842 - ], - [ - 124.63917076900023, - -8.41025155999992 - ], - [ - 124.61670983200023, - -8.423109632999854 - ], - [ - 124.59644616000006, - -8.428155205999886 - ], - [ - 124.57601972700016, - -8.43743254999984 - ], - [ - 124.55909264400006, - -8.440687757999882 - ], - [ - 124.54957116000017, - -8.445896091999884 - ], - [ - 124.54460696700002, - -8.447035414999917 - ], - [ - 124.53842207100016, - -8.445000908999887 - ], - [ - 124.52654056100019, - -8.43564218499985 - ], - [ - 124.52035566500015, - -8.432793877999913 - ], - [ - 124.50196373800011, - -8.429782809999907 - ], - [ - 124.49545332099999, - -8.430352471999882 - ], - [ - 124.48633873800011, - -8.432793877999913 - ], - [ - 124.46070397200006, - -8.445082289999874 - ], - [ - 124.45541425900015, - -8.447035414999917 - ], - [ - 124.44955488400004, - -8.450290622999859 - ], - [ - 124.44418379000015, - -8.457207940999865 - ], - [ - 124.43751061300011, - -8.464288018999824 - ], - [ - 124.42790774800002, - -8.467461846999882 - ], - [ - 124.41822350400017, - -8.464613539999945 - ], - [ - 124.40691165500019, - -8.451104424999869 - ], - [ - 124.39682050900004, - -8.447035414999917 - ], - [ - 124.39096113399998, - -8.448907158999887 - ], - [ - 124.3732202480002, - -8.458265882999825 - ], - [ - 124.37029056100008, - -8.460625908999873 - ], - [ - 124.35710696700014, - -8.456312757999868 - ], - [ - 124.35075931100019, - -8.448825778999904 - ], - [ - 124.34620201900023, - -8.439222914999917 - ], - [ - 124.33855228000013, - -8.429375908999901 - ], - [ - 124.33350670700005, - -8.413018487999892 - ], - [ - 124.34538821700002, - -8.39641692499984 - ], - [ - 124.37647545700023, - -8.37127044099985 - ], - [ - 124.38607832100004, - -8.35833098799985 - ], - [ - 124.40674889400023, - -8.320570570999877 - ], - [ - 124.41049238400015, - -8.306084893999838 - ], - [ - 124.47266686300006, - -8.268812757999868 - ], - [ - 124.50440514400023, - -8.264092705999857 - ], - [ - 124.51417076900006, - -8.261407158999873 - ], - [ - 124.51929772200018, - -8.257500908999873 - ], - [ - 124.532969597, - -8.243829033999845 - ], - [ - 124.54297936300011, - -8.237888278999918 - ], - [ - 124.54761803500006, - -8.230726820999877 - ], - [ - 124.54761803500006, - -8.223728122999887 - ], - [ - 124.53777103000019, - -8.220472914999945 - ], - [ - 124.51563561300023, - -8.225681247999844 - ], - [ - 124.49317467500023, - -8.233493747999844 - ], - [ - 124.4212345710001, - -8.267510674999869 - ], - [ - 124.39242597700016, - -8.26523202899989 - ], - [ - 124.39682050900004, - -8.220472914999945 - ], - [ - 124.405528191, - -8.211114190999822 - ], - [ - 124.41968834700006, - -8.202243747999873 - ], - [ - 124.43279056100019, - -8.191094658999845 - ], - [ - 124.43848717500006, - -8.175876559999864 - ], - [ - 124.44190514400012, - -8.162041924999869 - ], - [ - 124.45069420700017, - -8.149021091999884 - ], - [ - 124.46265709700018, - -8.138604424999897 - ], - [ - 124.47527103000007, - -8.132582289999888 - ], - [ - 124.49634850400011, - -8.138604424999897 - ], - [ - 124.54542076900023, - -8.130140882999854 - ], - [ - 124.56869550900015, - -8.13103606599985 - ] - ] - ], - [ - [ - [ - 127.83253014400012, - -8.098565362999864 - ], - [ - 127.86793053500006, - -8.106215101999894 - ], - [ - 127.94027753999998, - -8.13103606599985 - ], - [ - 128.01783287900005, - -8.143161716999842 - ], - [ - 128.05738366000017, - -8.142022393999895 - ], - [ - 128.090586785, - -8.13103606599985 - ], - [ - 128.12354576900006, - -8.150323174999883 - ], - [ - 128.12745201900006, - -8.161309502999842 - ], - [ - 128.11793053500017, - -8.17888762799987 - ], - [ - 128.06641686300011, - -8.220472914999945 - ], - [ - 128.05396569100017, - -8.226820570999877 - ], - [ - 128.04151451900023, - -8.255059502999842 - ], - [ - 128.02564537900005, - -8.261407158999873 - ], - [ - 128.00863691500015, - -8.258721612999892 - ], - [ - 127.99415123800011, - -8.251885674999883 - ], - [ - 127.9519962900001, - -8.223890882999854 - ], - [ - 127.93930097700004, - -8.21819426899988 - ], - [ - 127.92530358200023, - -8.215101820999806 - ], - [ - 127.86378014400012, - -8.210707289999903 - ], - [ - 127.84359785200016, - -8.205743096999853 - ], - [ - 127.82699629000004, - -8.196384372999916 - ], - [ - 127.80209394600016, - -8.176202080999886 - ], - [ - 127.79322350400005, - -8.162367445999806 - ], - [ - 127.78956139400017, - -8.141371351999851 - ], - [ - 127.78516686300006, - -8.131605726999823 - ], - [ - 127.7755639980002, - -8.124607028999932 - ], - [ - 127.76156660200016, - -8.117445570999806 - ], - [ - 127.76563561300011, - -8.108086846999853 - ], - [ - 127.77418053500006, - -8.10344817499984 - ], - [ - 127.78516686300006, - -8.102308851999808 - ], - [ - 127.79639733200011, - -8.103773695999863 - ], - [ - 127.83253014400012, - -8.098565362999864 - ] - ] - ], - [ - [ - [ - 117.97120201900006, - -8.100355726999851 - ], - [ - 117.97754967500012, - -8.109144789999903 - ], - [ - 117.986094597, - -8.10719166499986 - ], - [ - 117.99610436300011, - -8.100681247999873 - ], - [ - 118.00505618600002, - -8.100192966999884 - ], - [ - 118.024180535, - -8.103773695999863 - ], - [ - 118.07154381600006, - -8.105401299999883 - ], - [ - 118.11524498800023, - -8.113864841999913 - ], - [ - 118.14966881600017, - -8.134454033999859 - ], - [ - 118.16822350400017, - -8.172621351999823 - ], - [ - 118.17269941500004, - -8.213148695999848 - ], - [ - 118.17725670700005, - -8.232679945999834 - ], - [ - 118.18506920700005, - -8.240899346999825 - ], - [ - 118.18913821700002, - -8.248223565999837 - ], - [ - 118.222911004, - -8.288750908999845 - ], - [ - 118.24390709700006, - -8.328708591999899 - ], - [ - 118.25359134200014, - -8.340264580999829 - ], - [ - 118.25953209700006, - -8.342868747999916 - ], - [ - 118.26417076900006, - -8.340997002999856 - ], - [ - 118.26807701900017, - -8.338067315999837 - ], - [ - 118.27068118600008, - -8.33717213299984 - ], - [ - 118.30396569100006, - -8.368259372999844 - ], - [ - 118.31226647200006, - -8.37127044099985 - ], - [ - 118.32781009200002, - -8.3676083309999 - ], - [ - 118.34701582099999, - -8.357354424999869 - ], - [ - 118.36524498800006, - -8.344659112999821 - ], - [ - 118.39161217500006, - -8.318454684999878 - ], - [ - 118.39828535200004, - -8.309014580999857 - ], - [ - 118.40113366000017, - -8.299248955999829 - ], - [ - 118.40642337300002, - -8.295586846999868 - ], - [ - 118.41814212300002, - -8.290134372999916 - ], - [ - 118.42986087300014, - -8.282484632999811 - ], - [ - 118.44361412900005, - -8.257907809999878 - ], - [ - 118.46338951900017, - -8.249444268999852 - ], - [ - 118.486094597, - -8.246189059999892 - ], - [ - 118.50342858200011, - -8.247735283999845 - ], - [ - 118.51319420700023, - -8.253187757999882 - ], - [ - 118.52955162900005, - -8.266289971999853 - ], - [ - 118.54102623800011, - -8.268812757999868 - ], - [ - 118.58228600400005, - -8.268812757999868 - ], - [ - 118.59017988400004, - -8.270684502999828 - ], - [ - 118.59644616000017, - -8.274672132999811 - ], - [ - 118.60173587300002, - -8.279066664999888 - ], - [ - 118.60645592500023, - -8.28191497199984 - ], - [ - 118.63941491000006, - -8.286309502999913 - ], - [ - 118.64747155000018, - -8.288750908999845 - ], - [ - 118.66374759200019, - -8.305759372999901 - ], - [ - 118.69581139400006, - -8.37127044099985 - ], - [ - 118.68913821700014, - -8.387872002999899 - ], - [ - 118.68474368600002, - -8.41269296699987 - ], - [ - 118.68148847699999, - -8.456963799999826 - ], - [ - 118.65650475400017, - -8.526462497999844 - ], - [ - 118.65430748800006, - -8.542087497999916 - ], - [ - 118.66732832100016, - -8.547295830999914 - ], - [ - 118.68311608200011, - -8.53346119599982 - ], - [ - 118.69646243600002, - -8.514580987999878 - ], - [ - 118.70199629000015, - -8.504489841999913 - ], - [ - 118.70427493600013, - -8.49700286299985 - ], - [ - 118.71517988399998, - -8.471449476999865 - ], - [ - 118.72689863399998, - -8.451836846999896 - ], - [ - 118.72584069100006, - -8.441989841999884 - ], - [ - 118.72095787900017, - -8.432061455999886 - ], - [ - 118.71631920700023, - -8.41912200299987 - ], - [ - 118.71697024800008, - -8.37957122199984 - ], - [ - 118.73145592500012, - -8.349297783999845 - ], - [ - 118.75391686300023, - -8.326429945999834 - ], - [ - 118.77784264400012, - -8.309258721999896 - ], - [ - 118.81267337300002, - -8.295586846999868 - ], - [ - 118.85922285200016, - -8.288832289999917 - ], - [ - 118.90805097700016, - -8.288832289999917 - ], - [ - 118.94971764400012, - -8.295586846999868 - ], - [ - 118.97250410200004, - -8.302015882999882 - ], - [ - 118.98829186300011, - -8.309014580999857 - ], - [ - 118.99830162900017, - -8.321221612999835 - ], - [ - 119.00440514400017, - -8.343357028999904 - ], - [ - 119.00733483200005, - -8.372002862999878 - ], - [ - 119.02165774800008, - -8.419528903999876 - ], - [ - 119.05111738400015, - -8.470472914999888 - ], - [ - 119.04558353000002, - -8.508965752999885 - ], - [ - 119.030528191, - -8.547784112999892 - ], - [ - 119.03842207099999, - -8.582940362999864 - ], - [ - 119.038340691, - -8.607679945999848 - ], - [ - 119.04151451900006, - -8.629815362999821 - ], - [ - 119.05225670700011, - -8.645684502999842 - ], - [ - 119.07569420700005, - -8.65195077899989 - ], - [ - 119.09050540500002, - -8.649102471999853 - ], - [ - 119.11085045700023, - -8.642266533999845 - ], - [ - 119.13013756600017, - -8.633396091999884 - ], - [ - 119.14087975400017, - -8.624607028999918 - ], - [ - 119.14039147200018, - -8.615329684999864 - ], - [ - 119.13542728000002, - -8.60621510199988 - ], - [ - 119.13396243600008, - -8.59937916499986 - ], - [ - 119.154551629, - -8.59441497199991 - ], - [ - 119.15967858200023, - -8.58806731599988 - ], - [ - 119.16138756600006, - -8.57838307099982 - ], - [ - 119.16138756600006, - -8.565850518999824 - ], - [ - 119.16732832100016, - -8.559747002999842 - ], - [ - 119.180918816, - -8.573011976999865 - ], - [ - 119.19507897200006, - -8.594008070999806 - ], - [ - 119.20362389400023, - -8.61093515399989 - ], - [ - 119.19922936300006, - -8.612399997999844 - ], - [ - 119.19312584700018, - -8.615980726999823 - ], - [ - 119.18930097700016, - -8.617771091999899 - ], - [ - 119.19434655000012, - -8.626071872999887 - ], - [ - 119.18946373800023, - -8.631280205999872 - ], - [ - 119.180918816, - -8.636488539999874 - ], - [ - 119.17497806100019, - -8.64511484199987 - ], - [ - 119.17408287900011, - -8.659926039999945 - ], - [ - 119.177012566, - -8.674493096999882 - ], - [ - 119.18246504000015, - -8.688164971999825 - ], - [ - 119.18930097700016, - -8.700290622999901 - ], - [ - 119.18100019599999, - -8.703383070999806 - ], - [ - 119.17774498800023, - -8.706801039999903 - ], - [ - 119.17823326900023, - -8.71209075299987 - ], - [ - 119.1818139980002, - -8.720798434999864 - ], - [ - 119.16456139400012, - -8.731540622999873 - ], - [ - 119.15162194100017, - -8.742364190999865 - ], - [ - 119.13843834700006, - -8.745782158999873 - ], - [ - 119.120371941, - -8.734470309999892 - ], - [ - 119.11670983200005, - -8.747816664999903 - ], - [ - 119.11003665500013, - -8.753594658999873 - ], - [ - 119.10059655000012, - -8.752129815999822 - ], - [ - 119.08969160200004, - -8.744317315999822 - ], - [ - 119.07789147200006, - -8.739353122999873 - ], - [ - 119.06544030000023, - -8.74114348799985 - ], - [ - 119.052989129, - -8.745538018999838 - ], - [ - 118.99154707100004, - -8.755059502999842 - ], - [ - 118.97185306100019, - -8.751153252999842 - ], - [ - 118.94597415500019, - -8.73064544099988 - ], - [ - 118.92359459700006, - -8.698500257999825 - ], - [ - 118.91553795700023, - -8.692152601999894 - ], - [ - 118.89844811300006, - -8.688409112999864 - ], - [ - 118.89193769599999, - -8.693454684999892 - ], - [ - 118.8885197270001, - -8.703301690999822 - ], - [ - 118.88086998800023, - -8.713962497999844 - ], - [ - 118.85710696700008, - -8.721774997999844 - ], - [ - 118.81332441499998, - -8.710219007999811 - ], - [ - 118.79135175900015, - -8.720798434999864 - ], - [ - 118.76514733200023, - -8.710870049999855 - ], - [ - 118.74642988400015, - -8.717868747999844 - ], - [ - 118.72779381600017, - -8.733168226999808 - ], - [ - 118.70199629000015, - -8.74814218499992 - ], - [ - 118.71192467500023, - -8.754815362999892 - ], - [ - 118.72657311300017, - -8.769789320999834 - ], - [ - 118.73617597700004, - -8.774672132999896 - ], - [ - 118.74659264400012, - -8.776299737999821 - ], - [ - 118.82569420700011, - -8.776543877999856 - ], - [ - 118.90723717500023, - -8.78972747199991 - ], - [ - 118.92693118600019, - -8.79656340899983 - ], - [ - 118.93539472700004, - -8.806084893999824 - ], - [ - 118.93775475400017, - -8.812269789999888 - ], - [ - 118.94752037900005, - -8.825372002999856 - ], - [ - 118.94971764400012, - -8.833672783999845 - ], - [ - 118.944590691, - -8.84148528399983 - ], - [ - 118.93246504000004, - -8.84644947699988 - ], - [ - 118.90805097700016, - -8.85051848799985 - ], - [ - 118.89682050900015, - -8.849786065999822 - ], - [ - 118.87696373800023, - -8.84539153399983 - ], - [ - 118.86719811300011, - -8.84433359199987 - ], - [ - 118.8517358730002, - -8.838148695999806 - ], - [ - 118.84595787900005, - -8.836846612999906 - ], - [ - 118.84669030000023, - -8.839125257999882 - ], - [ - 118.84229576900006, - -8.843926690999865 - ], - [ - 118.83562259200014, - -8.848402601999837 - ], - [ - 118.82927493600019, - -8.85051848799985 - ], - [ - 118.81763756600017, - -8.84351978999986 - ], - [ - 118.77735436300011, - -8.811618747999844 - ], - [ - 118.75733483200023, - -8.802015882999868 - ], - [ - 118.71404056100008, - -8.799981377999842 - ], - [ - 118.66895592500006, - -8.806898695999834 - ], - [ - 118.4650171230002, - -8.865004164999888 - ], - [ - 118.41423587300002, - -8.85361093499992 - ], - [ - 118.38738040500007, - -8.795830987999892 - ], - [ - 118.39112389400006, - -8.77019622199984 - ], - [ - 118.40503991000017, - -8.7504208309999 - ], - [ - 118.422129754, - -8.731052341999884 - ], - [ - 118.43523196700008, - -8.70647551899988 - ], - [ - 118.43873131600017, - -8.690036716999884 - ], - [ - 118.43970787900005, - -8.674574476999865 - ], - [ - 118.43832441500015, - -8.65976327899989 - ], - [ - 118.43523196700008, - -8.64511484199987 - ], - [ - 118.42855879000004, - -8.629815362999821 - ], - [ - 118.42042076900012, - -8.615655205999886 - ], - [ - 118.41456139400017, - -8.600518487999892 - ], - [ - 118.41472415500002, - -8.582940362999864 - ], - [ - 118.40040123800023, - -8.596123955999914 - ], - [ - 118.39698326900023, - -8.617933851999865 - ], - [ - 118.40113366000017, - -8.662367445999877 - ], - [ - 118.39356530000012, - -8.674574476999865 - ], - [ - 118.37623131600006, - -8.680759372999916 - ], - [ - 118.3556421230002, - -8.684991143999852 - ], - [ - 118.33904056100002, - -8.692152601999894 - ], - [ - 118.31226647200006, - -8.726983330999829 - ], - [ - 118.29932701900023, - -8.757907809999878 - ], - [ - 118.29493248800023, - -8.765232028999876 - ], - [ - 118.28663170700005, - -8.770440362999878 - ], - [ - 118.27491295700005, - -8.772149346999882 - ], - [ - 118.15772545700011, - -8.86785247199984 - ], - [ - 118.14031009200002, - -8.872247002999913 - ], - [ - 118.11947675900015, - -8.862969658999859 - ], - [ - 118.09799238400004, - -8.850274346999896 - ], - [ - 118.07886803500006, - -8.84433359199987 - ], - [ - 118.07016035200016, - -8.846286716999913 - ], - [ - 118.03728274800008, - -8.858005466999899 - ], - [ - 118.03858483200005, - -8.856052341999856 - ], - [ - 118.03516686300006, - -8.853122653999847 - ], - [ - 118.02955162900017, - -8.850844007999868 - ], - [ - 118.024180535, - -8.85051848799985 - ], - [ - 118.01677493600002, - -8.862562757999854 - ], - [ - 118.00847415500007, - -8.867771091999856 - ], - [ - 117.99838300899998, - -8.880954684999892 - ], - [ - 117.89047285200016, - -8.936781507999882 - ], - [ - 117.88013756600006, - -8.928317966999842 - ], - [ - 117.87289472700004, - -8.92782968499985 - ], - [ - 117.86622155000018, - -8.93092213299984 - ], - [ - 117.85670006600017, - -8.933038018999852 - ], - [ - 117.85303795700011, - -8.929131768999852 - ], - [ - 117.84498131600017, - -8.910902601999865 - ], - [ - 117.83936608200005, - -8.905694268999866 - ], - [ - 117.82545006600012, - -8.905450127999828 - ], - [ - 117.817637566, - -8.911228122999887 - ], - [ - 117.81202233200011, - -8.919203382999854 - ], - [ - 117.80518639400006, - -8.926202080999829 - ], - [ - 117.79558353000013, - -8.930759372999873 - ], - [ - 117.78793378999998, - -8.932793877999899 - ], - [ - 117.77442467500012, - -8.933038018999852 - ], - [ - 117.76758873800011, - -8.931247653999861 - ], - [ - 117.75717207099999, - -8.926527601999851 - ], - [ - 117.74781334700018, - -8.92099374799993 - ], - [ - 117.73780358200005, - -8.909763278999918 - ], - [ - 117.72510826900012, - -8.912041924999897 - ], - [ - 117.71290123800023, - -8.917413018999866 - ], - [ - 117.70899498800023, - -8.920017184999864 - ], - [ - 117.66765384200014, - -8.937107028999904 - ], - [ - 117.55811608200005, - -9.001885674999912 - ], - [ - 117.51807701900023, - -9.01783619599982 - ], - [ - 117.47388756600006, - -9.029961846999825 - ], - [ - 117.38886774800002, - -9.053738711999898 - ], - [ - 117.33413203800004, - -9.059354224999836 - ], - [ - 117.30050792500018, - -9.047070401999903 - ], - [ - 117.27385838899997, - -9.040239581999856 - ], - [ - 117.22614543300003, - -9.023780684999807 - ], - [ - 117.19240561200004, - -9.023726812999868 - ], - [ - 117.17144575300009, - -9.032049267999867 - ], - [ - 117.1534646800001, - -9.061166275999838 - ], - [ - 117.14096893700005, - -9.076417890999934 - ], - [ - 117.1268009770001, - -9.091241143999838 - ], - [ - 117.07129967500012, - -9.101739190999893 - ], - [ - 117.0097356150001, - -9.107292888999865 - ], - [ - 116.99142139600005, - -9.085126613999918 - ], - [ - 116.97039034600019, - -9.071334698999891 - ], - [ - 116.94922936300006, - -9.060153903999918 - ], - [ - 116.92823326900023, - -9.063897393999866 - ], - [ - 116.90642337300008, - -9.063409112999878 - ], - [ - 116.85027103000019, - -9.045342705999857 - ], - [ - 116.82829837300008, - -9.042901299999826 - ], - [ - 116.80616295700011, - -9.036309502999842 - ], - [ - 116.77393639400023, - -9.012790622999887 - ], - [ - 116.76303144600016, - -9.015557549999855 - ], - [ - 116.758555535, - -9.004571221999882 - ], - [ - 116.74537194100006, - -8.983086846999868 - ], - [ - 116.72845166200003, - -8.963095719999927 - ], - [ - 116.73119975700004, - -8.946521530999831 - ], - [ - 116.74790651800018, - -8.922928004999918 - ], - [ - 116.74086780600024, - -8.905055321999853 - ], - [ - 116.73661259900004, - -8.883020736999867 - ], - [ - 116.73517982600018, - -8.873397366999882 - ], - [ - 116.75883945400008, - -8.849859070999813 - ], - [ - 116.77690855500012, - -8.826346783999867 - ], - [ - 116.81714928500006, - -8.818129164999931 - ], - [ - 116.82447350400005, - -8.799004815999865 - ], - [ - 116.82129967500006, - -8.78728606599988 - ], - [ - 116.81446373800006, - -8.780043226999851 - ], - [ - 116.80762780000023, - -8.775485934999907 - ], - [ - 116.80453535200016, - -8.771661065999893 - ], - [ - 116.80250084700006, - -8.764580987999835 - ], - [ - 116.79737389400012, - -8.754571221999853 - ], - [ - 116.79070071700008, - -8.745375257999868 - ], - [ - 116.77107815800017, - -8.747815281999877 - ], - [ - 116.76407471300016, - -8.738189313999854 - ], - [ - 116.77234298600004, - -8.705071437999877 - ], - [ - 116.77226736300005, - -8.68025719799985 - ], - [ - 116.74851672300011, - -8.666544377999898 - ], - [ - 116.79009149300012, - -8.583704495999854 - ], - [ - 116.83204186300011, - -8.574802341999856 - ], - [ - 116.83936608200011, - -8.554864190999865 - ], - [ - 116.83814537900017, - -8.50790780999992 - ], - [ - 116.85726972700016, - -8.524021091999899 - ], - [ - 116.86589603000007, - -8.527601820999877 - ], - [ - 116.87964928500017, - -8.528252862999821 - ], - [ - 116.89039147200018, - -8.526299737999878 - ], - [ - 116.9845483730002, - -8.495782158999845 - ], - [ - 117.03199303500006, - -8.468357028999876 - ], - [ - 117.09017988400015, - -8.425225518999866 - ], - [ - 117.12614993600002, - -8.405450127999842 - ], - [ - 117.11768639400012, - -8.383477471999825 - ], - [ - 117.14047285200004, - -8.372002862999878 - ], - [ - 117.17351321700008, - -8.365166924999869 - ], - [ - 117.19507897200018, - -8.357598565999822 - ], - [ - 117.21558678500006, - -8.38494231599988 - ], - [ - 117.22901451900023, - -8.388116143999852 - ], - [ - 117.261973504, - -8.390313408999845 - ], - [ - 117.2737736340001, - -8.395196221999825 - ], - [ - 117.28736412900005, - -8.404961846999853 - ], - [ - 117.31609134200008, - -8.419691664999931 - ], - [ - 117.35320071700019, - -8.446709893999895 - ], - [ - 117.43392988400004, - -8.481133721999825 - ], - [ - 117.42774498800023, - -8.4652645809999 - ], - [ - 117.43116295700023, - -8.453301690999865 - ], - [ - 117.43775475400005, - -8.442315362999821 - ], - [ - 117.44141686300006, - -8.429375908999901 - ], - [ - 117.44271894600016, - -8.410739841999913 - ], - [ - 117.44727623800011, - -8.4086239559999 - ], - [ - 117.45573978000007, - -8.414239190999908 - ], - [ - 117.46876061300023, - -8.41912200299987 - ], - [ - 117.51970462300008, - -8.418715101999865 - ], - [ - 117.54411868600019, - -8.414239190999908 - ], - [ - 117.55811608200005, - -8.405450127999842 - ], - [ - 117.56788170700011, - -8.422295830999843 - ], - [ - 117.57691491, - -8.487074476999851 - ], - [ - 117.59229576900023, - -8.514743747999844 - ], - [ - 117.59815514400012, - -8.493910414999874 - ], - [ - 117.59994550899998, - -8.446058851999851 - ], - [ - 117.61280358200011, - -8.432793877999913 - ], - [ - 117.62330162900017, - -8.438409112999821 - ], - [ - 117.62907962300002, - -8.4574520809999 - ], - [ - 117.63550866000006, - -8.524997653999876 - ], - [ - 117.63965905000012, - -8.540622653999861 - ], - [ - 117.64909915500013, - -8.551853122999859 - ], - [ - 117.69874108200023, - -8.576755466999899 - ], - [ - 117.71111087300008, - -8.573907158999859 - ], - [ - 117.7208764980002, - -8.568536065999893 - ], - [ - 117.73072350400005, - -8.565362237999835 - ], - [ - 117.74382571700019, - -8.569268487999835 - ], - [ - 117.73943118600019, - -8.576267184999907 - ], - [ - 117.73633873800011, - -8.582940362999864 - ], - [ - 117.74756920700023, - -8.585707289999917 - ], - [ - 117.75619550900004, - -8.589532158999845 - ], - [ - 117.76368248800011, - -8.595310153999904 - ], - [ - 117.77165774800002, - -8.60409921699987 - ], - [ - 117.76889082099999, - -8.607110283999873 - ], - [ - 117.76465905000018, - -8.614190362999835 - ], - [ - 117.76465905000018, - -8.621270440999893 - ], - [ - 117.77442467500012, - -8.624607028999918 - ], - [ - 117.78207441500004, - -8.625258070999877 - ], - [ - 117.78630618600008, - -8.627699476999808 - ], - [ - 117.78874759200019, - -8.631931247999916 - ], - [ - 117.79151451900023, - -8.638116143999895 - ], - [ - 117.78077233200023, - -8.637627862999821 - ], - [ - 117.77149498800006, - -8.638604424999883 - ], - [ - 117.76368248800011, - -8.641045830999829 - ], - [ - 117.75733483200005, - -8.64511484199987 - ], - [ - 117.76531009200014, - -8.659926039999945 - ], - [ - 117.77833092500012, - -8.695977471999896 - ], - [ - 117.78785241, - -8.710219007999811 - ], - [ - 117.80518639400006, - -8.719984632999854 - ], - [ - 117.82349694100006, - -8.719333591999899 - ], - [ - 117.88656660200016, - -8.699476820999806 - ], - [ - 117.89389082100016, - -8.700290622999901 - ], - [ - 117.90007571700002, - -8.70671965899983 - ], - [ - 117.90235436300011, - -8.715590101999865 - ], - [ - 117.90308678500006, - -8.723565362999821 - ], - [ - 117.9044702480002, - -8.726983330999829 - ], - [ - 117.91684004000015, - -8.727308851999851 - ], - [ - 117.93425540500002, - -8.729750257999882 - ], - [ - 117.952891472, - -8.736016533999845 - ], - [ - 117.96900475400017, - -8.74814218499992 - ], - [ - 117.98861738400015, - -8.732354424999883 - ], - [ - 118.03028405000012, - -8.688246351999808 - ], - [ - 118.04786217500012, - -8.679131768999895 - ], - [ - 118.04859459700006, - -8.675957940999837 - ], - [ - 118.0548608730002, - -8.669203382999811 - ], - [ - 118.06185957099999, - -8.663344007999854 - ], - [ - 118.06527753999998, - -8.662367445999877 - ], - [ - 118.06812584700006, - -8.655938408999873 - ], - [ - 118.07496178500006, - -8.65374114399988 - ], - [ - 118.083750847, - -8.653252862999892 - ], - [ - 118.12281334700018, - -8.645765882999825 - ], - [ - 118.15772545700011, - -8.64511484199987 - ], - [ - 118.16578209700006, - -8.64723072699988 - ], - [ - 118.18376712300008, - -8.656508070999848 - ], - [ - 118.19190514400012, - -8.658786716999913 - ], - [ - 118.24610436300023, - -8.657159112999892 - ], - [ - 118.26563561300023, - -8.652032158999873 - ], - [ - 118.28174889400012, - -8.641534112999906 - ], - [ - 118.291270379, - -8.624607028999918 - ], - [ - 118.29086347699999, - -8.605889580999857 - ], - [ - 118.28288821700002, - -8.587985934999892 - ], - [ - 118.26954186300023, - -8.574476820999834 - ], - [ - 118.25359134200014, - -8.569268487999835 - ], - [ - 118.25025475400011, - -8.56454843499992 - ], - [ - 118.24187259200002, - -8.5551083309999 - ], - [ - 118.23316491000006, - -8.54851653399983 - ], - [ - 118.22917728000007, - -8.552504164999903 - ], - [ - 118.22706139400023, - -8.55836353999986 - ], - [ - 118.22234134200008, - -8.564873955999843 - ], - [ - 118.20923912900017, - -8.576755466999899 - ], - [ - 118.19288170700005, - -8.549493096999896 - ], - [ - 118.14893639400023, - -8.512139580999857 - ], - [ - 118.13355553500011, - -8.486748955999829 - ], - [ - 118.12671959700018, - -8.486748955999829 - ], - [ - 118.11719811300006, - -8.496514580999872 - ], - [ - 118.10328209700012, - -8.48837655999985 - ], - [ - 118.07545006600006, - -8.456963799999826 - ], - [ - 118.05746504000004, - -8.45061614399988 - ], - [ - 118.03638756600017, - -8.457289320999848 - ], - [ - 118.00318444100017, - -8.473728122999844 - ], - [ - 117.98845462300008, - -8.469984632999811 - ], - [ - 117.97022545700011, - -8.4613583309999 - ], - [ - 117.95492597700004, - -8.451267184999935 - ], - [ - 117.93995201900012, - -8.432793877999913 - ], - [ - 117.88152103000002, - -8.398614190999822 - ], - [ - 117.82252037900017, - -8.354180596999896 - ], - [ - 117.81006920700017, - -8.34002044099988 - ], - [ - 117.78663170700005, - -8.30559661299985 - ], - [ - 117.77165774800002, - -8.288750908999845 - ], - [ - 117.74382571700019, - -8.268812757999868 - ], - [ - 117.73080488400004, - -8.252699476999894 - ], - [ - 117.72217858200011, - -8.244561455999872 - ], - [ - 117.71225019599999, - -8.240899346999825 - ], - [ - 117.70630944100017, - -8.229668877999828 - ], - [ - 117.71111087300008, - -8.203871351999894 - ], - [ - 117.72071373800023, - -8.176202080999886 - ], - [ - 117.72950280000012, - -8.15894947699988 - ], - [ - 117.74097741000006, - -8.147881768999852 - ], - [ - 117.74968509200002, - -8.144952080999829 - ], - [ - 117.75684655000006, - -8.145603122999873 - ], - [ - 117.76351972700004, - -8.144789320999863 - ], - [ - 117.78980553500006, - -8.127373955999886 - ], - [ - 117.79493248800017, - -8.124932549999855 - ], - [ - 117.81251061300011, - -8.12184010199988 - ], - [ - 117.89527428500006, - -8.090020440999837 - ], - [ - 117.91781660200004, - -8.085870049999897 - ], - [ - 117.95875084700006, - -8.083265882999811 - ], - [ - 117.96558678500017, - -8.088962497999887 - ], - [ - 117.97120201900006, - -8.100355726999851 - ] - ] - ], - [ - [ - [ - 131.07715905000023, - -8.142022393999895 - ], - [ - 131.07943769600004, - -8.148858330999829 - ], - [ - 131.08887780000012, - -8.151543877999899 - ], - [ - 131.09400475400005, - -8.14837004999984 - ], - [ - 131.10401451900012, - -8.134372653999876 - ], - [ - 131.10938561300006, - -8.13103606599985 - ], - [ - 131.124847852, - -8.127699476999823 - ], - [ - 131.14161217500012, - -8.121677341999913 - ], - [ - 131.16016686300023, - -8.11874765399989 - ], - [ - 131.18165123800023, - -8.124932549999855 - ], - [ - 131.1608179050002, - -8.15227629999984 - ], - [ - 131.13168379000004, - -8.167657158999873 - ], - [ - 131.10092207100004, - -8.179620049999897 - ], - [ - 131.06120853000002, - -8.205824476999837 - ], - [ - 130.99105879000015, - -8.234795830999843 - ], - [ - 130.9796655610002, - -8.236097914999931 - ], - [ - 130.95167076900006, - -8.233493747999844 - ], - [ - 130.90211022200006, - -8.249688408999887 - ], - [ - 130.8937280610002, - -8.25123463299984 - ], - [ - 130.89625084700012, - -8.28435637799987 - ], - [ - 130.892425977, - -8.296075127999856 - ], - [ - 130.87940514400012, - -8.309258721999896 - ], - [ - 130.83472741000006, - -8.335625908999901 - ], - [ - 130.82129967500023, - -8.347100518999852 - ], - [ - 130.81088300900015, - -8.35133228999986 - ], - [ - 130.76335696700008, - -8.350762627999899 - ], - [ - 130.77442467500012, - -8.334161065999837 - ], - [ - 130.81527754000015, - -8.285332940999837 - ], - [ - 130.835785352, - -8.268649997999901 - ], - [ - 130.84424889400023, - -8.254327080999914 - ], - [ - 130.85499108200023, - -8.240004164999917 - ], - [ - 130.86939537900005, - -8.233493747999844 - ], - [ - 130.87907962300008, - -8.231215101999865 - ], - [ - 130.90552819100006, - -8.219414971999896 - ], - [ - 130.91342207100004, - -8.213636976999837 - ], - [ - 130.92221113399998, - -8.198418877999856 - ], - [ - 130.92107181100008, - -8.18775807099982 - ], - [ - 130.91602623800023, - -8.17644622199984 - ], - [ - 130.91342207100004, - -8.15894947699988 - ], - [ - 130.9174910820001, - -8.141289971999868 - ], - [ - 130.92644290500013, - -8.132500908999901 - ], - [ - 130.93848717500023, - -8.132582289999888 - ], - [ - 130.95167076900006, - -8.141371351999851 - ], - [ - 130.97380618600008, - -8.145277601999851 - ], - [ - 131.01441491000017, - -8.095391533999887 - ], - [ - 131.03760826900012, - -8.083265882999811 - ], - [ - 131.0509546230002, - -8.091241143999852 - ], - [ - 131.0854598320001, - -8.124932549999855 - ], - [ - 131.079844597, - -8.133233330999843 - ], - [ - 131.07715905000023, - -8.142022393999895 - ] - ] - ], - [ - [ - [ - 122.98292076900023, - -8.160332940999865 - ], - [ - 122.97787519600004, - -8.196384372999916 - ], - [ - 123.00660241000017, - -8.261407158999873 - ], - [ - 123.02149498800011, - -8.278985283999901 - ], - [ - 123.02637780000006, - -8.288750908999845 - ], - [ - 123.02800540500019, - -8.297051690999837 - ], - [ - 123.02637780000006, - -8.320082289999888 - ], - [ - 123.01872806100008, - -8.334079684999864 - ], - [ - 123.000743035, - -8.340997002999856 - ], - [ - 122.94288170700011, - -8.34392669099988 - ], - [ - 122.92115319100006, - -8.34970468499985 - ], - [ - 122.90414472700016, - -8.363376559999878 - ], - [ - 122.89730879000015, - -8.388360283999887 - ], - [ - 122.90381920700023, - -8.42693450299987 - ], - [ - 122.90455162900017, - -8.447035414999917 - ], - [ - 122.89730879000015, - -8.460625908999873 - ], - [ - 122.87842858200023, - -8.462090752999842 - ], - [ - 122.85287519600004, - -8.454278252999842 - ], - [ - 122.83057701900012, - -8.44345468499985 - ], - [ - 122.82097415500013, - -8.436211846999825 - ], - [ - 122.81771894600016, - -8.426446221999882 - ], - [ - 122.81080162900017, - -8.428643487999878 - ], - [ - 122.80355879000015, - -8.437920830999829 - ], - [ - 122.80054772200006, - -8.450127862999892 - ], - [ - 122.80111738400004, - -8.469496351999823 - ], - [ - 122.80307050900015, - -8.477634372999844 - ], - [ - 122.80738366000017, - -8.486748955999829 - ], - [ - 122.84937584700006, - -8.552015882999825 - ], - [ - 122.84839928500017, - -8.583591403999904 - ], - [ - 122.80738366000017, - -8.61093515399989 - ], - [ - 122.79712975400005, - -8.613539320999877 - ], - [ - 122.74732506600017, - -8.620049737999878 - ], - [ - 122.74097741000006, - -8.623630466999856 - ], - [ - 122.72852623800011, - -8.63486093499985 - ], - [ - 122.72103925900015, - -8.63665129999984 - ], - [ - 122.68751061300011, - -8.631442966999842 - ], - [ - 122.67920983200023, - -8.632907809999892 - ], - [ - 122.6564233730002, - -8.64511484199987 - ], - [ - 122.64966881600017, - -8.65195077899989 - ], - [ - 122.63819420700011, - -8.65195077899989 - ], - [ - 122.56544030000023, - -8.669122002999828 - ], - [ - 122.55494225400017, - -8.676527601999808 - ], - [ - 122.52540123800011, - -8.706312757999825 - ], - [ - 122.51514733200011, - -8.71209075299987 - ], - [ - 122.44947350400011, - -8.73430754999984 - ], - [ - 122.40788821700019, - -8.741469007999882 - ], - [ - 122.30388431100019, - -8.739027601999851 - ], - [ - 122.28711998800017, - -8.740655205999872 - ], - [ - 122.26531009200019, - -8.74814218499992 - ], - [ - 122.25277754000004, - -8.749688408999873 - ], - [ - 122.22706139400017, - -8.737237237999864 - ], - [ - 122.16293378999998, - -8.726983330999829 - ], - [ - 122.114512566, - -8.732354424999883 - ], - [ - 122.07781009200019, - -8.753838799999826 - ], - [ - 122.04420006600017, - -8.780694268999895 - ], - [ - 122.00538170700005, - -8.802015882999868 - ], - [ - 121.87614993600008, - -8.837660414999917 - ], - [ - 121.83472741000006, - -8.858005466999899 - ], - [ - 121.79371178500006, - -8.883965752999899 - ], - [ - 121.78044681100013, - -8.887953382999882 - ], - [ - 121.76978600400017, - -8.88762786299985 - ], - [ - 121.75977623800011, - -8.885349216999884 - ], - [ - 121.74870853000007, - -8.883965752999899 - ], - [ - 121.73406009200008, - -8.879978122999916 - ], - [ - 121.71583092500006, - -8.870538018999909 - ], - [ - 121.69922936300011, - -8.859470309999864 - ], - [ - 121.69011478000002, - -8.85051848799985 - ], - [ - 121.67432701900006, - -8.862725518999824 - ], - [ - 121.65935306100002, - -8.898207289999903 - ], - [ - 121.64600670700023, - -8.905694268999866 - ], - [ - 121.64063561300006, - -8.896661065999865 - ], - [ - 121.63086998800023, - -8.852634372999859 - ], - [ - 121.62175540500007, - -8.836846612999906 - ], - [ - 121.58106530000023, - -8.817640882999854 - ], - [ - 121.54086347700016, - -8.814873955999886 - ], - [ - 121.50001061300011, - -8.816501559999907 - ], - [ - 121.45671634200002, - -8.810153903999876 - ], - [ - 121.42017662900011, - -8.798028252999885 - ], - [ - 121.39600670700011, - -8.794122002999885 - ], - [ - 121.378184441, - -8.799004815999865 - ], - [ - 121.36703535199999, - -8.819919528999918 - ], - [ - 121.37012780000006, - -8.842380466999913 - ], - [ - 121.37623131600017, - -8.864353122999844 - ], - [ - 121.37476647200012, - -8.883965752999899 - ], - [ - 121.340586785, - -8.918064059999907 - ], - [ - 121.29851321700008, - -8.918389580999843 - ], - [ - 121.21094811300011, - -8.892022393999838 - ], - [ - 121.16529381600017, - -8.895114841999913 - ], - [ - 121.12867272200006, - -8.908623955999886 - ], - [ - 121.06690514400023, - -8.940524997999901 - ], - [ - 121.04810631600012, - -8.94410572699988 - ], - [ - 120.99488366, - -8.940524997999901 - ], - [ - 120.96387780000006, - -8.92962004999984 - ], - [ - 120.95850670700023, - -8.92595794099988 - ], - [ - 120.93213951900023, - -8.926934502999856 - ], - [ - 120.92286217500006, - -8.926202080999829 - ], - [ - 120.90650475400017, - -8.913832289999888 - ], - [ - 120.86329186300006, - -8.869317315999893 - ], - [ - 120.85450280000012, - -8.854180596999896 - ], - [ - 120.848399285, - -8.829766533999845 - ], - [ - 120.83318118600002, - -8.816989841999899 - ], - [ - 120.81299889400012, - -8.815036716999856 - ], - [ - 120.79249108200017, - -8.823174737999864 - ], - [ - 120.780528191, - -8.836683851999851 - ], - [ - 120.77312259200002, - -8.852471612999892 - ], - [ - 120.76417076900012, - -8.865492445999877 - ], - [ - 120.74781334700018, - -8.871026299999897 - ], - [ - 120.72584069100017, - -8.867445570999834 - ], - [ - 120.71159915500007, - -8.85955169099985 - ], - [ - 120.6993921230002, - -8.850681247999901 - ], - [ - 120.683360222, - -8.84433359199987 - ], - [ - 120.67310631600017, - -8.843845309999878 - ], - [ - 120.65162194100006, - -8.845635674999869 - ], - [ - 120.64161217500006, - -8.84433359199987 - ], - [ - 120.62427819100017, - -8.82626718499985 - ], - [ - 120.61784915500007, - -8.823174737999864 - ], - [ - 120.60108483200023, - -8.802015882999868 - ], - [ - 120.5939233730002, - -8.795830987999892 - ], - [ - 120.586192254, - -8.792250257999825 - ], - [ - 120.577891472, - -8.790215752999899 - ], - [ - 120.55640709700018, - -8.788995049999883 - ], - [ - 120.53386478000019, - -8.79159921699987 - ], - [ - 120.49268639400023, - -8.801364841999913 - ], - [ - 120.47046959700018, - -8.802015882999868 - ], - [ - 120.43783613400004, - -8.79656340899983 - ], - [ - 120.42579186300011, - -8.795830987999892 - ], - [ - 120.41431725400017, - -8.79762135199988 - ], - [ - 120.40430748800011, - -8.800713799999869 - ], - [ - 120.39372806100002, - -8.801202080999857 - ], - [ - 120.38160241000006, - -8.795830987999892 - ], - [ - 120.32300866, - -8.830661716999842 - ], - [ - 120.27906334700018, - -8.82935963299984 - ], - [ - 120.243907097, - -8.823174737999864 - ], - [ - 120.22364342500012, - -8.811455987999878 - ], - [ - 120.18262780000006, - -8.776055596999868 - ], - [ - 120.165293816, - -8.768649997999887 - ], - [ - 120.14478600400005, - -8.76873137799987 - ], - [ - 120.13103274800002, - -8.770765882999811 - ], - [ - 120.09424889400023, - -8.788995049999883 - ], - [ - 120.05884850400005, - -8.799899997999859 - ], - [ - 119.97575931100008, - -8.813897393999824 - ], - [ - 119.94711347699999, - -8.832696221999868 - ], - [ - 119.94336998800017, - -8.832289320999863 - ], - [ - 119.93930097699999, - -8.832696221999868 - ], - [ - 119.93588300899998, - -8.836846612999906 - ], - [ - 119.93637128999998, - -8.84254322699988 - ], - [ - 119.94369550899998, - -8.853122653999847 - ], - [ - 119.94271894600004, - -8.858005466999899 - ], - [ - 119.93376712300008, - -8.864434502999828 - ], - [ - 119.91993248800006, - -8.870782158999859 - ], - [ - 119.90739993600019, - -8.871677341999842 - ], - [ - 119.90186608200005, - -8.861260674999855 - ], - [ - 119.89185631600017, - -8.806735934999878 - ], - [ - 119.88363691499998, - -8.802992445999848 - ], - [ - 119.87256920700023, - -8.803399346999853 - ], - [ - 119.86036217500006, - -8.802015882999868 - ], - [ - 119.83969160200016, - -8.792901299999869 - ], - [ - 119.82398522200018, - -8.780368747999873 - ], - [ - 119.81275475400011, - -8.763278903999918 - ], - [ - 119.80567467500012, - -8.740655205999872 - ], - [ - 119.80372155000006, - -8.596774997999859 - ], - [ - 119.80779056100002, - -8.570000908999859 - ], - [ - 119.82064863400015, - -8.546563408999887 - ], - [ - 119.87110436300006, - -8.49407317499984 - ], - [ - 119.87370853000019, - -8.472263278999876 - ], - [ - 119.86768639400006, - -8.447849216999927 - ], - [ - 119.86719811300011, - -8.412855726999837 - ], - [ - 119.89795983200005, - -8.444756768999852 - ], - [ - 119.91944420700011, - -8.461195570999848 - ], - [ - 119.92920983200023, - -8.456963799999826 - ], - [ - 119.93425540500007, - -8.45582447699988 - ], - [ - 119.96387780000012, - -8.439629815999837 - ], - [ - 119.97046959700018, - -8.437595309999892 - ], - [ - 119.977305535, - -8.436293226999808 - ], - [ - 119.984141472, - -8.438653252999856 - ], - [ - 119.99057050900015, - -8.447035414999917 - ], - [ - 120.00269616000006, - -8.43873463299984 - ], - [ - 120.00977623800011, - -8.424737237999878 - ], - [ - 120.01514733200023, - -8.405450127999842 - ], - [ - 120.01783287900005, - -8.402520440999822 - ], - [ - 120.02222741, - -8.38884856599988 - ], - [ - 120.02475019600004, - -8.38494231599988 - ], - [ - 120.033457879, - -8.383477471999825 - ], - [ - 120.04175866000011, - -8.38600025799984 - ], - [ - 120.04916425899998, - -8.389825127999856 - ], - [ - 120.05600019599999, - -8.391778252999899 - ], - [ - 120.05909264400006, - -8.39072030999985 - ], - [ - 120.06332441499998, - -8.388360283999887 - ], - [ - 120.06918379000015, - -8.38600025799984 - ], - [ - 120.07650800900015, - -8.38494231599988 - ], - [ - 120.08432050900015, - -8.387383721999825 - ], - [ - 120.08814537900017, - -8.397556247999873 - ], - [ - 120.09424889400023, - -8.398614190999822 - ], - [ - 120.10889733200017, - -8.391859632999882 - ], - [ - 120.11402428500017, - -8.380954684999907 - ], - [ - 120.11597741, - -8.366875908999873 - ], - [ - 120.12094160200016, - -8.350762627999899 - ], - [ - 120.12614993600008, - -8.354668877999885 - ], - [ - 120.13697350400017, - -8.36467864399988 - ], - [ - 120.14210045700005, - -8.37127044099985 - ], - [ - 120.14893639400006, - -8.37127044099985 - ], - [ - 120.160899285, - -8.349867445999806 - ], - [ - 120.19605553500017, - -8.315687757999825 - ], - [ - 120.2034611340001, - -8.299248955999829 - ], - [ - 120.21290123800006, - -8.292738539999917 - ], - [ - 120.27702884200002, - -8.269219658999873 - ], - [ - 120.37794030000006, - -8.275079033999901 - ], - [ - 120.39193769600016, - -8.267836195999891 - ], - [ - 120.41098066500015, - -8.23552825299987 - ], - [ - 120.42204837300008, - -8.227308851999865 - ], - [ - 120.43726647200006, - -8.232354424999897 - ], - [ - 120.44467207100016, - -8.247002862999821 - ], - [ - 120.44971764400006, - -8.26376718499992 - ], - [ - 120.45736738400004, - -8.275079033999901 - ], - [ - 120.48340905000006, - -8.278741143999866 - ], - [ - 120.521739129, - -8.255466403999847 - ], - [ - 120.54273522200006, - -8.26523202899989 - ], - [ - 120.5529077480002, - -8.272881768999824 - ], - [ - 120.56771894600016, - -8.280531507999854 - ], - [ - 120.58301842500023, - -8.284600518999909 - ], - [ - 120.5939233730002, - -8.28191497199984 - ], - [ - 120.60108483200023, - -8.269789320999834 - ], - [ - 120.60141035200016, - -8.257012627999885 - ], - [ - 120.5939233730002, - -8.233493747999844 - ], - [ - 120.63575280000012, - -8.249607028999904 - ], - [ - 120.65455162900017, - -8.261651299999826 - ], - [ - 120.6622827480002, - -8.278497002999828 - ], - [ - 120.67310631600017, - -8.29225025799984 - ], - [ - 120.72584069100017, - -8.322686455999886 - ], - [ - 120.74463951900023, - -8.329766533999859 - ], - [ - 120.81251061300011, - -8.320977471999882 - ], - [ - 120.83008873800023, - -8.326592705999886 - ], - [ - 120.84644616000017, - -8.334161065999837 - ], - [ - 120.87037194100006, - -8.339288018999852 - ], - [ - 120.90919030000023, - -8.343357028999904 - ], - [ - 120.95435631600012, - -8.337497653999861 - ], - [ - 120.97608483200005, - -8.337497653999861 - ], - [ - 120.99488366, - -8.347100518999852 - ], - [ - 121.017832879, - -8.378513278999876 - ], - [ - 121.03093509200008, - -8.392673434999892 - ], - [ - 121.05323326900012, - -8.405450127999842 - ], - [ - 121.10629316500004, - -8.423923434999864 - ], - [ - 121.12501061300011, - -8.425957940999893 - ], - [ - 121.14730879000015, - -8.426039320999877 - ], - [ - 121.15707441499998, - -8.428887627999828 - ], - [ - 121.16618899800008, - -8.436211846999825 - ], - [ - 121.17530358200005, - -8.440362237999864 - ], - [ - 121.19996178500006, - -8.43873463299984 - ], - [ - 121.21094811300011, - -8.439629815999837 - ], - [ - 121.21843509200008, - -8.444594007999882 - ], - [ - 121.22339928500006, - -8.451755466999913 - ], - [ - 121.22982832100016, - -8.457940362999892 - ], - [ - 121.24154707100004, - -8.460625908999873 - ], - [ - 121.25123131600017, - -8.461114190999865 - ], - [ - 121.27051842500012, - -8.464532158999873 - ], - [ - 121.27914472700004, - -8.467461846999882 - ], - [ - 121.29053795700011, - -8.477471612999878 - ], - [ - 121.31641686300011, - -8.514743747999844 - ], - [ - 121.337168816, - -8.525323174999897 - ], - [ - 121.38054446700008, - -8.572198174999855 - ], - [ - 121.40886478000013, - -8.582940362999864 - ], - [ - 121.42465254000015, - -8.579278252999913 - ], - [ - 121.43702233200011, - -8.571954033999901 - ], - [ - 121.45085696700019, - -8.566664320999834 - ], - [ - 121.47095787900005, - -8.569268487999835 - ], - [ - 121.48943118600008, - -8.576104424999855 - ], - [ - 121.49577884200019, - -8.582452080999872 - ], - [ - 121.498301629, - -8.593519789999917 - ], - [ - 121.501719597, - -8.601820570999806 - ], - [ - 121.509532097, - -8.602146091999913 - ], - [ - 121.52247155000012, - -8.596612237999892 - ], - [ - 121.528086785, - -8.591241143999852 - ], - [ - 121.565684441, - -8.568942966999899 - ], - [ - 121.57455488400015, - -8.565850518999824 - ], - [ - 121.573496941, - -8.547295830999914 - ], - [ - 121.57447350400017, - -8.537855726999808 - ], - [ - 121.58375084700006, - -8.53639088299984 - ], - [ - 121.60816491000017, - -8.542087497999916 - ], - [ - 121.60271243600008, - -8.521091403999876 - ], - [ - 121.60271243600008, - -8.496351820999806 - ], - [ - 121.60962975400005, - -8.476006768999824 - ], - [ - 121.62549889400006, - -8.467461846999882 - ], - [ - 121.63868248800023, - -8.472751559999864 - ], - [ - 121.68043053500017, - -8.511325778999847 - ], - [ - 121.69629967500006, - -8.510674737999892 - ], - [ - 121.75131269600016, - -8.490817966999884 - ], - [ - 121.772715691, - -8.486748955999829 - ], - [ - 121.78443444100012, - -8.489434502999899 - ], - [ - 121.79029381600006, - -8.492608330999872 - ], - [ - 121.79590905000023, - -8.494724216999884 - ], - [ - 121.8068139980002, - -8.494805596999868 - ], - [ - 121.81397545700017, - -8.491794528999861 - ], - [ - 121.83472741000006, - -8.473728122999844 - ], - [ - 121.85157311300017, - -8.484551690999837 - ], - [ - 121.87159264400012, - -8.491957289999917 - ], - [ - 121.89275149800002, - -8.492852471999825 - ], - [ - 121.93197675900015, - -8.474216403999918 - ], - [ - 121.94011478000007, - -8.46795012799987 - ], - [ - 121.94320722700016, - -8.456963799999826 - ], - [ - 121.94825280000006, - -8.452569268999838 - ], - [ - 121.98487389400012, - -8.447035414999917 - ], - [ - 121.99333743600008, - -8.441501559999892 - ], - [ - 122.00049889400012, - -8.433851820999863 - ], - [ - 122.00814863400004, - -8.427504164999931 - ], - [ - 122.01905358200011, - -8.425957940999893 - ], - [ - 122.0286564460001, - -8.430922132999854 - ], - [ - 122.03728274800008, - -8.440199476999808 - ], - [ - 122.04118899800008, - -8.449151299999826 - ], - [ - 122.02654056100008, - -8.461114190999865 - ], - [ - 122.02214603000019, - -8.479261976999865 - ], - [ - 122.02564537900017, - -8.499769789999903 - ], - [ - 122.03956139400023, - -8.514743747999844 - ], - [ - 122.04908287900005, - -8.516534112999835 - ], - [ - 122.07105553500017, - -8.5140927059999 - ], - [ - 122.08106530000023, - -8.514743747999844 - ], - [ - 122.092051629, - -8.519707940999893 - ], - [ - 122.11247806100008, - -8.532647393999895 - ], - [ - 122.12549889400017, - -8.535251559999892 - ], - [ - 122.14112389400023, - -8.541680596999825 - ], - [ - 122.22974694100006, - -8.616875908999901 - ], - [ - 122.25806725400017, - -8.631280205999872 - ], - [ - 122.28842207100016, - -8.633884372999873 - ], - [ - 122.45101972700004, - -8.60409921699987 - ], - [ - 122.47738691500004, - -8.594984632999882 - ], - [ - 122.50074303500006, - -8.576267184999907 - ], - [ - 122.51465905000012, - -8.552666924999869 - ], - [ - 122.512461785, - -8.528252862999821 - ], - [ - 122.50619550900015, - -8.522556247999844 - ], - [ - 122.490489129, - -8.518324476999823 - ], - [ - 122.48511803500006, - -8.514743747999844 - ], - [ - 122.48121178500006, - -8.506117445999848 - ], - [ - 122.48170006600006, - -8.500583591999913 - ], - [ - 122.48389733200023, - -8.494398695999863 - ], - [ - 122.48511803500006, - -8.483982028999861 - ], - [ - 122.49415123800023, - -8.475030205999843 - ], - [ - 122.54656009200014, - -8.453220309999878 - ], - [ - 122.56153405000023, - -8.44133879999984 - ], - [ - 122.59815514400006, - -8.395196221999825 - ], - [ - 122.614024285, - -8.386407158999845 - ], - [ - 122.65284264400023, - -8.384209893999852 - ], - [ - 122.670176629, - -8.377536716999899 - ], - [ - 122.68824303500006, - -8.38469817499984 - ], - [ - 122.70411217500023, - -8.37908294099985 - ], - [ - 122.71941165500002, - -8.369561455999843 - ], - [ - 122.73560631600017, - -8.364515882999825 - ], - [ - 122.75814863400015, - -8.36101653399983 - ], - [ - 122.77222741000011, - -8.351983330999914 - ], - [ - 122.79371178500006, - -8.323500257999811 - ], - [ - 122.82016035199999, - -8.30543385199988 - ], - [ - 122.88086998800023, - -8.285739841999842 - ], - [ - 122.94410241000006, - -8.215427341999913 - ], - [ - 122.95069420700011, - -8.203057549999883 - ], - [ - 122.94044030000018, - -8.193129164999874 - ], - [ - 122.91700280000012, - -8.187676690999837 - ], - [ - 122.87614993600008, - -8.185723565999893 - ], - [ - 122.85303795700011, - -8.19150155999985 - ], - [ - 122.83041425900004, - -8.201592705999829 - ], - [ - 122.809336785, - -8.21493905999992 - ], - [ - 122.790293816, - -8.230401299999855 - ], - [ - 122.78549238400004, - -8.229424737999878 - ], - [ - 122.74887129000004, - -8.233493747999844 - ], - [ - 122.74138431100002, - -8.230238539999888 - ], - [ - 122.74040774800008, - -8.222426039999888 - ], - [ - 122.74512780000018, - -8.206801039999903 - ], - [ - 122.775157097, - -8.162774346999896 - ], - [ - 122.78003991000017, - -8.148125908999887 - ], - [ - 122.78419030000023, - -8.123955987999878 - ], - [ - 122.79566491000017, - -8.110039971999896 - ], - [ - 122.83464603000007, - -8.089532158999859 - ], - [ - 122.85320071700008, - -8.074314059999878 - ], - [ - 122.86255944100017, - -8.069756768999838 - ], - [ - 122.87614993600008, - -8.069594007999868 - ], - [ - 122.88559004000015, - -8.074965101999823 - ], - [ - 122.89429772200006, - -8.09303150799984 - ], - [ - 122.90040123800023, - -8.09693775799984 - ], - [ - 122.91749108200005, - -8.101332289999917 - ], - [ - 122.93653405000006, - -8.111504815999865 - ], - [ - 122.96436608200023, - -8.13103606599985 - ], - [ - 122.97966556100019, - -8.146905205999872 - ], - [ - 122.98292076900023, - -8.160332940999865 - ] - ] - ], - [ - [ - [ - 115.50245201900012, - -8.172621351999823 - ], - [ - 115.5353296230002, - -8.19459400799984 - ], - [ - 115.56511478000019, - -8.221612237999878 - ], - [ - 115.61915123800011, - -8.288750908999845 - ], - [ - 115.65251712300008, - -8.318454684999878 - ], - [ - 115.69109134200002, - -8.344414971999868 - ], - [ - 115.71420332099999, - -8.37517669099985 - ], - [ - 115.70093834700006, - -8.41912200299987 - ], - [ - 115.69068444100006, - -8.429457289999888 - ], - [ - 115.65845787900011, - -8.455498955999857 - ], - [ - 115.63990319100017, - -8.466241143999866 - ], - [ - 115.61548912900005, - -8.49244557099982 - ], - [ - 115.60482832099999, - -8.501071872999901 - ], - [ - 115.53370201900017, - -8.506524346999853 - ], - [ - 115.52295983200023, - -8.511325778999847 - ], - [ - 115.51596113400015, - -8.534356377999899 - ], - [ - 115.49878991000006, - -8.548435153999847 - ], - [ - 115.36402428500006, - -8.596937757999825 - ], - [ - 115.32260175900004, - -8.623793226999823 - ], - [ - 115.29078209700018, - -8.658786716999913 - ], - [ - 115.26880944100017, - -8.699151299999869 - ], - [ - 115.25391686300011, - -8.714613539999888 - ], - [ - 115.23170006600006, - -8.720798434999864 - ], - [ - 115.21241295700011, - -8.728448174999883 - ], - [ - 115.20313561300017, - -8.747002862999892 - ], - [ - 115.20533287900017, - -8.769463799999897 - ], - [ - 115.22055097700004, - -8.788995049999883 - ], - [ - 115.22803795700011, - -8.782159112999864 - ], - [ - 115.22348066500015, - -8.778008721999825 - ], - [ - 115.21436608200005, - -8.761814059999864 - ], - [ - 115.23243248800006, - -8.754001559999878 - ], - [ - 115.23796634200019, - -8.772230726999865 - ], - [ - 115.23552493600008, - -8.819756768999866 - ], - [ - 115.22901451900006, - -8.830254815999837 - ], - [ - 115.21322675900004, - -8.839939059999892 - ], - [ - 115.19507897200006, - -8.847100518999838 - ], - [ - 115.180918816, - -8.85051848799985 - ], - [ - 115.15739993600008, - -8.851820570999848 - ], - [ - 115.13453209700006, - -8.850762627999885 - ], - [ - 115.1134546230002, - -8.84539153399983 - ], - [ - 115.09498131600017, - -8.833672783999845 - ], - [ - 115.09424889400017, - -8.818454684999864 - ], - [ - 115.11491946700008, - -8.803399346999853 - ], - [ - 115.15919030000023, - -8.782159112999864 - ], - [ - 115.17066491000017, - -8.76873137799987 - ], - [ - 115.18189537900017, - -8.746351820999848 - ], - [ - 115.18628991000017, - -8.722344658999901 - ], - [ - 115.17693118600002, - -8.703383070999806 - ], - [ - 115.17237389400006, - -8.696547132999868 - ], - [ - 115.15609785200016, - -8.662041924999855 - ], - [ - 115.14869225400017, - -8.658135674999869 - ], - [ - 115.13982181100013, - -8.655368747999901 - ], - [ - 115.13184655000023, - -8.65195077899989 - ], - [ - 115.10336347700016, - -8.629652601999851 - ], - [ - 115.09009850400005, - -8.614841403999876 - ], - [ - 115.08472741000017, - -8.600355726999837 - ], - [ - 115.07667076900023, - -8.585137627999856 - ], - [ - 115.05811608200023, - -8.570733330999886 - ], - [ - 115.02263431100002, - -8.548923434999935 - ], - [ - 114.95313561300011, - -8.485121351999808 - ], - [ - 114.92701256600017, - -8.467461846999882 - ], - [ - 114.79664147200006, - -8.405450127999842 - ], - [ - 114.75586998800006, - -8.39771900799984 - ], - [ - 114.63900800900004, - -8.398614190999822 - ], - [ - 114.60450280000012, - -8.386488539999917 - ], - [ - 114.57422936300011, - -8.362481377999885 - ], - [ - 114.54908287900005, - -8.33424244599982 - ], - [ - 114.46843509200019, - -8.218519789999903 - ], - [ - 114.44792728000002, - -8.12184010199988 - ], - [ - 114.45240319100012, - -8.095147393999852 - ], - [ - 114.48145592500006, - -8.089532158999859 - ], - [ - 114.50473066499998, - -8.090427341999842 - ], - [ - 114.51783287900017, - -8.099704684999892 - ], - [ - 114.52735436300023, - -8.113539320999806 - ], - [ - 114.53972415500019, - -8.128024997999844 - ], - [ - 114.55534915500019, - -8.133884372999887 - ], - [ - 114.57097415500007, - -8.129489841999899 - ], - [ - 114.59742272200006, - -8.110609632999868 - ], - [ - 114.61255944100006, - -8.12184010199988 - ], - [ - 114.63404381600017, - -8.127211195999834 - ], - [ - 114.67310631600006, - -8.13103606599985 - ], - [ - 114.69141686300011, - -8.135023695999834 - ], - [ - 114.85759524800002, - -8.193129164999874 - ], - [ - 114.89291425900015, - -8.180271091999856 - ], - [ - 114.98438561300011, - -8.180433851999823 - ], - [ - 115.02263431100002, - -8.172621351999823 - ], - [ - 115.06324303500006, - -8.143243096999825 - ], - [ - 115.13591556100013, - -8.072849216999913 - ], - [ - 115.17286217500018, - -8.055352471999868 - ], - [ - 115.19312584700018, - -8.055108330999829 - ], - [ - 115.21550540500019, - -8.059502862999892 - ], - [ - 115.23617597700004, - -8.067966403999847 - ], - [ - 115.25196373800017, - -8.079522393999866 - ], - [ - 115.26880944100017, - -8.089450778999876 - ], - [ - 115.33790123800006, - -8.103773695999863 - ], - [ - 115.50245201900012, - -8.172621351999823 - ] - ] - ], - [ - [ - [ - 127.22494550900004, - -8.108575127999842 - ], - [ - 127.20215905000012, - -8.111260674999826 - ], - [ - 127.15211022200018, - -8.09693775799984 - ], - [ - 127.15211022200018, - -8.089532158999859 - ], - [ - 127.15756269600004, - -8.079359632999811 - ], - [ - 127.1556095710001, - -8.048435153999861 - ], - [ - 127.15894616, - -8.034926039999888 - ], - [ - 127.1707462900001, - -8.023858330999857 - ], - [ - 127.1858830090001, - -8.018731377999842 - ], - [ - 127.20191491000017, - -8.019789320999806 - ], - [ - 127.21631920700023, - -8.026950778999932 - ], - [ - 127.22641035199999, - -8.039239190999893 - ], - [ - 127.23210696700008, - -8.054294528999904 - ], - [ - 127.2342228520001, - -8.070407809999878 - ], - [ - 127.23462975400011, - -8.086521091999856 - ], - [ - 127.22494550900004, - -8.108575127999842 - ] - ] - ], - [ - [ - [ - 129.76612389400023, - -7.813083591999927 - ], - [ - 129.77523847700004, - -7.817071221999896 - ], - [ - 129.81055748800017, - -7.816501559999935 - ], - [ - 129.81934655000012, - -7.819268487999892 - ], - [ - 129.82984459700018, - -7.82390715899983 - ], - [ - 129.83920332100004, - -7.829847914999945 - ], - [ - 129.84457441499998, - -7.836195570999877 - ], - [ - 129.84424889400017, - -7.846856377999913 - ], - [ - 129.83838951900012, - -7.87273528399983 - ], - [ - 129.8411564460001, - -7.877862237999835 - ], - [ - 129.85450280000006, - -7.884047132999811 - ], - [ - 129.8610132170002, - -7.898858330999872 - ], - [ - 129.86207116000006, - -7.916924737999892 - ], - [ - 129.85906009200002, - -7.932549737999878 - ], - [ - 129.847911004, - -7.946547132999839 - ], - [ - 129.81153405000023, - -7.983005466999899 - ], - [ - 129.78223717500012, - -8.046075127999899 - ], - [ - 129.77637780000018, - -8.055352471999868 - ], - [ - 129.75879967500023, - -8.054457289999874 - ], - [ - 129.69385826900017, - -8.038262627999828 - ], - [ - 129.68848717500012, - -8.028415622999887 - ], - [ - 129.59424889400012, - -7.924004815999865 - ], - [ - 129.585215691, - -7.902032158999845 - ], - [ - 129.58757571700008, - -7.835625908999901 - ], - [ - 129.6012475920002, - -7.807305596999868 - ], - [ - 129.63249759200008, - -7.795993747999887 - ], - [ - 129.7248641290001, - -7.795993747999887 - ], - [ - 129.73292076900023, - -7.798028252999913 - ], - [ - 129.75879967500023, - -7.80868905999985 - ], - [ - 129.76612389400023, - -7.813083591999927 - ] - ] - ], - [ - [ - [ - 130.0666610040001, - -7.762627862999906 - ], - [ - 130.07748457099999, - -7.765883070999848 - ], - [ - 130.08375084700006, - -7.772556247999901 - ], - [ - 130.08033287900005, - -7.787367445999877 - ], - [ - 130.06592858200017, - -7.787855726999865 - ], - [ - 130.05250084700018, - -7.77711353999986 - ], - [ - 130.04517662900017, - -7.77507903399983 - ], - [ - 130.03248131600012, - -7.774997653999847 - ], - [ - 130.02564537900017, - -7.772556247999901 - ], - [ - 130.02906334700018, - -7.767836195999806 - ], - [ - 130.03093509200008, - -7.762627862999906 - ], - [ - 130.03711998800023, - -7.761651299999841 - ], - [ - 130.04688561300006, - -7.763360283999845 - ], - [ - 130.05591881600017, - -7.761488539999874 - ], - [ - 130.0666610040001, - -7.762627862999906 - ] - ] - ], - [ - [ - [ - 130.01539147200006, - -7.744073174999897 - ], - [ - 130.00847415500007, - -7.750420830999829 - ], - [ - 129.99724368600008, - -7.748223565999837 - ], - [ - 129.99415123800006, - -7.744398695999834 - ], - [ - 129.99268639400012, - -7.738539320999877 - ], - [ - 129.98316491, - -7.732354424999912 - ], - [ - 129.979746941, - -7.722100518999881 - ], - [ - 129.97885175900004, - -7.712660414999874 - ], - [ - 129.98259524800002, - -7.704847914999874 - ], - [ - 129.99195397200018, - -7.702080987999821 - ], - [ - 130.00098717500006, - -7.706719658999845 - ], - [ - 130.00586998800017, - -7.714043877999856 - ], - [ - 130.00782311300011, - -7.724867445999848 - ], - [ - 130.01539147200006, - -7.744073174999897 - ] - ] - ], - [ - [ - [ - 108.95777428500017, - -7.720147393999838 - ], - [ - 109.01099694100017, - -7.750258070999863 - ], - [ - 109.01929772200006, - -7.758070570999863 - ], - [ - 109.02369225400005, - -7.762383721999868 - ], - [ - 109.04273522200006, - -7.761488539999874 - ], - [ - 109.046641472, - -7.767998955999857 - ], - [ - 109.04314212300002, - -7.778903903999847 - ], - [ - 109.03581790500002, - -7.780368747999901 - ], - [ - 109.02621504000015, - -7.777520440999865 - ], - [ - 108.99927819100017, - -7.772881768999838 - ], - [ - 108.94483483200011, - -7.754327080999829 - ], - [ - 108.8860783210001, - -7.743910414999931 - ], - [ - 108.87281334700006, - -7.737237237999878 - ], - [ - 108.85743248800011, - -7.73202890399989 - ], - [ - 108.81527754000015, - -7.737725518999866 - ], - [ - 108.80014082100016, - -7.733819268999866 - ], - [ - 108.79411868600008, - -7.719414971999896 - ], - [ - 108.7970483730002, - -7.701592705999829 - ], - [ - 108.806895379, - -7.686211846999882 - ], - [ - 108.821543816, - -7.67864348799985 - ], - [ - 108.8738712900001, - -7.70322030999985 - ], - [ - 108.92505944100017, - -7.710381768999895 - ], - [ - 108.95777428500017, - -7.720147393999838 - ] - ] - ], - [ - [ - [ - 131.132578972, - -7.623304945999848 - ], - [ - 131.11939537900017, - -7.663262627999899 - ], - [ - 131.10922285200004, - -7.681817315999908 - ], - [ - 131.09229576900023, - -7.692315362999878 - ], - [ - 131.04981530000018, - -7.683770440999851 - ], - [ - 131.03589928500017, - -7.687595309999864 - ], - [ - 131.04379316500015, - -7.713474216999884 - ], - [ - 130.98682701900023, - -7.711846612999864 - ], - [ - 130.97120201900023, - -7.701348565999879 - ], - [ - 130.98243248800017, - -7.671807549999826 - ], - [ - 130.989512566, - -7.663832289999874 - ], - [ - 130.9995223320001, - -7.657484632999839 - ], - [ - 131.01189212300002, - -7.653497002999856 - ], - [ - 131.04029381600017, - -7.650160414999931 - ], - [ - 131.05494225400017, - -7.645603122999887 - ], - [ - 131.06853274800002, - -7.638848565999851 - ], - [ - 131.07789147200018, - -7.630791924999826 - ], - [ - 131.07837975400017, - -7.633396091999913 - ], - [ - 131.08253014400012, - -7.635023695999834 - ], - [ - 131.09034264400006, - -7.635918877999828 - ], - [ - 131.09376061300011, - -7.635023695999834 - ], - [ - 131.1049910820001, - -7.629001559999921 - ], - [ - 131.11898847700016, - -7.619317315999865 - ], - [ - 131.12647545700023, - -7.617771091999927 - ], - [ - 131.132578972, - -7.623304945999848 - ] - ] - ], - [ - [ - [ - 126.72169030000012, - -7.668064059999892 - ], - [ - 126.73755944100006, - -7.671807549999826 - ], - [ - 126.79883873800023, - -7.664239190999879 - ], - [ - 126.813243035, - -7.668633721999853 - ], - [ - 126.82162519600016, - -7.68027109199987 - ], - [ - 126.82911217500023, - -7.695489190999851 - ], - [ - 126.83432050900004, - -7.711846612999864 - ], - [ - 126.83676191500015, - -7.726332289999903 - ], - [ - 126.8400171230002, - -7.73943450299987 - ], - [ - 126.83920332099999, - -7.748223565999837 - ], - [ - 126.83334394600016, - -7.758070570999863 - ], - [ - 126.82349694100006, - -7.762383721999868 - ], - [ - 126.81348717500023, - -7.758070570999863 - ], - [ - 126.80298912900017, - -7.751153252999856 - ], - [ - 126.79232832100016, - -7.747491143999909 - ], - [ - 126.74903405000018, - -7.754001559999892 - ], - [ - 126.72787519600016, - -7.754652601999851 - ], - [ - 126.71338951900012, - -7.747491143999909 - ], - [ - 126.63135826900012, - -7.775485934999921 - ], - [ - 126.62045332100004, - -7.781345309999878 - ], - [ - 126.59734134200008, - -7.802178643999852 - ], - [ - 126.58936608200023, - -7.806247653999904 - ], - [ - 126.56836998800006, - -7.814141533999887 - ], - [ - 126.55933678500017, - -7.819919528999847 - ], - [ - 126.50440514400006, - -7.888116143999866 - ], - [ - 126.50220787900011, - -7.89478932099982 - ], - [ - 126.50416100400005, - -7.903090101999808 - ], - [ - 126.50424238400004, - -7.912367445999848 - ], - [ - 126.497325066, - -7.922539971999896 - ], - [ - 126.48812910200016, - -7.932712497999844 - ], - [ - 126.47527103000002, - -7.95533619599982 - ], - [ - 126.46615644600004, - -7.966566664999903 - ], - [ - 126.45476321700008, - -7.958184502999856 - ], - [ - 126.43327884200002, - -7.936700127999828 - ], - [ - 126.42188561300006, - -7.932549737999878 - ], - [ - 126.37378991, - -7.932549737999878 - ], - [ - 126.35027103000007, - -7.929294528999932 - ], - [ - 126.30054772200006, - -7.915215752999885 - ], - [ - 126.27442467500012, - -7.91187916499986 - ], - [ - 126.18978925899998, - -7.923516533999873 - ], - [ - 126.16895592500012, - -7.915704033999873 - ], - [ - 126.155528191, - -7.901625257999839 - ], - [ - 126.13689212300002, - -7.888604424999855 - ], - [ - 126.114512566, - -7.882989190999851 - ], - [ - 126.09009850400017, - -7.891534112999878 - ], - [ - 126.07496178500017, - -7.883884372999844 - ], - [ - 126.05396569100006, - -7.884698174999855 - ], - [ - 125.99878991000011, - -7.89373137799987 - ], - [ - 125.98031660200016, - -7.903497002999899 - ], - [ - 125.96941165500019, - -7.905857028999861 - ], - [ - 125.9461369150001, - -7.906019789999917 - ], - [ - 125.93506920700023, - -7.907891533999887 - ], - [ - 125.92505944100006, - -7.91187916499986 - ], - [ - 125.9240014980002, - -7.915134372999901 - ], - [ - 125.92139733200011, - -7.927504164999945 - ], - [ - 125.91814212300008, - -7.932549737999878 - ], - [ - 125.91285241000017, - -7.934991143999824 - ], - [ - 125.90202884200019, - -7.937269789999888 - ], - [ - 125.89771569100017, - -7.939222914999931 - ], - [ - 125.81202233200011, - -8.007582289999917 - ], - [ - 125.78931725400017, - -8.016045830999857 - ], - [ - 125.77418053500017, - -8.007582289999917 - ], - [ - 125.77588951900006, - -7.991794528999876 - ], - [ - 125.78630618600008, - -7.971123955999857 - ], - [ - 125.79818769600004, - -7.953220309999892 - ], - [ - 125.80518639400012, - -7.945489190999879 - ], - [ - 125.80844160200016, - -7.934258721999882 - ], - [ - 125.80836022200018, - -7.864190362999892 - ], - [ - 125.814219597, - -7.850274346999825 - ], - [ - 125.82504316500004, - -7.837009372999887 - ], - [ - 125.83887780000012, - -7.827080987999892 - ], - [ - 125.85328209700018, - -7.823337497999859 - ], - [ - 125.86980228000007, - -7.814711195999848 - ], - [ - 125.87623131600006, - -7.794691664999888 - ], - [ - 125.87891686300023, - -7.771905205999857 - ], - [ - 125.88404381600006, - -7.754327080999829 - ], - [ - 125.88803144600004, - -7.751885674999883 - ], - [ - 125.90259850400017, - -7.74724700299987 - ], - [ - 125.90821373800023, - -7.744073174999897 - ], - [ - 125.91439863400004, - -7.736586195999834 - ], - [ - 125.92115319100017, - -7.7211239559999 - ], - [ - 125.94792728000007, - -7.678317966999913 - ], - [ - 125.9572046230002, - -7.667901299999826 - ], - [ - 125.9689233730002, - -7.660088799999841 - ], - [ - 125.9806421230002, - -7.658623955999872 - ], - [ - 125.99268639400012, - -7.661553643999895 - ], - [ - 126.02271569100006, - -7.676039320999848 - ], - [ - 126.03126061300006, - -7.682305596999896 - ], - [ - 126.03492272200006, - -7.689141533999901 - ], - [ - 126.04615319100006, - -7.693454684999907 - ], - [ - 126.20313561300011, - -7.713474216999884 - ], - [ - 126.21485436300011, - -7.709405205999829 - ], - [ - 126.24537194100006, - -7.691176039999931 - ], - [ - 126.26148522200012, - -7.686130466999899 - ], - [ - 126.28003991, - -7.688083591999856 - ], - [ - 126.30437259200008, - -7.693454684999907 - ], - [ - 126.32837975400005, - -7.695733330999886 - ], - [ - 126.34644616000006, - -7.689141533999901 - ], - [ - 126.39795983200011, - -7.643812757999811 - ], - [ - 126.452403191, - -7.619561455999914 - ], - [ - 126.48454837300008, - -7.597263278999876 - ], - [ - 126.50375410200004, - -7.590427341999856 - ], - [ - 126.60352623800023, - -7.569431247999916 - ], - [ - 126.61744225400005, - -7.562107028999904 - ], - [ - 126.62696373800011, - -7.559991143999895 - ], - [ - 126.63135826900012, - -7.565362237999864 - ], - [ - 126.63021894600016, - -7.587172132999811 - ], - [ - 126.63086998800011, - -7.598565362999878 - ], - [ - 126.63453209700018, - -7.606866143999852 - ], - [ - 126.64698326900006, - -7.616957289999917 - ], - [ - 126.69271894599999, - -7.637627862999835 - ], - [ - 126.70313561300011, - -7.647719007999811 - ], - [ - 126.71159915500002, - -7.658868096999825 - ], - [ - 126.72169030000012, - -7.668064059999892 - ] - ] - ], - [ - [ - [ - 129.68067467500012, - -7.554131768999852 - ], - [ - 129.69068444100012, - -7.559991143999895 - ], - [ - 129.70004316500004, - -7.558363539999874 - ], - [ - 129.70679772200018, - -7.554782809999907 - ], - [ - 129.71387780000023, - -7.558200778999904 - ], - [ - 129.71216881600006, - -7.569512627999899 - ], - [ - 129.69459069100012, - -7.577569268999838 - ], - [ - 129.68197675900004, - -7.577243747999901 - ], - [ - 129.67514082099999, - -7.571547132999825 - ], - [ - 129.65528405000012, - -7.560479424999883 - ], - [ - 129.65357506600017, - -7.547051690999893 - ], - [ - 129.65853925900015, - -7.535088799999869 - ], - [ - 129.66374759200002, - -7.536553643999824 - ], - [ - 129.68067467500012, - -7.554131768999852 - ] - ] - ], - [ - [ - [ - 127.38949629000015, - -7.649672132999854 - ], - [ - 127.373301629, - -7.656182549999841 - ], - [ - 127.357676629, - -7.655694268999852 - ], - [ - 127.35075931100013, - -7.640801690999893 - ], - [ - 127.34766686300023, - -7.622979424999826 - ], - [ - 127.34839928500017, - -7.615329684999892 - ], - [ - 127.35450280000023, - -7.606866143999852 - ], - [ - 127.36198978000013, - -7.602797132999896 - ], - [ - 127.36988366000017, - -7.600274346999882 - ], - [ - 127.37614993600002, - -7.595879815999893 - ], - [ - 127.37867272200006, - -7.585870049999912 - ], - [ - 127.37574303500006, - -7.569919528999904 - ], - [ - 127.36443118600008, - -7.536797783999873 - ], - [ - 127.36443118600008, - -7.521579684999892 - ], - [ - 127.37273196700002, - -7.506117445999863 - ], - [ - 127.3849389980002, - -7.502862237999821 - ], - [ - 127.41846764400023, - -7.50790780999985 - ], - [ - 127.440684441, - -7.520603122999916 - ], - [ - 127.45411217500012, - -7.525648695999848 - ], - [ - 127.47022545700005, - -7.527764580999857 - ], - [ - 127.48438561300011, - -7.532403252999885 - ], - [ - 127.48926842500023, - -7.544528903999876 - ], - [ - 127.48780358200011, - -7.579278252999842 - ], - [ - 127.481700066, - -7.590101820999834 - ], - [ - 127.46729576900023, - -7.599053643999866 - ], - [ - 127.43116295700011, - -7.613051039999917 - ], - [ - 127.41863040500019, - -7.614678643999852 - ], - [ - 127.41285241000006, - -7.617771091999927 - ], - [ - 127.40837649800008, - -7.623304945999848 - ], - [ - 127.39861087300002, - -7.643812757999811 - ], - [ - 127.38949629000015, - -7.649672132999854 - ] - ] - ], - [ - [ - [ - 130.8647567070001, - -7.489190362999878 - ], - [ - 130.8937280610002, - -7.514092705999829 - ], - [ - 130.90674889400006, - -7.507500908999845 - ], - [ - 130.92042076900012, - -7.510918877999856 - ], - [ - 130.93360436300017, - -7.517836195999863 - ], - [ - 130.94483483200017, - -7.521579684999892 - ], - [ - 130.97754967500006, - -7.515313408999845 - ], - [ - 130.98462975400005, - -7.518161716999884 - ], - [ - 130.96859785200016, - -7.534600518999881 - ], - [ - 130.97657311300011, - -7.536390882999868 - ], - [ - 130.98422285200016, - -7.539971612999835 - ], - [ - 130.98829186300011, - -7.545179945999834 - ], - [ - 130.98585045700005, - -7.55193450299987 - ], - [ - 130.97917728000013, - -7.555271091999884 - ], - [ - 130.97339928500006, - -7.551202080999843 - ], - [ - 130.96705162900005, - -7.545179945999834 - ], - [ - 130.9585067070001, - -7.542087497999844 - ], - [ - 130.95386803500017, - -7.544203382999854 - ], - [ - 130.9416610040001, - -7.553480726999808 - ], - [ - 130.9376733730002, - -7.555759372999873 - ], - [ - 130.89771569100017, - -7.554457289999874 - ], - [ - 130.85661868600008, - -7.546970309999907 - ], - [ - 130.8452254570001, - -7.542087497999844 - ], - [ - 130.8409936860002, - -7.528741143999838 - ], - [ - 130.84449303500017, - -7.513848565999879 - ], - [ - 130.858653191, - -7.486911716999913 - ], - [ - 130.8647567070001, - -7.489190362999878 - ] - ] - ], - [ - [ - [ - 131.18287194100017, - -7.415948174999841 - ], - [ - 131.16586347700004, - -7.424493096999853 - ], - [ - 131.12696373800011, - -7.466403903999861 - ], - [ - 131.11646569100006, - -7.471856377999899 - ], - [ - 131.10515384200008, - -7.476006768999838 - ], - [ - 131.09595787900017, - -7.481377862999892 - ], - [ - 131.08887780000012, - -7.497735283999901 - ], - [ - 131.080332879, - -7.503676039999931 - ], - [ - 131.06918378999998, - -7.507500908999845 - ], - [ - 131.05738366, - -7.50790780999985 - ], - [ - 131.05738366, - -7.500420830999886 - ], - [ - 131.0631616550002, - -7.497002862999878 - ], - [ - 131.06666100400017, - -7.492852471999839 - ], - [ - 131.07178795700005, - -7.47942473799985 - ], - [ - 131.04721113400015, - -7.480401299999826 - ], - [ - 131.0245874360002, - -7.485284112999892 - ], - [ - 131.00489342500023, - -7.485772393999881 - ], - [ - 130.98926842500006, - -7.47323984199987 - ], - [ - 130.98519941500004, - -7.455987237999864 - ], - [ - 130.99105879000015, - -7.438897393999824 - ], - [ - 131.00326582100004, - -7.424493096999853 - ], - [ - 131.01823978000007, - -7.415215752999899 - ], - [ - 131.027110222, - -7.413018487999821 - ], - [ - 131.035004102, - -7.413506768999895 - ], - [ - 131.05128014400023, - -7.417168877999856 - ], - [ - 131.06739342500012, - -7.417738539999917 - ], - [ - 131.124766472, - -7.41041432099982 - ], - [ - 131.14144941500015, - -7.405368747999887 - ], - [ - 131.15365644600004, - -7.404229424999855 - ], - [ - 131.16016686300023, - -7.402927341999856 - ], - [ - 131.16342207100016, - -7.400485934999907 - ], - [ - 131.16724694100017, - -7.399997653999918 - ], - [ - 131.17481530000023, - -7.404229424999855 - ], - [ - 131.177500847, - -7.406670830999886 - ], - [ - 131.181407097, - -7.411309502999899 - ], - [ - 131.18287194100017, - -7.415948174999841 - ] - ] - ], - [ - [ - [ - 138.89258873800017, - -8.04127369599982 - ], - [ - 138.9041447270001, - -8.075860283999916 - ], - [ - 138.85767662900005, - -8.075290622999844 - ], - [ - 138.8366805350001, - -8.080010674999855 - ], - [ - 138.81820722700016, - -8.093194268999895 - ], - [ - 138.78834069100017, - -8.13005950299987 - ], - [ - 138.77182050900004, - -8.143161716999842 - ], - [ - 138.74659264400023, - -8.151543877999899 - ], - [ - 138.700938347, - -8.153985283999845 - ], - [ - 138.67969811300023, - -8.157484632999825 - ], - [ - 138.66089928500017, - -8.169040622999859 - ], - [ - 138.6461694670002, - -8.188734632999896 - ], - [ - 138.62126712300008, - -8.233819268999866 - ], - [ - 138.60254967500006, - -8.254652601999837 - ], - [ - 138.53581790500002, - -8.302178643999838 - ], - [ - 138.51758873800023, - -8.309258721999896 - ], - [ - 138.50782311300011, - -8.315687757999825 - ], - [ - 138.47217858200023, - -8.357598565999822 - ], - [ - 138.44418379000004, - -8.37908294099985 - ], - [ - 138.41211998800023, - -8.396254164999874 - ], - [ - 138.37598717500012, - -8.40960051899988 - ], - [ - 138.33570397200006, - -8.41912200299987 - ], - [ - 138.29346764400012, - -8.418715101999865 - ], - [ - 138.22339928500006, - -8.391859632999882 - ], - [ - 138.17798912900005, - -8.38494231599988 - ], - [ - 138.03419030000012, - -8.381931247999887 - ], - [ - 137.84913170700023, - -8.377536716999899 - ], - [ - 137.80160566500015, - -8.382989190999837 - ], - [ - 137.75953209700018, - -8.393975518999895 - ], - [ - 137.67709394600016, - -8.425957940999893 - ], - [ - 137.63819420700017, - -8.425876559999907 - ], - [ - 137.63697350400005, - -8.389418226999851 - ], - [ - 137.72624759200008, - -8.144789320999863 - ], - [ - 137.74976647200006, - -8.101169528999861 - ], - [ - 137.75277754000015, - -8.086521091999856 - ], - [ - 137.75904381600017, - -8.073418877999885 - ], - [ - 137.78939863400015, - -8.052341403999861 - ], - [ - 137.80054772200018, - -8.041680596999825 - ], - [ - 137.80974368600008, - -7.98357512799987 - ], - [ - 137.818207227, - -7.973402601999837 - ], - [ - 137.82439212300008, - -7.964288018999838 - ], - [ - 137.89486738400015, - -7.816176039999903 - ], - [ - 137.91797936300011, - -7.7816708309999 - ], - [ - 137.96583092500023, - -7.73943450299987 - ], - [ - 137.97266686300023, - -7.723321221999896 - ], - [ - 137.97624759200014, - -7.702894789999917 - ], - [ - 137.98519941500015, - -7.67929452899989 - ], - [ - 138.0066837900001, - -7.637627862999835 - ], - [ - 138.02808678500006, - -7.610039971999825 - ], - [ - 138.08863366, - -7.559828382999839 - ], - [ - 138.24415123800023, - -7.456475518999852 - ], - [ - 138.39503014400012, - -7.404880466999899 - ], - [ - 138.52906334700018, - -7.38648853999986 - ], - [ - 138.55648847700004, - -7.377048434999935 - ], - [ - 138.62086022200006, - -7.364678643999895 - ], - [ - 138.71705162900017, - -7.359551690999879 - ], - [ - 138.80453535200004, - -7.374200127999899 - ], - [ - 138.84278405000006, - -7.421644789999917 - ], - [ - 138.84815514400023, - -7.435235283999873 - ], - [ - 138.89600670700005, - -7.505059502999913 - ], - [ - 138.90870201900023, - -7.519789320999806 - ], - [ - 138.92286217500023, - -7.531914971999896 - ], - [ - 138.93897545700023, - -7.542087497999844 - ], - [ - 138.9741317070001, - -7.553399346999825 - ], - [ - 139.04639733200005, - -7.561944268999852 - ], - [ - 139.07553144600004, - -7.576267184999921 - ], - [ - 139.05738366000006, - -7.594659112999878 - ], - [ - 139.0444442070001, - -7.611423434999892 - ], - [ - 139.03516686300017, - -7.629571221999896 - ], - [ - 139.020274285, - -7.671970309999878 - ], - [ - 138.99366295700005, - -7.720147393999838 - ], - [ - 138.98878014400012, - -7.737969658999901 - ], - [ - 138.982676629, - -7.829847914999945 - ], - [ - 138.97722415500007, - -7.840915622999887 - ], - [ - 138.9663192070001, - -7.850518487999864 - ], - [ - 138.91065514400006, - -7.87851327899989 - ], - [ - 138.89112389400012, - -7.898044528999861 - ], - [ - 138.88379967500012, - -7.932549737999878 - ], - [ - 138.88648522200018, - -8.007012627999856 - ], - [ - 138.89258873800017, - -8.04127369599982 - ] - ] - ], - [ - [ - [ - 121.810313347, - -7.404229424999855 - ], - [ - 121.77588951900006, - -7.416924737999821 - ], - [ - 121.75904381600017, - -7.415785414999874 - ], - [ - 121.75180097700016, - -7.394301039999931 - ], - [ - 121.75407962300014, - -7.379082940999865 - ], - [ - 121.75993899800008, - -7.363539320999863 - ], - [ - 121.76889082099999, - -7.350762627999828 - ], - [ - 121.77979576900006, - -7.343438408999916 - ], - [ - 121.8182072270001, - -7.33359140399989 - ], - [ - 121.83708743600019, - -7.356540622999887 - ], - [ - 121.83480879000004, - -7.388278903999847 - ], - [ - 121.810313347, - -7.404229424999855 - ] - ] - ], - [ - [ - [ - 131.28223717500006, - -7.323500257999839 - ], - [ - 131.28394616000017, - -7.329766533999873 - ], - [ - 131.29273522200006, - -7.318047783999887 - ], - [ - 131.297618035, - -7.319105726999851 - ], - [ - 131.29916425900015, - -7.327406507999825 - ], - [ - 131.297618035, - -7.336602471999896 - ], - [ - 131.29346764400006, - -7.340590101999879 - ], - [ - 131.27100670700005, - -7.357110283999859 - ], - [ - 131.27711022200018, - -7.370782158999887 - ], - [ - 131.22754967500023, - -7.362481377999899 - ], - [ - 131.21583092500023, - -7.357110283999859 - ], - [ - 131.2234806650001, - -7.351250908999901 - ], - [ - 131.23096764400023, - -7.344170830999843 - ], - [ - 131.24301191500015, - -7.329766533999873 - ], - [ - 131.25757897200018, - -7.303969007999854 - ], - [ - 131.26498457100016, - -7.297133070999834 - ], - [ - 131.26954186300011, - -7.302911065999893 - ], - [ - 131.28223717500006, - -7.323500257999839 - ] - ] - ], - [ - [ - [ - 120.87110436300017, - -7.273532809999892 - ], - [ - 120.96045983200005, - -7.281996351999837 - ], - [ - 121.01986738400004, - -7.280368747999901 - ], - [ - 121.04997806100008, - -7.285821221999853 - ], - [ - 121.06690514400023, - -7.302504164999888 - ], - [ - 121.05689537900017, - -7.321058851999808 - ], - [ - 121.025645379, - -7.331638278999847 - ], - [ - 120.99268639400012, - -7.33359140399989 - ], - [ - 120.97738691500015, - -7.326348565999865 - ], - [ - 120.96387780000006, - -7.313897393999852 - ], - [ - 120.90040123800006, - -7.30388762799987 - ], - [ - 120.88135826900006, - -7.295017184999921 - ], - [ - 120.86410566499998, - -7.301934502999828 - ], - [ - 120.84017988400004, - -7.304457289999931 - ], - [ - 120.81625410200016, - -7.302422783999901 - ], - [ - 120.79932701900006, - -7.295017184999921 - ], - [ - 120.79395592500012, - -7.287692966999913 - ], - [ - 120.79232832099999, - -7.279473565999822 - ], - [ - 120.79428144600004, - -7.271172783999845 - ], - [ - 120.79965253999998, - -7.263848565999837 - ], - [ - 120.81568444100017, - -7.257500908999901 - ], - [ - 120.83464603000019, - -7.260511976999808 - ], - [ - 120.87110436300017, - -7.273532809999892 - ] - ] - ], - [ - [ - [ - 114.62452233200005, - -7.147881768999866 - ], - [ - 114.62305748800011, - -7.163262627999913 - ], - [ - 114.61882571700019, - -7.167250257999882 - ], - [ - 114.53272545700011, - -7.158461195999834 - ], - [ - 114.51124108200011, - -7.159274997999844 - ], - [ - 114.50017337300002, - -7.158298434999864 - ], - [ - 114.49537194100006, - -7.154717705999886 - ], - [ - 114.49634850400005, - -7.143812757999825 - ], - [ - 114.49919681100008, - -7.137872002999885 - ], - [ - 114.504649285, - -7.13437265399989 - ], - [ - 114.54102623800011, - -7.118584893999852 - ], - [ - 114.55005944100012, - -7.116875908999845 - ], - [ - 114.55909264400012, - -7.119073174999841 - ], - [ - 114.58130944100017, - -7.128350518999895 - ], - [ - 114.59376061300011, - -7.130547783999887 - ], - [ - 114.60474694100006, - -7.13062916499986 - ], - [ - 114.61459394600016, - -7.132094007999825 - ], - [ - 114.62183678500017, - -7.137302341999913 - ], - [ - 114.62452233200005, - -7.147881768999866 - ] - ] - ], - [ - [ - [ - 131.65357506600006, - -7.166192315999837 - ], - [ - 131.65463300899998, - -7.172133070999863 - ], - [ - 131.66822350400005, - -7.166680596999825 - ], - [ - 131.67652428500006, - -7.160577080999843 - ], - [ - 131.69190514400006, - -7.141208591999913 - ], - [ - 131.70411217500023, - -7.131524346999853 - ], - [ - 131.70997155000006, - -7.137465101999879 - ], - [ - 131.71371504000004, - -7.150485934999864 - ], - [ - 131.73951256600006, - -7.195977471999839 - ], - [ - 131.74333743600008, - -7.196058851999823 - ], - [ - 131.73829186300023, - -7.206638278999876 - ], - [ - 131.72608483200017, - -7.216566664999874 - ], - [ - 131.711192254, - -7.223890882999882 - ], - [ - 131.69857832100004, - -7.226739190999822 - ], - [ - 131.68360436300011, - -7.225030205999829 - ], - [ - 131.67457116000017, - -7.222588799999883 - ], - [ - 131.66651451900023, - -7.223890882999882 - ], - [ - 131.65463300899998, - -7.233575127999842 - ], - [ - 131.64551842500012, - -7.244805596999839 - ], - [ - 131.64275149800002, - -7.254815362999835 - ], - [ - 131.64722741, - -7.281996351999837 - ], - [ - 131.64649498800006, - -7.302178643999866 - ], - [ - 131.64722741, - -7.309258721999825 - ], - [ - 131.64869225400017, - -7.310316664999874 - ], - [ - 131.66944420700005, - -7.344008070999877 - ], - [ - 131.67505944100017, - -7.358168226999808 - ], - [ - 131.67335045700005, - -7.371840101999851 - ], - [ - 131.66089928500006, - -7.383884372999859 - ], - [ - 131.66846764400012, - -7.394219658999859 - ], - [ - 131.6779077480002, - -7.400811455999843 - ], - [ - 131.68726647200006, - -7.405857028999876 - ], - [ - 131.69499759200008, - -7.411797783999887 - ], - [ - 131.69922936300006, - -7.413995049999883 - ], - [ - 131.70313561300006, - -7.412774346999868 - ], - [ - 131.70630944100006, - -7.412692966999884 - ], - [ - 131.70923912900017, - -7.417901299999883 - ], - [ - 131.70875084700018, - -7.424574476999837 - ], - [ - 131.70362389400023, - -7.425388278999847 - ], - [ - 131.69776451900012, - -7.425062757999825 - ], - [ - 131.69499759200008, - -7.428806247999859 - ], - [ - 131.68344160200004, - -7.451592705999886 - ], - [ - 131.67986087300008, - -7.473077080999914 - ], - [ - 131.67554772200006, - -7.480157158999873 - ], - [ - 131.66911868600008, - -7.484551690999865 - ], - [ - 131.66089928500006, - -7.486911716999913 - ], - [ - 131.66871178500006, - -7.509209893999852 - ], - [ - 131.6629337900001, - -7.531833591999913 - ], - [ - 131.65259850400017, - -7.554945570999863 - ], - [ - 131.64332116, - -7.599053643999866 - ], - [ - 131.63306725400017, - -7.620049737999892 - ], - [ - 131.61890709700018, - -7.636976820999877 - ], - [ - 131.60279381600017, - -7.643812757999811 - ], - [ - 131.59864342500023, - -7.648532809999907 - ], - [ - 131.579356316, - -7.688897393999866 - ], - [ - 131.57422936300011, - -7.694919528999876 - ], - [ - 131.55836022200018, - -7.706638278999861 - ], - [ - 131.53858483200023, - -7.712579033999887 - ], - [ - 131.5133569670002, - -7.716973565999865 - ], - [ - 131.49691816499998, - -7.726332289999903 - ], - [ - 131.50318444100006, - -7.747491143999909 - ], - [ - 131.4974064460001, - -7.75611744599982 - ], - [ - 131.49000084700018, - -7.763278903999861 - ], - [ - 131.48072350400005, - -7.76620859199987 - ], - [ - 131.46900475400017, - -7.761814059999892 - ], - [ - 131.47494550899998, - -7.782972914999888 - ], - [ - 131.46412194100017, - -7.794366143999866 - ], - [ - 131.4489038420002, - -7.800225518999895 - ], - [ - 131.44117272200018, - -7.805840752999899 - ], - [ - 131.43433678500017, - -7.814060153999904 - ], - [ - 131.38990319100017, - -7.847100518999852 - ], - [ - 131.38257897200006, - -7.859551690999879 - ], - [ - 131.38021894599999, - -7.873223565999822 - ], - [ - 131.37964928500006, - -7.891534112999878 - ], - [ - 131.36866295700005, - -7.903985283999887 - ], - [ - 131.35808353000002, - -7.912286065999865 - ], - [ - 131.34815514400012, - -7.922133070999806 - ], - [ - 131.33863366000006, - -7.939222914999931 - ], - [ - 131.34864342500012, - -7.939060153999876 - ], - [ - 131.35726972700004, - -7.941582940999893 - ], - [ - 131.3608504570001, - -7.94736093499985 - ], - [ - 131.35572350400017, - -7.956312757999882 - ], - [ - 131.34978274800002, - -7.964125257999868 - ], - [ - 131.34848066500015, - -7.969903252999842 - ], - [ - 131.34839928500017, - -7.976657809999878 - ], - [ - 131.34546959700006, - -7.987074476999865 - ], - [ - 131.335215691, - -8.000909112999864 - ], - [ - 131.31674238399998, - -8.0179989559999 - ], - [ - 131.29932701900012, - -8.025648695999834 - ], - [ - 131.29151451900023, - -8.011325778999847 - ], - [ - 131.3060001960001, - -7.973402601999837 - ], - [ - 131.31080162900017, - -7.954034112999821 - ], - [ - 131.30144290500002, - -7.945489190999879 - ], - [ - 131.29395592500018, - -7.942478122999887 - ], - [ - 131.28931725400005, - -7.937188408999901 - ], - [ - 131.2834578790001, - -7.936130466999856 - ], - [ - 131.27100670700005, - -7.945489190999879 - ], - [ - 131.26587975400017, - -7.954359632999839 - ], - [ - 131.2618921230002, - -7.9769833309999 - ], - [ - 131.25733483200023, - -7.987074476999865 - ], - [ - 131.22966556100008, - -8.003513278999861 - ], - [ - 131.19076582100016, - -8.006605726999851 - ], - [ - 131.11622155000012, - -8.000746351999808 - ], - [ - 131.10661868600013, - -7.991306247999887 - ], - [ - 131.11158287900017, - -7.969496351999837 - ], - [ - 131.12696373800011, - -7.929131768999866 - ], - [ - 131.12387129000004, - -7.913669528999847 - ], - [ - 131.11597741000006, - -7.89869557099982 - ], - [ - 131.10474694100006, - -7.889580987999835 - ], - [ - 131.09229576900023, - -7.891534112999878 - ], - [ - 131.08570397200006, - -7.871758721999853 - ], - [ - 131.09017988400004, - -7.848809502999856 - ], - [ - 131.10254967500023, - -7.828545830999857 - ], - [ - 131.11963951900012, - -7.816501559999935 - ], - [ - 131.1329858730002, - -7.816582940999822 - ], - [ - 131.143809441, - -7.82122161299985 - ], - [ - 131.15284264400012, - -7.82187265399989 - ], - [ - 131.16114342500012, - -7.809665622999916 - ], - [ - 131.16114342500012, - -7.799574476999851 - ], - [ - 131.15528405000023, - -7.791599216999899 - ], - [ - 131.14714603000007, - -7.785577080999886 - ], - [ - 131.13998457099999, - -7.7816708309999 - ], - [ - 131.13998457099999, - -7.775485934999921 - ], - [ - 131.15699303500017, - -7.774346612999892 - ], - [ - 131.15674889400012, - -7.766045830999914 - ], - [ - 131.15137780000023, - -7.753838799999841 - ], - [ - 131.15365644600004, - -7.740655205999886 - ], - [ - 131.14405358200017, - -7.744398695999834 - ], - [ - 131.1373804050002, - -7.743422132999854 - ], - [ - 131.13355553500017, - -7.737481377999828 - ], - [ - 131.13314863399998, - -7.726332289999903 - ], - [ - 131.12696373800011, - -7.726332289999903 - ], - [ - 131.12696373800011, - -7.733819268999866 - ], - [ - 131.11963951900012, - -7.733819268999866 - ], - [ - 131.11475670700023, - -7.706963799999883 - ], - [ - 131.12256920700023, - -7.691013278999876 - ], - [ - 131.13917076900006, - -7.686130466999899 - ], - [ - 131.16114342500012, - -7.692315362999878 - ], - [ - 131.203868035, - -7.713311455999829 - ], - [ - 131.22331790500013, - -7.714450778999861 - ], - [ - 131.24984785200016, - -7.706638278999861 - ], - [ - 131.23210696700008, - -7.702569268999895 - ], - [ - 131.211680535, - -7.694919528999876 - ], - [ - 131.1948348320001, - -7.683770440999851 - ], - [ - 131.18132571700002, - -7.64959075299987 - ], - [ - 131.181407097, - -7.641208591999899 - ], - [ - 131.19157962300008, - -7.637627862999835 - ], - [ - 131.1897078790001, - -7.632419528999847 - ], - [ - 131.19516035200004, - -7.596774997999887 - ], - [ - 131.20248457100004, - -7.579522393999881 - ], - [ - 131.22478274800008, - -7.546319268999866 - ], - [ - 131.22950280000006, - -7.531182549999869 - ], - [ - 131.23267662900005, - -7.507094007999839 - ], - [ - 131.24154707099999, - -7.487725518999824 - ], - [ - 131.25473066500015, - -7.472263278999904 - ], - [ - 131.31519616000006, - -7.422946872999916 - ], - [ - 131.32813561300023, - -7.417901299999883 - ], - [ - 131.33570397200012, - -7.42253997199991 - ], - [ - 131.34115644600016, - -7.431573174999826 - ], - [ - 131.34701582099999, - -7.438246351999879 - ], - [ - 131.35572350400017, - -7.43531666499986 - ], - [ - 131.36060631600006, - -7.427666924999826 - ], - [ - 131.372813347, - -7.398044528999876 - ], - [ - 131.37964928500006, - -7.389336846999896 - ], - [ - 131.38428795700017, - -7.386000257999868 - ], - [ - 131.38835696700014, - -7.381931247999901 - ], - [ - 131.39332116000017, - -7.370782158999887 - ], - [ - 131.39136803500006, - -7.368340752999856 - ], - [ - 131.3898218110002, - -7.358656507999896 - ], - [ - 131.39079837300008, - -7.348321221999882 - ], - [ - 131.39698326900012, - -7.343438408999916 - ], - [ - 131.45313561300023, - -7.3344052059999 - ], - [ - 131.45411217500012, - -7.328301690999822 - ], - [ - 131.44971764400012, - -7.319594007999839 - ], - [ - 131.44849694100012, - -7.309258721999825 - ], - [ - 131.45508873800006, - -7.291192315999908 - ], - [ - 131.462657097, - -7.278741143999881 - ], - [ - 131.4826766290001, - -7.254652601999865 - ], - [ - 131.48682701900023, - -7.245375257999811 - ], - [ - 131.48902428500006, - -7.236504815999865 - ], - [ - 131.49398847700016, - -7.229587497999859 - ], - [ - 131.50684655000012, - -7.226739190999822 - ], - [ - 131.52670332099999, - -7.225518487999906 - ], - [ - 131.5358179050002, - -7.223402601999808 - ], - [ - 131.54476972700004, - -7.219903252999899 - ], - [ - 131.53207441500015, - -7.19036223799985 - ], - [ - 131.5288192070001, - -7.170098565999837 - ], - [ - 131.53695722700004, - -7.154229424999897 - ], - [ - 131.568614129, - -7.130954684999892 - ], - [ - 131.58985436300011, - -7.120212497999873 - ], - [ - 131.61719811300017, - -7.112237237999821 - ], - [ - 131.63754316500015, - -7.109063408999859 - ], - [ - 131.65430748800006, - -7.112888278999876 - ], - [ - 131.66098066500004, - -7.128594658999845 - ], - [ - 131.65357506600006, - -7.166192315999837 - ] - ] - ], - [ - [ - [ - 115.89600670700011, - -7.124932549999883 - ], - [ - 115.894297722, - -7.164483330999829 - ], - [ - 115.875743035, - -7.185723565999822 - ], - [ - 115.83773847699999, - -7.197198174999855 - ], - [ - 115.79590905000006, - -7.190036716999913 - ], - [ - 115.75733483200011, - -7.169691664999917 - ], - [ - 115.74301191500004, - -7.150323174999897 - ], - [ - 115.75294030000012, - -7.14031340899983 - ], - [ - 115.76221764400006, - -7.1390927059999 - ], - [ - 115.76596113400004, - -7.143975518999881 - ], - [ - 115.76986738400004, - -7.14218515399989 - ], - [ - 115.77816816499998, - -7.115492445999863 - ], - [ - 115.7859806650001, - -7.115980726999851 - ], - [ - 115.79127037900017, - -7.125664971999825 - ], - [ - 115.79476972700016, - -7.137872002999885 - ], - [ - 115.80103600400011, - -7.146416924999912 - ], - [ - 115.80795332099999, - -7.149834893999824 - ], - [ - 115.82276451900017, - -7.149509372999887 - ], - [ - 115.84278405000023, - -7.157647393999824 - ], - [ - 115.87012780000012, - -7.159844658999901 - ], - [ - 115.88021894600016, - -7.158461195999834 - ], - [ - 115.88379967500023, - -7.153252862999835 - ], - [ - 115.88135826900012, - -7.152927341999899 - ], - [ - 115.87517337300002, - -7.153578382999854 - ], - [ - 115.86939537900017, - -7.147149346999839 - ], - [ - 115.86670983200011, - -7.137302341999913 - ], - [ - 115.86963951900012, - -7.128676039999917 - ], - [ - 115.87745201900012, - -7.123467705999829 - ], - [ - 115.88355553500011, - -7.123955987999821 - ], - [ - 115.88599694100006, - -7.12957122199991 - ], - [ - 115.886973504, - -7.126560153999904 - ], - [ - 115.88900800900015, - -7.113702080999886 - ], - [ - 115.890879754, - -7.107110283999901 - ], - [ - 115.894297722, - -7.111586195999877 - ], - [ - 115.89600670700011, - -7.124932549999883 - ] - ] - ], - [ - [ - [ - 131.91846764400023, - -7.103610934999907 - ], - [ - 131.93384850400017, - -7.111586195999877 - ], - [ - 131.94418378999998, - -7.126641533999887 - ], - [ - 131.94809003999998, - -7.141208591999913 - ], - [ - 131.95346113400015, - -7.154066664999931 - ], - [ - 131.97706139400006, - -7.17408619599982 - ], - [ - 131.98218834700018, - -7.188897393999881 - ], - [ - 131.9860132170002, - -7.225274346999868 - ], - [ - 131.981700066, - -7.245700778999932 - ], - [ - 131.96558678500006, - -7.254652601999865 - ], - [ - 131.9559025400001, - -7.249200127999828 - ], - [ - 131.92164147200012, - -7.223890882999882 - ], - [ - 131.91407311300023, - -7.216485283999887 - ], - [ - 131.9039819670002, - -7.180352471999853 - ], - [ - 131.87794030000012, - -7.164483330999829 - ], - [ - 131.84278405000023, - -7.161797783999859 - ], - [ - 131.77222741000017, - -7.164971612999821 - ], - [ - 131.74268639400012, - -7.158379815999851 - ], - [ - 131.73218834700006, - -7.141208591999913 - ], - [ - 131.7570093110002, - -7.110039971999839 - ], - [ - 131.8784285820001, - -7.106052341999856 - ], - [ - 131.90040123800011, - -7.110039971999839 - ], - [ - 131.91846764400023, - -7.103610934999907 - ] - ] - ], - [ - [ - [ - 128.676524285, - -7.178887627999899 - ], - [ - 128.63868248800017, - -7.219903252999899 - ], - [ - 128.62232506600006, - -7.21013762799987 - ], - [ - 128.58399498800011, - -7.178887627999899 - ], - [ - 128.54664147200006, - -7.162692966999842 - ], - [ - 128.53272545700005, - -7.151055596999839 - ], - [ - 128.5288192070001, - -7.130547783999887 - ], - [ - 128.53939863400015, - -7.112237237999821 - ], - [ - 128.563243035, - -7.091241143999881 - ], - [ - 128.59245853000007, - -7.073011976999808 - ], - [ - 128.61963951900017, - -7.063164971999882 - ], - [ - 128.6285913420002, - -7.068536065999837 - ], - [ - 128.64340254000015, - -7.082777601999837 - ], - [ - 128.65235436300011, - -7.089532158999873 - ], - [ - 128.66081790500002, - -7.092461846999896 - ], - [ - 128.67896569100006, - -7.093845309999878 - ], - [ - 128.68637129000004, - -7.096368096999896 - ], - [ - 128.69971764400023, - -7.109551690999851 - ], - [ - 128.70134524800008, - -7.122816664999874 - ], - [ - 128.691254102, - -7.133233330999857 - ], - [ - 128.66968834700018, - -7.137383721999896 - ], - [ - 128.65853925900015, - -7.143812757999825 - ], - [ - 128.66822350400005, - -7.158135674999897 - ], - [ - 128.6805119150001, - -7.172458591999884 - ], - [ - 128.676524285, - -7.178887627999899 - ] - ] - ], - [ - [ - [ - 114.39685522900018, - -7.131462291999881 - ], - [ - 114.39465789400012, - -7.157564834999917 - ], - [ - 114.391856316, - -7.178887627999899 - ], - [ - 114.37826582100016, - -7.178155205999872 - ], - [ - 114.35726972700004, - -7.167413018999852 - ], - [ - 114.331797722, - -7.159356377999828 - ], - [ - 114.32520592500023, - -7.147637627999828 - ], - [ - 114.3065582190001, - -7.148779183999878 - ], - [ - 114.29282201900006, - -7.143151295999886 - ], - [ - 114.28476081600016, - -7.126164773999875 - ], - [ - 114.27324774500008, - -7.101247319999828 - ], - [ - 114.26976204800022, - -7.080834943999861 - ], - [ - 114.29482566800019, - -7.05466592399992 - ], - [ - 114.32225455000011, - -7.050030942999854 - ], - [ - 114.34294681100002, - -7.055759372999887 - ], - [ - 114.3577514890001, - -7.06920244699991 - ], - [ - 114.36925548200006, - -7.089582670999874 - ], - [ - 114.38306849500017, - -7.113356878999824 - ], - [ - 114.39685522900018, - -7.131462291999881 - ] - ] - ], - [ - [ - [ - 120.74496504000015, - -7.074151299999841 - ], - [ - 120.75782311300006, - -7.075941664999917 - ], - [ - 120.77263431100008, - -7.058851820999877 - ], - [ - 120.78126061300023, - -7.055922132999854 - ], - [ - 120.78516686300023, - -7.072442315999837 - ], - [ - 120.78305097700004, - -7.088636976999879 - ], - [ - 120.77377363399998, - -7.115817966999884 - ], - [ - 120.77149498800011, - -7.130547783999887 - ], - [ - 120.74226145100008, - -7.134935144999901 - ], - [ - 120.70558207900015, - -7.13338046399987 - ], - [ - 120.683360222, - -7.124281507999839 - ], - [ - 120.68189537900005, - -7.139418226999837 - ], - [ - 120.67034946900017, - -7.150959797999818 - ], - [ - 120.63348911200015, - -7.131528227999823 - ], - [ - 120.6204073690001, - -7.108675148999879 - ], - [ - 120.62417124100003, - -7.093960320999884 - ], - [ - 120.5984220820001, - -7.098033898999873 - ], - [ - 120.58092290500022, - -7.091815049999852 - ], - [ - 120.56290620300004, - -7.09453775199988 - ], - [ - 120.55625306400023, - -7.072889484999891 - ], - [ - 120.56586410600008, - -7.067054209999881 - ], - [ - 120.59111302900013, - -7.079589061999812 - ], - [ - 120.61369512200011, - -7.069816589999917 - ], - [ - 120.61989363100022, - -7.044242793999928 - ], - [ - 120.61572917600009, - -7.022561127999921 - ], - [ - 120.62125566200021, - -6.998245237999825 - ], - [ - 120.63550866000017, - -7.00701262799987 - ], - [ - 120.65361520400003, - -7.010104614999904 - ], - [ - 120.67767356200008, - -7.043671315999902 - ], - [ - 120.73023522200006, - -7.067152601999851 - ], - [ - 120.74496504000015, - -7.074151299999841 - ] - ] - ], - [ - [ - [ - 129.14258873800023, - -6.997491143999881 - ], - [ - 129.1354272800002, - -6.998142184999921 - ], - [ - 129.12501061300011, - -6.993259372999859 - ], - [ - 129.11622155000023, - -6.98333098799985 - ], - [ - 129.11744225400017, - -6.972751559999892 - ], - [ - 129.12501061300011, - -6.965752862999821 - ], - [ - 129.13428795700005, - -6.961114190999893 - ], - [ - 129.14478600400005, - -6.96209075299987 - ], - [ - 129.15284264400006, - -6.976169528999904 - ], - [ - 129.15040123800023, - -6.991469007999868 - ], - [ - 129.14258873800023, - -6.997491143999881 - ] - ] - ], - [ - [ - [ - 113.98991946700002, - -6.877862237999864 - ], - [ - 114.00961347700016, - -6.886976820999848 - ], - [ - 114.02800540500013, - -6.89902109199987 - ], - [ - 114.04566491000006, - -6.914646091999856 - ], - [ - 114.06568444100012, - -6.922621351999808 - ], - [ - 114.0935361000002, - -6.932656869999889 - ], - [ - 114.10979032100019, - -6.946898122999869 - ], - [ - 114.12480136100018, - -6.981610298999854 - ], - [ - 114.0966859060002, - -6.982878634999821 - ], - [ - 114.05110424100022, - -7.011430963999871 - ], - [ - 113.98113040500007, - -7.020684502999899 - ], - [ - 113.95556836000017, - -7.044948626999883 - ], - [ - 113.93558346700004, - -7.049914273999875 - ], - [ - 113.90997853900015, - -7.048063177999921 - ], - [ - 113.89187473100006, - -7.059225490999879 - ], - [ - 113.87065451200013, - -7.095177104999848 - ], - [ - 113.88625582000012, - -7.099515480999898 - ], - [ - 113.894999265, - -7.109432092999896 - ], - [ - 113.89535566500004, - -7.120538018999895 - ], - [ - 113.87281334700006, - -7.128838799999883 - ], - [ - 113.83253315700003, - -7.132019753999899 - ], - [ - 113.77671570200002, - -7.12525605399982 - ], - [ - 113.70624848300011, - -7.113613321999907 - ], - [ - 113.68666778000008, - -7.112641921999824 - ], - [ - 113.66521243600008, - -7.110039971999839 - ], - [ - 113.6453268920001, - -7.13113389199988 - ], - [ - 113.61005227600012, - -7.129187025999911 - ], - [ - 113.59337868000014, - -7.138901022999946 - ], - [ - 113.58276663400014, - -7.153486441999888 - ], - [ - 113.57728379800008, - -7.168367782999894 - ], - [ - 113.57044638000005, - -7.181896028999859 - ], - [ - 113.56588242900014, - -7.193622593999862 - ], - [ - 113.5594892610001, - -7.212117351999893 - ], - [ - 113.54898420600014, - -7.23377815399985 - ], - [ - 113.53394127900012, - -7.240101743999929 - ], - [ - 113.5134253430002, - -7.247781563999879 - ], - [ - 113.50705780900003, - -7.240109507999861 - ], - [ - 113.495213409, - -7.230636771999812 - ], - [ - 113.47247064700016, - -7.222049961999886 - ], - [ - 113.42269941499998, - -7.226739190999822 - ], - [ - 113.26905358200017, - -7.217461846999868 - ], - [ - 113.25123131600017, - -7.209649346999882 - ], - [ - 113.23438561300006, - -7.207614841999856 - ], - [ - 113.18653405000023, - -7.223321221999825 - ], - [ - 113.16553795700011, - -7.219903252999899 - ], - [ - 113.15870201900012, - -7.18523528399983 - ], - [ - 113.1531681650001, - -7.177422783999845 - ], - [ - 113.14633222700016, - -7.171563408999887 - ], - [ - 113.14576256600017, - -7.165785414999917 - ], - [ - 113.15870201900012, - -7.158461195999834 - ], - [ - 113.15870201900012, - -7.151055596999839 - ], - [ - 113.14600670700023, - -7.14959075299987 - ], - [ - 113.122325066, - -7.139418226999837 - ], - [ - 113.11426842500006, - -7.141208591999913 - ], - [ - 113.10962975400005, - -7.151462497999844 - ], - [ - 113.10971113400004, - -7.171482028999904 - ], - [ - 113.10336347699999, - -7.178887627999899 - ], - [ - 113.11638431100019, - -7.190687757999868 - ], - [ - 113.13526451900012, - -7.202732028999876 - ], - [ - 113.148692254, - -7.214776299999883 - ], - [ - 113.14503014400023, - -7.226739190999822 - ], - [ - 113.12794030000012, - -7.231052341999913 - ], - [ - 112.818125847, - -7.161390882999854 - ], - [ - 112.77808678500017, - -7.158461195999834 - ], - [ - 112.74252363400004, - -7.161390882999854 - ], - [ - 112.72641035200004, - -7.158786716999856 - ], - [ - 112.71989993600008, - -7.147881768999866 - ], - [ - 112.717051629, - -7.117608330999872 - ], - [ - 112.71876061300011, - -7.103285414999888 - ], - [ - 112.72730553500006, - -7.089532158999873 - ], - [ - 112.71989993600008, - -7.082777601999837 - ], - [ - 112.70997155000023, - -7.097344658999873 - ], - [ - 112.70134524800002, - -7.092054945999806 - ], - [ - 112.69499759200019, - -7.076104424999883 - ], - [ - 112.69263756600006, - -7.058526299999855 - ], - [ - 112.69450931100013, - -7.038995049999869 - ], - [ - 112.70093834700006, - -7.033298434999892 - ], - [ - 112.71363366000011, - -7.032403252999899 - ], - [ - 112.73414147200006, - -7.028090101999808 - ], - [ - 112.76351972700016, - -7.011000257999854 - ], - [ - 112.79265384200019, - -6.984063408999887 - ], - [ - 112.84400475400005, - -6.925062757999839 - ], - [ - 112.8419702480002, - -6.908868096999882 - ], - [ - 112.87322024800008, - -6.897719007999868 - ], - [ - 112.91529381600006, - -6.891696872999859 - ], - [ - 112.94402103000019, - -6.890964450999917 - ], - [ - 112.98170006600006, - -6.891289971999853 - ], - [ - 113.06739342500012, - -6.881036065999837 - ], - [ - 113.14601986800008, - -6.894371211999896 - ], - [ - 113.27335673500014, - -6.892996303999908 - ], - [ - 113.44558230000021, - -6.882377938999838 - ], - [ - 113.52622788700015, - -6.896293042999915 - ], - [ - 113.67205189100005, - -6.879398963999918 - ], - [ - 113.79311278800006, - -6.882479059999852 - ], - [ - 113.92367597700016, - -6.864841403999876 - ], - [ - 113.96802819100012, - -6.870538018999852 - ], - [ - 113.98991946700002, - -6.877862237999864 - ] - ] - ], - [ - [ - [ - 115.37924238400004, - -6.834730726999851 - ], - [ - 115.46078535200004, - -6.842543226999837 - ], - [ - 115.48357181100008, - -6.851657809999921 - ], - [ - 115.55347741000017, - -6.889418226999879 - ], - [ - 115.57064863400004, - -6.904554945999877 - ], - [ - 115.57227623800023, - -6.930596612999864 - ], - [ - 115.55713951900023, - -6.94003671699987 - ], - [ - 115.51270592500012, - -6.938734632999868 - ], - [ - 115.50318444100006, - -6.936618747999859 - ], - [ - 115.48316491000017, - -6.927341403999904 - ], - [ - 115.46705162900017, - -6.923923434999892 - ], - [ - 115.454844597, - -6.917575778999876 - ], - [ - 115.45118248800017, - -6.914646091999856 - ], - [ - 115.44410241000011, - -6.910088799999897 - ], - [ - 115.43897545700011, - -6.911797783999901 - ], - [ - 115.43409264400012, - -6.91822682099982 - ], - [ - 115.42579186300023, - -6.920098565999879 - ], - [ - 115.41911868600019, - -6.925062757999839 - ], - [ - 115.41309655000006, - -6.925062757999839 - ], - [ - 115.40512129000004, - -6.921644789999917 - ], - [ - 115.40040123800011, - -6.916924737999821 - ], - [ - 115.394297722, - -6.912692966999899 - ], - [ - 115.38233483200011, - -6.910821221999839 - ], - [ - 115.3504337900001, - -6.927504164999874 - ], - [ - 115.34473717500012, - -6.928155205999829 - ], - [ - 115.34815514400012, - -6.940606377999842 - ], - [ - 115.35661868600008, - -6.945407809999921 - ], - [ - 115.36784915500007, - -6.9476864559999 - ], - [ - 115.37891686300006, - -6.952406507999811 - ], - [ - 115.39096113399998, - -6.961195570999877 - ], - [ - 115.39600670700023, - -6.966078382999854 - ], - [ - 115.40064537900017, - -6.972914320999863 - ], - [ - 115.37826582100004, - -6.987399997999901 - ], - [ - 115.35531660200016, - -6.982028903999861 - ], - [ - 115.31739342500012, - -6.952406507999811 - ], - [ - 115.30323326900012, - -6.966078382999854 - ], - [ - 115.301036004, - -6.972263278999904 - ], - [ - 115.300547722, - -6.977959893999895 - ], - [ - 115.30152428500011, - -6.981215101999851 - ], - [ - 115.30323326900012, - -6.980401299999841 - ], - [ - 115.30355879000004, - -6.985935153999847 - ], - [ - 115.31137129000004, - -6.995538018999838 - ], - [ - 115.31055748800011, - -7.000746351999823 - ], - [ - 115.30600019600016, - -7.004164320999834 - ], - [ - 115.29948978000007, - -7.00701262799987 - ], - [ - 115.29330488399998, - -7.007582289999931 - ], - [ - 115.29078209700018, - -7.004001559999864 - ], - [ - 115.28711998800023, - -7.003024997999887 - ], - [ - 115.26563561300011, - -6.983493747999916 - ], - [ - 115.26531009200008, - -6.976006768999852 - ], - [ - 115.27588951900023, - -6.938734632999868 - ], - [ - 115.23804772200018, - -6.94231536299985 - ], - [ - 115.22144616000006, - -6.939711195999848 - ], - [ - 115.21436608200005, - -6.928155205999829 - ], - [ - 115.21851647200012, - -6.904392184999921 - ], - [ - 115.22877037900005, - -6.891534112999892 - ], - [ - 115.24203535200016, - -6.88095468499985 - ], - [ - 115.25538170700005, - -6.863051039999888 - ], - [ - 115.24431399800002, - -6.846449476999837 - ], - [ - 115.25505618600008, - -6.838148695999848 - ], - [ - 115.27572675900015, - -6.835381768999895 - ], - [ - 115.29493248800011, - -6.835625908999845 - ], - [ - 115.37924238400004, - -6.834730726999851 - ] - ] - ], - [ - [ - [ - 129.52906334700012, - -6.723077080999886 - ], - [ - 129.5307723320001, - -6.731215101999808 - ], - [ - 129.52906334700012, - -6.73919036299985 - ], - [ - 129.51807701900023, - -6.763116143999824 - ], - [ - 129.51156660200016, - -6.769707940999893 - ], - [ - 129.50131269600004, - -6.770603122999887 - ], - [ - 129.49317467500012, - -6.765720309999907 - ], - [ - 129.48812910200016, - -6.760837497999844 - ], - [ - 129.48617597700004, - -6.754571221999896 - ], - [ - 129.4845483730002, - -6.755303643999824 - ], - [ - 129.48096764400023, - -6.760023695999834 - ], - [ - 129.47787519600016, - -6.756036065999851 - ], - [ - 129.47877037900005, - -6.744073174999826 - ], - [ - 129.48633873800011, - -6.729099216999884 - ], - [ - 129.49708092500012, - -6.722588799999897 - ], - [ - 129.50977623800006, - -6.723402601999808 - ], - [ - 129.52019290500007, - -6.721123955999843 - ], - [ - 129.52906334700012, - -6.723077080999886 - ] - ] - ], - [ - [ - [ - 138.74659264400023, - -6.863051039999888 - ], - [ - 138.72828209700018, - -6.867771091999899 - ], - [ - 138.71631920700023, - -6.864678643999824 - ], - [ - 138.7065535820001, - -6.859144789999888 - ], - [ - 138.69507897200018, - -6.856215101999865 - ], - [ - 138.68197675900004, - -6.847751559999921 - ], - [ - 138.67286217500012, - -6.810153903999918 - ], - [ - 138.66089928500017, - -6.801527601999837 - ], - [ - 138.65015709700018, - -6.7972958309999 - ], - [ - 138.63892662900017, - -6.787367445999806 - ], - [ - 138.62305748800023, - -6.767347914999931 - ], - [ - 138.61695397200006, - -6.748142184999878 - ], - [ - 138.61850019599999, - -6.729099216999884 - ], - [ - 138.62696373800023, - -6.720147393999866 - ], - [ - 138.64128665500013, - -6.730645440999837 - ], - [ - 138.6655379570001, - -6.750258070999806 - ], - [ - 138.67920983200023, - -6.758070570999877 - ], - [ - 138.69507897200018, - -6.761325778999918 - ], - [ - 138.731211785, - -6.763116143999824 - ], - [ - 138.74683678500017, - -6.768161716999856 - ], - [ - 138.75342858200005, - -6.778252862999821 - ], - [ - 138.75904381600017, - -6.791680596999896 - ], - [ - 138.78305097700004, - -6.814222914999888 - ], - [ - 138.78744550899998, - -6.829522393999852 - ], - [ - 138.78150475400017, - -6.838962497999859 - ], - [ - 138.76872806100002, - -6.84937916499986 - ], - [ - 138.74659264400023, - -6.863051039999888 - ] - ] - ], - [ - [ - [ - 131.62452233200005, - -6.709730726999865 - ], - [ - 131.606211785, - -6.727146091999842 - ], - [ - 131.58399498800023, - -6.719496351999823 - ], - [ - 131.56869550899998, - -6.732598565999879 - ], - [ - 131.56617272200018, - -6.751641533999873 - ], - [ - 131.59131920700023, - -6.767673434999864 - ], - [ - 131.58204186300011, - -6.781670830999829 - ], - [ - 131.56478925899998, - -6.795586846999896 - ], - [ - 131.55103600400017, - -6.801527601999837 - ], - [ - 131.52735436300023, - -6.780857028999904 - ], - [ - 131.53736412900005, - -6.738051039999917 - ], - [ - 131.56568444100017, - -6.696465752999842 - ], - [ - 131.59742272200006, - -6.679131768999852 - ], - [ - 131.61931399800008, - -6.682549737999864 - ], - [ - 131.62867272200012, - -6.693942966999913 - ], - [ - 131.62452233200005, - -6.709730726999865 - ] - ] - ], - [ - [ - [ - 134.67603600400017, - -6.757500908999916 - ], - [ - 134.6694442070001, - -6.772881768999852 - ], - [ - 134.65365644600016, - -6.768812757999811 - ], - [ - 134.62142988400004, - -6.74700286299985 - ], - [ - 134.6300561860002, - -6.735772393999852 - ], - [ - 134.63160241000006, - -6.727227471999825 - ], - [ - 134.62826582100004, - -6.709405205999843 - ], - [ - 134.63257897200006, - -6.700372002999842 - ], - [ - 134.66578209700006, - -6.650485934999878 - ], - [ - 134.67660566500015, - -6.610528252999828 - ], - [ - 134.68148847700004, - -6.599867445999806 - ], - [ - 134.68767337300008, - -6.591973565999822 - ], - [ - 134.69605553500006, - -6.58798593499985 - ], - [ - 134.70736738400004, - -6.589043877999899 - ], - [ - 134.7200626960001, - -6.595310153999847 - ], - [ - 134.73015384200008, - -6.604750257999868 - ], - [ - 134.73633873800011, - -6.616875908999859 - ], - [ - 134.73755944100006, - -6.630954684999892 - ], - [ - 134.72950280000012, - -6.664808851999865 - ], - [ - 134.7221785820001, - -6.682793877999899 - ], - [ - 134.71363366000017, - -6.6957333309999 - ], - [ - 134.70329837300008, - -6.707777601999823 - ], - [ - 134.68043053500006, - -6.743259372999901 - ], - [ - 134.67603600400017, - -6.757500908999916 - ] - ] - ], - [ - [ - [ - 105.26417076900006, - -6.527927341999842 - ], - [ - 105.26563561300006, - -6.55331796699987 - ], - [ - 105.26384524800008, - -6.592380466999927 - ], - [ - 105.25603274800008, - -6.628187757999839 - ], - [ - 105.23991946700019, - -6.643975518999881 - ], - [ - 105.22242272200006, - -6.64934661299985 - ], - [ - 105.20386803500006, - -6.673272393999909 - ], - [ - 105.19214928500006, - -6.678806247999916 - ], - [ - 105.18295332100016, - -6.671563408999901 - ], - [ - 105.18506920700011, - -6.655043226999837 - ], - [ - 105.19353274800014, - -6.636651299999883 - ], - [ - 105.20215905000012, - -6.623467705999843 - ], - [ - 105.18995201900006, - -6.617852471999839 - ], - [ - 105.18295332100016, - -6.607679945999891 - ], - [ - 105.17546634200019, - -6.583103122999873 - ], - [ - 105.13209069100006, - -6.626885674999841 - ], - [ - 105.12012780000012, - -6.630954684999892 - ], - [ - 105.11768639400006, - -6.612399997999887 - ], - [ - 105.13795006600017, - -6.587334893999895 - ], - [ - 105.18848717500012, - -6.547621351999879 - ], - [ - 105.19581139400012, - -6.555108330999857 - ], - [ - 105.20411217500006, - -6.545179945999848 - ], - [ - 105.21558678500006, - -6.538832289999917 - ], - [ - 105.22559655000012, - -6.536390882999882 - ], - [ - 105.22999108200011, - -6.538181247999873 - ], - [ - 105.23357181100008, - -6.531833591999842 - ], - [ - 105.2420353520001, - -6.52841562299993 - ], - [ - 105.253184441, - -6.527276299999897 - ], - [ - 105.26417076900006, - -6.527927341999842 - ] - ] - ], - [ - [ - [ - 134.72982832100004, - -6.546156507999825 - ], - [ - 134.71534264400006, - -6.552992445999848 - ], - [ - 134.70248457100016, - -6.550957940999822 - ], - [ - 134.69385826900023, - -6.553480726999837 - ], - [ - 134.68848717500006, - -6.558526299999869 - ], - [ - 134.67481530000023, - -6.563083591999899 - ], - [ - 134.65626061300023, - -6.559014580999857 - ], - [ - 134.64812259200002, - -6.541924737999906 - ], - [ - 134.644297722, - -6.520765882999811 - ], - [ - 134.63591556100008, - -6.506280205999857 - ], - [ - 134.62614993600013, - -6.497165622999859 - ], - [ - 134.62378991000017, - -6.486097914999917 - ], - [ - 134.63135826900012, - -6.475844007999811 - ], - [ - 134.644786004, - -6.464450778999932 - ], - [ - 134.66325931100002, - -6.45484791499986 - ], - [ - 134.68433678500006, - -6.457777601999879 - ], - [ - 134.70484459700012, - -6.470472914999931 - ], - [ - 134.719493035, - -6.486260674999883 - ], - [ - 134.72779381600017, - -6.504571221999853 - ], - [ - 134.73096764400023, - -6.514336846999882 - ], - [ - 134.73438561300006, - -6.525811455999843 - ], - [ - 134.72982832100004, - -6.546156507999825 - ] - ] - ], - [ - [ - [ - 130.0216577480002, - -6.324965101999823 - ], - [ - 130.01368248800023, - -6.328383070999834 - ], - [ - 130.006114129, - -6.324883721999839 - ], - [ - 129.99870853000013, - -6.317152601999823 - ], - [ - 129.997813347, - -6.309747002999842 - ], - [ - 130.00375410200016, - -6.306247653999847 - ], - [ - 130.020762566, - -6.312432549999826 - ], - [ - 130.0260522800002, - -6.318454684999921 - ], - [ - 130.0216577480002, - -6.324965101999823 - ] - ] - ], - [ - [ - [ - 134.6077580090001, - -6.421482028999876 - ], - [ - 134.60222415500007, - -6.441582940999837 - ], - [ - 134.588145379, - -6.455254815999865 - ], - [ - 134.55372155000006, - -6.473239841999899 - ], - [ - 134.565684441, - -6.491387627999899 - ], - [ - 134.56055748800011, - -6.516045830999886 - ], - [ - 134.54175866000006, - -6.529473565999879 - ], - [ - 134.51156660200004, - -6.513604424999855 - ], - [ - 134.50228925899998, - -6.500176690999865 - ], - [ - 134.49586022200018, - -6.485284112999821 - ], - [ - 134.49236087300008, - -6.471612237999878 - ], - [ - 134.49122155000023, - -6.462334893999824 - ], - [ - 134.486582879, - -6.454359632999868 - ], - [ - 134.46387780000018, - -6.424899997999887 - ], - [ - 134.45142662900005, - -6.424899997999887 - ], - [ - 134.43799889400023, - -6.427504164999888 - ], - [ - 134.42725670700023, - -6.426364841999856 - ], - [ - 134.42286217500023, - -6.414646091999856 - ], - [ - 134.41773522200006, - -6.406426690999865 - ], - [ - 134.35840905000006, - -6.379489841999899 - ], - [ - 134.35035241000006, - -6.371758721999882 - ], - [ - 134.34717858200005, - -6.359633070999806 - ], - [ - 134.34986412900017, - -6.350681247999859 - ], - [ - 134.35645592500023, - -6.341566664999874 - ], - [ - 134.36451256600017, - -6.333591403999918 - ], - [ - 134.37208092500012, - -6.327813408999859 - ], - [ - 134.38672936300023, - -6.319594007999854 - ], - [ - 134.39136803500006, - -6.316094658999873 - ], - [ - 134.40642337300008, - -6.299574476999894 - ], - [ - 134.41342207100016, - -6.294528903999861 - ], - [ - 134.42115319100006, - -6.290134372999873 - ], - [ - 134.42937259200008, - -6.286716403999861 - ], - [ - 134.437754754, - -6.285088799999841 - ], - [ - 134.4461369150001, - -6.285414320999863 - ], - [ - 134.45215905000006, - -6.288018487999864 - ], - [ - 134.46355228000007, - -6.296970309999892 - ], - [ - 134.4949650400001, - -6.313897393999881 - ], - [ - 134.50473066500004, - -6.321221612999878 - ], - [ - 134.5286564460001, - -6.350274346999853 - ], - [ - 134.54420006600017, - -6.363864841999913 - ], - [ - 134.5631616550002, - -6.369561455999886 - ], - [ - 134.57471764400012, - -6.374769789999888 - ], - [ - 134.58961022200018, - -6.387790622999873 - ], - [ - 134.60230553500006, - -6.404554945999806 - ], - [ - 134.6077580090001, - -6.421482028999876 - ] - ] - ], - [ - [ - [ - 134.83765709700018, - -6.460056247999859 - ], - [ - 134.8263452480002, - -6.473239841999899 - ], - [ - 134.81177819100006, - -6.464288018999866 - ], - [ - 134.79835045700005, - -6.452243747999859 - ], - [ - 134.79395592500006, - -6.440524997999873 - ], - [ - 134.80640709700012, - -6.431735934999907 - ], - [ - 134.80640709700012, - -6.424899997999887 - ], - [ - 134.79411868600008, - -6.40195077899989 - ], - [ - 134.7990014980002, - -6.370538018999866 - ], - [ - 134.81421959700018, - -6.345798434999892 - ], - [ - 134.83375084700018, - -6.342380466999884 - ], - [ - 134.8336694670002, - -6.31145598799985 - ], - [ - 134.83562259200002, - -6.296563408999887 - ], - [ - 134.84058678500017, - -6.287692966999842 - ], - [ - 134.8561304050002, - -6.283786716999842 - ], - [ - 134.87183678500017, - -6.288506768999852 - ], - [ - 134.88379967500006, - -6.29949309699991 - ], - [ - 134.88819420700005, - -6.314060153999847 - ], - [ - 134.8859155610002, - -6.336358330999872 - ], - [ - 134.87891686300011, - -6.355889580999857 - ], - [ - 134.86109459700006, - -6.390069268999852 - ], - [ - 134.83765709700018, - -6.460056247999859 - ] - ] - ], - [ - [ - [ - 134.43653405000012, - -6.445245049999883 - ], - [ - 134.44263756600017, - -6.446384372999916 - ], - [ - 134.4460555350001, - -6.443454684999892 - ], - [ - 134.44996178500017, - -6.441338799999883 - ], - [ - 134.45704186300023, - -6.445245049999883 - ], - [ - 134.4612736340001, - -6.450860283999873 - ], - [ - 134.4620874360002, - -6.45566171699987 - ], - [ - 134.4620874360002, - -6.460381768999881 - ], - [ - 134.46387780000018, - -6.465752862999835 - ], - [ - 134.48170006600006, - -6.49773528399983 - ], - [ - 134.48536217500012, - -6.506931247999901 - ], - [ - 134.48780358200023, - -6.508558851999837 - ], - [ - 134.490000847, - -6.51132577899989 - ], - [ - 134.49122155000023, - -6.517266533999901 - ], - [ - 134.48902428500006, - -6.520684502999828 - ], - [ - 134.48438561300023, - -6.52263762799987 - ], - [ - 134.47974694100012, - -6.525485934999907 - ], - [ - 134.47754967500012, - -6.53134530999985 - ], - [ - 134.48438561300023, - -6.575616143999909 - ], - [ - 134.51050866000017, - -6.580661716999842 - ], - [ - 134.52149498800023, - -6.586846612999821 - ], - [ - 134.51539147200006, - -6.599541924999869 - ], - [ - 134.50831139400006, - -6.609063408999873 - ], - [ - 134.50416100400005, - -6.627536716999884 - ], - [ - 134.49927819100017, - -6.637790622999916 - ], - [ - 134.47217858200023, - -6.661797783999859 - ], - [ - 134.4503686860002, - -6.660577080999843 - ], - [ - 134.42872155000012, - -6.652764580999857 - ], - [ - 134.40170332100016, - -6.657484632999868 - ], - [ - 134.40170332100016, - -6.664971612999835 - ], - [ - 134.42042076900023, - -6.664157809999907 - ], - [ - 134.43376712300002, - -6.677015882999839 - ], - [ - 134.43653405000012, - -6.682061455999872 - ], - [ - 134.43213951900012, - -6.691582940999865 - ], - [ - 134.42156009200008, - -6.704196872999859 - ], - [ - 134.40894616000017, - -6.715020440999851 - ], - [ - 134.39828535200016, - -6.719659112999878 - ], - [ - 134.34717858200005, - -6.801527601999837 - ], - [ - 134.36426842500012, - -6.80779387799987 - ], - [ - 134.35889733200005, - -6.820733330999886 - ], - [ - 134.3107202480002, - -6.859470309999907 - ], - [ - 134.24480228000007, - -6.883477471999868 - ], - [ - 134.20736738400004, - -6.911309502999828 - ], - [ - 134.1850692070001, - -6.918633721999825 - ], - [ - 134.15845787900005, - -6.873630466999842 - ], - [ - 134.1461694670002, - -6.858982028999918 - ], - [ - 134.14047285200004, - -6.854913018999866 - ], - [ - 134.12745201900023, - -6.84937916499986 - ], - [ - 134.08985436300023, - -6.838311455999914 - ], - [ - 134.07341556100002, - -6.826755466999884 - ], - [ - 134.06446373800011, - -6.795586846999896 - ], - [ - 134.05502363399998, - -6.775160414999917 - ], - [ - 134.05298912900017, - -6.764336846999839 - ], - [ - 134.054453972, - -6.751641533999873 - ], - [ - 134.0665796230002, - -6.719659112999878 - ], - [ - 134.08594811300023, - -6.642022393999838 - ], - [ - 134.103770379, - -6.474867445999834 - ], - [ - 134.11060631600006, - -6.459161065999865 - ], - [ - 134.11752363400004, - -6.452080987999892 - ], - [ - 134.1206160820001, - -6.462334893999824 - ], - [ - 134.13111412900017, - -6.479750257999896 - ], - [ - 134.18580162900005, - -6.489190362999821 - ], - [ - 134.20997155000023, - -6.50741952899989 - ], - [ - 134.20826256600006, - -6.489841403999861 - ], - [ - 134.19117272200018, - -6.462823174999912 - ], - [ - 134.18946373800006, - -6.445245049999883 - ], - [ - 134.13697350400005, - -6.450372002999885 - ], - [ - 134.12037194100017, - -6.419854424999855 - ], - [ - 134.12745201900023, - -6.325290622999844 - ], - [ - 134.12159264400006, - -6.291924737999864 - ], - [ - 134.09913170700005, - -6.225681247999887 - ], - [ - 134.09750410200016, - -6.192071221999868 - ], - [ - 134.10271243600008, - -6.180108330999843 - ], - [ - 134.1119897800002, - -6.172946872999887 - ], - [ - 134.12378991000017, - -6.171563408999916 - ], - [ - 134.13599694100006, - -6.17693450299987 - ], - [ - 134.14600670700023, - -6.188734632999839 - ], - [ - 134.15406334700018, - -6.203057549999826 - ], - [ - 134.163828972, - -6.215020440999865 - ], - [ - 134.19874108200023, - -6.224297783999901 - ], - [ - 134.2140405610002, - -6.234795830999886 - ], - [ - 134.2472436860002, - -6.268324476999823 - ], - [ - 134.27711022200018, - -6.290215752999856 - ], - [ - 134.28882897200018, - -6.294528903999861 - ], - [ - 134.29460696700002, - -6.297784112999906 - ], - [ - 134.29883873800017, - -6.305840752999842 - ], - [ - 134.29981530000023, - -6.315850518999824 - ], - [ - 134.29590905000023, - -6.325290622999844 - ], - [ - 134.28809655000023, - -6.33603280999985 - ], - [ - 134.28777103000002, - -6.341892184999892 - ], - [ - 134.31275475400005, - -6.374200127999828 - ], - [ - 134.3297632170002, - -6.389336846999825 - ], - [ - 134.34937584700018, - -6.399834893999881 - ], - [ - 134.392425977, - -6.408298434999921 - ], - [ - 134.40723717500006, - -6.419122002999828 - ], - [ - 134.42042076900023, - -6.432793877999856 - ], - [ - 134.43653405000012, - -6.445245049999883 - ] - ] - ], - [ - [ - [ - 134.15528405000006, - -6.00652434699991 - ], - [ - 134.15528405000006, - -6.048028252999899 - ], - [ - 134.16065514400023, - -6.043552341999842 - ], - [ - 134.20679772200018, - -6.025323174999855 - ], - [ - 134.21778405000012, - -6.023614190999851 - ], - [ - 134.22584069100006, - -6.028741143999866 - ], - [ - 134.23585045700023, - -6.062676690999822 - ], - [ - 134.24048912900017, - -6.073500257999811 - ], - [ - 134.24480228000007, - -6.075941664999931 - ], - [ - 134.25098717500023, - -6.070977471999896 - ], - [ - 134.27149498800011, - -6.061700127999842 - ], - [ - 134.2657983730002, - -6.077406507999811 - ], - [ - 134.246348504, - -6.096449476999808 - ], - [ - 134.23731530000012, - -6.110121351999837 - ], - [ - 134.23414147200006, - -6.130059502999828 - ], - [ - 134.24252363399998, - -6.144219658999845 - ], - [ - 134.25700931100008, - -6.158379815999865 - ], - [ - 134.27149498800011, - -6.178399346999839 - ], - [ - 134.28630618600008, - -6.174981377999828 - ], - [ - 134.29981530000023, - -6.184502862999821 - ], - [ - 134.33326256600012, - -6.234551690999837 - ], - [ - 134.34278405000012, - -6.239353122999916 - ], - [ - 134.36150149800008, - -6.239353122999916 - ], - [ - 134.3532007170002, - -6.250420830999872 - ], - [ - 134.35596764400023, - -6.254571221999896 - ], - [ - 134.37794030000023, - -6.254082940999822 - ], - [ - 134.3859155610002, - -6.25750090899983 - ], - [ - 134.39568118600008, - -6.264906507999825 - ], - [ - 134.40788821700002, - -6.271905205999886 - ], - [ - 134.42286217500023, - -6.274021091999899 - ], - [ - 134.42286217500023, - -6.280857028999918 - ], - [ - 134.39747155000023, - -6.284926039999874 - ], - [ - 134.38086998800006, - -6.298760674999883 - ], - [ - 134.366465691, - -6.315687757999868 - ], - [ - 134.34717858200005, - -6.329278252999828 - ], - [ - 134.33765709700018, - -6.331963799999897 - ], - [ - 134.33480879000015, - -6.328871351999823 - ], - [ - 134.33318118600013, - -6.320570570999834 - ], - [ - 134.32667076900012, - -6.30820077899989 - ], - [ - 134.30396569100017, - -6.287530205999872 - ], - [ - 134.29078209700006, - -6.280043226999823 - ], - [ - 134.28500410200016, - -6.28427499799993 - ], - [ - 134.27759850400017, - -6.275079033999859 - ], - [ - 134.2338973320001, - -6.239353122999916 - ], - [ - 134.2179468110002, - -6.20761484199987 - ], - [ - 134.2028100920002, - -6.194268487999864 - ], - [ - 134.18262780000023, - -6.205743096999896 - ], - [ - 134.16228274800008, - -6.196547132999839 - ], - [ - 134.16602623800011, - -6.183038018999866 - ], - [ - 134.1798608730002, - -6.167087497999859 - ], - [ - 134.18946373800006, - -6.150485934999892 - ], - [ - 134.18604576900017, - -6.133965752999828 - ], - [ - 134.17164147200012, - -6.136488539999931 - ], - [ - 134.14112389400017, - -6.157891533999873 - ], - [ - 134.12037194100017, - -6.122165622999844 - ], - [ - 134.11491946700002, - -6.076836846999839 - ], - [ - 134.12598717500018, - -6.034274997999887 - ], - [ - 134.15528405000006, - -6.00652434699991 - ] - ] - ], - [ - [ - [ - 106.15919030000006, - -6.009535414999903 - ], - [ - 106.17603600400005, - -6.013929945999806 - ], - [ - 106.20948326900012, - -5.99830494599982 - ], - [ - 106.23145592500012, - -5.966973565999865 - ], - [ - 106.25652103000002, - -5.941582940999837 - ], - [ - 106.29883873800006, - -5.945000908999845 - ], - [ - 106.36101321700002, - -5.993422132999839 - ], - [ - 106.3849389980002, - -6.000258070999863 - ], - [ - 106.40935306100008, - -6.004327080999829 - ], - [ - 106.4700626960001, - -6.03435637799987 - ], - [ - 106.49537194100006, - -6.034844658999859 - ], - [ - 106.5120548840001, - -6.024834893999866 - ], - [ - 106.5276798840001, - -6.012465101999837 - ], - [ - 106.54932701900006, - -6.00652434699991 - ], - [ - 106.66293379000015, - -6.007989190999865 - ], - [ - 106.68539472700016, - -6.012465101999837 - ], - [ - 106.70582116000006, - -6.020196221999853 - ], - [ - 106.72087649800008, - -6.030938408999859 - ], - [ - 106.72901451900006, - -6.047539971999825 - ], - [ - 106.73104902400021, - -6.058851820999806 - ], - [ - 106.73243248800011, - -6.066582940999822 - ], - [ - 106.73780358200005, - -6.083916924999897 - ], - [ - 106.75196373800006, - -6.095879815999837 - ], - [ - 106.79322350400005, - -6.104099216999927 - ], - [ - 106.8377384770001, - -6.102715752999856 - ], - [ - 106.98829186300006, - -6.079359632999854 - ], - [ - 106.99350019600016, - -6.078545830999843 - ], - [ - 107.00513756600017, - -6.072360934999878 - ], - [ - 107.00855553500017, - -6.053155205999829 - ], - [ - 107.01392662900005, - -6.040459893999852 - ], - [ - 107.0149845710001, - -6.028985283999901 - ], - [ - 107.00513756600017, - -6.013929945999806 - ], - [ - 106.99903405000006, - -6.003513278999904 - ], - [ - 107.00456790500019, - -5.988213799999855 - ], - [ - 107.02564537900005, - -5.958672783999887 - ], - [ - 107.02125084700006, - -5.924086195999891 - ], - [ - 107.04444420700005, - -5.914320570999848 - ], - [ - 107.08033287900017, - -5.921563408999873 - ], - [ - 107.11443118600019, - -5.938164971999839 - ], - [ - 107.12574303500017, - -5.948907158999845 - ], - [ - 107.13648522200018, - -5.961602471999896 - ], - [ - 107.15007571700002, - -5.973077080999857 - ], - [ - 107.16968834700018, - -5.979750257999811 - ], - [ - 107.187754754, - -5.980157158999901 - ], - [ - 107.20533287900005, - -5.977308851999865 - ], - [ - 107.28093509200008, - -5.954766533999887 - ], - [ - 107.32064731700015, - -5.962415976999893 - ], - [ - 107.35413648700009, - -5.975994692999933 - ], - [ - 107.37963099700019, - -6.008516380999879 - ], - [ - 107.4130776150001, - -6.06317397199993 - ], - [ - 107.44565470100011, - -6.104322740999848 - ], - [ - 107.47026793800009, - -6.145432463999924 - ], - [ - 107.51077896500013, - -6.164443739999868 - ], - [ - 107.56317927900008, - -6.184246526999843 - ], - [ - 107.62113228600006, - -6.187473681999876 - ], - [ - 107.655221834, - -6.225378002999847 - ], - [ - 107.67822384900015, - -6.238022903999905 - ], - [ - 107.69966144000009, - -6.226997790999846 - ], - [ - 107.715526068, - -6.235689939999872 - ], - [ - 107.7321944830002, - -6.232548475999835 - ], - [ - 107.74490028600022, - -6.223092012999885 - ], - [ - 107.76807701900012, - -6.213311455999857 - ], - [ - 107.773692254, - -6.207940362999892 - ], - [ - 107.78296959700018, - -6.205743096999896 - ], - [ - 107.79297936300006, - -6.207940362999892 - ], - [ - 107.80290774800008, - -6.21152109199987 - ], - [ - 107.81031334700006, - -6.211195570999848 - ], - [ - 107.81324303500017, - -6.202325127999899 - ], - [ - 107.81083632800008, - -6.189346824999873 - ], - [ - 107.82626293400008, - -6.185130075999851 - ], - [ - 107.84768385100008, - -6.191952341999894 - ], - [ - 107.849402905, - -6.205527749999845 - ], - [ - 107.86396034600014, - -6.206397675999881 - ], - [ - 107.87766123600008, - -6.191151889999915 - ], - [ - 107.8853592950002, - -6.186922216999903 - ], - [ - 107.89563098100021, - -6.209830572999877 - ], - [ - 107.89562430100008, - -6.231024718999876 - ], - [ - 107.94727623800006, - -6.263116143999838 - ], - [ - 107.99047130700009, - -6.281091899999893 - ], - [ - 108.0493425010001, - -6.309907120999853 - ], - [ - 108.07406950600009, - -6.318379011999866 - ], - [ - 108.09368265800018, - -6.326846921999916 - ], - [ - 108.11328863600014, - -6.326847264999856 - ], - [ - 108.12947950200012, - -6.32600111199983 - ], - [ - 108.14226053200017, - -6.322614955999882 - ], - [ - 108.15844983600002, - -6.311609683999862 - ], - [ - 108.18360436300006, - -6.296970309999892 - ], - [ - 108.18702233200005, - -6.294528903999861 - ], - [ - 108.19507653400015, - -6.287061085999881 - ], - [ - 108.20359445600016, - -6.276057684999927 - ], - [ - 108.2069985840001, - -6.262513256999867 - ], - [ - 108.20529439700013, - -6.24981620999985 - ], - [ - 108.19848087200009, - -6.240504778999906 - ], - [ - 108.18655716400022, - -6.231192666999917 - ], - [ - 108.1984810750001, - -6.227807820999899 - ], - [ - 108.2163638260001, - -6.237965338999842 - ], - [ - 108.24872349800009, - -6.247274812999891 - ], - [ - 108.31088199700011, - -6.248956414999853 - ], - [ - 108.33217267500018, - -6.261646979999867 - ], - [ - 108.33898106000007, - -6.250641592999926 - ], - [ - 108.36026907700008, - -6.246400944999877 - ], - [ - 108.36453480500003, - -6.272639433999885 - ], - [ - 108.37222736900017, - -6.340352902999896 - ], - [ - 108.45541425900015, - -6.442071221999825 - ], - [ - 108.47461998800011, - -6.452080987999892 - ], - [ - 108.48780358200005, - -6.456801039999903 - ], - [ - 108.53956139400006, - -6.486911716999842 - ], - [ - 108.5745548840001, - -6.669610283999859 - ], - [ - 108.60547936300011, - -6.761651299999855 - ], - [ - 108.66309655000006, - -6.767347914999931 - ], - [ - 108.705332879, - -6.795993747999901 - ], - [ - 108.74878991000006, - -6.812188408999859 - ], - [ - 108.79224694100012, - -6.811130466999899 - ], - [ - 108.83497155000012, - -6.787855726999894 - ], - [ - 108.84327233200011, - -6.797946872999859 - ], - [ - 108.85865319100006, - -6.80242278399983 - ], - [ - 108.87614993600019, - -6.804864190999851 - ], - [ - 108.88965905000006, - -6.809014580999886 - ], - [ - 108.89519290500007, - -6.814222914999888 - ], - [ - 108.90357506600006, - -6.822198174999841 - ], - [ - 108.911875847, - -6.834893487999906 - ], - [ - 108.92302493600002, - -6.84465911299985 - ], - [ - 108.94483483200011, - -6.84937916499986 - ], - [ - 108.9689233730002, - -6.848321221999896 - ], - [ - 108.98340905000006, - -6.841729424999826 - ], - [ - 108.99073326900006, - -6.827894789999917 - ], - [ - 108.99268639400012, - -6.805352471999839 - ], - [ - 109.0013126960001, - -6.789157809999892 - ], - [ - 109.0208439460001, - -6.788669528999904 - ], - [ - 109.04151451900012, - -6.795586846999896 - ], - [ - 109.05347741000006, - -6.801527601999837 - ], - [ - 109.092051629, - -6.831475518999895 - ], - [ - 109.11548912900011, - -6.838555596999853 - ], - [ - 109.14283287900017, - -6.856215101999865 - ], - [ - 109.15040123800011, - -6.857028903999876 - ], - [ - 109.17693118600008, - -6.856215101999865 - ], - [ - 109.3518986340001, - -6.875664971999868 - ], - [ - 109.43824303500011, - -6.860121351999865 - ], - [ - 109.49293053500006, - -6.801527601999837 - ], - [ - 109.531993035, - -6.835137627999856 - ], - [ - 109.72559655000012, - -6.863051039999888 - ], - [ - 109.8963322270001, - -6.91822682099982 - ], - [ - 109.940684441, - -6.923435153999904 - ], - [ - 109.98389733200011, - -6.922621351999808 - ], - [ - 110.11426842500006, - -6.903903903999932 - ], - [ - 110.13884524800008, - -6.897149346999896 - ], - [ - 110.14958743600008, - -6.88730234199987 - ], - [ - 110.15284264400012, - -6.881768487999864 - ], - [ - 110.1697697270001, - -6.860935153999876 - ], - [ - 110.177500847, - -6.856215101999865 - ], - [ - 110.1883244150001, - -6.860284112999835 - ], - [ - 110.19206790500007, - -6.869805596999825 - ], - [ - 110.1935327480002, - -6.88111744599982 - ], - [ - 110.19800866000017, - -6.890883070999848 - ], - [ - 110.21257571700019, - -6.899997653999847 - ], - [ - 110.25879967500012, - -6.920993747999873 - ], - [ - 110.29297936300011, - -6.931247653999904 - ], - [ - 110.33464603000007, - -6.961358330999843 - ], - [ - 110.35572350400017, - -6.972914320999863 - ], - [ - 110.3810327480002, - -6.975681247999916 - ], - [ - 110.39909915500002, - -6.96786874799993 - ], - [ - 110.41504967500006, - -6.957452080999843 - ], - [ - 110.43458092500012, - -6.952406507999811 - ], - [ - 110.45606530000006, - -6.950941664999945 - ], - [ - 110.47242272200018, - -6.946384372999901 - ], - [ - 110.4861759770001, - -6.937920830999857 - ], - [ - 110.52702884200002, - -6.895196221999853 - ], - [ - 110.57154381600006, - -6.836195570999806 - ], - [ - 110.6447046230002, - -6.688164971999868 - ], - [ - 110.65739993600008, - -6.643975518999881 - ], - [ - 110.66325931100019, - -6.60605234199987 - ], - [ - 110.66480553500006, - -6.565362237999878 - ], - [ - 110.669688347, - -6.546319268999881 - ], - [ - 110.67847741000017, - -6.534600518999895 - ], - [ - 110.68189537900017, - -6.521905205999843 - ], - [ - 110.67107181100019, - -6.499932549999826 - ], - [ - 110.69166100400005, - -6.496026299999826 - ], - [ - 110.70199629000015, - -6.488702080999829 - ], - [ - 110.71876061300006, - -6.465752862999835 - ], - [ - 110.73047936300006, - -6.456963799999869 - ], - [ - 110.7810978520001, - -6.436455987999821 - ], - [ - 110.80811608200005, - -6.431735934999907 - ], - [ - 110.81812584700006, - -6.428155205999843 - ], - [ - 110.83375084700006, - -6.420668226999865 - ], - [ - 110.84229576900006, - -6.418064059999864 - ], - [ - 110.9031681650001, - -6.410821221999853 - ], - [ - 110.92481530000006, - -6.403741143999881 - ], - [ - 110.93409264400012, - -6.411065362999892 - ], - [ - 110.9617619150001, - -6.427911065999893 - ], - [ - 110.9725041020001, - -6.431735934999907 - ], - [ - 110.99219811300006, - -6.432305596999868 - ], - [ - 111.00245201900012, - -6.431247653999918 - ], - [ - 111.00684655000006, - -6.428317966999899 - ], - [ - 111.01075280000006, - -6.420993747999887 - ], - [ - 111.01929772200012, - -6.426364841999856 - ], - [ - 111.0267033210001, - -6.435316664999874 - ], - [ - 111.02784264400012, - -6.438409112999864 - ], - [ - 111.0408634770001, - -6.447360934999892 - ], - [ - 111.05176842500006, - -6.45671965899983 - ], - [ - 111.05925540500007, - -6.46990325299987 - ], - [ - 111.06544030000012, - -6.509372653999847 - ], - [ - 111.0823673840001, - -6.54387786299985 - ], - [ - 111.11931399800008, - -6.649672132999868 - ], - [ - 111.13705488400015, - -6.685479424999883 - ], - [ - 111.14437910200016, - -6.691827080999914 - ], - [ - 111.15056399800014, - -6.692966403999847 - ], - [ - 111.15691165500007, - -6.692071221999853 - ], - [ - 111.34253991000011, - -6.712823174999855 - ], - [ - 111.36638431100019, - -6.712009372999844 - ], - [ - 111.40805097700016, - -6.701755466999913 - ], - [ - 111.42872155000006, - -6.699151299999826 - ], - [ - 111.44410241000011, - -6.689060153999861 - ], - [ - 111.47779381600012, - -6.640313408999845 - ], - [ - 111.49341881600017, - -6.623467705999843 - ], - [ - 111.51986738400015, - -6.639906507999839 - ], - [ - 111.57699629000015, - -6.65097421699987 - ], - [ - 111.61011803500017, - -6.664971612999835 - ], - [ - 111.62142988400015, - -6.674574476999808 - ], - [ - 111.6546330090001, - -6.716241143999866 - ], - [ - 111.6726994150001, - -6.733656507999839 - ], - [ - 111.69499759200002, - -6.755140882999868 - ], - [ - 111.71680748800006, - -6.77068450299987 - ], - [ - 111.74040774800014, - -6.781670830999829 - ], - [ - 111.80730228000007, - -6.799493096999896 - ], - [ - 111.8494572270001, - -6.803887627999885 - ], - [ - 111.86622155000012, - -6.80779387799987 - ], - [ - 111.88233483200005, - -6.808689059999864 - ], - [ - 111.90430748800011, - -6.801527601999837 - ], - [ - 111.93653405000012, - -6.784926039999874 - ], - [ - 111.95850670700005, - -6.77939218499985 - ], - [ - 111.97624759200002, - -6.784844658999887 - ], - [ - 112.00993899800002, - -6.818617445999877 - ], - [ - 112.06788170700023, - -6.893649997999901 - ], - [ - 112.08399498800011, - -6.906019789999931 - ], - [ - 112.10694420700011, - -6.910821221999839 - ], - [ - 112.15064537900017, - -6.910088799999897 - ], - [ - 112.19288170700011, - -6.904554945999877 - ], - [ - 112.22657311300011, - -6.892673434999921 - ], - [ - 112.23707116000017, - -6.890883070999848 - ], - [ - 112.27816816500015, - -6.890883070999848 - ], - [ - 112.29867597700004, - -6.887465101999837 - ], - [ - 112.33969160200004, - -6.87314218499985 - ], - [ - 112.363536004, - -6.870538018999852 - ], - [ - 112.40007571700008, - -6.876722914999917 - ], - [ - 112.41504967500012, - -6.882500908999887 - ], - [ - 112.42237389400012, - -6.878838799999841 - ], - [ - 112.42920983200011, - -6.873223565999837 - ], - [ - 112.43523196700014, - -6.870538018999852 - ], - [ - 112.45484459700018, - -6.875420830999829 - ], - [ - 112.47120201900012, - -6.887139580999914 - ], - [ - 112.48601321700008, - -6.900567315999908 - ], - [ - 112.50074303500017, - -6.910821221999839 - ], - [ - 112.52271569100017, - -6.917657158999859 - ], - [ - 112.54281660200004, - -6.917575778999876 - ], - [ - 112.55713951900012, - -6.907891533999901 - ], - [ - 112.56283613399998, - -6.88730234199987 - ], - [ - 112.56218509200002, - -6.874200127999899 - ], - [ - 112.56251061300006, - -6.866794528999918 - ], - [ - 112.56812584700018, - -6.865411065999851 - ], - [ - 112.58277428500017, - -6.870538018999852 - ], - [ - 112.58985436300023, - -6.876071872999873 - ], - [ - 112.59620201900006, - -6.885186455999872 - ], - [ - 112.60108483200023, - -6.895603122999859 - ], - [ - 112.60377037900005, - -6.904554945999877 - ], - [ - 112.60254967500012, - -6.925957940999837 - ], - [ - 112.58668053500017, - -6.965590101999865 - ], - [ - 112.58277428500017, - -6.98992278399983 - ], - [ - 112.58716881600017, - -6.99960702899989 - ], - [ - 112.60954837300008, - -7.033379815999865 - ], - [ - 112.61801191500004, - -7.041192315999865 - ], - [ - 112.62867272200006, - -7.0453427059999 - ], - [ - 112.64332116000017, - -7.039483330999857 - ], - [ - 112.65739993600019, - -7.037855726999837 - ], - [ - 112.66578209700018, - -7.054864190999893 - ], - [ - 112.63379967500018, - -7.063734632999854 - ], - [ - 112.61768639400012, - -7.070570570999863 - ], - [ - 112.61060631600006, - -7.079359632999839 - ], - [ - 112.61410566500004, - -7.091241143999881 - ], - [ - 112.62256920700005, - -7.108493747999887 - ], - [ - 112.63282311300011, - -7.123793226999851 - ], - [ - 112.64161217500023, - -7.130547783999887 - ], - [ - 112.65837649800008, - -7.13762786299985 - ], - [ - 112.67465254000004, - -7.154473565999851 - ], - [ - 112.68384850400017, - -7.174899997999916 - ], - [ - 112.678965691, - -7.192640882999825 - ], - [ - 112.664317254, - -7.198825778999876 - ], - [ - 112.60377037900005, - -7.192640882999825 - ], - [ - 112.62012780000023, - -7.21493905999985 - ], - [ - 112.64551842500023, - -7.23015715899983 - ], - [ - 112.70069420700011, - -7.254652601999865 - ], - [ - 112.71631920700005, - -7.23919036299985 - ], - [ - 112.72950280000012, - -7.220472914999874 - ], - [ - 112.74512780000012, - -7.205173434999907 - ], - [ - 112.76823978000007, - -7.199395440999851 - ], - [ - 112.784434441, - -7.205498955999843 - ], - [ - 112.79786217500012, - -7.218926690999837 - ], - [ - 112.80860436300011, - -7.234551690999822 - ], - [ - 112.82325280000012, - -7.262627862999821 - ], - [ - 112.82667076900023, - -7.27792734199987 - ], - [ - 112.8263452480002, - -7.293226820999834 - ], - [ - 112.818125847, - -7.329522393999838 - ], - [ - 112.81617272200018, - -7.346937757999811 - ], - [ - 112.81609134200019, - -7.3871395809999 - ], - [ - 112.8074650400001, - -7.40732187299993 - ], - [ - 112.77003014400023, - -7.432712497999859 - ], - [ - 112.761485222, - -7.448907158999901 - ], - [ - 112.761485222, - -7.531182549999869 - ], - [ - 112.84489993600013, - -7.592868747999887 - ], - [ - 112.97201582099999, - -7.647637627999828 - ], - [ - 112.99048912900005, - -7.651950778999918 - ], - [ - 113.01628665500007, - -7.652276299999841 - ], - [ - 113.03711998800023, - -7.655043226999808 - ], - [ - 113.05600019600016, - -7.663018487999864 - ], - [ - 113.07618248800011, - -7.67864348799985 - ], - [ - 113.1115014980002, - -7.713148695999863 - ], - [ - 113.13266035200004, - -7.727797132999868 - ], - [ - 113.16537519600016, - -7.735935153999876 - ], - [ - 113.18726647200018, - -7.745049737999878 - ], - [ - 113.19955488400015, - -7.747491143999909 - ], - [ - 113.20826256600006, - -7.746270440999893 - ], - [ - 113.22974694100006, - -7.740817966999856 - ], - [ - 113.24122155000012, - -7.740655205999886 - ], - [ - 113.260996941, - -7.750176690999879 - ], - [ - 113.2853296230002, - -7.7816708309999 - ], - [ - 113.29932701900023, - -7.788506768999824 - ], - [ - 113.32309004000015, - -7.785577080999886 - ], - [ - 113.34253991000006, - -7.7777645809999 - ], - [ - 113.37777753999998, - -7.754327080999829 - ], - [ - 113.41374759200008, - -7.736260674999897 - ], - [ - 113.43580162900017, - -7.729180596999853 - ], - [ - 113.45687910199999, - -7.726332289999903 - ], - [ - 113.4728296230002, - -7.722100518999881 - ], - [ - 113.50456790500007, - -7.703789971999825 - ], - [ - 113.52857506600012, - -7.700372002999913 - ], - [ - 113.65894616000006, - -7.720147393999838 - ], - [ - 113.67107181100013, - -7.717950127999842 - ], - [ - 113.69092858200023, - -7.709079684999892 - ], - [ - 113.69996178500006, - -7.706638278999861 - ], - [ - 113.72299238400004, - -7.708265882999882 - ], - [ - 113.76303144600004, - -7.722832940999822 - ], - [ - 113.78589928500006, - -7.726332289999903 - ], - [ - 113.80388431100019, - -7.721774997999859 - ], - [ - 113.81657962300002, - -7.710625908999845 - ], - [ - 113.83716881600017, - -7.686130466999899 - ], - [ - 113.854746941, - -7.677015882999825 - ], - [ - 113.86963951900017, - -7.677992445999806 - ], - [ - 113.88607832100016, - -7.683038018999824 - ], - [ - 113.90943444100006, - -7.686130466999899 - ], - [ - 113.9305119150001, - -7.683851820999834 - ], - [ - 113.945078972, - -7.677992445999806 - ], - [ - 114.01612389400017, - -7.61809661299985 - ], - [ - 114.04558353000007, - -7.611993096999868 - ], - [ - 114.07732181100019, - -7.630791924999826 - ], - [ - 114.11695397200006, - -7.680596612999892 - ], - [ - 114.140391472, - -7.700860283999901 - ], - [ - 114.17221113400015, - -7.713474216999884 - ], - [ - 114.19597415500007, - -7.714125257999839 - ], - [ - 114.23682701900012, - -7.703301690999837 - ], - [ - 114.25855553500017, - -7.700372002999913 - ], - [ - 114.27361087300008, - -7.705498955999829 - ], - [ - 114.31006920700023, - -7.740655205999886 - ], - [ - 114.32520592500023, - -7.750258070999863 - ], - [ - 114.33448326900012, - -7.753187757999882 - ], - [ - 114.34750410200016, - -7.754327080999829 - ], - [ - 114.36963951900023, - -7.753187757999882 - ], - [ - 114.381114129, - -7.754164320999863 - ], - [ - 114.38892662900011, - -7.758070570999863 - ], - [ - 114.40674889400017, - -7.77320728999986 - ], - [ - 114.44597415500019, - -7.794691664999888 - ], - [ - 114.46021569100017, - -7.809665622999916 - ], - [ - 114.46729576900023, - -7.830987237999878 - ], - [ - 114.46648196700002, - -7.852715752999856 - ], - [ - 114.46021569100017, - -7.894952080999886 - ], - [ - 114.45736738400015, - -7.902520440999837 - ], - [ - 114.444590691, - -7.920668226999837 - ], - [ - 114.44044030000018, - -7.932549737999878 - ], - [ - 114.44027754000004, - -7.943780205999886 - ], - [ - 114.44255618600019, - -7.952406507999882 - ], - [ - 114.4454858730002, - -7.95964934699991 - ], - [ - 114.44727623800011, - -7.966566664999903 - ], - [ - 114.44678795700011, - -8.01425546699987 - ], - [ - 114.40479576900012, - -8.158379815999822 - ], - [ - 114.36597741, - -8.357191664999903 - ], - [ - 114.36353600400017, - -8.386163018999895 - ], - [ - 114.35865319100012, - -8.409112237999892 - ], - [ - 114.35792076900017, - -8.41912200299987 - ], - [ - 114.36011803500017, - -8.430596612999821 - ], - [ - 114.37159264400012, - -8.453220309999878 - ], - [ - 114.37338300899998, - -8.498467705999914 - ], - [ - 114.376719597, - -8.519463799999855 - ], - [ - 114.38892662900011, - -8.528252862999821 - ], - [ - 114.40113366000017, - -8.517185153999876 - ], - [ - 114.40512129000015, - -8.491794528999861 - ], - [ - 114.40560957100004, - -8.447035414999917 - ], - [ - 114.42318769600016, - -8.46502044099985 - ], - [ - 114.42741946700019, - -8.496840101999894 - ], - [ - 114.42611738399998, - -8.562432549999912 - ], - [ - 114.432871941, - -8.582614841999842 - ], - [ - 114.44532311300023, - -8.602797132999868 - ], - [ - 114.46119225400017, - -8.61834075299987 - ], - [ - 114.47803795700005, - -8.624607028999918 - ], - [ - 114.49805748800023, - -8.625258070999877 - ], - [ - 114.51075280000012, - -8.628350518999852 - ], - [ - 114.53598066500015, - -8.64511484199987 - ], - [ - 114.58912194100017, - -8.66423919099985 - ], - [ - 114.59742272200006, - -8.675713799999897 - ], - [ - 114.60336347700016, - -8.688164971999825 - ], - [ - 114.61557050900015, - -8.70012786299985 - ], - [ - 114.62566165500019, - -8.716078382999854 - ], - [ - 114.624766472, - -8.740655205999872 - ], - [ - 114.59717858200011, - -8.77556731599988 - ], - [ - 114.55534915500019, - -8.777927341999842 - ], - [ - 114.4676212900001, - -8.74814218499992 - ], - [ - 114.44532311300023, - -8.744073174999869 - ], - [ - 114.38892662900011, - -8.74814218499992 - ], - [ - 114.36695397200018, - -8.741469007999882 - ], - [ - 114.36980228000013, - -8.726332289999874 - ], - [ - 114.39193769599999, - -8.700290622999901 - ], - [ - 114.38526451900023, - -8.66472747199984 - ], - [ - 114.34961998800011, - -8.632500908999887 - ], - [ - 114.30258222700016, - -8.611911716999856 - ], - [ - 114.26172936300023, - -8.61093515399989 - ], - [ - 114.22087649800008, - -8.636488539999874 - ], - [ - 114.19703209700012, - -8.645603122999859 - ], - [ - 114.18653405000023, - -8.63486093499985 - ], - [ - 114.17481530000023, - -8.61980559699984 - ], - [ - 114.14820397200012, - -8.622328382999854 - ], - [ - 114.10401451900023, - -8.638116143999895 - ], - [ - 114.09489993600002, - -8.637872002999856 - ], - [ - 114.05933678500017, - -8.631442966999842 - ], - [ - 114.05079186300023, - -8.627129815999837 - ], - [ - 114.04151451900012, - -8.608330987999892 - ], - [ - 114.03199303500011, - -8.60409921699987 - ], - [ - 114.01238040500002, - -8.60947030999992 - ], - [ - 113.99488366000017, - -8.61834075299987 - ], - [ - 113.97999108200023, - -8.620212497999844 - ], - [ - 113.96802819100012, - -8.60409921699987 - ], - [ - 113.96924889400012, - -8.593519789999917 - ], - [ - 113.97315514400012, - -8.579685153999918 - ], - [ - 113.97388756600006, - -8.567559502999828 - ], - [ - 113.96436608200023, - -8.562432549999912 - ], - [ - 113.95427493600019, - -8.564711195999877 - ], - [ - 113.93376712300014, - -8.574476820999834 - ], - [ - 113.92286217500023, - -8.576755466999899 - ], - [ - 113.90560957100016, - -8.573907158999859 - ], - [ - 113.87964928500006, - -8.566176039999931 - ], - [ - 113.85377037900005, - -8.5551083309999 - ], - [ - 113.83716881600017, - -8.542087497999916 - ], - [ - 113.83204186300006, - -8.546807549999826 - ], - [ - 113.82846113399998, - -8.548923434999935 - ], - [ - 113.82593834700018, - -8.551039320999848 - ], - [ - 113.82349694100006, - -8.55632903399983 - ], - [ - 113.81885826900012, - -8.541761976999808 - ], - [ - 113.81381269599999, - -8.507745049999869 - ], - [ - 113.80616295700017, - -8.501071872999901 - ], - [ - 113.790782097, - -8.503024997999859 - ], - [ - 113.77369225400017, - -8.508070570999806 - ], - [ - 113.76010175900004, - -8.515801690999893 - ], - [ - 113.75456790500019, - -8.524997653999876 - ], - [ - 113.75074303500017, - -8.528090101999865 - ], - [ - 113.74170983200005, - -8.528985283999859 - ], - [ - 113.72388756600012, - -8.528252862999821 - ], - [ - 113.71973717500023, - -8.524672132999854 - ], - [ - 113.72185306100008, - -8.507419528999847 - ], - [ - 113.72046959700018, - -8.501071872999901 - ], - [ - 113.70728600400005, - -8.492364190999837 - ], - [ - 113.69874108200011, - -8.493584893999852 - ], - [ - 113.68897545700005, - -8.496840101999894 - ], - [ - 113.67261803500017, - -8.494805596999868 - ], - [ - 113.65845787900005, - -8.484958591999842 - ], - [ - 113.64047285199999, - -8.458591403999847 - ], - [ - 113.62794030000012, - -8.453220309999878 - ], - [ - 113.59693444100017, - -8.447035414999917 - ], - [ - 113.59058678500006, - -8.442071221999868 - ], - [ - 113.57911217500012, - -8.428806247999844 - ], - [ - 113.57300866, - -8.425957940999893 - ], - [ - 113.54086347700016, - -8.430596612999821 - ], - [ - 113.52719160200004, - -8.429294528999918 - ], - [ - 113.490489129, - -8.408379815999865 - ], - [ - 113.48389733200023, - -8.40203215899983 - ], - [ - 113.47885175900004, - -8.394707940999837 - ], - [ - 113.47242272200018, - -8.382094007999854 - ], - [ - 113.46656334700006, - -8.377536716999899 - ], - [ - 113.44605553500011, - -8.375583591999856 - ], - [ - 113.42945397200006, - -8.384047132999896 - ], - [ - 113.41358483200011, - -8.390232028999861 - ], - [ - 113.39519290500007, - -8.381280205999843 - ], - [ - 113.34595787900017, - -8.324151299999855 - ], - [ - 113.32309004000015, - -8.309258721999896 - ], - [ - 113.28199303500017, - -8.292087497999873 - ], - [ - 113.24073326900012, - -8.280938408999859 - ], - [ - 113.19792728000013, - -8.277276299999897 - ], - [ - 113.07007897200012, - -8.292413018999895 - ], - [ - 113.02670332100016, - -8.302992445999848 - ], - [ - 112.98731530000023, - -8.323500257999811 - ], - [ - 112.93677819100006, - -8.381280205999843 - ], - [ - 112.90267988400015, - -8.403985283999873 - ], - [ - 112.87061608200005, - -8.391778252999899 - ], - [ - 112.85743248800011, - -8.392673434999892 - ], - [ - 112.83383222700016, - -8.375746351999823 - ], - [ - 112.82976321700014, - -8.381280205999843 - ], - [ - 112.8263452480002, - -8.390069268999895 - ], - [ - 112.81788170700005, - -8.396579684999892 - ], - [ - 112.80787194100017, - -8.398858330999872 - ], - [ - 112.79908287900005, - -8.395196221999825 - ], - [ - 112.78980553500017, - -8.387872002999899 - ], - [ - 112.78419030000018, - -8.38681405999985 - ], - [ - 112.76921634200002, - -8.395196221999825 - ], - [ - 112.75513756600017, - -8.40797291499986 - ], - [ - 112.74781334700018, - -8.412855726999837 - ], - [ - 112.73316491000017, - -8.417657158999916 - ], - [ - 112.71680748800017, - -8.41912200299987 - ], - [ - 112.70191491, - -8.422295830999843 - ], - [ - 112.69044030000023, - -8.429864190999893 - ], - [ - 112.67269941500015, - -8.447035414999917 - ], - [ - 112.65626061300006, - -8.436455987999864 - ], - [ - 112.6121525400001, - -8.4164364559999 - ], - [ - 112.57341556100008, - -8.410088799999869 - ], - [ - 112.52068118600008, - -8.391778252999899 - ], - [ - 112.44239342500018, - -8.391778252999899 - ], - [ - 112.42652428500006, - -8.387627862999864 - ], - [ - 112.41358483200023, - -8.37908294099985 - ], - [ - 112.39869225400017, - -8.37175872199984 - ], - [ - 112.37663821700019, - -8.37127044099985 - ], - [ - 112.38135826900012, - -8.36142343499992 - ], - [ - 112.38404381600017, - -8.357598565999822 - ], - [ - 112.36622155000012, - -8.341973565999837 - ], - [ - 112.34156334700012, - -8.332696221999882 - ], - [ - 112.31592858200023, - -8.329034112999835 - ], - [ - 112.29525800900004, - -8.329766533999859 - ], - [ - 112.28451582099999, - -8.332696221999882 - ], - [ - 112.25782311300006, - -8.343357028999904 - ], - [ - 112.24439537900017, - -8.341973565999837 - ], - [ - 112.23755944100017, - -8.338474216999842 - ], - [ - 112.23308353000019, - -8.333916924999897 - ], - [ - 112.22706139400012, - -8.329766533999859 - ], - [ - 112.20899498800006, - -8.323663018999866 - ], - [ - 112.02475019600004, - -8.304945570999806 - ], - [ - 112.00269616000006, - -8.297784112999864 - ], - [ - 111.97071373800011, - -8.277764580999886 - ], - [ - 111.96119225400005, - -8.278252862999878 - ], - [ - 111.93620853000019, - -8.29485442499984 - ], - [ - 111.93165123800006, - -8.299574476999851 - ], - [ - 111.92725670700005, - -8.30250416499986 - ], - [ - 111.91863040500019, - -8.302992445999848 - ], - [ - 111.89869225400011, - -8.296482028999861 - ], - [ - 111.87476647200006, - -8.273858330999886 - ], - [ - 111.85987389400006, - -8.268812757999868 - ], - [ - 111.833750847, - -8.270684502999828 - ], - [ - 111.82243899800002, - -8.268812757999868 - ], - [ - 111.81128991, - -8.26441822699988 - ], - [ - 111.80152428500017, - -8.258884372999859 - ], - [ - 111.79200280000006, - -8.256524346999896 - ], - [ - 111.78142337300002, - -8.261407158999873 - ], - [ - 111.77100670700005, - -8.281508070999834 - ], - [ - 111.77222741000017, - -8.30169036299985 - ], - [ - 111.7703556650001, - -8.317315362999835 - ], - [ - 111.75066165500007, - -8.323500257999811 - ], - [ - 111.74659264400012, - -8.318047783999873 - ], - [ - 111.74187259200019, - -8.306084893999838 - ], - [ - 111.73536217500006, - -8.294040622999916 - ], - [ - 111.72608483200005, - -8.288750908999845 - ], - [ - 111.71729576900006, - -8.292738539999917 - ], - [ - 111.71192467500012, - -8.302178643999838 - ], - [ - 111.70573978000007, - -8.323500257999811 - ], - [ - 111.7024845710001, - -8.327406507999811 - ], - [ - 111.69678795700011, - -8.336846612999821 - ], - [ - 111.69483483200005, - -8.346368096999825 - ], - [ - 111.70923912900005, - -8.354099216999913 - ], - [ - 111.71127363400015, - -8.36101653399983 - ], - [ - 111.70753014400012, - -8.368096612999878 - ], - [ - 111.69581139400006, - -8.37127044099985 - ], - [ - 111.67335045700005, - -8.36785247199984 - ], - [ - 111.65406334700012, - -8.358086846999896 - ], - [ - 111.63917076900006, - -8.343031507999882 - ], - [ - 111.63054446700008, - -8.323500257999811 - ], - [ - 111.62370853000002, - -8.323500257999811 - ], - [ - 111.612559441, - -8.337009372999873 - ], - [ - 111.59587649800008, - -8.334405205999886 - ], - [ - 111.56169681100019, - -8.316664320999891 - ], - [ - 111.54802493600008, - -8.315606377999842 - ], - [ - 111.53288821700008, - -8.326592705999886 - ], - [ - 111.51783287900005, - -8.329766533999859 - ], - [ - 111.44874108200011, - -8.312920830999857 - ], - [ - 111.44166100400017, - -8.296807549999883 - ], - [ - 111.44353274800014, - -8.284844658999859 - ], - [ - 111.44206790500007, - -8.276055596999882 - ], - [ - 111.42505944100012, - -8.268812757999868 - ], - [ - 111.41749108200005, - -8.26913827899989 - ], - [ - 111.39991295700011, - -8.274346612999878 - ], - [ - 111.390391472, - -8.275079033999901 - ], - [ - 111.38412519600016, - -8.272881768999824 - ], - [ - 111.3724064460001, - -8.26441822699988 - ], - [ - 111.36304772200006, - -8.261407158999873 - ], - [ - 111.31153405000006, - -8.261407158999873 - ], - [ - 111.3006291020001, - -8.262953382999825 - ], - [ - 111.29493248800011, - -8.260430596999896 - ], - [ - 111.28419030000012, - -8.25123463299984 - ], - [ - 111.27613366000017, - -8.24830494599982 - ], - [ - 111.26579837300008, - -8.249281507999882 - ], - [ - 111.25700931100019, - -8.253024997999916 - ], - [ - 111.25318444100017, - -8.257989190999865 - ], - [ - 111.17123457100016, - -8.282647393999866 - ], - [ - 111.1619572270001, - -8.28191497199984 - ], - [ - 111.15821373800006, - -8.272067966999899 - ], - [ - 111.15544681100019, - -8.261000257999868 - ], - [ - 111.14828535200016, - -8.253513278999904 - ], - [ - 111.13843834700006, - -8.249200127999899 - ], - [ - 111.12720787900005, - -8.247735283999845 - ], - [ - 111.11475670700011, - -8.241957289999874 - ], - [ - 111.11117597700016, - -8.22918059699984 - ], - [ - 111.1097111340001, - -8.215427341999913 - ], - [ - 111.10303795700011, - -8.206801039999903 - ], - [ - 111.09555097700016, - -8.208184502999885 - ], - [ - 111.09083092500006, - -8.215508721999896 - ], - [ - 111.08716881600012, - -8.22527434699984 - ], - [ - 111.0823673840001, - -8.233493747999844 - ], - [ - 111.07276451900012, - -8.247002862999821 - ], - [ - 111.06666100400005, - -8.252536716999927 - ], - [ - 111.05827884200019, - -8.254652601999837 - ], - [ - 111.01734459700006, - -8.254652601999837 - ], - [ - 110.99822024800008, - -8.25017669099988 - ], - [ - 110.93100019600016, - -8.220472914999945 - ], - [ - 110.84791100400017, - -8.20110442499984 - ], - [ - 110.71534264400006, - -8.193129164999874 - ], - [ - 110.70557701900012, - -8.190036716999884 - ], - [ - 110.6912541020001, - -8.175876559999864 - ], - [ - 110.6814884770001, - -8.172621351999823 - ], - [ - 110.66065514400012, - -8.169854424999869 - ], - [ - 110.63941491, - -8.162774346999896 - ], - [ - 110.60271243600019, - -8.144789320999863 - ], - [ - 110.60271243600019, - -8.151543877999899 - ], - [ - 110.54908287900005, - -8.12761809699984 - ], - [ - 110.52116946700019, - -8.120212497999859 - ], - [ - 110.49626712300002, - -8.117445570999806 - ], - [ - 110.47673587300008, - -8.11191171699987 - ], - [ - 110.410899285, - -8.075860283999916 - ], - [ - 110.4005639980002, - -8.0746395809999 - ], - [ - 110.38941491000017, - -8.07488372199984 - ], - [ - 110.38038170700005, - -8.073174737999835 - ], - [ - 110.376719597, - -8.06617603999986 - ], - [ - 110.35230553500017, - -8.041680596999825 - ], - [ - 110.34742272200018, - -8.038832289999888 - ], - [ - 110.328379754, - -8.021172783999873 - ], - [ - 110.31910241000006, - -8.018731377999842 - ], - [ - 110.28736412900011, - -8.01506926899988 - ], - [ - 110.03419030000006, - -7.884698174999855 - ], - [ - 109.93189537900017, - -7.854913018999852 - ], - [ - 109.90601647200006, - -7.837660414999931 - ], - [ - 109.88306725400017, - -7.844821872999887 - ], - [ - 109.84742272200012, - -7.836683851999865 - ], - [ - 109.81177819100006, - -7.823418877999842 - ], - [ - 109.75245201900006, - -7.811944268999895 - ], - [ - 109.65674889400012, - -7.7816708309999 - ], - [ - 109.486094597, - -7.761814059999892 - ], - [ - 109.44678795700011, - -7.772067966999913 - ], - [ - 109.42628014400006, - -7.774183851999837 - ], - [ - 109.41724694100006, - -7.764906507999882 - ], - [ - 109.41472415500007, - -7.757907809999892 - ], - [ - 109.4085392590001, - -7.754978122999873 - ], - [ - 109.40170332100016, - -7.752618096999825 - ], - [ - 109.39665774800014, - -7.747491143999909 - ], - [ - 109.39722741000017, - -7.741875908999901 - ], - [ - 109.40455162900011, - -7.731052341999913 - ], - [ - 109.40349368600002, - -7.726332289999903 - ], - [ - 109.39763431100019, - -7.722832940999822 - ], - [ - 109.36882571700008, - -7.713474216999884 - ], - [ - 109.19723358700017, - -7.696216842999917 - ], - [ - 109.09814586600012, - -7.686861173999873 - ], - [ - 109.0465552430002, - -7.701853287999896 - ], - [ - 109.03296959700018, - -7.720147393999838 - ], - [ - 109.02125084700012, - -7.73202890399989 - ], - [ - 109.01441491000017, - -7.732598565999851 - ], - [ - 108.98389733200005, - -7.707207940999837 - ], - [ - 108.97364342500012, - -7.702243747999873 - ], - [ - 108.96159915500019, - -7.700372002999913 - ], - [ - 108.93897545700005, - -7.69947682099982 - ], - [ - 108.9183048840001, - -7.696384372999844 - ], - [ - 108.90154056100019, - -7.689629815999893 - ], - [ - 108.88965905000006, - -7.67864348799985 - ], - [ - 108.88160241, - -7.63250090899983 - ], - [ - 108.87322024800008, - -7.610609632999882 - ], - [ - 108.85865319100006, - -7.614027601999808 - ], - [ - 108.85206139400006, - -7.618829033999887 - ], - [ - 108.82748457100016, - -7.630791924999826 - ], - [ - 108.82048587300008, - -7.63787200299987 - ], - [ - 108.8069767590001, - -7.658135674999883 - ], - [ - 108.79900149800002, - -7.664727471999868 - ], - [ - 108.78825931100013, - -7.67351653399983 - ], - [ - 108.76105384500013, - -7.692764579999917 - ], - [ - 108.73536217500006, - -7.67864348799985 - ], - [ - 108.72901451900012, - -7.675957940999865 - ], - [ - 108.72193444100017, - -7.670342705999857 - ], - [ - 108.71387780000012, - -7.665704033999845 - ], - [ - 108.70394941500015, - -7.665622653999861 - ], - [ - 108.69174238400015, - -7.6722958309999 - ], - [ - 108.68171394000015, - -7.682244261999884 - ], - [ - 108.67314890500015, - -7.69075251999989 - ], - [ - 108.6795353520001, - -7.710219007999839 - ], - [ - 108.67774498800011, - -7.718926690999822 - ], - [ - 108.67261803500017, - -7.720635674999826 - ], - [ - 108.65174052100011, - -7.716271036999913 - ], - [ - 108.64649498800011, - -7.692966403999918 - ], - [ - 108.63892662900017, - -7.687920830999886 - ], - [ - 108.62549889400006, - -7.686130466999899 - ], - [ - 108.5594181650001, - -7.687432549999897 - ], - [ - 108.53956139400006, - -7.692315362999878 - ], - [ - 108.50782311300011, - -7.719496351999879 - ], - [ - 108.50383388100008, - -7.764224063999905 - ], - [ - 108.49526643100009, - -7.792922989999823 - ], - [ - 108.45371146800014, - -7.818501408999836 - ], - [ - 108.32682945600001, - -7.817471294999876 - ], - [ - 108.13791037300021, - -7.786661276999894 - ], - [ - 107.9535305520001, - -7.739873403999866 - ], - [ - 107.90528615500014, - -7.738783636999841 - ], - [ - 107.86453418900012, - -7.745130128999861 - ], - [ - 107.8302284260001, - -7.729167343999904 - ], - [ - 107.82814549600002, - -7.700493919999872 - ], - [ - 107.80673901800017, - -7.686675730999895 - ], - [ - 107.7787964840002, - -7.680248537999859 - ], - [ - 107.71439665500012, - -7.671659197999901 - ], - [ - 107.68654876600007, - -7.66207504199987 - ], - [ - 107.678013241, - -7.639753394999929 - ], - [ - 107.66083976400009, - -7.614208032999898 - ], - [ - 107.62546860400019, - -7.598219571999863 - ], - [ - 107.59096020900009, - -7.570433912999832 - ], - [ - 107.55544769800022, - -7.561823282999882 - ], - [ - 107.5285142760001, - -7.548963287999868 - ], - [ - 107.48115147000007, - -7.53819352299989 - ], - [ - 107.47050903500005, - -7.516909873999865 - ], - [ - 107.45207948700013, - -7.512536997999888 - ], - [ - 107.431895379, - -7.506524346999868 - ], - [ - 107.42603600400017, - -7.50790780999985 - ], - [ - 107.42017662900005, - -7.505629164999874 - ], - [ - 107.41138756600017, - -7.495863539999931 - ], - [ - 107.3615306190002, - -7.503713305999895 - ], - [ - 107.29778959400008, - -7.496136852999896 - ], - [ - 107.24632553600011, - -7.489654141999893 - ], - [ - 107.21200781200017, - -7.485328705999848 - ], - [ - 107.17985941700013, - -7.475696022999884 - ], - [ - 107.14558584200009, - -7.467119921999867 - ], - [ - 107.10704903400008, - -7.456406114999893 - ], - [ - 106.87141725100005, - -7.437711292999921 - ], - [ - 106.79102156000008, - -7.435331375999823 - ], - [ - 106.60792076900012, - -7.417901299999883 - ], - [ - 106.52266213700014, - -7.410957330999807 - ], - [ - 106.48082591500005, - -7.375669131999842 - ], - [ - 106.45933116000018, - -7.365995098999846 - ], - [ - 106.43392988400015, - -7.361993096999825 - ], - [ - 106.40747974700011, - -7.375316991999838 - ], - [ - 106.397760497, - -7.378465401999932 - ], - [ - 106.39889456100016, - -7.360363496999824 - ], - [ - 106.39905776800018, - -7.334824459999865 - ], - [ - 106.37536532100015, - -7.310194341999889 - ], - [ - 106.3831486340001, - -7.26767343499985 - ], - [ - 106.3807072270001, - -7.24724700299987 - ], - [ - 106.38607832100016, - -7.230645440999822 - ], - [ - 106.39844811300006, - -7.207777601999823 - ], - [ - 106.4148869150001, - -7.187676690999865 - ], - [ - 106.43262780000006, - -7.178887627999899 - ], - [ - 106.45004316500015, - -7.179131768999838 - ], - [ - 106.46729576900006, - -7.176446221999868 - ], - [ - 106.47299238400015, - -7.166599216999842 - ], - [ - 106.45655358200005, - -7.144789320999891 - ], - [ - 106.474375847, - -7.128106377999856 - ], - [ - 106.51396716500003, - -7.079596706999908 - ], - [ - 106.54050382500012, - -7.054612118999913 - ], - [ - 106.54200280000006, - -7.016778252999913 - ], - [ - 106.5371492570001, - -6.982961612999844 - ], - [ - 106.51080421300017, - -6.963798794999889 - ], - [ - 106.48145592500006, - -6.96705494599982 - ], - [ - 106.45170181000006, - -6.955059068999915 - ], - [ - 106.42386967900009, - -6.963220839999849 - ], - [ - 106.40463300900015, - -6.991306247999901 - ], - [ - 106.40162194100006, - -6.993096612999892 - ], - [ - 106.37891686300011, - -6.999769789999945 - ], - [ - 106.35450280000006, - -7.002699476999865 - ], - [ - 106.33301842500012, - -7.000746351999823 - ], - [ - 106.3196720710001, - -6.996189059999878 - ], - [ - 106.31104576900012, - -6.991469007999868 - ], - [ - 106.30241946700019, - -6.987969658999873 - ], - [ - 106.28858483200011, - -6.986504815999822 - ], - [ - 106.2833764980002, - -6.98333098799985 - ], - [ - 106.27320397200018, - -6.969333591999884 - ], - [ - 106.267832879, - -6.966078382999854 - ], - [ - 106.25424238400015, - -6.964288018999866 - ], - [ - 106.25033613400015, - -6.959567966999856 - ], - [ - 106.2493595710001, - -6.952813408999916 - ], - [ - 106.24415123800011, - -6.945570570999806 - ], - [ - 106.237559441, - -6.940606377999842 - ], - [ - 106.20116190500019, - -6.913679238999876 - ], - [ - 106.16837141600016, - -6.915809251999818 - ], - [ - 106.12470716300018, - -6.896279079999914 - ], - [ - 106.05298499400013, - -6.836805569999839 - ], - [ - 106.00831139400006, - -6.821954033999901 - ], - [ - 105.97870617700013, - -6.817711560999882 - ], - [ - 105.95957332400005, - -6.817628373999838 - ], - [ - 105.93962649800008, - -6.820977471999825 - ], - [ - 105.91895592500006, - -6.823988539999917 - ], - [ - 105.90162194100006, - -6.829522393999852 - ], - [ - 105.89819202700002, - -6.843176040999879 - ], - [ - 105.88437996900015, - -6.847672883999806 - ], - [ - 105.87373494300019, - -6.834708033999917 - ], - [ - 105.85450280000006, - -6.838148695999848 - ], - [ - 105.8231327010001, - -6.839039911999876 - ], - [ - 105.79241752600015, - -6.845743527999872 - ], - [ - 105.77474377900009, - -6.850226666999902 - ], - [ - 105.7556036610001, - -6.844816069999865 - ], - [ - 105.72331790500002, - -6.838555596999853 - ], - [ - 105.70289147200006, - -6.835707289999917 - ], - [ - 105.59653182000008, - -6.84907327299986 - ], - [ - 105.55518770700004, - -6.85568044699987 - ], - [ - 105.53512074200009, - -6.872326969999904 - ], - [ - 105.4984603020001, - -6.860727447999835 - ], - [ - 105.48613478600006, - -6.867515500999886 - ], - [ - 105.47095787900005, - -6.853448174999912 - ], - [ - 105.46045983200005, - -6.84531015399989 - ], - [ - 105.44223066500015, - -6.842543226999837 - ], - [ - 105.43881269600016, - -6.845961195999848 - ], - [ - 105.42969811300006, - -6.852715752999885 - ], - [ - 105.4200952480002, - -6.856866143999824 - ], - [ - 105.41553795700005, - -6.852797132999868 - ], - [ - 105.41358483200011, - -6.845798434999878 - ], - [ - 105.40894616000017, - -6.838148695999848 - ], - [ - 105.40308678500006, - -6.83212655999985 - ], - [ - 105.39795983200011, - -6.829522393999852 - ], - [ - 105.35612567800015, - -6.812872490999879 - ], - [ - 105.31078445900019, - -6.810354247999896 - ], - [ - 105.30111738400015, - -6.814141533999901 - ], - [ - 105.29639733200011, - -6.833265882999882 - ], - [ - 105.29118899800014, - -6.840997002999885 - ], - [ - 105.28370201900006, - -6.846937757999825 - ], - [ - 105.27466881600006, - -6.84937916499986 - ], - [ - 105.25611412900005, - -6.84238046699987 - ], - [ - 105.24708092500012, - -6.825453382999882 - ], - [ - 105.23617597700016, - -6.787855726999894 - ], - [ - 105.22217858200011, - -6.778497002999856 - ], - [ - 105.21680748800006, - -6.772067966999842 - ], - [ - 105.21973717500006, - -6.764336846999839 - ], - [ - 105.22706139400006, - -6.762627862999835 - ], - [ - 105.26075280000006, - -6.767347914999931 - ], - [ - 105.27466881600006, - -6.761651299999855 - ], - [ - 105.2918400400001, - -6.748223565999865 - ], - [ - 105.31934655000012, - -6.719659112999878 - ], - [ - 105.328868035, - -6.70273202899989 - ], - [ - 105.3362736340001, - -6.684828382999839 - ], - [ - 105.34636478000007, - -6.670668226999823 - ], - [ - 105.36378014400012, - -6.664971612999835 - ], - [ - 105.37623131600006, - -6.670017184999864 - ], - [ - 105.38982181100019, - -6.681410414999917 - ], - [ - 105.40137780000012, - -6.695000908999873 - ], - [ - 105.40821373800006, - -6.705987237999835 - ], - [ - 105.41081790500007, - -6.718438408999859 - ], - [ - 105.41041100400005, - -6.728773695999863 - ], - [ - 105.41163170700005, - -6.73894622199991 - ], - [ - 105.43539472700016, - -6.778252862999821 - ], - [ - 105.44068444100006, - -6.794122002999842 - ], - [ - 105.45362389400006, - -6.808770440999851 - ], - [ - 105.47120201900006, - -6.815850518999824 - ], - [ - 105.4900822270001, - -6.809014580999886 - ], - [ - 105.50261478000019, - -6.791110934999935 - ], - [ - 105.51726321700019, - -6.744235934999878 - ], - [ - 105.52857506600017, - -6.723321221999825 - ], - [ - 105.60743248800006, - -6.651462497999859 - ], - [ - 105.62224368600019, - -6.631605726999851 - ], - [ - 105.62794030000012, - -6.615980726999865 - ], - [ - 105.61897438500014, - -6.532504875999877 - ], - [ - 105.6438585000001, - -6.482333287999921 - ], - [ - 105.65624206700014, - -6.473264317999877 - ], - [ - 105.67778979500022, - -6.474924131999899 - ], - [ - 105.68223819200014, - -6.511534528999931 - ], - [ - 105.69911100100009, - -6.520773518999903 - ], - [ - 105.71136412400003, - -6.534563343999835 - ], - [ - 105.73908515500014, - -6.530148685999876 - ], - [ - 105.7822342800001, - -6.512107304999887 - ], - [ - 105.80853431500006, - -6.477215533999868 - ], - [ - 105.82409120800011, - -6.434645719999878 - ], - [ - 105.82129967500006, - -6.401136976999879 - ], - [ - 105.8323673840001, - -6.228692315999893 - ], - [ - 105.839610222, - -6.192071221999868 - ], - [ - 105.86719811300011, - -6.110121351999837 - ], - [ - 105.88786868600002, - -6.070570570999891 - ], - [ - 105.95704186300006, - -5.998711846999825 - ], - [ - 105.96680748800006, - -5.992852471999868 - ], - [ - 105.97730553500006, - -5.983493747999844 - ], - [ - 105.99724368600002, - -5.91773853999986 - ], - [ - 106.02003014400006, - -5.893243096999825 - ], - [ - 106.05274498800006, - -5.881036065999851 - ], - [ - 106.08521569100017, - -5.885511976999823 - ], - [ - 106.10710696700019, - -5.910902601999837 - ], - [ - 106.11158287900017, - -5.975192966999856 - ], - [ - 106.11793053500011, - -5.986016533999859 - ], - [ - 106.128672722, - -5.990329684999864 - ], - [ - 106.15919030000006, - -6.009535414999903 - ] - ] - ], - [ - [ - [ - 124.07113691499998, - -6.01132577899989 - ], - [ - 124.05933678500006, - -6.027439059999864 - ], - [ - 124.041270379, - -6.020765882999825 - ], - [ - 124.03744550899998, - -6.011651299999826 - ], - [ - 124.03589928500006, - -5.987399997999844 - ], - [ - 124.03044681100013, - -5.976006768999866 - ], - [ - 124.01856530000018, - -5.967950127999842 - ], - [ - 123.99293053500011, - -5.961195570999806 - ], - [ - 123.9825952480002, - -5.955254815999879 - ], - [ - 123.96892337300008, - -5.935316664999888 - ], - [ - 123.966075066, - -5.915459893999881 - ], - [ - 123.97071373800023, - -5.893975518999852 - ], - [ - 123.97917728000019, - -5.869886976999837 - ], - [ - 123.98609459700018, - -5.879815362999835 - ], - [ - 124.03744550899998, - -5.914320570999848 - ], - [ - 124.04639733200023, - -5.925713799999912 - ], - [ - 124.05762780000012, - -5.951104424999841 - ], - [ - 124.06519616000017, - -5.96249765399989 - ], - [ - 124.07398522200006, - -5.985284112999835 - ], - [ - 124.07113691499998, - -6.01132577899989 - ] - ] - ], - [ - [ - [ - 110.44988040500019, - -5.874444268999881 - ], - [ - 110.43799889400012, - -5.881036065999851 - ], - [ - 110.43034915500019, - -5.873711846999853 - ], - [ - 110.42660566500015, - -5.861504815999865 - ], - [ - 110.421641472, - -5.851332289999917 - ], - [ - 110.42066491000006, - -5.843682549999897 - ], - [ - 110.43132571700008, - -5.837334893999866 - ], - [ - 110.459239129, - -5.831638278999876 - ], - [ - 110.46558678500006, - -5.839532158999859 - ], - [ - 110.46363366000011, - -5.857110283999887 - ], - [ - 110.44988040500019, - -5.874444268999881 - ] - ] - ], - [ - [ - [ - 120.49048912900005, - -6.471449476999823 - ], - [ - 120.4812931650001, - -6.477308851999865 - ], - [ - 120.47510826900012, - -6.434502862999864 - ], - [ - 120.46566816499998, - -6.4027645809999 - ], - [ - 120.46363366000017, - -6.383884372999873 - ], - [ - 120.47087649800008, - -6.275160414999931 - ], - [ - 120.46810957100004, - -6.264336846999853 - ], - [ - 120.46045983200011, - -6.259698174999826 - ], - [ - 120.44825280000012, - -6.256524346999853 - ], - [ - 120.44483483200011, - -6.248467705999829 - ], - [ - 120.44507897200006, - -6.237725518999895 - ], - [ - 120.4436955090001, - -6.226169528999876 - ], - [ - 120.43083743600008, - -6.194512627999899 - ], - [ - 120.42945397200018, - -6.18580494599982 - ], - [ - 120.43336022200018, - -6.174004815999851 - ], - [ - 120.44695071700014, - -6.154473565999865 - ], - [ - 120.44996178500006, - -6.140801690999837 - ], - [ - 120.45215905000012, - -6.080824476999823 - ], - [ - 120.44141686300011, - -5.977634372999887 - ], - [ - 120.44825280000012, - -5.843926690999837 - ], - [ - 120.45736738400004, - -5.801039320999863 - ], - [ - 120.47046959700018, - -5.766859632999868 - ], - [ - 120.48047936300017, - -5.764092705999914 - ], - [ - 120.48861738399998, - -5.767266533999873 - ], - [ - 120.49439537900005, - -5.774509372999901 - ], - [ - 120.49708092500012, - -5.783298434999864 - ], - [ - 120.49561608200017, - -5.806410414999917 - ], - [ - 120.50342858200023, - -5.822686455999857 - ], - [ - 120.51335696700008, - -5.836602471999839 - ], - [ - 120.51807701900017, - -5.852634372999916 - ], - [ - 120.52149498800006, - -5.87468840899983 - ], - [ - 120.54615319100017, - -5.938164971999839 - ], - [ - 120.55518639400006, - -5.979424737999878 - ], - [ - 120.559336785, - -6.022556247999901 - ], - [ - 120.55860436300006, - -6.066338799999869 - ], - [ - 120.55298912900017, - -6.110121351999837 - ], - [ - 120.52979576900023, - -6.173109632999854 - ], - [ - 120.5262150400001, - -6.195489190999879 - ], - [ - 120.53207441500004, - -6.248304945999863 - ], - [ - 120.5301212900001, - -6.287286065999837 - ], - [ - 120.52247155000023, - -6.336521091999842 - ], - [ - 120.5149845710001, - -6.35247161299985 - ], - [ - 120.50261478000002, - -6.373467705999886 - ], - [ - 120.50098717500012, - -6.392510674999883 - ], - [ - 120.50513756600006, - -6.431735934999907 - ], - [ - 120.50001061300023, - -6.4515927059999 - ], - [ - 120.49048912900005, - -6.471449476999823 - ] - ] - ], - [ - [ - [ - 134.20687910200016, - -5.827325127999885 - ], - [ - 134.19459069100017, - -5.830173434999921 - ], - [ - 134.18051191500015, - -5.827325127999885 - ], - [ - 134.16968834700006, - -5.811130466999927 - ], - [ - 134.16749108200017, - -5.788995049999855 - ], - [ - 134.16968834700006, - -5.768324476999837 - ], - [ - 134.17774498800011, - -5.754489841999842 - ], - [ - 134.19206790500007, - -5.753024997999873 - ], - [ - 134.20020592500006, - -5.755303643999852 - ], - [ - 134.204844597, - -5.756117445999863 - ], - [ - 134.212738477, - -5.758721612999864 - ], - [ - 134.22559655000012, - -5.771172783999873 - ], - [ - 134.22828209700018, - -5.773370049999869 - ], - [ - 134.227793816, - -5.789320570999877 - ], - [ - 134.22038821700014, - -5.815606377999885 - ], - [ - 134.20687910200016, - -5.827325127999885 - ] - ] - ], - [ - [ - [ - 104.84644616000006, - -5.81121184699991 - ], - [ - 104.83838951900012, - -5.820407809999878 - ], - [ - 104.8201603520001, - -5.81226978999986 - ], - [ - 104.79004967500012, - -5.787692966999856 - ], - [ - 104.7767033210001, - -5.771579684999878 - ], - [ - 104.77165774800008, - -5.761651299999883 - ], - [ - 104.77035566500015, - -5.752048434999892 - ], - [ - 104.77654056100002, - -5.741143487999835 - ], - [ - 104.78679446700008, - -5.742120049999897 - ], - [ - 104.80787194100017, - -5.754327080999872 - ], - [ - 104.82699629000015, - -5.75790780999985 - ], - [ - 104.832774285, - -5.760023695999863 - ], - [ - 104.84636478000007, - -5.772556247999859 - ], - [ - 104.84978274800008, - -5.783298434999864 - ], - [ - 104.84644616000006, - -5.81121184699991 - ] - ] - ], - [ - [ - [ - 112.71469160200016, - -5.736097914999888 - ], - [ - 112.72706139400006, - -5.747328382999896 - ], - [ - 112.73617597700016, - -5.763116143999838 - ], - [ - 112.7404077480002, - -5.787367445999834 - ], - [ - 112.73853600400005, - -5.809991143999895 - ], - [ - 112.73145592500018, - -5.828383070999834 - ], - [ - 112.71876061300011, - -5.841566664999888 - ], - [ - 112.70069420700011, - -5.848809502999899 - ], - [ - 112.69109134200019, - -5.849541924999841 - ], - [ - 112.66391035199999, - -5.848321221999825 - ], - [ - 112.65837649800008, - -5.845391533999901 - ], - [ - 112.65479576900012, - -5.837172132999811 - ], - [ - 112.64625084700018, - -5.839288018999824 - ], - [ - 112.63054446700014, - -5.848809502999899 - ], - [ - 112.60425866, - -5.847426039999917 - ], - [ - 112.59620201900006, - -5.836032809999864 - ], - [ - 112.59343509200019, - -5.817315362999892 - ], - [ - 112.58277428500017, - -5.794203382999854 - ], - [ - 112.59009850400017, - -5.785577080999843 - ], - [ - 112.61801191500004, - -5.76344166499986 - ], - [ - 112.62110436300011, - -5.75790780999985 - ], - [ - 112.64535566499998, - -5.732110283999916 - ], - [ - 112.65707441499998, - -5.736748955999843 - ], - [ - 112.67017662900005, - -5.733493747999887 - ], - [ - 112.68458092500012, - -5.727959893999881 - ], - [ - 112.70069420700011, - -5.726006768999838 - ], - [ - 112.71469160200016, - -5.736097914999888 - ] - ] - ], - [ - [ - [ - 132.70289147200012, - -5.616794528999904 - ], - [ - 132.6994735040001, - -5.631524346999896 - ], - [ - 132.69239342500023, - -5.642022393999866 - ], - [ - 132.69060306100008, - -5.650079033999901 - ], - [ - 132.70289147200012, - -5.657647393999852 - ], - [ - 132.7111108730002, - -5.658623955999829 - ], - [ - 132.72632897200018, - -5.654961846999868 - ], - [ - 132.7335718110002, - -5.655043226999851 - ], - [ - 132.740489129, - -5.660088799999883 - ], - [ - 132.74366295700005, - -5.668389580999857 - ], - [ - 132.74537194100017, - -5.686455987999878 - ], - [ - 132.75717207100016, - -5.722914320999848 - ], - [ - 132.75757897200006, - -5.732110283999916 - ], - [ - 132.76238040500002, - -5.72242603999986 - ], - [ - 132.76368248800023, - -5.718438408999873 - ], - [ - 132.77125084700018, - -5.718438408999873 - ], - [ - 132.77637780000012, - -5.738457940999851 - ], - [ - 132.77930748800011, - -5.761000257999839 - ], - [ - 132.7858992850001, - -5.7797177059999 - ], - [ - 132.80201256600017, - -5.787367445999834 - ], - [ - 132.81104576900006, - -5.797051690999879 - ], - [ - 132.81226647200018, - -5.819594007999868 - ], - [ - 132.80543053500017, - -5.862481377999842 - ], - [ - 132.7971297540001, - -5.885837497999844 - ], - [ - 132.78736412900017, - -5.905857028999904 - ], - [ - 132.7755639980002, - -5.923923434999921 - ], - [ - 132.76059004000015, - -5.941582940999837 - ], - [ - 132.74154707100016, - -5.950372002999899 - ], - [ - 132.73072350400017, - -5.934177341999856 - ], - [ - 132.72364342500012, - -5.910332940999865 - ], - [ - 132.71599368600008, - -5.896661065999837 - ], - [ - 132.71648196700008, - -5.906996351999851 - ], - [ - 132.71420332099999, - -5.9183895809999 - ], - [ - 132.70866946700008, - -5.927504164999888 - ], - [ - 132.69922936300023, - -5.931329033999901 - ], - [ - 132.69190514400023, - -5.928806247999887 - ], - [ - 132.68604576900012, - -5.922051690999865 - ], - [ - 132.67505944100006, - -5.904066664999917 - ], - [ - 132.67505944100006, - -5.910902601999837 - ], - [ - 132.66968834700018, - -5.899997653999861 - ], - [ - 132.66781660200004, - -5.888116143999824 - ], - [ - 132.66822350400005, - -5.862481377999842 - ], - [ - 132.66700280000012, - -5.857517184999892 - ], - [ - 132.664805535, - -5.855157158999845 - ], - [ - 132.66236412900017, - -5.852146091999842 - ], - [ - 132.661387566, - -5.845391533999901 - ], - [ - 132.66342207100004, - -5.838555596999882 - ], - [ - 132.66797936300006, - -5.836521091999856 - ], - [ - 132.67269941499998, - -5.836358330999886 - ], - [ - 132.67505944100006, - -5.835707289999931 - ], - [ - 132.67164147200006, - -5.783379815999851 - ], - [ - 132.6744897800002, - -5.760023695999863 - ], - [ - 132.68873131600017, - -5.760023695999863 - ], - [ - 132.683360222, - -5.749118747999873 - ], - [ - 132.67505944100006, - -5.712172132999839 - ], - [ - 132.67017662900017, - -5.711521091999884 - ], - [ - 132.661387566, - -5.711114190999879 - ], - [ - 132.65503991000017, - -5.708754164999917 - ], - [ - 132.65796959700012, - -5.701755466999842 - ], - [ - 132.66041100400005, - -5.697198174999897 - ], - [ - 132.66195722700016, - -5.691013278999918 - ], - [ - 132.66236412900017, - -5.684340101999865 - ], - [ - 132.661387566, - -5.678806247999859 - ], - [ - 132.657481316, - -5.677422783999873 - ], - [ - 132.65040123800023, - -5.67750416499986 - ], - [ - 132.64380944100017, - -5.67546965899983 - ], - [ - 132.64087975400017, - -5.667901299999869 - ], - [ - 132.64193769600004, - -5.648532809999864 - ], - [ - 132.64087975400017, - -5.643324476999865 - ], - [ - 132.63412519600004, - -5.633396091999856 - ], - [ - 132.62761478000002, - -5.62558359199987 - ], - [ - 132.62232506600006, - -5.616631768999838 - ], - [ - 132.61980228000002, - -5.602959893999895 - ], - [ - 132.65691165500007, - -5.620375257999868 - ], - [ - 132.661387566, - -5.623467705999857 - ], - [ - 132.6753035820001, - -5.612888278999904 - ], - [ - 132.68783613399998, - -5.600030205999886 - ], - [ - 132.69752037900005, - -5.597426039999888 - ], - [ - 132.70289147200012, - -5.616794528999904 - ] - ] - ], - [ - [ - [ - 132.78939863399998, - -5.552911065999879 - ], - [ - 132.784922722, - -5.561455987999821 - ], - [ - 132.78980553500017, - -5.557305596999868 - ], - [ - 132.79737389400023, - -5.553969007999839 - ], - [ - 132.80518639400023, - -5.552992445999863 - ], - [ - 132.81104576900006, - -5.555596612999864 - ], - [ - 132.81185957099999, - -5.565524997999873 - ], - [ - 132.79737389400023, - -5.609063408999887 - ], - [ - 132.796722852, - -5.625664971999853 - ], - [ - 132.79932701900006, - -5.641534112999878 - ], - [ - 132.8045353520001, - -5.656670830999872 - ], - [ - 132.81275475400017, - -5.671319268999881 - ], - [ - 132.80746504000004, - -5.679864190999908 - ], - [ - 132.80543053500017, - -5.684991143999824 - ], - [ - 132.79786217500012, - -5.680433851999879 - ], - [ - 132.79200280000006, - -5.674493096999853 - ], - [ - 132.78785241000006, - -5.666680596999853 - ], - [ - 132.784922722, - -5.657647393999852 - ], - [ - 132.784922722, - -5.672539971999896 - ], - [ - 132.78052819100006, - -5.680352471999896 - ], - [ - 132.77279707100004, - -5.682224216999856 - ], - [ - 132.76368248800023, - -5.678806247999859 - ], - [ - 132.75847415500007, - -5.670668226999837 - ], - [ - 132.74317467500006, - -5.630303643999881 - ], - [ - 132.74317467500006, - -5.604424737999864 - ], - [ - 132.75082441500004, - -5.573500257999825 - ], - [ - 132.76531009200008, - -5.545342705999843 - ], - [ - 132.784922722, - -5.527276299999826 - ], - [ - 132.78980553500017, - -5.535821221999839 - ], - [ - 132.79127037900005, - -5.544366143999866 - ], - [ - 132.78939863399998, - -5.552911065999879 - ] - ] - ], - [ - [ - [ - 132.34620201900023, - -5.535902601999823 - ], - [ - 132.3611759770001, - -5.540297132999811 - ], - [ - 132.38070722700016, - -5.534112237999835 - ], - [ - 132.3776147800002, - -5.544203382999811 - ], - [ - 132.37142988400004, - -5.554131768999895 - ], - [ - 132.36329186300011, - -5.562920830999872 - ], - [ - 132.35352623800023, - -5.56894296699987 - ], - [ - 132.34001712300008, - -5.573663018999881 - ], - [ - 132.33432050900004, - -5.572930596999853 - ], - [ - 132.33155358200023, - -5.568291924999826 - ], - [ - 132.31739342500012, - -5.55103932099982 - ], - [ - 132.3088485040001, - -5.535739841999856 - ], - [ - 132.30713951900012, - -5.52117278399983 - ], - [ - 132.31861412900005, - -5.513604424999883 - ], - [ - 132.34620201900023, - -5.535902601999823 - ] - ] - ], - [ - [ - [ - 127.55518639400012, - -5.506605726999808 - ], - [ - 127.5613712900001, - -5.517266533999845 - ], - [ - 127.55128014400012, - -5.512383721999868 - ], - [ - 127.55518639400012, - -5.506605726999808 - ] - ] - ], - [ - [ - [ - 127.55486087300008, - -5.490492445999834 - ], - [ - 127.55697675899998, - -5.499769789999888 - ], - [ - 127.54590905000023, - -5.495293877999828 - ], - [ - 127.55486087300008, - -5.490492445999834 - ] - ] - ], - [ - [ - [ - 123.80925540500019, - -5.571954033999873 - ], - [ - 123.81470787900005, - -5.595635674999897 - ], - [ - 123.79330488399998, - -5.589125257999811 - ], - [ - 123.77816816499998, - -5.5726864559999 - ], - [ - 123.75318444100017, - -5.534112237999835 - ], - [ - 123.73462975400017, - -5.518324476999894 - ], - [ - 123.71664472700004, - -5.506524346999825 - ], - [ - 123.70167076900012, - -5.493096612999835 - ], - [ - 123.69117272200006, - -5.472751559999935 - ], - [ - 123.70484459700018, - -5.472751559999935 - ], - [ - 123.73324628999998, - -5.475274346999853 - ], - [ - 123.74976647200018, - -5.489841403999876 - ], - [ - 123.76197350400005, - -5.50595468499985 - ], - [ - 123.77711022200006, - -5.513604424999883 - ], - [ - 123.80144290500013, - -5.522719007999868 - ], - [ - 123.808360222, - -5.545017184999907 - ], - [ - 123.80925540500019, - -5.571954033999873 - ] - ] - ], - [ - [ - [ - 134.5812280610002, - -5.424248955999857 - ], - [ - 134.62826582100004, - -5.444756768999824 - ], - [ - 134.63591556100008, - -5.455254815999879 - ], - [ - 134.648203972, - -5.493096612999835 - ], - [ - 134.65894616000006, - -5.504652601999851 - ], - [ - 134.68848717500006, - -5.5238583309999 - ], - [ - 134.69654381600006, - -5.534112237999835 - ], - [ - 134.68897545700005, - -5.536879164999888 - ], - [ - 134.6686304050002, - -5.547784112999878 - ], - [ - 134.67530358200023, - -5.552178643999852 - ], - [ - 134.67896569100017, - -5.557875257999839 - ], - [ - 134.68238366, - -5.57512786299985 - ], - [ - 134.67603600400017, - -5.57512786299985 - ], - [ - 134.67603600400017, - -5.56894296699987 - ], - [ - 134.65170332099999, - -5.574639580999857 - ], - [ - 134.6414494150001, - -5.579196872999901 - ], - [ - 134.63510175900015, - -5.588799737999878 - ], - [ - 134.644297722, - -5.586195570999877 - ], - [ - 134.67237389400012, - -5.588799737999878 - ], - [ - 134.68034915500007, - -5.590915622999887 - ], - [ - 134.69117272200018, - -5.596368096999839 - ], - [ - 134.71021569100017, - -5.609144789999874 - ], - [ - 134.73682701900012, - -5.637953382999811 - ], - [ - 134.75806725400017, - -5.671319268999881 - ], - [ - 134.73975670700023, - -5.685153903999876 - ], - [ - 134.72641035200004, - -5.711195570999863 - ], - [ - 134.71876061300006, - -5.737562757999854 - ], - [ - 134.71705162900017, - -5.752618096999868 - ], - [ - 134.72624759200008, - -5.754327080999872 - ], - [ - 134.73316491000006, - -5.756605726999851 - ], - [ - 134.73755944100006, - -5.760023695999863 - ], - [ - 134.73861738399998, - -5.765557549999869 - ], - [ - 134.73878014400023, - -5.773532809999921 - ], - [ - 134.73755944100006, - -5.787367445999834 - ], - [ - 134.731211785, - -5.802911065999837 - ], - [ - 134.71111087300008, - -5.823663018999838 - ], - [ - 134.70289147200006, - -5.835707289999931 - ], - [ - 134.7239689460001, - -5.837823174999855 - ], - [ - 134.7433374360002, - -5.846937757999839 - ], - [ - 134.75440514400023, - -5.860772393999838 - ], - [ - 134.75123131600017, - -5.876722914999945 - ], - [ - 134.75586998800011, - -5.879327080999843 - ], - [ - 134.76002037900005, - -5.885674737999878 - ], - [ - 134.764903191, - -5.890394789999888 - ], - [ - 134.7542423840001, - -5.898370049999841 - ], - [ - 134.73438561300006, - -5.909844658999887 - ], - [ - 134.72388756600012, - -5.91773853999986 - ], - [ - 134.72022545700023, - -5.900567315999837 - ], - [ - 134.7096460300002, - -5.896172783999845 - ], - [ - 134.69947350400005, - -5.902601820999863 - ], - [ - 134.69654381600006, - -5.91773853999986 - ], - [ - 134.70289147200006, - -5.925957940999851 - ], - [ - 134.72779381600017, - -5.936944268999824 - ], - [ - 134.73755944100006, - -5.945000908999845 - ], - [ - 134.72706139400017, - -5.944756768999895 - ], - [ - 134.72388756600012, - -5.945000908999845 - ], - [ - 134.73609459700018, - -5.969496351999879 - ], - [ - 134.72095787900017, - -5.971612237999892 - ], - [ - 134.69532311300011, - -5.962172132999868 - ], - [ - 134.67603600400017, - -5.951836846999868 - ], - [ - 134.66846764400012, - -5.944756768999895 - ], - [ - 134.66277103000007, - -5.938164971999839 - ], - [ - 134.65430748800011, - -5.933282158999859 - ], - [ - 134.63884524800008, - -5.931329033999901 - ], - [ - 134.62598717500023, - -5.933038018999824 - ], - [ - 134.614512566, - -5.937432549999897 - ], - [ - 134.60572350400005, - -5.943942966999884 - ], - [ - 134.6010848320001, - -5.951836846999868 - ], - [ - 134.64258873800011, - -5.947523695999863 - ], - [ - 134.65699303500017, - -5.953871351999808 - ], - [ - 134.66236412900005, - -5.976006768999866 - ], - [ - 134.67066491, - -5.986748955999886 - ], - [ - 134.71143639400006, - -6.020277601999837 - ], - [ - 134.727305535, - -6.027601820999834 - ], - [ - 134.76514733200023, - -6.076836846999839 - ], - [ - 134.77222741, - -6.089613539999874 - ], - [ - 134.76823978000002, - -6.112969658999873 - ], - [ - 134.75464928500017, - -6.135511976999865 - ], - [ - 134.7360132170002, - -6.153985283999887 - ], - [ - 134.71705162900017, - -6.164727471999896 - ], - [ - 134.71314537900017, - -6.16171640399989 - ], - [ - 134.71021569100017, - -6.160088799999869 - ], - [ - 134.70289147200006, - -6.157891533999873 - ], - [ - 134.7014266290001, - -6.170586846999839 - ], - [ - 134.69727623800023, - -6.18084075299987 - ], - [ - 134.6910913420002, - -6.188083591999884 - ], - [ - 134.74073326900012, - -6.171156507999811 - ], - [ - 134.75806725400017, - -6.157891533999873 - ], - [ - 134.75814863400015, - -6.167901299999869 - ], - [ - 134.75660241000006, - -6.175957940999893 - ], - [ - 134.753184441, - -6.182793877999828 - ], - [ - 134.74781334700006, - -6.189060153999861 - ], - [ - 134.74366295700023, - -6.198825778999904 - ], - [ - 134.75131269600016, - -6.2191708309999 - ], - [ - 134.74781334700006, - -6.229913018999824 - ], - [ - 134.73959394600016, - -6.241957289999917 - ], - [ - 134.7208764980002, - -6.281833591999899 - ], - [ - 134.71705162900017, - -6.297946872999873 - ], - [ - 134.7018335300002, - -6.321872653999918 - ], - [ - 134.63021894600016, - -6.35125090899983 - ], - [ - 134.6077580090001, - -6.369561455999886 - ], - [ - 134.58366946700008, - -6.352308851999879 - ], - [ - 134.57056725400017, - -6.348809502999899 - ], - [ - 134.55933678500017, - -6.355889580999857 - ], - [ - 134.55372155000006, - -6.355889580999857 - ], - [ - 134.54037519600016, - -6.338067315999879 - ], - [ - 134.53581790500002, - -6.335381768999895 - ], - [ - 134.53484134200008, - -6.33123137799987 - ], - [ - 134.51628665500007, - -6.313897393999881 - ], - [ - 134.51156660200004, - -6.311618747999901 - ], - [ - 134.50196373800023, - -6.299248955999872 - ], - [ - 134.45923912900005, - -6.278415622999887 - ], - [ - 134.449473504, - -6.263767184999878 - ], - [ - 134.437754754, - -6.2640927059999 - ], - [ - 134.37794030000023, - -6.239353122999916 - ], - [ - 134.37159264400023, - -6.237562757999839 - ], - [ - 134.36890709700006, - -6.233168226999865 - ], - [ - 134.3673608730002, - -6.227959893999866 - ], - [ - 134.36451256600017, - -6.223077080999886 - ], - [ - 134.358653191, - -6.219821872999844 - ], - [ - 134.35401451900012, - -6.221368096999882 - ], - [ - 134.34937584700018, - -6.224541924999855 - ], - [ - 134.34376061300006, - -6.226169528999876 - ], - [ - 134.33350670700023, - -6.221449476999865 - ], - [ - 134.32667076900012, - -6.210625908999873 - ], - [ - 134.32146243600002, - -6.198174737999864 - ], - [ - 134.31609134200008, - -6.189060153999861 - ], - [ - 134.29135175899998, - -6.156345309999935 - ], - [ - 134.276621941, - -6.119317315999908 - ], - [ - 134.27588951900006, - -6.083591403999876 - ], - [ - 134.29249108200023, - -6.054864190999822 - ], - [ - 134.3120223320001, - -6.04713307099982 - ], - [ - 134.33057701900012, - -6.050388278999861 - ], - [ - 134.34888756600017, - -6.05087655999985 - ], - [ - 134.36768639400023, - -6.03435637799987 - ], - [ - 134.36931399800008, - -6.0238583309999 - ], - [ - 134.33326256600012, - -6.026055596999882 - ], - [ - 134.31299889400006, - -6.027601820999834 - ], - [ - 134.30176842500006, - -6.016289971999853 - ], - [ - 134.30567467500006, - -6.001234632999839 - ], - [ - 134.3151147800002, - -5.983982028999918 - ], - [ - 134.31910241000017, - -5.966078382999868 - ], - [ - 134.31226647200006, - -5.954359632999882 - ], - [ - 134.28809655000023, - -5.923923434999921 - ], - [ - 134.28882897200018, - -5.91773853999986 - ], - [ - 134.29916425899998, - -5.91301848799985 - ], - [ - 134.31251061300011, - -5.901950778999904 - ], - [ - 134.32252037900017, - -5.889418226999823 - ], - [ - 134.32349694100006, - -5.868259372999901 - ], - [ - 134.36036217500012, - -5.849541924999841 - ], - [ - 134.35401451900012, - -5.835707289999931 - ], - [ - 134.35401451900012, - -5.828301690999851 - ], - [ - 134.3764754570001, - -5.805596612999821 - ], - [ - 134.3782658210001, - -5.793715101999865 - ], - [ - 134.36150149800008, - -5.780531507999811 - ], - [ - 134.35238691500015, - -5.793389580999843 - ], - [ - 134.3409936860002, - -5.804294528999904 - ], - [ - 134.33090254000015, - -5.803969007999882 - ], - [ - 134.32667076900012, - -5.783949476999823 - ], - [ - 134.3182072270001, - -5.772556247999859 - ], - [ - 134.29916425899998, - -5.768243096999853 - ], - [ - 134.26514733200017, - -5.766859632999868 - ], - [ - 134.24789472700016, - -5.760430596999868 - ], - [ - 134.23267662900017, - -5.750909112999864 - ], - [ - 134.20655358200023, - -5.729099216999913 - ], - [ - 134.2019962900001, - -5.712497653999861 - ], - [ - 134.21550540500007, - -5.695896091999899 - ], - [ - 134.23731530000012, - -5.683282158999916 - ], - [ - 134.25782311300023, - -5.678806247999859 - ], - [ - 134.27719160200016, - -5.685723565999851 - ], - [ - 134.30974368600002, - -5.712579033999845 - ], - [ - 134.33008873800023, - -5.718438408999873 - ], - [ - 134.351817254, - -5.714450778999904 - ], - [ - 134.35873457099999, - -5.703545830999829 - ], - [ - 134.36068769600016, - -5.688409112999835 - ], - [ - 134.36768639400023, - -5.671319268999881 - ], - [ - 134.37818444100012, - -5.661797783999887 - ], - [ - 134.39185631600006, - -5.652113539999917 - ], - [ - 134.404063347, - -5.640883070999834 - ], - [ - 134.40919030000012, - -5.626885674999869 - ], - [ - 134.4124455090001, - -5.613946221999868 - ], - [ - 134.45704186300023, - -5.534112237999835 - ], - [ - 134.46265709700006, - -5.552829684999907 - ], - [ - 134.47250410200016, - -5.557875257999839 - ], - [ - 134.48316491, - -5.552829684999907 - ], - [ - 134.49122155000023, - -5.540948174999855 - ], - [ - 134.49480228000013, - -5.543226820999834 - ], - [ - 134.50473066500004, - -5.547784112999878 - ], - [ - 134.50586998800023, - -5.528252862999892 - ], - [ - 134.50505618600002, - -5.517754815999822 - ], - [ - 134.50196373800023, - -5.510349216999842 - ], - [ - 134.49463951900023, - -5.500746351999865 - ], - [ - 134.49203535200016, - -5.495782158999901 - ], - [ - 134.49122155000023, - -5.448174737999835 - ], - [ - 134.49252363400015, - -5.441827080999886 - ], - [ - 134.49659264400012, - -5.436130466999913 - ], - [ - 134.5021264980002, - -5.431735934999921 - ], - [ - 134.50831139400006, - -5.429375908999873 - ], - [ - 134.51547285200004, - -5.42945728999986 - ], - [ - 134.51929772200006, - -5.432305596999896 - ], - [ - 134.52247155000012, - -5.436293226999879 - ], - [ - 134.52711022200006, - -5.440036716999899 - ], - [ - 134.53972415500013, - -5.44060637799987 - ], - [ - 134.5678817070001, - -5.427829684999921 - ], - [ - 134.5812280610002, - -5.424248955999857 - ] - ] - ], - [ - [ - [ - 127.80339603000007, - -5.407647393999895 - ], - [ - 127.79004967500023, - -5.409600518999852 - ], - [ - 127.79851321700019, - -5.400160414999931 - ], - [ - 127.80339603000007, - -5.407647393999895 - ] - ] - ], - [ - [ - [ - 127.77906334700018, - -5.342868747999887 - ], - [ - 127.78516686300006, - -5.352959893999866 - ], - [ - 127.77686608200011, - -5.348809502999828 - ], - [ - 127.77906334700018, - -5.342868747999887 - ] - ] - ], - [ - [ - [ - 131.97510826900023, - -5.387465101999879 - ], - [ - 131.96558678500006, - -5.388767184999878 - ], - [ - 131.95948326900023, - -5.372979424999826 - ], - [ - 131.96241295700005, - -5.343519789999931 - ], - [ - 131.97738691500004, - -5.323337497999916 - ], - [ - 131.9865014980002, - -5.317640882999839 - ], - [ - 131.9972436860002, - -5.312432549999841 - ], - [ - 132.00863691500015, - -5.312758070999863 - ], - [ - 132.0162866550002, - -5.330824476999879 - ], - [ - 132.00033613399998, - -5.373223565999865 - ], - [ - 131.99203535200004, - -5.3773739559999 - ], - [ - 131.98519941499998, - -5.377862237999892 - ], - [ - 131.98072350400005, - -5.379652601999879 - ], - [ - 131.97510826900023, - -5.387465101999879 - ] - ] - ], - [ - [ - [ - 133.04704837300008, - -5.648614190999837 - ], - [ - 133.03353925899998, - -5.654392184999892 - ], - [ - 133.02711022200018, - -5.662692966999884 - ], - [ - 133.0171004570001, - -5.678806247999859 - ], - [ - 132.9972436860002, - -5.699965101999851 - ], - [ - 132.97543379000004, - -5.728692315999908 - ], - [ - 132.95753014400006, - -5.761407158999845 - ], - [ - 132.94939212300008, - -5.794203382999854 - ], - [ - 132.95093834700012, - -5.81308359199987 - ], - [ - 132.95850670700023, - -5.844333591999842 - ], - [ - 132.95679772200006, - -5.862481377999842 - ], - [ - 132.94947350400005, - -5.874281507999825 - ], - [ - 132.85678144599999, - -5.98943450299987 - ], - [ - 132.84229576900023, - -5.996840101999851 - ], - [ - 132.84050540500007, - -5.984958591999899 - ], - [ - 132.90007571700008, - -5.813897393999881 - ], - [ - 132.92351321700008, - -5.786716403999876 - ], - [ - 132.9288843110002, - -5.777113539999903 - ], - [ - 132.93116295700005, - -5.714939059999892 - ], - [ - 132.9288843110002, - -5.698011976999808 - ], - [ - 132.96412194100006, - -5.640720309999864 - ], - [ - 132.980316602, - -5.644626559999864 - ], - [ - 132.99659264400023, - -5.651543877999856 - ], - [ - 133.0040796230002, - -5.647149346999882 - ], - [ - 133.01490319100012, - -5.607110283999845 - ], - [ - 133.01856530000023, - -5.566176039999917 - ], - [ - 133.02295983200023, - -5.548516533999901 - ], - [ - 133.03874759200008, - -5.513604424999883 - ], - [ - 133.0758569670002, - -5.398044528999918 - ], - [ - 133.09669030000018, - -5.366306247999873 - ], - [ - 133.10434003999998, - -5.350681247999887 - ], - [ - 133.11011803500017, - -5.310967705999872 - ], - [ - 133.12134850400017, - -5.294610283999859 - ], - [ - 133.13786868600002, - -5.287286065999865 - ], - [ - 133.15609785200004, - -5.288344007999825 - ], - [ - 133.1726180350001, - -5.296482028999918 - ], - [ - 133.18433678500017, - -5.310316664999917 - ], - [ - 133.1881616550002, - -5.32480234199987 - ], - [ - 133.18873131600017, - -5.344496351999823 - ], - [ - 133.18433678500017, - -5.361993096999868 - ], - [ - 133.172129754, - -5.369724216999884 - ], - [ - 133.16537519600016, - -5.380140882999868 - ], - [ - 133.1389266290001, - -5.52117278399983 - ], - [ - 133.11329186300023, - -5.595635674999897 - ], - [ - 133.10596764400012, - -5.605645440999879 - ], - [ - 133.07960045700023, - -5.631768487999835 - ], - [ - 133.06910241000006, - -5.637139580999886 - ], - [ - 133.06080162900017, - -5.639336846999882 - ], - [ - 133.04704837300008, - -5.648614190999837 - ] - ] - ], - [ - [ - [ - 102.38249759200008, - -5.466241143999852 - ], - [ - 102.39014733200011, - -5.476983330999857 - ], - [ - 102.3787541020001, - -5.48219166499986 - ], - [ - 102.33236738400015, - -5.472263278999847 - ], - [ - 102.32447350400011, - -5.468926690999822 - ], - [ - 102.32129967500012, - -5.472914320999806 - ], - [ - 102.31364993600019, - -5.472914320999806 - ], - [ - 102.30469811300006, - -5.471856377999842 - ], - [ - 102.29786217500006, - -5.472751559999935 - ], - [ - 102.29420006600012, - -5.47747161299985 - ], - [ - 102.28353925900015, - -5.499281507999811 - ], - [ - 102.2703556650001, - -5.488702080999843 - ], - [ - 102.25733483200005, - -5.457207940999837 - ], - [ - 102.24610436300006, - -5.441582940999851 - ], - [ - 102.12769616000006, - -5.349541924999855 - ], - [ - 102.09864342500006, - -5.33489348799985 - ], - [ - 102.14722741, - -5.289646091999913 - ], - [ - 102.17204837300008, - -5.280368747999859 - ], - [ - 102.20101972700016, - -5.287204684999878 - ], - [ - 102.22828209700006, - -5.301853122999887 - ], - [ - 102.24170983200005, - -5.306084893999909 - ], - [ - 102.25977623800006, - -5.307549737999864 - ], - [ - 102.27393639400012, - -5.312269789999874 - ], - [ - 102.286387566, - -5.323011976999894 - ], - [ - 102.3040470710001, - -5.342380466999899 - ], - [ - 102.36589603000019, - -5.361260674999841 - ], - [ - 102.3943791020001, - -5.37590911299985 - ], - [ - 102.40650475400011, - -5.403741143999909 - ], - [ - 102.40023847700016, - -5.418389580999829 - ], - [ - 102.38648522200006, - -5.43027109199987 - ], - [ - 102.36622155000012, - -5.441582940999851 - ], - [ - 102.36963951900006, - -5.453301690999837 - ], - [ - 102.38249759200008, - -5.466241143999852 - ] - ] - ], - [ - [ - [ - 123.63379967500012, - -5.366875908999845 - ], - [ - 123.61915123800011, - -5.37656015399989 - ], - [ - 123.590586785, - -5.374118747999859 - ], - [ - 123.5721134770001, - -5.366143487999821 - ], - [ - 123.55925540500007, - -5.351332289999931 - ], - [ - 123.52295983200017, - -5.277439059999935 - ], - [ - 123.5198673840001, - -5.251722914999888 - ], - [ - 123.53972415500019, - -5.245538018999824 - ], - [ - 123.56348717500006, - -5.252618096999882 - ], - [ - 123.59555097700016, - -5.256768487999821 - ], - [ - 123.62378991000006, - -5.266534112999864 - ], - [ - 123.63591556100013, - -5.290785414999945 - ], - [ - 123.63835696700008, - -5.343519789999931 - ], - [ - 123.63379967500012, - -5.366875908999845 - ] - ] - ], - [ - [ - [ - 121.91944420700023, - -5.095472914999945 - ], - [ - 121.93702233200005, - -5.095879815999851 - ], - [ - 121.94418379000004, - -5.091892184999878 - ], - [ - 121.95948326900006, - -5.071221612999864 - ], - [ - 121.96957441500015, - -5.066989841999842 - ], - [ - 121.97730553500017, - -5.070489190999837 - ], - [ - 121.982676629, - -5.07903411299985 - ], - [ - 121.99659264400012, - -5.137872002999842 - ], - [ - 122.00977623800023, - -5.153741143999866 - ], - [ - 122.03337649800008, - -5.149997653999918 - ], - [ - 122.04509524800008, - -5.165134372999916 - ], - [ - 122.05616295700011, - -5.175713799999883 - ], - [ - 122.06421959700006, - -5.1898739559999 - ], - [ - 122.06739342500012, - -5.215020440999879 - ], - [ - 122.06421959700006, - -5.223565362999906 - ], - [ - 122.05713951900006, - -5.226657809999892 - ], - [ - 122.05014082099999, - -5.2308895809999 - ], - [ - 122.04688561300017, - -5.242364190999851 - ], - [ - 122.05176842500012, - -5.26978932099982 - ], - [ - 122.05298912900005, - -5.432305596999896 - ], - [ - 122.04688561300017, - -5.451592705999843 - ], - [ - 122.031993035, - -5.465264580999872 - ], - [ - 122.01441491000017, - -5.465264580999872 - ], - [ - 121.99675540500007, - -5.462823174999841 - ], - [ - 121.98145592500012, - -5.468926690999822 - ], - [ - 121.96827233200023, - -5.467950127999856 - ], - [ - 121.93921959700018, - -5.420993747999916 - ], - [ - 121.92351321700019, - -5.403741143999909 - ], - [ - 121.90992272200006, - -5.399509372999887 - ], - [ - 121.90056399800014, - -5.399102471999882 - ], - [ - 121.89210045700005, - -5.397719007999811 - ], - [ - 121.88184655000023, - -5.390232028999932 - ], - [ - 121.87696373800006, - -5.381931247999859 - ], - [ - 121.86841881600006, - -5.359958591999842 - ], - [ - 121.82715905000012, - -5.300713799999855 - ], - [ - 121.8068139980002, - -5.259860934999907 - ], - [ - 121.813731316, - -5.249688408999859 - ], - [ - 121.81218509200008, - -5.22096119599982 - ], - [ - 121.81723066500004, - -5.208265882999854 - ], - [ - 121.82618248800023, - -5.197686455999886 - ], - [ - 121.83375084700018, - -5.18531666499986 - ], - [ - 121.83887780000012, - -5.172539971999825 - ], - [ - 121.84083092500023, - -5.160088799999897 - ], - [ - 121.84636478000007, - -5.152764580999886 - ], - [ - 121.87256920700011, - -5.148532809999864 - ], - [ - 121.88184655000023, - -5.143731377999885 - ], - [ - 121.88152103000002, - -5.133884372999859 - ], - [ - 121.87305748800006, - -5.122247002999856 - ], - [ - 121.85385175900004, - -5.102146091999899 - ], - [ - 121.86491946700008, - -5.086521091999913 - ], - [ - 121.88038170700011, - -5.072198174999841 - ], - [ - 121.89795983200023, - -5.060967705999843 - ], - [ - 121.91602623800023, - -5.054375908999859 - ], - [ - 121.91016686300011, - -5.07057057099982 - ], - [ - 121.91089928500006, - -5.085707289999903 - ], - [ - 121.91944420700023, - -5.095472914999945 - ] - ] - ], - [ - [ - [ - 115.80681399800008, - -4.821872653999861 - ], - [ - 115.78638756600017, - -4.827813408999972 - ], - [ - 115.77344811300006, - -4.815118096999839 - ], - [ - 115.79525800900004, - -4.786309502999899 - ], - [ - 115.85181725400005, - -4.739027601999837 - ], - [ - 115.85181725400005, - -4.745538018999838 - ], - [ - 115.84701582100016, - -4.757745049999897 - ], - [ - 115.8458764980002, - -4.764092705999843 - ], - [ - 115.84669030000023, - -4.768649997999887 - ], - [ - 115.84913170700005, - -4.774672132999882 - ], - [ - 115.85303795700017, - -4.779473565999879 - ], - [ - 115.85808353000019, - -4.779961846999868 - ], - [ - 115.80681399800008, - -4.821872653999861 - ] - ] - ], - [ - [ - [ - 131.74870853000002, - -4.759047132999896 - ], - [ - 131.73650149800008, - -4.766289971999839 - ], - [ - 131.72901451900006, - -4.754652601999823 - ], - [ - 131.72510826900006, - -4.731703382999839 - ], - [ - 131.72608483200017, - -4.707777601999865 - ], - [ - 131.73308353000007, - -4.693047783999873 - ], - [ - 131.7501733730002, - -4.710544528999918 - ], - [ - 131.75440514400012, - -4.736504815999822 - ], - [ - 131.74870853000002, - -4.759047132999896 - ] - ] - ], - [ - [ - [ - 122.77857506600006, - -4.949476820999834 - ], - [ - 122.77312259200019, - -4.958184502999828 - ], - [ - 122.76539147200018, - -4.957940362999878 - ], - [ - 122.75391686300023, - -4.953871351999823 - ], - [ - 122.74350019600016, - -4.952813408999859 - ], - [ - 122.73902428500017, - -4.961846612999878 - ], - [ - 122.73487389400023, - -4.974704684999892 - ], - [ - 122.72494550900015, - -4.989678643999838 - ], - [ - 122.66138756600006, - -5.055352471999839 - ], - [ - 122.64340254000004, - -5.07878997199991 - ], - [ - 122.60425866000017, - -5.159926039999931 - ], - [ - 122.60124759200008, - -5.180922132999868 - ], - [ - 122.60661868600002, - -5.190524997999859 - ], - [ - 122.61866295700023, - -5.191176039999903 - ], - [ - 122.63062584700018, - -5.190199476999837 - ], - [ - 122.63599694100006, - -5.194268487999878 - ], - [ - 122.63453209700018, - -5.206963799999855 - ], - [ - 122.62989342500023, - -5.216729424999883 - ], - [ - 122.62240644600016, - -5.222832940999879 - ], - [ - 122.59815514400006, - -5.228448174999869 - ], - [ - 122.60645592500023, - -5.235772393999881 - ], - [ - 122.629161004, - -5.245538018999824 - ], - [ - 122.647715691, - -5.256117445999877 - ], - [ - 122.65235436300023, - -5.26181405999985 - ], - [ - 122.6564233730002, - -5.273370049999883 - ], - [ - 122.65853925900004, - -5.296482028999918 - ], - [ - 122.65544681100002, - -5.322523695999806 - ], - [ - 122.64747155000018, - -5.344903252999828 - ], - [ - 122.63599694100006, - -5.355401299999897 - ], - [ - 122.62452233200005, - -5.342461846999882 - ], - [ - 122.61597741000017, - -5.356052341999842 - ], - [ - 122.61060631600012, - -5.38046640399989 - ], - [ - 122.60865319100006, - -5.400485934999864 - ], - [ - 122.60547936300011, - -5.413018487999864 - ], - [ - 122.59839928500006, - -5.420098565999822 - ], - [ - 122.59148196700002, - -5.420668226999894 - ], - [ - 122.588145379, - -5.413995049999841 - ], - [ - 122.58448326900023, - -5.409112237999864 - ], - [ - 122.57618248800006, - -5.414320570999863 - ], - [ - 122.56373131600006, - -5.427666924999869 - ], - [ - 122.54346764400023, - -5.428806247999901 - ], - [ - 122.54086347700004, - -5.387953382999868 - ], - [ - 122.54281660199999, - -5.338799737999835 - ], - [ - 122.53663170700023, - -5.315036716999842 - ], - [ - 122.52881920700023, - -5.306410414999931 - ], - [ - 122.52084394600016, - -5.291680596999839 - ], - [ - 122.51148522200006, - -5.28671640399989 - ], - [ - 122.49878991000017, - -5.307549737999864 - ], - [ - 122.49691816500004, - -5.318291924999883 - ], - [ - 122.49919681100019, - -5.339288018999824 - ], - [ - 122.49878991000017, - -5.349216403999918 - ], - [ - 122.48511803500006, - -5.383233330999857 - ], - [ - 122.46859785200016, - -5.396416924999897 - ], - [ - 122.45020592500012, - -5.399346612999835 - ], - [ - 122.43197675900015, - -5.392673434999864 - ], - [ - 122.41627037900017, - -5.37656015399989 - ], - [ - 122.40723717500018, - -5.353204033999901 - ], - [ - 122.41488691499998, - -5.339288018999824 - ], - [ - 122.45101972700004, - -5.321221612999906 - ], - [ - 122.45101972700004, - -5.315036716999842 - ], - [ - 122.43360436300017, - -5.315036716999842 - ], - [ - 122.42156009200008, - -5.311944268999852 - ], - [ - 122.41016686300011, - -5.311944268999852 - ], - [ - 122.39519290500007, - -5.321221612999906 - ], - [ - 122.38721764400012, - -5.330661716999913 - ], - [ - 122.38363691500004, - -5.341566664999888 - ], - [ - 122.38266035200016, - -5.373142184999892 - ], - [ - 122.377207879, - -5.384942315999865 - ], - [ - 122.36394290500019, - -5.389825127999828 - ], - [ - 122.31332441499998, - -5.389580987999878 - ], - [ - 122.30054772200006, - -5.386976820999891 - ], - [ - 122.29021243600008, - -5.380791924999826 - ], - [ - 122.27963300899998, - -5.369724216999884 - ], - [ - 122.28711998800017, - -5.362888278999861 - ], - [ - 122.27621503999998, - -5.345961195999877 - ], - [ - 122.27515709700006, - -5.327569268999838 - ], - [ - 122.28150475400017, - -5.307793877999913 - ], - [ - 122.30713951900023, - -5.263929945999863 - ], - [ - 122.31568444100006, - -5.2426083309999 - ], - [ - 122.32007897200006, - -5.219496351999851 - ], - [ - 122.32601972700016, - -5.144707940999851 - ], - [ - 122.33253014400023, - -5.123793226999808 - ], - [ - 122.34180748800011, - -5.108982028999918 - ], - [ - 122.350840691, - -5.105075778999918 - ], - [ - 122.377207879, - -5.098239841999899 - ], - [ - 122.38266035200016, - -5.092461846999853 - ], - [ - 122.38510175899998, - -5.087172132999868 - ], - [ - 122.40259850400005, - -5.061781507999854 - ], - [ - 122.39600670700005, - -5.048435153999932 - ], - [ - 122.39177493600008, - -5.030450127999899 - ], - [ - 122.38591556100019, - -4.978773695999863 - ], - [ - 122.37224368600008, - -4.955010674999855 - ], - [ - 122.36524498800006, - -4.915459893999909 - ], - [ - 122.35499108200017, - -4.884860934999892 - ], - [ - 122.34156334700018, - -4.857679945999962 - ], - [ - 122.32748457100004, - -4.842054945999806 - ], - [ - 122.32748457100004, - -4.835219007999882 - ], - [ - 122.34498131600017, - -4.814629815999851 - ], - [ - 122.36670983200023, - -4.765801690999851 - ], - [ - 122.38266035200016, - -4.74586353999986 - ], - [ - 122.40495853000019, - -4.737888278999904 - ], - [ - 122.47095787900005, - -4.731377862999906 - ], - [ - 122.49878991000017, - -4.725355726999894 - ], - [ - 122.52947024800008, - -4.71005624799993 - ], - [ - 122.60124759200008, - -4.656426690999851 - ], - [ - 122.65699303500017, - -4.624281507999896 - ], - [ - 122.69068444100017, - -4.611748955999886 - ], - [ - 122.71111087300002, - -4.615492445999834 - ], - [ - 122.72722415500013, - -4.628106377999899 - ], - [ - 122.73552493600019, - -4.643731377999885 - ], - [ - 122.75269616, - -4.773207289999917 - ], - [ - 122.75277753999998, - -4.84433359199987 - ], - [ - 122.75570722700004, - -4.855726820999919 - ], - [ - 122.77027428500006, - -4.874281507999925 - ], - [ - 122.77312259200019, - -4.87957122199991 - ], - [ - 122.77409915500007, - -4.887790622999901 - ], - [ - 122.77857506600006, - -4.905043226999908 - ], - [ - 122.78003991000017, - -4.916599216999842 - ], - [ - 122.78060957100016, - -4.939060153999847 - ], - [ - 122.77857506600006, - -4.949476820999834 - ] - ] - ], - [ - [ - [ - 129.77833092500012, - -4.524509372999887 - ], - [ - 129.77027428500017, - -4.539320570999863 - ], - [ - 129.75782311300017, - -4.52255624799993 - ], - [ - 129.76270592500023, - -4.518812757999811 - ], - [ - 129.77833092500012, - -4.524509372999887 - ] - ] - ], - [ - [ - [ - 129.94849694100006, - -4.514336846999925 - ], - [ - 129.94564863399998, - -4.556084893999881 - ], - [ - 129.93336022200006, - -4.562920830999886 - ], - [ - 129.91602623800023, - -4.563897393999952 - ], - [ - 129.89926191500004, - -4.568291924999855 - ], - [ - 129.89332116, - -4.560235283999916 - ], - [ - 129.88379967500012, - -4.555596612999892 - ], - [ - 129.87183678500017, - -4.553887627999885 - ], - [ - 129.85906009200002, - -4.554782809999878 - ], - [ - 129.87403405000018, - -4.545830987999935 - ], - [ - 129.91814212300008, - -4.53720468499985 - ], - [ - 129.92725670700023, - -4.530450127999899 - ], - [ - 129.9318139980002, - -4.515069268999952 - ], - [ - 129.94109134200008, - -4.508884372999901 - ], - [ - 129.94849694100006, - -4.514336846999925 - ] - ] - ], - [ - [ - [ - 131.68043053500006, - -4.524021091999899 - ], - [ - 131.66089928500006, - -4.534274998 - ], - [ - 131.65503991, - -4.52564869599982 - ], - [ - 131.61646569100006, - -4.441582940999879 - ], - [ - 131.606211785, - -4.430433851999851 - ], - [ - 131.613536004, - -4.425225518999866 - ], - [ - 131.61980228000007, - -4.424493096999839 - ], - [ - 131.6261499360002, - -4.426853122999887 - ], - [ - 131.6334741550002, - -4.430433851999851 - ], - [ - 131.64942467500012, - -4.452406507999953 - ], - [ - 131.67074629000015, - -4.490166924999841 - ], - [ - 131.68043053500006, - -4.524021091999899 - ] - ] - ], - [ - [ - [ - 123.21127363399998, - -4.677504164999959 - ], - [ - 123.21705162900017, - -4.711195570999962 - ], - [ - 123.21973717500023, - -4.816664320999877 - ], - [ - 123.21127363399998, - -4.842054945999806 - ], - [ - 123.19703209700018, - -4.836846612999892 - ], - [ - 123.188731316, - -4.816582940999893 - ], - [ - 123.18409264400006, - -4.776543877999941 - ], - [ - 123.18189537900011, - -4.771905205999829 - ], - [ - 123.17115319100017, - -4.756036065999893 - ], - [ - 123.16700280000023, - -4.752618096999896 - ], - [ - 123.15772545700011, - -4.748467705999857 - ], - [ - 123.15463300900004, - -4.738539320999848 - ], - [ - 123.15349368600008, - -4.726983330999914 - ], - [ - 123.14991295700011, - -4.717950127999913 - ], - [ - 123.12387129000004, - -4.710219007999896 - ], - [ - 123.10531660200004, - -4.767266533999901 - ], - [ - 123.08155358200011, - -4.739027601999837 - ], - [ - 123.07797285200004, - -4.74342213299991 - ], - [ - 123.07105553500006, - -4.748304945999891 - ], - [ - 123.06739342500006, - -4.752618096999896 - ], - [ - 123.05209394600004, - -4.740329684999935 - ], - [ - 123.04639733200023, - -4.752862237999835 - ], - [ - 123.04688561300023, - -4.797051690999908 - ], - [ - 123.04265384200019, - -4.803317966999856 - ], - [ - 123.02377363399998, - -4.815118096999839 - ], - [ - 123.01954186300017, - -4.824639580999914 - ], - [ - 123.01295006600017, - -4.857110283999901 - ], - [ - 123.01221764400023, - -4.869317315999879 - ], - [ - 123.01742597700016, - -4.909844658999987 - ], - [ - 123.01514733200005, - -4.929375908999887 - ], - [ - 122.98991946700014, - -4.94508228999986 - ], - [ - 122.97738691500004, - -4.962172132999811 - ], - [ - 122.96794681100019, - -4.980889580999872 - ], - [ - 122.96436608200023, - -4.992852471999896 - ], - [ - 122.96607506600006, - -5.003838799999855 - ], - [ - 122.96989993600008, - -5.012139580999843 - ], - [ - 122.974375847, - -5.019219658999887 - ], - [ - 122.97787519600004, - -5.026462497999916 - ], - [ - 122.98462975400005, - -5.052504164999888 - ], - [ - 122.98536217500006, - -5.064873955999829 - ], - [ - 122.98357181100019, - -5.087823174999826 - ], - [ - 122.97852623800023, - -5.103285414999931 - ], - [ - 122.95525149800002, - -5.149997653999918 - ], - [ - 122.94792728000002, - -5.17213307099982 - ], - [ - 122.94988040500019, - -5.190199476999837 - ], - [ - 122.96802819100017, - -5.197686455999886 - ], - [ - 122.98845462300008, - -5.186700127999842 - ], - [ - 123.00342858200011, - -5.163262627999856 - ], - [ - 123.0203556650001, - -5.142185153999847 - ], - [ - 123.04688561300023, - -5.137465101999837 - ], - [ - 123.05933678500006, - -5.14413827899989 - ], - [ - 123.06267337300008, - -5.152764580999886 - ], - [ - 123.06299889400012, - -5.162041924999841 - ], - [ - 123.06739342500006, - -5.170505466999884 - ], - [ - 123.10206139400017, - -5.180922132999868 - ], - [ - 123.10670006600017, - -5.197686455999886 - ], - [ - 123.11793053500011, - -5.209161065999837 - ], - [ - 123.14991295700011, - -5.225030205999872 - ], - [ - 123.18881269599999, - -5.247816664999888 - ], - [ - 123.20932050900015, - -5.265394789999917 - ], - [ - 123.21810957100004, - -5.28378671699987 - ], - [ - 123.21314537900017, - -5.301690362999835 - ], - [ - 123.20142662900017, - -5.317071221999868 - ], - [ - 123.17725670700005, - -5.342380466999899 - ], - [ - 123.15805097700004, - -5.373793226999837 - ], - [ - 123.14503014400012, - -5.385430596999853 - ], - [ - 123.10303795700023, - -5.395277601999865 - ], - [ - 123.06560306100019, - -5.418389580999829 - ], - [ - 123.04688561300023, - -5.424248955999857 - ], - [ - 123.030528191, - -5.419528903999861 - ], - [ - 123.01026451900012, - -5.39568450299987 - ], - [ - 122.99537194100006, - -5.390232028999932 - ], - [ - 122.97754967500006, - -5.394219658999901 - ], - [ - 122.89291425900015, - -5.444268487999835 - ], - [ - 122.87623131600006, - -5.458428643999852 - ], - [ - 122.86280358200023, - -5.495863539999888 - ], - [ - 122.86101321700008, - -5.508070570999863 - ], - [ - 122.86597741, - -5.513604424999883 - ], - [ - 122.87631269600004, - -5.510918877999899 - ], - [ - 122.90170332100004, - -5.499932549999855 - ], - [ - 122.91041100400005, - -5.499281507999811 - ], - [ - 122.918223504, - -5.527439059999878 - ], - [ - 122.89682050900015, - -5.57122161299985 - ], - [ - 122.84888756600006, - -5.637139580999886 - ], - [ - 122.82764733200005, - -5.676202080999857 - ], - [ - 122.81348717500023, - -5.687920830999843 - ], - [ - 122.790293816, - -5.692478122999887 - ], - [ - 122.78793379000015, - -5.687269789999888 - ], - [ - 122.78630618600002, - -5.662692966999884 - ], - [ - 122.783457879, - -5.654229424999841 - ], - [ - 122.77100670700005, - -5.642022393999866 - ], - [ - 122.767832879, - -5.641371351999823 - ], - [ - 122.76628665500007, - -5.648125908999859 - ], - [ - 122.75359134200019, - -5.66578541499986 - ], - [ - 122.75049889400023, - -5.675388278999847 - ], - [ - 122.74659264400023, - -5.67937590899983 - ], - [ - 122.73902428500017, - -5.671319268999881 - ], - [ - 122.73682701900012, - -5.661065362999864 - ], - [ - 122.73959394600016, - -5.636895440999851 - ], - [ - 122.73560631600017, - -5.626885674999869 - ], - [ - 122.72234134200002, - -5.627699476999879 - ], - [ - 122.69092858200011, - -5.66578541499986 - ], - [ - 122.67701256600006, - -5.678806247999859 - ], - [ - 122.65430748800011, - -5.678480726999837 - ], - [ - 122.63835696700008, - -5.662204684999892 - ], - [ - 122.56714928500017, - -5.506931247999916 - ], - [ - 122.64429772200012, - -5.439385674999855 - ], - [ - 122.65455162900005, - -5.42473723799985 - ], - [ - 122.65211022200018, - -5.411390882999839 - ], - [ - 122.629161004, - -5.403741143999909 - ], - [ - 122.63559004000004, - -5.391045830999843 - ], - [ - 122.66325931100013, - -5.355401299999897 - ], - [ - 122.67261803500006, - -5.324151299999826 - ], - [ - 122.67839603000013, - -5.322442315999822 - ], - [ - 122.68506920700005, - -5.32293059699991 - ], - [ - 122.69068444100017, - -5.321221612999906 - ], - [ - 122.70411217500023, - -5.302911065999851 - ], - [ - 122.72103925900015, - -5.266208591999842 - ], - [ - 122.73218834700018, - -5.253024997999887 - ], - [ - 122.75269616, - -5.245863539999931 - ], - [ - 122.77947024800014, - -5.241143487999835 - ], - [ - 122.80323326900012, - -5.231866143999881 - ], - [ - 122.81470787900017, - -5.211358330999829 - ], - [ - 122.81413821700019, - -5.193129164999945 - ], - [ - 122.80860436300006, - -5.189385674999826 - ], - [ - 122.76343834700006, - -5.207940362999821 - ], - [ - 122.75757897200018, - -5.206719658999901 - ], - [ - 122.76628665500007, - -5.190850518999881 - ], - [ - 122.75456790500019, - -5.177666924999826 - ], - [ - 122.75660241, - -5.164727471999825 - ], - [ - 122.77312259200019, - -5.143731377999885 - ], - [ - 122.77849368600008, - -5.129571221999853 - ], - [ - 122.77808678500006, - -5.104587497999844 - ], - [ - 122.78003991000017, - -5.089043877999842 - ], - [ - 122.79761803500006, - -5.060642184999907 - ], - [ - 122.80445397200006, - -5.043633721999853 - ], - [ - 122.80054772200006, - -5.026462497999916 - ], - [ - 122.7911889980002, - -5.021254164999917 - ], - [ - 122.77979576900023, - -5.024997653999861 - ], - [ - 122.76661217500012, - -5.031182549999826 - ], - [ - 122.75269616, - -5.033868096999896 - ], - [ - 122.7618921230002, - -5.015394789999874 - ], - [ - 122.81788170700023, - -4.968682549999883 - ], - [ - 122.82740319100006, - -4.95232512799987 - ], - [ - 122.83350670700011, - -4.929131768999852 - ], - [ - 122.83594811300023, - -4.904392184999864 - ], - [ - 122.83464603000007, - -4.883070570999806 - ], - [ - 122.83073978000007, - -4.873223565999965 - ], - [ - 122.82496178500011, - -4.862888278999876 - ], - [ - 122.82048587300002, - -4.852227471999839 - ], - [ - 122.82097415500013, - -4.842054945999806 - ], - [ - 122.82886803500017, - -4.835870049999826 - ], - [ - 122.8401798840001, - -4.83464934699991 - ], - [ - 122.85059655000023, - -4.831149997999916 - ], - [ - 122.85499108200023, - -4.817803643999909 - ], - [ - 122.84799238400015, - -4.648858330999985 - ], - [ - 122.85499108200023, - -4.609551690999893 - ], - [ - 122.869395379, - -4.568291924999855 - ], - [ - 122.89942467500023, - -4.510023695999834 - ], - [ - 122.90357506600012, - -4.489190362999864 - ], - [ - 122.90894616000017, - -4.474541924999855 - ], - [ - 122.92261803500011, - -4.461602471999839 - ], - [ - 123.01954186300017, - -4.390232028999861 - ], - [ - 123.04135175900004, - -4.384372653999904 - ], - [ - 123.06910241000011, - -4.383233330999872 - ], - [ - 123.08570397200006, - -4.389092705999829 - ], - [ - 123.06153405000023, - -4.421319268999866 - ], - [ - 123.06853274800014, - -4.439629815999837 - ], - [ - 123.08423912900011, - -4.456149997999901 - ], - [ - 123.1477970710001, - -4.508477471999896 - ], - [ - 123.16358483200023, - -4.526788018999852 - ], - [ - 123.19044030000012, - -4.566827080999971 - ], - [ - 123.20045006600012, - -4.589043877999856 - ], - [ - 123.20443769600016, - -4.611748955999886 - ], - [ - 123.20240319100006, - -4.621514580999843 - ], - [ - 123.19304446700019, - -4.641371351999837 - ], - [ - 123.19092858200011, - -4.653008721999853 - ], - [ - 123.19336998800023, - -4.66285572699995 - ], - [ - 123.19922936300006, - -4.667413018999909 - ], - [ - 123.20606530000012, - -4.670830987999821 - ], - [ - 123.21127363399998, - -4.677504164999959 - ] - ] - ], - [ - [ - [ - 133.55836022200006, - -4.232028903999876 - ], - [ - 133.6085718110002, - -4.291761976999851 - ], - [ - 133.62769616000017, - -4.300225518999881 - ], - [ - 133.60417728000002, - -4.300713799999869 - ], - [ - 133.57911217500012, - -4.278497002999913 - ], - [ - 133.55518639400017, - -4.251722914999903 - ], - [ - 133.53516686300011, - -4.238702080999914 - ], - [ - 133.52271569100017, - -4.23992278399993 - ], - [ - 133.49952233200023, - -4.245049737999864 - ], - [ - 133.487559441, - -4.246189059999892 - ], - [ - 133.4703882170002, - -4.246026299999841 - ], - [ - 133.4604598320001, - -4.244073174999883 - ], - [ - 133.45118248800023, - -4.237888278999904 - ], - [ - 133.4358830090001, - -4.225192966999856 - ], - [ - 133.42335045700005, - -4.217380466999856 - ], - [ - 133.39942467500012, - -4.209893487999892 - ], - [ - 133.3881942070001, - -4.20468515399989 - ], - [ - 133.37671959700018, - -4.193536065999879 - ], - [ - 133.36939537900017, - -4.182386976999865 - ], - [ - 133.36019941499998, - -4.173923434999907 - ], - [ - 133.34376061300011, - -4.170505466999899 - ], - [ - 133.33139082100016, - -4.165215752999842 - ], - [ - 133.32374108200023, - -4.15292734199987 - ], - [ - 133.32007897200018, - -4.137627862999906 - ], - [ - 133.31934655000023, - -4.124200127999913 - ], - [ - 133.32422936300011, - -4.108330987999977 - ], - [ - 133.33448326900023, - -4.109063408999916 - ], - [ - 133.40756269600004, - -4.160332940999865 - ], - [ - 133.41260826900023, - -4.162286065999908 - ], - [ - 133.41863040500007, - -4.16301848799985 - ], - [ - 133.42139733200023, - -4.165948174999869 - ], - [ - 133.42676842500006, - -4.179864190999851 - ], - [ - 133.42904707100016, - -4.184177341999842 - ], - [ - 133.44597415500002, - -4.196954033999887 - ], - [ - 133.45606530000012, - -4.202406507999825 - ], - [ - 133.46664472700016, - -4.20468515399989 - ], - [ - 133.49431399800008, - -4.206638278999932 - ], - [ - 133.51970462300008, - -4.212172132999868 - ], - [ - 133.54127037900017, - -4.220879815999936 - ], - [ - 133.55836022200006, - -4.232028903999876 - ] - ] - ], - [ - [ - [ - 131.391856316, - -4.153497002999842 - ], - [ - 131.3854272800002, - -4.156182549999912 - ], - [ - 131.35271243600008, - -4.133396091999899 - ], - [ - 131.30502363400004, - -4.115329684999878 - ], - [ - 131.29656009200008, - -4.109063408999916 - ], - [ - 131.28923587300008, - -4.100030205999914 - ], - [ - 131.28370201900023, - -4.089776299999883 - ], - [ - 131.28052819100017, - -4.079522393999866 - ], - [ - 131.2804468110002, - -4.074802341999941 - ], - [ - 131.28150475400005, - -4.070000908999873 - ], - [ - 131.28419030000012, - -4.066094658999873 - ], - [ - 131.28834069100017, - -4.063409112999892 - ], - [ - 131.2946069670002, - -4.063164971999853 - ], - [ - 131.2985132170002, - -4.065850518999838 - ], - [ - 131.30437259200008, - -4.074883721999925 - ], - [ - 131.31763756600017, - -4.088067315999879 - ], - [ - 131.3659774100001, - -4.122165622999887 - ], - [ - 131.38550866000017, - -4.140232028999904 - ], - [ - 131.391856316, - -4.153497002999842 - ] - ] - ], - [ - [ - [ - 131.2475692070001, - -4.042657158999887 - ], - [ - 131.23959394600016, - -4.047051690999879 - ], - [ - 131.22608483200005, - -4.038344007999896 - ], - [ - 131.2164819670002, - -4.018649997999859 - ], - [ - 131.21078535200004, - -3.99578215899993 - ], - [ - 131.2091577480002, - -3.978936455999929 - ], - [ - 131.2350366550002, - -3.987562757999854 - ], - [ - 131.24048912900005, - -3.991794528999861 - ], - [ - 131.245371941, - -3.996840101999808 - ], - [ - 131.24870853000002, - -4.002862237999906 - ], - [ - 131.24984785200016, - -4.009698174999912 - ], - [ - 131.25049889400012, - -4.032321872999887 - ], - [ - 131.2475692070001, - -4.042657158999887 - ] - ] - ], - [ - [ - [ - 123.08179772200006, - -4.001234632999882 - ], - [ - 123.102305535, - -4.012465101999965 - ], - [ - 123.11890709700018, - -4.009698174999912 - ], - [ - 123.13502037900005, - -4.000176690999837 - ], - [ - 123.158457879, - -3.993096612999949 - ], - [ - 123.18360436300011, - -3.990329684999907 - ], - [ - 123.20443769600016, - -3.992933851999894 - ], - [ - 123.23414147200012, - -4.01531340899983 - ], - [ - 123.25123131600006, - -4.050876559999892 - ], - [ - 123.25342858200023, - -4.089776299999883 - ], - [ - 123.23878014400023, - -4.122165622999887 - ], - [ - 123.19629967500023, - -4.187676690999922 - ], - [ - 123.16928144600004, - -4.221123955999886 - ], - [ - 123.13624108200017, - -4.238702080999914 - ], - [ - 123.08659915500007, - -4.234470309999907 - ], - [ - 123.04476972700004, - -4.209649346999853 - ], - [ - 123.00912519600016, - -4.171970309999864 - ], - [ - 122.97787519600004, - -4.128838799999855 - ], - [ - 122.96876061300011, - -4.108493747999944 - ], - [ - 122.95972741, - -4.065118096999896 - ], - [ - 122.95069420700011, - -4.047051690999879 - ], - [ - 122.96119225400017, - -4.034844658999901 - ], - [ - 122.98658287900011, - -4.017754815999865 - ], - [ - 122.99838300900015, - -4.006605726999837 - ], - [ - 123.01563561300006, - -3.981133721999839 - ], - [ - 123.02816816500015, - -3.973809502999828 - ], - [ - 123.04688561300023, - -3.978692315999979 - ], - [ - 123.06185957100016, - -3.986504815999893 - ], - [ - 123.08179772200006, - -4.001234632999882 - ] - ] - ], - [ - [ - [ - 131.4532983730002, - -4.055759372999859 - ], - [ - 131.44239342500012, - -4.065118096999896 - ], - [ - 131.42188561300017, - -4.062920830999985 - ], - [ - 131.40064537900017, - -4.047051690999879 - ], - [ - 131.39128665500007, - -4.031508070999877 - ], - [ - 131.37012780000023, - -3.985284112999878 - ], - [ - 131.3659774100001, - -3.968438408999873 - ], - [ - 131.36963951900023, - -3.96217213299991 - ], - [ - 131.37769616000017, - -3.957126559999892 - ], - [ - 131.39437910200004, - -3.951592705999872 - ], - [ - 131.41602623800011, - -3.958591403999847 - ], - [ - 131.42701256600017, - -3.983330987999835 - ], - [ - 131.43433678500017, - -4.013604424999826 - ], - [ - 131.44483483200023, - -4.036716403999876 - ], - [ - 131.4532983730002, - -4.055759372999859 - ] - ] - ], - [ - [ - [ - 127.24136752900009, - -3.91081651099995 - ], - [ - 127.22697055400019, - -3.917062727999934 - ], - [ - 127.20952868300006, - -3.914779310999918 - ], - [ - 127.19072684300014, - -3.911730995999861 - ], - [ - 127.17255262400025, - -3.910109891999838 - ], - [ - 127.16049974600006, - -3.899030720999832 - ], - [ - 127.14508612100022, - -3.884983417999919 - ], - [ - 127.13604776400004, - -3.869858900999859 - ], - [ - 127.13793300500018, - -3.846851729999869 - ], - [ - 127.16521243600008, - -3.814141533999873 - ], - [ - 127.18189537900011, - -3.808526299999883 - ], - [ - 127.19898522200006, - -3.81031666499986 - ], - [ - 127.23462975400011, - -3.821058851999879 - ], - [ - 127.24611869600008, - -3.836224612999885 - ], - [ - 127.25320002800007, - -3.849206734999868 - ], - [ - 127.25602091500005, - -3.874534031999886 - ], - [ - 127.24952506000002, - -3.890279744999916 - ], - [ - 127.24263984400002, - -3.900407626999893 - ], - [ - 127.24136752900009, - -3.91081651099995 - ] - ] - ], - [ - [ - [ - 128.7971297540001, - -3.693780205999843 - ], - [ - 128.77930748800011, - -3.702243747999958 - ], - [ - 128.76172936300006, - -3.699639580999872 - ], - [ - 128.74854576900023, - -3.683851820999919 - ], - [ - 128.74634850400005, - -3.659763278999904 - ], - [ - 128.75798587300008, - -3.64364999799993 - ], - [ - 128.77686608200005, - -3.637302341999984 - ], - [ - 128.79623457099999, - -3.642836195999834 - ], - [ - 128.7971297540001, - -3.652520440999965 - ], - [ - 128.79965254000004, - -3.661390882999839 - ], - [ - 128.80420983200023, - -3.669366143999966 - ], - [ - 128.81055748800006, - -3.676446221999853 - ], - [ - 128.7971297540001, - -3.693780205999843 - ] - ] - ], - [ - [ - [ - 123.17709394599999, - -3.601006768999895 - ], - [ - 123.15992272200018, - -3.603773695999948 - ], - [ - 123.13941491000006, - -3.602715752999899 - ], - [ - 123.12940514400023, - -3.618340752999885 - ], - [ - 123.11988366000006, - -3.629164320999891 - ], - [ - 123.09880618600013, - -3.619235934999878 - ], - [ - 123.07837975400005, - -3.602634372999916 - ], - [ - 123.06666100400017, - -3.589613540000016 - ], - [ - 123.06169681100019, - -3.580254815999908 - ], - [ - 123.06104576900023, - -3.570896091999956 - ], - [ - 123.07081139400012, - -3.566582940999865 - ], - [ - 123.08277428500006, - -3.564222914999917 - ], - [ - 123.14063561300023, - -3.539157809999907 - ], - [ - 123.15723717500012, - -3.544854424999897 - ], - [ - 123.16976972699999, - -3.558282158999972 - ], - [ - 123.17725670700005, - -3.57398853999986 - ], - [ - 123.17709394599999, - -3.601006768999895 - ] - ] - ], - [ - [ - [ - 128.43165123800006, - -3.627048434999878 - ], - [ - 128.39291425900015, - -3.642836195999834 - ], - [ - 128.3875431650001, - -3.626885674999912 - ], - [ - 128.39291425900015, - -3.606622002999984 - ], - [ - 128.40137780000006, - -3.586358330999886 - ], - [ - 128.40601647200012, - -3.570245049999912 - ], - [ - 128.4069116550002, - -3.556817315999837 - ], - [ - 128.41016686300023, - -3.543226820999877 - ], - [ - 128.41651451900006, - -3.531345309999921 - ], - [ - 128.42709394600004, - -3.52271900799991 - ], - [ - 128.46143639400006, - -3.512139580999872 - ], - [ - 128.477305535, - -3.519789320999891 - ], - [ - 128.51270592500012, - -3.526055596999853 - ], - [ - 128.5288192070001, - -3.532972914999945 - ], - [ - 128.54281660200016, - -3.547458591999899 - ], - [ - 128.55884850400005, - -3.57048919099995 - ], - [ - 128.56381269599999, - -3.59189218499999 - ], - [ - 128.54590905000023, - -3.601332289999917 - ], - [ - 128.52898196700008, - -3.604424737999821 - ], - [ - 128.49057050900015, - -3.618584893999923 - ], - [ - 128.44906660200004, - -3.623142184999963 - ], - [ - 128.43165123800006, - -3.627048434999878 - ] - ] - ], - [ - [ - [ - 122.30567467500018, - -3.5707333309999 - ], - [ - 122.29330488400004, - -3.580824476999879 - ], - [ - 122.28467858200023, - -3.562920830999914 - ], - [ - 122.29037519600004, - -3.541192315999851 - ], - [ - 122.30486087300008, - -3.522067966999956 - ], - [ - 122.32129967500023, - -3.511895440999837 - ], - [ - 122.33301842500023, - -3.516696872999916 - ], - [ - 122.344004754, - -3.528985283999873 - ], - [ - 122.35222415500019, - -3.543877862999835 - ], - [ - 122.35547936300023, - -3.556573174999969 - ], - [ - 122.34652754000004, - -3.557305596999825 - ], - [ - 122.32667076900012, - -3.562269789999874 - ], - [ - 122.30567467500018, - -3.5707333309999 - ] - ] - ], - [ - [ - [ - 128.32341556100013, - -3.570245049999912 - ], - [ - 128.32886803500017, - -3.591729424999855 - ], - [ - 128.33716881600006, - -3.611586195999863 - ], - [ - 128.33497155000023, - -3.627211195999848 - ], - [ - 128.3097436860002, - -3.635430596999925 - ], - [ - 128.30307050900004, - -3.63396575299987 - ], - [ - 128.28305097700016, - -3.621758721999981 - ], - [ - 128.26921634200008, - -3.61581796699987 - ], - [ - 128.26303144599999, - -3.61500416499986 - ], - [ - 128.25196373800023, - -3.614922783999887 - ], - [ - 128.24659264400012, - -3.62037525799991 - ], - [ - 128.25123131600006, - -3.632582289999888 - ], - [ - 128.27588951900012, - -3.666192315999908 - ], - [ - 128.27816816499998, - -3.674411716999913 - ], - [ - 128.27491295700023, - -3.681084893999866 - ], - [ - 128.25489342500006, - -3.709567966999884 - ], - [ - 128.23650149800002, - -3.722263278999847 - ], - [ - 128.21265709700006, - -3.729261976999823 - ], - [ - 128.1831160820001, - -3.73162200299987 - ], - [ - 128.16146894599999, - -3.739027601999865 - ], - [ - 128.146739129, - -3.755059502999856 - ], - [ - 128.12867272200018, - -3.769626559999963 - ], - [ - 128.097422722, - -3.773207289999945 - ], - [ - 128.10401451900012, - -3.763767184999935 - ], - [ - 128.12712649800002, - -3.749444268999937 - ], - [ - 128.13209069100012, - -3.742282809999907 - ], - [ - 128.1520288420002, - -3.703057549999969 - ], - [ - 128.20435631600017, - -3.66814544099995 - ], - [ - 128.22095787900005, - -3.649102471999868 - ], - [ - 128.202891472, - -3.639336846999839 - ], - [ - 128.18376712300002, - -3.646905205999886 - ], - [ - 128.14519290500007, - -3.676446221999853 - ], - [ - 128.10670006600017, - -3.692071221999839 - ], - [ - 128.0807397800002, - -3.708184502999899 - ], - [ - 128.05551191500004, - -3.713311455999914 - ], - [ - 128.04273522200018, - -3.71803150799991 - ], - [ - 128.02173912900005, - -3.736423434999949 - ], - [ - 128.00570722700016, - -3.756768487999864 - ], - [ - 127.98601321700019, - -3.771579685 - ], - [ - 127.95411217500006, - -3.773207289999945 - ], - [ - 127.93344160200016, - -3.763441664999903 - ], - [ - 127.92676842500012, - -3.746840101999851 - ], - [ - 127.92335045700011, - -3.726006768999881 - ], - [ - 127.91236412900005, - -3.703057549999969 - ], - [ - 127.91635175900004, - -3.693942966999899 - ], - [ - 127.96094811300011, - -3.640313408999987 - ], - [ - 127.98414147200006, - -3.620538018999966 - ], - [ - 128.0345158210001, - -3.589043877999956 - ], - [ - 128.04769941500004, - -3.584730726999865 - ], - [ - 128.06251061300011, - -3.583591403999932 - ], - [ - 128.1473087900001, - -3.588474216999984 - ], - [ - 128.15870201900023, - -3.584649346999882 - ], - [ - 128.24170983200023, - -3.522149346999939 - ], - [ - 128.28711998800011, - -3.50457122199991 - ], - [ - 128.33082116, - -3.511895440999837 - ], - [ - 128.349375847, - -3.529473565999865 - ], - [ - 128.34457441500004, - -3.542087497999844 - ], - [ - 128.33106530000023, - -3.554131768999937 - ], - [ - 128.32341556100013, - -3.570245049999912 - ] - ] - ], - [ - [ - [ - 128.66065514400006, - -3.533379815999851 - ], - [ - 128.67286217500023, - -3.53980885199995 - ], - [ - 128.68246504000004, - -3.517022393999838 - ], - [ - 128.69320722700004, - -3.502048434999907 - ], - [ - 128.70573978000007, - -3.502536716999884 - ], - [ - 128.72055097700004, - -3.525567315999865 - ], - [ - 128.72641035200016, - -3.54599374799993 - ], - [ - 128.72803795700005, - -3.614922783999887 - ], - [ - 128.70655358200023, - -3.602959893999937 - ], - [ - 128.68702233200005, - -3.582207940999851 - ], - [ - 128.66879316499998, - -3.569268487999935 - ], - [ - 128.65235436300011, - -3.580824476999879 - ], - [ - 128.65162194100017, - -3.591485283999987 - ], - [ - 128.6554468110002, - -3.602146091999927 - ], - [ - 128.65601647200006, - -3.612399997999873 - ], - [ - 128.64551842500006, - -3.621758721999981 - ], - [ - 128.63624108200023, - -3.62281666499986 - ], - [ - 128.62745201900023, - -3.617608330999857 - ], - [ - 128.61898847700004, - -3.607517184999978 - ], - [ - 128.61060631600006, - -3.593926690999851 - ], - [ - 128.61817467500012, - -3.593926690999851 - ], - [ - 128.60352623800011, - -3.583428643999866 - ], - [ - 128.59376061300023, - -3.568617445999891 - ], - [ - 128.585703972, - -3.552992445999905 - ], - [ - 128.56788170700023, - -3.528008721999896 - ], - [ - 128.55909264400006, - -3.509372653999989 - ], - [ - 128.56104576900023, - -3.493747654 - ], - [ - 128.58399498800011, - -3.491469007999939 - ], - [ - 128.5978296230002, - -3.491794528999961 - ], - [ - 128.60629316500015, - -3.496677341999856 - ], - [ - 128.62159264400012, - -3.515720309999935 - ], - [ - 128.6316837900001, - -3.522556247999944 - ], - [ - 128.66065514400006, - -3.533379815999851 - ] - ] - ], - [ - [ - [ - 132.68116295700023, - -3.42343515399989 - ], - [ - 132.70281009200014, - -3.453301690999879 - ], - [ - 132.71045983200023, - -3.469496351999837 - ], - [ - 132.71469160200016, - -3.486993096999882 - ], - [ - 132.71290123800011, - -3.504164320999905 - ], - [ - 132.70289147200012, - -3.519301039999903 - ], - [ - 132.68995201900012, - -3.509535414999874 - ], - [ - 132.67888431100008, - -3.495863539999931 - ], - [ - 132.67115319100006, - -3.47942473799985 - ], - [ - 132.66635175900015, - -3.453383070999863 - ], - [ - 132.66114342500018, - -3.450616143999909 - ], - [ - 132.64429772200018, - -3.451104424999897 - ], - [ - 132.63746178500006, - -3.447523695999919 - ], - [ - 132.62029056100013, - -3.423760674999912 - ], - [ - 132.62680097700004, - -3.418389580999872 - ], - [ - 132.64356530000023, - -3.408623955999914 - ], - [ - 132.65162194100017, - -3.406019789999917 - ], - [ - 132.66651451900012, - -3.410251559999935 - ], - [ - 132.68116295700023, - -3.42343515399989 - ] - ] - ], - [ - [ - [ - 122.44922936300023, - -3.479750257999868 - ], - [ - 122.43360436300017, - -3.485284112999878 - ], - [ - 122.42579186300006, - -3.477308851999837 - ], - [ - 122.41553795700023, - -3.459649346999825 - ], - [ - 122.40259850400005, - -3.43059661299985 - ], - [ - 122.40211022200006, - -3.42050546699987 - ], - [ - 122.40349368600002, - -3.407972914999959 - ], - [ - 122.40650475400005, - -3.396172783999987 - ], - [ - 122.4122827480002, - -3.387790622999844 - ], - [ - 122.4153751960001, - -3.385430596999896 - ], - [ - 122.41781660200004, - -3.384535414999903 - ], - [ - 122.42042076900012, - -3.385186455999857 - ], - [ - 122.42359459700018, - -3.387465101999823 - ], - [ - 122.42847741000006, - -3.394301040000016 - ], - [ - 122.43490644600016, - -3.411390882999967 - ], - [ - 122.43962649800008, - -3.419040622999916 - ], - [ - 122.46127363400015, - -3.436130466999856 - ], - [ - 122.46469160200016, - -3.440850518999952 - ], - [ - 122.46338951900006, - -3.45224374799993 - ], - [ - 122.45866946700008, - -3.466973565999822 - ], - [ - 122.44922936300023, - -3.479750257999868 - ] - ] - ], - [ - [ - [ - 116.39307701900006, - -3.632419528999932 - ], - [ - 116.385996941, - -3.639580987999878 - ], - [ - 116.37012780000012, - -3.621351820999806 - ], - [ - 116.33220462300008, - -3.561700127999899 - ], - [ - 116.32536868600008, - -3.547621351999865 - ], - [ - 116.32471764400012, - -3.532972914999945 - ], - [ - 116.33106530000023, - -3.511895440999837 - ], - [ - 116.35564212300002, - -3.459730726999808 - ], - [ - 116.35889733200011, - -3.440850518999952 - ], - [ - 116.36524498800023, - -3.429131768999881 - ], - [ - 116.39307701900006, - -3.405857028999861 - ], - [ - 116.39926191500015, - -3.392754815999979 - ], - [ - 116.40447024800002, - -3.37460702899989 - ], - [ - 116.41586347700004, - -3.38176848799985 - ], - [ - 116.43441816500004, - -3.409763278999947 - ], - [ - 116.431407097, - -3.447523695999919 - ], - [ - 116.41146894600004, - -3.520928643999923 - ], - [ - 116.40455162900005, - -3.576836846999896 - ], - [ - 116.39527428500017, - -3.613457940999822 - ], - [ - 116.39307701900006, - -3.632419528999932 - ] - ] - ], - [ - [ - [ - 127.53223717500012, - -3.254489841999899 - ], - [ - 127.534434441, - -3.255791924999897 - ], - [ - 127.56397545700005, - -3.255791924999897 - ], - [ - 127.58301842500018, - -3.267998955999872 - ], - [ - 127.61548912900005, - -3.307386976999851 - ], - [ - 127.62867272200012, - -3.321872653999904 - ], - [ - 127.64161217500012, - -3.340264580999843 - ], - [ - 127.64356530000023, - -3.356052341999884 - ], - [ - 127.62452233200017, - -3.361748955999957 - ], - [ - 127.60303795700023, - -3.356866143999895 - ], - [ - 127.56544030000023, - -3.338474216999856 - ], - [ - 127.5197046230002, - -3.330254815999865 - ], - [ - 127.50359134200008, - -3.320082289999917 - ], - [ - 127.49057050900015, - -3.306817315999879 - ], - [ - 127.48047936300011, - -3.293389580999886 - ], - [ - 127.48511803500006, - -3.292087497999887 - ], - [ - 127.50961347700016, - -3.276543877999885 - ], - [ - 127.51270592500023, - -3.273614190999865 - ], - [ - 127.52182050900004, - -3.261814059999892 - ], - [ - 127.52475019600016, - -3.256117445999919 - ], - [ - 127.52637780000006, - -3.254327080999843 - ], - [ - 127.52963300900004, - -3.253350518999866 - ], - [ - 127.53223717500012, - -3.254489841999899 - ] - ] - ], - [ - [ - [ - 116.12468509200019, - -4.030368747999844 - ], - [ - 116.11557050900004, - -4.036716403999876 - ], - [ - 116.09978274800008, - -4.060642184999921 - ], - [ - 116.09148196700008, - -4.0668270809999 - ], - [ - 116.09034264400023, - -4.050551039999874 - ], - [ - 116.0828556650001, - -4.037774346999825 - ], - [ - 116.071055535, - -4.032891533999859 - ], - [ - 116.05738366000017, - -4.040704033999845 - ], - [ - 116.05014082100016, - -4.020196221999896 - ], - [ - 116.05347741000017, - -3.997816664999874 - ], - [ - 116.06031334700018, - -3.975355726999865 - ], - [ - 116.06421959700018, - -3.954522393999895 - ], - [ - 116.06836998800023, - -3.951104424999883 - ], - [ - 116.07781009200002, - -3.948337498 - ], - [ - 116.08716881600017, - -3.943536065999922 - ], - [ - 116.09148196700008, - -3.934340101999865 - ], - [ - 116.08871504000004, - -3.924737237999878 - ], - [ - 116.07601972700016, - -3.90984465899983 - ], - [ - 116.07154381600017, - -3.90300872199991 - ], - [ - 116.06885826900012, - -3.885511976999865 - ], - [ - 116.07781009200002, - -3.824476820999891 - ], - [ - 116.074473504, - -3.800876559999935 - ], - [ - 116.06609134200008, - -3.787041924999855 - ], - [ - 116.04371178500006, - -3.76580169099995 - ], - [ - 116.025645379, - -3.740166924999897 - ], - [ - 116.01905358200023, - -3.724867445999848 - ], - [ - 116.01303144600004, - -3.65048593499985 - ], - [ - 116.01636803500017, - -3.629164320999891 - ], - [ - 116.04053795700005, - -3.566338799999826 - ], - [ - 116.04639733200011, - -3.497491143999866 - ], - [ - 116.05250084700012, - -3.478692315999908 - ], - [ - 116.09669030000006, - -3.399672132999896 - ], - [ - 116.11793053500017, - -3.336114190999908 - ], - [ - 116.11939537900005, - -3.324151299999869 - ], - [ - 116.12623131600006, - -3.318617445999948 - ], - [ - 116.15919030000012, - -3.303643487999821 - ], - [ - 116.17066491000006, - -3.296807549999983 - ], - [ - 116.22917728000013, - -3.245538018999952 - ], - [ - 116.24594160200004, - -3.238213799999869 - ], - [ - 116.25473066499998, - -3.232598565999865 - ], - [ - 116.26140384200008, - -3.222588799999883 - ], - [ - 116.26783287900017, - -3.21884530999985 - ], - [ - 116.27637780000006, - -3.232028903999975 - ], - [ - 116.27857506600017, - -3.244724216999941 - ], - [ - 116.27613366000006, - -3.256280205999886 - ], - [ - 116.27214603000007, - -3.267754815999837 - ], - [ - 116.25896243600013, - -3.366631768999852 - ], - [ - 116.2630314460001, - -3.405531507999839 - ], - [ - 116.2893986340001, - -3.444268487999878 - ], - [ - 116.30469811300023, - -3.460137627999984 - ], - [ - 116.31885826900023, - -3.480401299999912 - ], - [ - 116.32105553500006, - -3.497735283999901 - ], - [ - 116.27637780000006, - -3.513604424999841 - ], - [ - 116.27409915500013, - -3.532891533999873 - ], - [ - 116.28199303500017, - -3.553643487999949 - ], - [ - 116.2893986340001, - -3.566582940999865 - ], - [ - 116.2970483730002, - -3.584730726999865 - ], - [ - 116.29883873800011, - -3.602146091999927 - ], - [ - 116.29688561300023, - -3.646091403999876 - ], - [ - 116.30258222700004, - -3.669854424999954 - ], - [ - 116.30372155000023, - -3.6801083309999 - ], - [ - 116.30372155000023, - -3.71803150799991 - ], - [ - 116.30974368600008, - -3.724541924999912 - ], - [ - 116.32496178500006, - -3.732028903999876 - ], - [ - 116.33106530000023, - -3.739027601999865 - ], - [ - 116.33326256600006, - -3.749769789999959 - ], - [ - 116.32105553500006, - -3.756931247999916 - ], - [ - 116.31153405000023, - -3.785739841999856 - ], - [ - 116.29932701900006, - -3.799086195999948 - ], - [ - 116.2892358730002, - -3.815606377999927 - ], - [ - 116.2893986340001, - -3.840915622999887 - ], - [ - 116.29493248800011, - -3.854587497999916 - ], - [ - 116.3079533210001, - -3.878594658999859 - ], - [ - 116.31055748800006, - -3.893324476999851 - ], - [ - 116.30648847700004, - -3.904473565999879 - ], - [ - 116.29688561300023, - -3.90797291499986 - ], - [ - 116.28549238399998, - -3.908298434999892 - ], - [ - 116.27637780000006, - -3.90984465899983 - ], - [ - 116.26758873800023, - -3.917901299999869 - ], - [ - 116.26270592500023, - -3.927015882999854 - ], - [ - 116.25709069100006, - -3.934665622999887 - ], - [ - 116.24594160200004, - -3.937758070999877 - ], - [ - 116.23121178500006, - -3.938083591999899 - ], - [ - 116.22185306100019, - -3.939629815999837 - ], - [ - 116.21509850400017, - -3.943780205999872 - ], - [ - 116.20818118600008, - -3.951348565999837 - ], - [ - 116.20655358200023, - -3.956719658999887 - ], - [ - 116.20753014400012, - -3.969496351999837 - ], - [ - 116.20476321700008, - -3.975274346999882 - ], - [ - 116.19898522200012, - -3.97926197699995 - ], - [ - 116.183848504, - -3.987074476999865 - ], - [ - 116.18091881600017, - -3.98935312299993 - ], - [ - 116.17774498800011, - -3.995293877999941 - ], - [ - 116.17025800900015, - -4.004001559999935 - ], - [ - 116.153575066, - -4.019707940999908 - ], - [ - 116.14454186300011, - -4.024102471999882 - ], - [ - 116.12468509200019, - -4.030368747999844 - ] - ] - ], - [ - [ - [ - 127.77849368600002, - -3.244235934999864 - ], - [ - 127.76644941500004, - -3.246270440999979 - ], - [ - 127.74187259200019, - -3.245700778999918 - ], - [ - 127.67920983200011, - -3.251641533999859 - ], - [ - 127.65853925899998, - -3.245700778999918 - ], - [ - 127.64332116, - -3.22437916499986 - ], - [ - 127.65967858200023, - -3.201429945999877 - ], - [ - 127.68734785200004, - -3.178317966999913 - ], - [ - 127.70630944100006, - -3.156345309999907 - ], - [ - 127.74187259200019, - -3.156345309999907 - ], - [ - 127.75342858200023, - -3.150567315999851 - ], - [ - 127.75814863400015, - -3.149509372999972 - ], - [ - 127.76140384200019, - -3.151543877999828 - ], - [ - 127.76335696700002, - -3.155938408999901 - ], - [ - 127.76628665500007, - -3.160414320999863 - ], - [ - 127.77222741000017, - -3.162530205999872 - ], - [ - 127.78443444100006, - -3.168715101999851 - ], - [ - 127.78825931100008, - -3.183282158999958 - ], - [ - 127.789805535, - -3.199639580999971 - ], - [ - 127.79639733200011, - -3.211521091999927 - ], - [ - 127.78565514400006, - -3.234307549999869 - ], - [ - 127.77849368600002, - -3.244235934999864 - ] - ] - ], - [ - [ - [ - 100.53638756600012, - -3.176853122999859 - ], - [ - 100.52881920700005, - -3.183526299999826 - ], - [ - 100.5066837900001, - -3.178399346999896 - ], - [ - 100.49366295700011, - -3.160251559999907 - ], - [ - 100.49301191500015, - -3.13827890399989 - ], - [ - 100.50847415500007, - -3.122165622999916 - ], - [ - 100.50831139400012, - -3.140801690999908 - ], - [ - 100.51547285200016, - -3.153903903999876 - ], - [ - 100.53638756600012, - -3.176853122999859 - ] - ] - ], - [ - [ - [ - 126.87525475400017, - -3.109470309999864 - ], - [ - 126.89340254000015, - -3.125583591999927 - ], - [ - 126.918711785, - -3.114678643999937 - ], - [ - 126.93409264400023, - -3.130547783999873 - ], - [ - 126.95573978000002, - -3.137790622999901 - ], - [ - 126.97917728000019, - -3.142266533999873 - ], - [ - 127.00066165500002, - -3.149509372999972 - ], - [ - 127.03500410199999, - -3.173516533999845 - ], - [ - 127.05494225400017, - -3.179457289999945 - ], - [ - 127.08423912900011, - -3.194268487999921 - ], - [ - 127.09351647200006, - -3.200778904 - ], - [ - 127.102305535, - -3.210381768999895 - ], - [ - 127.10694420700023, - -3.21884530999985 - ], - [ - 127.10914147200006, - -3.229424737999977 - ], - [ - 127.11231530000012, - -3.264418226999808 - ], - [ - 127.11182701900012, - -3.272067966999927 - ], - [ - 127.10645592500023, - -3.273044528999904 - ], - [ - 127.09351647200006, - -3.27239348799985 - ], - [ - 127.08301842500006, - -3.268161716999927 - ], - [ - 127.06983483200023, - -3.260918877999899 - ], - [ - 127.05591881600006, - -3.259535414999917 - ], - [ - 127.042246941, - -3.27239348799985 - ], - [ - 127.04078209700006, - -3.286716403999932 - ], - [ - 127.046153191, - -3.305352471999825 - ], - [ - 127.05453535200016, - -3.323011976999837 - ], - [ - 127.06275475400017, - -3.3344052059999 - ], - [ - 127.06950931100019, - -3.336683851999879 - ], - [ - 127.08008873800023, - -3.34880950299987 - ], - [ - 127.09473717500018, - -3.362074476999808 - ], - [ - 127.11394290500002, - -3.368584893999895 - ], - [ - 127.124766472, - -3.363213799999841 - ], - [ - 127.13786868600019, - -3.339776299999855 - ], - [ - 127.14828535200016, - -3.3344052059999 - ], - [ - 127.15894616, - -3.337172132999868 - ], - [ - 127.19312584700018, - -3.355564059999907 - ], - [ - 127.23853600400017, - -3.363213799999841 - ], - [ - 127.25977623800006, - -3.371189059999892 - ], - [ - 127.26880944100017, - -3.385918877999885 - ], - [ - 127.26465905000023, - -3.404717705999829 - ], - [ - 127.24634850400017, - -3.449965101999865 - ], - [ - 127.24089603000007, - -3.470961195999891 - ], - [ - 127.24341881600006, - -3.606052341999842 - ], - [ - 127.22722415500019, - -3.642836195999834 - ], - [ - 127.20573978000019, - -3.659600518999852 - ], - [ - 127.18580162900011, - -3.659926039999874 - ], - [ - 127.16521243600008, - -3.653415622999958 - ], - [ - 127.14144941500015, - -3.649102471999868 - ], - [ - 127.12159264400023, - -3.653252862999821 - ], - [ - 127.00196373800023, - -3.713799737999892 - ], - [ - 126.99073326900023, - -3.71803150799991 - ], - [ - 126.98072350400005, - -3.724541924999912 - ], - [ - 126.95679772200018, - -3.755629164999917 - ], - [ - 126.94605553500017, - -3.76580169099995 - ], - [ - 126.90699955900001, - -3.787341139999825 - ], - [ - 126.82692928800006, - -3.810093289999941 - ], - [ - 126.77708639000016, - -3.832694756999942 - ], - [ - 126.74218531500017, - -3.859378355999823 - ], - [ - 126.71889610399998, - -3.854854321999881 - ], - [ - 126.6965734400001, - -3.863792105999977 - ], - [ - 126.67427504300022, - -3.842502851999853 - ], - [ - 126.65629280300007, - -3.834851643999883 - ], - [ - 126.58932542100004, - -3.816639322999862 - ], - [ - 126.55852750400018, - -3.793291256999822 - ], - [ - 126.5250574730002, - -3.789916427999842 - ], - [ - 126.43887944399998, - -3.750449915999923 - ], - [ - 126.38062584700006, - -3.703057549999969 - ], - [ - 126.36443118600008, - -3.697198174999841 - ], - [ - 126.32466369400007, - -3.687644316999837 - ], - [ - 126.27489558199997, - -3.663260553999905 - ], - [ - 126.25879663700002, - -3.642255465999924 - ], - [ - 126.243918449, - -3.631398868999938 - ], - [ - 126.20302084400012, - -3.630993787999913 - ], - [ - 126.17356062000025, - -3.602527212999931 - ], - [ - 126.16529381600017, - -3.567966403999847 - ], - [ - 126.14855361099998, - -3.525500660999938 - ], - [ - 126.08812775800018, - -3.483623285999869 - ], - [ - 126.06850725100017, - -3.467379435999831 - ], - [ - 126.05262796000002, - -3.446320133999905 - ], - [ - 126.04175866000006, - -3.420098565999865 - ], - [ - 126.04118899800008, - -3.412855726999851 - ], - [ - 126.0072264520002, - -3.361011827999903 - ], - [ - 125.99174240300025, - -3.248191339999849 - ], - [ - 126.01726321700014, - -3.171156507999882 - ], - [ - 126.03656216900006, - -3.153592708999966 - ], - [ - 126.0646085380001, - -3.132931362999926 - ], - [ - 126.0909211750002, - -3.112098279999955 - ], - [ - 126.11086722700023, - -3.121706119999914 - ], - [ - 126.12161522799997, - -3.147897929999957 - ], - [ - 126.13631850200002, - -3.160623631999869 - ], - [ - 126.1613439070002, - -3.172316784999865 - ], - [ - 126.18508540000019, - -3.180893844999886 - ], - [ - 126.2020011980002, - -3.181841811999888 - ], - [ - 126.22774030100013, - -3.174758609999841 - ], - [ - 126.22657311300006, - -3.149509372999972 - ], - [ - 126.25831139400023, - -3.122002862999864 - ], - [ - 126.29712975400005, - -3.105889580999886 - ], - [ - 126.42139733200011, - -3.070489190999879 - ], - [ - 126.72022545700023, - -3.060153903999876 - ], - [ - 126.8400171230002, - -3.073663018999852 - ], - [ - 126.85889733200023, - -3.085870049999826 - ], - [ - 126.87525475400017, - -3.109470309999864 - ] - ] - ], - [ - [ - [ - 127.98357181100008, - -2.948825778999932 - ], - [ - 127.96908613400004, - -2.972263278999989 - ], - [ - 127.96404056100019, - -2.977634372999873 - ], - [ - 127.96094811300011, - -2.983493747999901 - ], - [ - 127.950938347, - -3.01091887799987 - ], - [ - 127.94727623800006, - -3.018487237999821 - ], - [ - 127.93425540500019, - -3.025567315999879 - ], - [ - 127.91846764400023, - -3.029229424999826 - ], - [ - 127.83838951900017, - -3.033298434999878 - ], - [ - 127.82699629000004, - -3.028985283999887 - ], - [ - 127.82545006600017, - -3.016534112999949 - ], - [ - 127.83716881600006, - -3.00188567499994 - ], - [ - 127.85401451900023, - -2.989434502999842 - ], - [ - 127.86801191500004, - -2.984307549999912 - ], - [ - 127.87525475400005, - -2.983005466999913 - ], - [ - 127.879649285, - -2.97942473799985 - ], - [ - 127.88892662900017, - -2.967217705999872 - ], - [ - 127.89649498800011, - -2.961846612999821 - ], - [ - 127.90235436300017, - -2.962497653999876 - ], - [ - 127.90739993600019, - -2.964532158999901 - ], - [ - 127.91236412900005, - -2.963799737999864 - ], - [ - 127.92530358200023, - -2.955173434999949 - ], - [ - 127.93287194100012, - -2.945977471999896 - ], - [ - 127.9337671230002, - -2.934014580999857 - ], - [ - 127.92603600400017, - -2.916680596999868 - ], - [ - 127.95411217500006, - -2.916680596999868 - ], - [ - 127.969981316, - -2.920179945999948 - ], - [ - 127.98536217500023, - -2.929457289999917 - ], - [ - 127.99439537900017, - -2.939060153999975 - ], - [ - 127.99154707100004, - -2.943454684999878 - ], - [ - 127.98357181100008, - -2.948825778999932 - ] - ] - ], - [ - [ - [ - 106.86589603000019, - -3.026543877999856 - ], - [ - 106.8611759770001, - -3.028985283999887 - ], - [ - 106.8157658210001, - -3.018487237999821 - ], - [ - 106.79859459700018, - -3.011000257999854 - ], - [ - 106.75806725400017, - -2.978204033999845 - ], - [ - 106.72266686300006, - -2.966078382999839 - ], - [ - 106.72559655000006, - -2.956231377999828 - ], - [ - 106.73406009200019, - -2.946547132999868 - ], - [ - 106.73829186300006, - -2.943454684999878 - ], - [ - 106.74561608200005, - -2.926934502999899 - ], - [ - 106.74952233200005, - -2.923109632999967 - ], - [ - 106.77222741000017, - -2.907321872999844 - ], - [ - 106.7923283210001, - -2.896416924999869 - ], - [ - 106.81251061300006, - -2.892185153999847 - ], - [ - 106.82642662900005, - -2.903008721999925 - ], - [ - 106.84351647200018, - -2.911879164999888 - ], - [ - 106.88990319100006, - -2.919854424999926 - ], - [ - 106.90894616000006, - -2.929782809999935 - ], - [ - 106.91570071700008, - -2.950941664999931 - ], - [ - 106.89079837300002, - -2.994886976999879 - ], - [ - 106.895274285, - -3.018487237999821 - ], - [ - 106.86589603000019, - -3.026543877999856 - ] - ] - ], - [ - [ - [ - 107.09075137900007, - -2.9029998339999 - ], - [ - 107.08375084700018, - -2.909844658999859 - ], - [ - 107.06999759200008, - -2.907484632999811 - ], - [ - 107.05958092500006, - -2.901462497999887 - ], - [ - 107.04437189200016, - -2.896928103999883 - ], - [ - 107.03369812700012, - -2.8885747839999 - ], - [ - 107.01707568300012, - -2.880205997999894 - ], - [ - 107.03260859400021, - -2.858870155999895 - ], - [ - 107.0457462900001, - -2.84075286299985 - ], - [ - 107.0594181650001, - -2.831963799999883 - ], - [ - 107.06104576900006, - -2.827243747999873 - ], - [ - 107.0646264980002, - -2.822523695999948 - ], - [ - 107.07349694100006, - -2.820489190999922 - ], - [ - 107.07789147200006, - -2.823337497999958 - ], - [ - 107.08621031600009, - -2.840005214999806 - ], - [ - 107.09923179600005, - -2.859058011999906 - ], - [ - 107.09676088100016, - -2.885194687999928 - ], - [ - 107.09075137900007, - -2.9029998339999 - ] - ] - ], - [ - [ - [ - 107.49488366000006, - -2.876397393999895 - ], - [ - 107.48096764400006, - -2.898695570999934 - ], - [ - 107.46290123800006, - -2.915948174999841 - ], - [ - 107.42798912900005, - -2.925713799999883 - ], - [ - 107.41014730800012, - -2.947565211999901 - ], - [ - 107.39845358700009, - -2.938427947999898 - ], - [ - 107.36924703000008, - -2.905168980999875 - ], - [ - 107.34129222600009, - -2.88685845099991 - ], - [ - 107.34848817300022, - -2.875167492999921 - ], - [ - 107.36605373000006, - -2.882383951999969 - ], - [ - 107.38105223200009, - -2.875274658999984 - ], - [ - 107.39503014400006, - -2.868910414999917 - ], - [ - 107.40023847700016, - -2.850762627999828 - ], - [ - 107.42579186300011, - -2.835219007999825 - ], - [ - 107.45818118600002, - -2.82447682099999 - ], - [ - 107.48438561300006, - -2.820489190999922 - ], - [ - 107.49519204700007, - -2.823489319999908 - ], - [ - 107.49383832500004, - -2.83782159599987 - ], - [ - 107.49773196700008, - -2.845147393999838 - ], - [ - 107.50473066500015, - -2.854668877999913 - ], - [ - 107.49488366000006, - -2.876397393999895 - ] - ] - ], - [ - [ - [ - 129.54102623800023, - -2.780043226999894 - ], - [ - 129.543711785, - -2.789727471999939 - ], - [ - 129.54525800900015, - -2.79355234199987 - ], - [ - 129.54957116000017, - -2.796644789999945 - ], - [ - 129.554942254, - -2.799004815999908 - ], - [ - 129.61182701900023, - -2.806817315999979 - ], - [ - 129.753754102, - -2.866469007999896 - ], - [ - 129.76612389400023, - -2.868910414999917 - ], - [ - 129.77808678500017, - -2.875420830999829 - ], - [ - 129.79802493600008, - -2.906426690999851 - ], - [ - 129.81055748800017, - -2.916680596999868 - ], - [ - 129.825450066, - -2.917657158999845 - ], - [ - 129.83814537900017, - -2.912692966999899 - ], - [ - 129.84986412900017, - -2.906182549999983 - ], - [ - 129.86207116000006, - -2.903008721999925 - ], - [ - 129.8683374360002, - -2.906996351999823 - ], - [ - 129.86988366000006, - -2.916273695999863 - ], - [ - 129.87330162900005, - -2.927504164999874 - ], - [ - 129.88559003999998, - -2.936618747999944 - ], - [ - 129.89503014400012, - -2.925388278999861 - ], - [ - 129.91163170700005, - -2.933200778999847 - ], - [ - 129.92758222700016, - -2.946954033999873 - ], - [ - 129.94385826900012, - -2.964532158999901 - ], - [ - 129.96485436300023, - -2.973565362999906 - ], - [ - 130.046641472, - -2.992120049999912 - ], - [ - 130.21265709700012, - -2.990411065999908 - ], - [ - 130.30152428500006, - -2.977227471999868 - ], - [ - 130.34498131600017, - -2.977634372999873 - ], - [ - 130.38933353000013, - -2.993829033999916 - ], - [ - 130.48894290500007, - -3.087497653999847 - ], - [ - 130.50294030000012, - -3.094496351999823 - ], - [ - 130.57846113400015, - -3.122816664999874 - ], - [ - 130.58790123800017, - -3.129489841999913 - ], - [ - 130.59197024800014, - -3.138848565999865 - ], - [ - 130.599375847, - -3.173028252999856 - ], - [ - 130.60222415500007, - -3.1801083309999 - ], - [ - 130.62224368600013, - -3.212579033999887 - ], - [ - 130.63103274800008, - -3.252699476999823 - ], - [ - 130.63282311300006, - -3.337823174999912 - ], - [ - 130.63721764400023, - -3.353610934999864 - ], - [ - 130.65593509200014, - -3.380954685 - ], - [ - 130.6603296230002, - -3.392754815999979 - ], - [ - 130.66667728000002, - -3.403578382999896 - ], - [ - 130.68262780000023, - -3.406426690999922 - ], - [ - 130.72234134200008, - -3.403252862999864 - ], - [ - 130.76148522200018, - -3.405857028999861 - ], - [ - 130.79297936300011, - -3.416436455999914 - ], - [ - 130.81657962300002, - -3.434258721999896 - ], - [ - 130.83155358200005, - -3.457940362999821 - ], - [ - 130.81088300900015, - -3.464939059999892 - ], - [ - 130.81080162900017, - -3.484551690999851 - ], - [ - 130.81934655000012, - -3.505140882999882 - ], - [ - 130.83139082100004, - -3.526462497999859 - ], - [ - 130.86280358200023, - -3.557305596999825 - ], - [ - 130.87322024800002, - -3.57398853999986 - ], - [ - 130.87574303500006, - -3.585625908999859 - ], - [ - 130.87623131600006, - -3.595310153999918 - ], - [ - 130.87322024800002, - -3.614922783999887 - ], - [ - 130.8686629570001, - -3.625746351999879 - ], - [ - 130.85482832099999, - -3.646416924999897 - ], - [ - 130.85206139400023, - -3.65292734199997 - ], - [ - 130.84888756600017, - -3.662692966999927 - ], - [ - 130.83472741000006, - -3.682305596999882 - ], - [ - 130.83155358200005, - -3.694105726999865 - ], - [ - 130.82471764400023, - -3.824476820999891 - ], - [ - 130.83106530000006, - -3.837497653999876 - ], - [ - 130.84148196700008, - -3.852797132999839 - ], - [ - 130.84156334700006, - -3.865004164999988 - ], - [ - 130.81788170700023, - -3.86882903399983 - ], - [ - 130.79957116000017, - -3.861748955999857 - ], - [ - 130.76734459700006, - -3.834079684999949 - ], - [ - 130.75277754000004, - -3.827894789999888 - ], - [ - 130.7312117850001, - -3.825941664999945 - ], - [ - 130.63160241000006, - -3.788669528999876 - ], - [ - 130.61646569100006, - -3.786309502999828 - ], - [ - 130.60694420700017, - -3.778497002999828 - ], - [ - 130.56470787900005, - -3.73162200299987 - ], - [ - 130.55128014400023, - -3.720961195999848 - ], - [ - 130.53516686300006, - -3.71184661299985 - ], - [ - 130.51579837300008, - -3.705498955999829 - ], - [ - 130.49268639400012, - -3.703057549999969 - ], - [ - 130.47779381600006, - -3.697360934999907 - ], - [ - 130.46558678500017, - -3.683851820999919 - ], - [ - 130.44800866000006, - -3.656508070999863 - ], - [ - 130.43531334700018, - -3.645440362999821 - ], - [ - 130.41879316499998, - -3.636895440999979 - ], - [ - 130.39893639400012, - -3.6312802059999 - ], - [ - 130.37598717500012, - -3.629164320999891 - ], - [ - 130.35645592500012, - -3.62468840899983 - ], - [ - 130.3108016290001, - -3.593926690999851 - ], - [ - 130.12647545700023, - -3.532972914999945 - ], - [ - 130.10661868600008, - -3.514825127999856 - ], - [ - 130.10189863400015, - -3.511895440999837 - ], - [ - 130.08806399800002, - -3.509698174999841 - ], - [ - 130.03711998800023, - -3.491469007999939 - ], - [ - 130.001719597, - -3.4730770809999 - ], - [ - 129.98316491, - -3.459730726999808 - ], - [ - 129.97510826900006, - -3.447686455999886 - ], - [ - 129.97291100400017, - -3.441501559999907 - ], - [ - 129.96363366000006, - -3.42831796699987 - ], - [ - 129.96127363399998, - -3.420098565999865 - ], - [ - 129.96225019600016, - -3.390801690999936 - ], - [ - 129.96127363399998, - -3.382256768999838 - ], - [ - 129.93384850400005, - -3.348321221999882 - ], - [ - 129.89047285200016, - -3.333103122999901 - ], - [ - 129.54493248800023, - -3.297784112999878 - ], - [ - 129.509613477, - -3.302504164999888 - ], - [ - 129.50196373800006, - -3.3344052059999 - ], - [ - 129.55144290500002, - -3.403252862999864 - ], - [ - 129.5632430350001, - -3.439629815999936 - ], - [ - 129.53003991000017, - -3.464776299999841 - ], - [ - 129.48560631600017, - -3.463474216999927 - ], - [ - 129.40154056100013, - -3.422946872999901 - ], - [ - 129.35808353000007, - -3.410088799999969 - ], - [ - 129.2361759770001, - -3.401625257999854 - ], - [ - 129.19361412900005, - -3.389743747999887 - ], - [ - 129.11353600400017, - -3.34880950299987 - ], - [ - 129.08432050900004, - -3.341241143999909 - ], - [ - 129.05844160200004, - -3.340752862999921 - ], - [ - 128.984222852, - -3.347426039999888 - ], - [ - 128.96078535200004, - -3.355564059999907 - ], - [ - 128.9396264980002, - -3.332614841999913 - ], - [ - 128.93767337300008, - -3.320407809999935 - ], - [ - 128.94703209700012, - -3.300225518999909 - ], - [ - 128.98194420700023, - -3.251885674999897 - ], - [ - 128.96892337300002, - -3.23300546699987 - ], - [ - 128.95289147200006, - -3.220391533999887 - ], - [ - 128.93336022200018, - -3.213555596999953 - ], - [ - 128.9095158210001, - -3.211521091999927 - ], - [ - 128.88965905000006, - -3.204359632999896 - ], - [ - 128.87745201900012, - -3.202569268999909 - ], - [ - 128.87208092500023, - -3.207777601999808 - ], - [ - 128.86915123800023, - -3.213636976999936 - ], - [ - 128.85092207100016, - -3.238213799999869 - ], - [ - 128.79216556100002, - -3.26043059699991 - ], - [ - 128.78272545700023, - -3.269219658999887 - ], - [ - 128.77686608200005, - -3.279392184999921 - ], - [ - 128.6925561860002, - -3.348728122999887 - ], - [ - 128.68637129000004, - -3.358575127999899 - ], - [ - 128.6843367850001, - -3.363864841999884 - ], - [ - 128.679535352, - -3.368747653999861 - ], - [ - 128.67497806100008, - -3.3754208309999 - ], - [ - 128.67286217500023, - -3.385918877999885 - ], - [ - 128.676036004, - -3.394789321 - ], - [ - 128.68327884200002, - -3.401055596999882 - ], - [ - 128.69044030000006, - -3.405694268999895 - ], - [ - 128.69385826900012, - -3.410088799999969 - ], - [ - 128.67758222700016, - -3.432305596999853 - ], - [ - 128.6359155610002, - -3.436618747999844 - ], - [ - 128.58692467500023, - -3.434340101999879 - ], - [ - 128.54932701900023, - -3.437432549999855 - ], - [ - 128.50831139400023, - -3.456963799999926 - ], - [ - 128.484141472, - -3.462497653999861 - ], - [ - 128.46420332100004, - -3.454522393999895 - ], - [ - 128.44971764400012, - -3.443291924999983 - ], - [ - 128.41618899800008, - -3.425957940999822 - ], - [ - 128.39918053500017, - -3.410088799999969 - ], - [ - 128.28207441499998, - -3.220879815999879 - ], - [ - 128.2721460300002, - -3.211521091999927 - ], - [ - 128.23096764400012, - -3.208754164999874 - ], - [ - 128.21143639400023, - -3.204278252999913 - ], - [ - 128.18287194100006, - -3.193780205999843 - ], - [ - 128.17872155000012, - -3.194268487999921 - ], - [ - 128.17855879000015, - -3.19101327899989 - ], - [ - 128.18018639400017, - -3.166761976999808 - ], - [ - 128.18588300900015, - -3.140720309999921 - ], - [ - 128.20004316500015, - -3.111423434999907 - ], - [ - 128.19678795700023, - -3.090915622999859 - ], - [ - 128.184336785, - -3.074395440999879 - ], - [ - 128.16578209700012, - -3.06698984199997 - ], - [ - 128.13575280000023, - -3.075372002999856 - ], - [ - 128.11060631600017, - -3.100030205999929 - ], - [ - 128.09066816499998, - -3.132012627999927 - ], - [ - 128.07691491000017, - -3.162530205999872 - ], - [ - 128.06657962300008, - -3.196954033999901 - ], - [ - 128.056895379, - -3.296807549999983 - ], - [ - 128.05307050899998, - -3.310642184999892 - ], - [ - 128.04420006600006, - -3.32577890399989 - ], - [ - 128.03150475400017, - -3.357679945999905 - ], - [ - 128.02222741000006, - -3.368584893999895 - ], - [ - 128.01417076900006, - -3.371351820999948 - ], - [ - 127.99390709700018, - -3.373711846999896 - ], - [ - 127.98755944100006, - -3.376071872999944 - ], - [ - 127.98145592500023, - -3.385023695999891 - ], - [ - 127.97559655000012, - -3.405043226999851 - ], - [ - 127.962168816, - -3.425713799999954 - ], - [ - 127.95289147200018, - -3.443942966999856 - ], - [ - 127.94027753999998, - -3.478448174999869 - ], - [ - 127.93588300900004, - -3.497002862999878 - ], - [ - 127.93718509200019, - -3.505547783999887 - ], - [ - 127.94385826900023, - -3.515720309999935 - ], - [ - 127.94263756600006, - -3.52166106599995 - ], - [ - 127.92920983200023, - -3.542738539999888 - ], - [ - 127.92603600400017, - -3.553480726999894 - ], - [ - 127.89861087300002, - -3.523858330999943 - ], - [ - 127.90308678500011, - -3.476657809999963 - ], - [ - 127.93344160200016, - -3.389743747999887 - ], - [ - 127.93384850400017, - -3.345310153999961 - ], - [ - 127.93018639400012, - -3.323337497999859 - ], - [ - 127.92302493600019, - -3.313897393999852 - ], - [ - 127.91570071700008, - -3.307224216999884 - ], - [ - 127.88575280000012, - -3.266208591999884 - ], - [ - 127.87525475400005, - -3.208754164999874 - ], - [ - 127.86801191500004, - -3.193780205999843 - ], - [ - 127.84229576900017, - -3.173272393999895 - ], - [ - 127.8439233730002, - -3.166110934999935 - ], - [ - 127.86475670700005, - -3.156345309999907 - ], - [ - 127.87403405000012, - -3.154392184999864 - ], - [ - 127.89649498800011, - -3.152113539999888 - ], - [ - 127.90560957100004, - -3.149509372999972 - ], - [ - 127.91627037900005, - -3.139906507999825 - ], - [ - 127.93873131600006, - -3.11337655999985 - ], - [ - 127.95069420700005, - -3.107842705999843 - ], - [ - 127.96729576900023, - -3.103692315999893 - ], - [ - 127.992930535, - -3.082614841999956 - ], - [ - 128.008067254, - -3.073663018999852 - ], - [ - 128.02564537900005, - -3.06861744599999 - ], - [ - 128.04615319100017, - -3.065850518999937 - ], - [ - 128.06666100400005, - -3.06698984199997 - ], - [ - 128.08375084700018, - -3.073663018999852 - ], - [ - 128.10368899800008, - -3.06698984199997 - ], - [ - 128.09180748800011, - -3.034600518999966 - ], - [ - 128.090586785, - -3.022149346999868 - ], - [ - 128.09498131600017, - -3.01091887799987 - ], - [ - 128.11410566500015, - -2.993584893999881 - ], - [ - 128.11793053500017, - -2.984307549999912 - ], - [ - 128.10629316500015, - -2.975518487999864 - ], - [ - 128.08497155000012, - -2.973890882999839 - ], - [ - 128.06999759200008, - -2.970635674999969 - ], - [ - 128.07691491000017, - -2.957696221999882 - ], - [ - 128.0854598320001, - -2.954847915000016 - ], - [ - 128.11215254000004, - -2.949965101999865 - ], - [ - 128.12110436300023, - -2.944512627999842 - ], - [ - 128.138926629, - -2.909844658999859 - ], - [ - 128.13648522200018, - -2.911879164999888 - ], - [ - 128.13624108200023, - -2.907647393999866 - ], - [ - 128.13746178500006, - -2.901299737999921 - ], - [ - 128.138926629, - -2.896172783999916 - ], - [ - 128.14323978000013, - -2.894626559999878 - ], - [ - 128.14991295700005, - -2.8949520809999 - ], - [ - 128.15609785200004, - -2.893243096999896 - ], - [ - 128.1588647800002, - -2.885674737999935 - ], - [ - 128.16089928500006, - -2.874118748 - ], - [ - 128.1666772800002, - -2.863946221999882 - ], - [ - 128.17546634200008, - -2.857028903999961 - ], - [ - 128.18677819100006, - -2.854668877999913 - ], - [ - 128.2124129570001, - -2.86052825299987 - ], - [ - 128.3810327480002, - -2.859958591999899 - ], - [ - 128.41732832099999, - -2.850518487999878 - ], - [ - 128.45972741000017, - -2.84628671699987 - ], - [ - 128.49854576900012, - -2.836521091999913 - ], - [ - 128.51587975400017, - -2.834161065999865 - ], - [ - 128.5378524100001, - -2.837172132999868 - ], - [ - 128.57545006600017, - -2.851332289999888 - ], - [ - 128.60075931100002, - -2.854668877999913 - ], - [ - 128.80054772200012, - -2.85621510199995 - ], - [ - 128.84229576900023, - -2.862237237999878 - ], - [ - 128.86524498800023, - -2.862074476999823 - ], - [ - 128.90821373800006, - -2.8554013 - ], - [ - 128.94727623800023, - -2.844414971999896 - ], - [ - 129.01596113400015, - -2.814222914999888 - ], - [ - 129.0529077480002, - -2.804457289999931 - ], - [ - 129.06885826900012, - -2.821221612999949 - ], - [ - 129.070567254, - -2.854913018999952 - ], - [ - 129.06446373800023, - -2.896172783999916 - ], - [ - 129.07943769600016, - -2.905368747999972 - ], - [ - 129.10523522200018, - -2.947930596999839 - ], - [ - 129.12183678500006, - -2.957696221999882 - ], - [ - 129.13314863400004, - -2.956475518999866 - ], - [ - 129.15259850400005, - -2.951348565999936 - ], - [ - 129.16285241000006, - -2.950290622999887 - ], - [ - 129.1691186860002, - -2.951348565999936 - ], - [ - 129.172129754, - -2.95387135199995 - ], - [ - 129.17416425900015, - -2.956475518999866 - ], - [ - 129.17709394600016, - -2.957696221999882 - ], - [ - 129.18539472700004, - -2.955173434999949 - ], - [ - 129.18433678500017, - -2.949151299999855 - ], - [ - 129.18051191500015, - -2.942152601999879 - ], - [ - 129.18051191500015, - -2.936618747999944 - ], - [ - 129.179942254, - -2.934258721999896 - ], - [ - 129.17823326900012, - -2.930433851999894 - ], - [ - 129.179453972, - -2.92644622199991 - ], - [ - 129.1873478520001, - -2.922946873 - ], - [ - 129.19190514400023, - -2.923028252999984 - ], - [ - 129.19532311300023, - -2.928399346999868 - ], - [ - 129.20045006600006, - -2.929782809999935 - ], - [ - 129.21159915500007, - -2.940850518999881 - ], - [ - 129.21851647200018, - -2.941176039999903 - ], - [ - 129.2214461600001, - -2.926364841999927 - ], - [ - 129.22779381600006, - -2.915215752999913 - ], - [ - 129.24317467500018, - -2.906833591999856 - ], - [ - 129.27613366000006, - -2.896172783999916 - ], - [ - 129.32837975400005, - -2.866794528999918 - ], - [ - 129.35840905000012, - -2.85621510199995 - ], - [ - 129.3641056650001, - -2.842054946000019 - ], - [ - 129.36646569100006, - -2.82398854 - ], - [ - 129.37289472700016, - -2.806817315999979 - ], - [ - 129.40023847700004, - -2.791599217 - ], - [ - 129.4435327480002, - -2.78492603999986 - ], - [ - 129.52320397200006, - -2.786309502999842 - ], - [ - 129.53484134200008, - -2.780043226999894 - ], - [ - 129.54102623800023, - -2.780043226999894 - ] - ] - ], - [ - [ - [ - 100.46753991000006, - -3.06698984199997 - ], - [ - 100.47331790500019, - -3.087172132999825 - ], - [ - 100.47291100400011, - -3.11394622199991 - ], - [ - 100.46452884200002, - -3.132500908999916 - ], - [ - 100.44703209700018, - -3.128350518999881 - ], - [ - 100.43718509200008, - -3.134372653999975 - ], - [ - 100.42652428500006, - -3.13640715899983 - ], - [ - 100.4158634770001, - -3.134372653999975 - ], - [ - 100.40601647200018, - -3.128350518999881 - ], - [ - 100.38640384200019, - -3.143812757999811 - ], - [ - 100.3807072270001, - -3.152520440999893 - ], - [ - 100.38868248800006, - -3.156345309999907 - ], - [ - 100.40211022200018, - -3.158868096999825 - ], - [ - 100.40316816500015, - -3.16545989399998 - ], - [ - 100.39942467500012, - -3.174248955999872 - ], - [ - 100.3986108730002, - -3.183526299999826 - ], - [ - 100.41163170700005, - -3.21347421699997 - ], - [ - 100.42652428500006, - -3.238213799999869 - ], - [ - 100.46697024800008, - -3.287286065999908 - ], - [ - 100.47828209700006, - -3.315199476999851 - ], - [ - 100.460703972, - -3.3344052059999 - ], - [ - 100.44825280000012, - -3.325372002999885 - ], - [ - 100.42937259200008, - -3.303155205999843 - ], - [ - 100.41895592500006, - -3.293389580999886 - ], - [ - 100.40788821700002, - -3.286879164999903 - ], - [ - 100.3860783210001, - -3.27752044099995 - ], - [ - 100.37867272200012, - -3.27239348799985 - ], - [ - 100.37761478000007, - -3.268161716999927 - ], - [ - 100.37867272200012, - -3.248711846999839 - ], - [ - 100.37623131600017, - -3.241143487999878 - ], - [ - 100.370371941, - -3.239515882999868 - ], - [ - 100.3636173840001, - -3.23984140399989 - ], - [ - 100.3582462900001, - -3.238213799999869 - ], - [ - 100.33692467500006, - -3.222588799999883 - ], - [ - 100.33041425900015, - -3.212985934999892 - ], - [ - 100.33033287900017, - -3.197360934999907 - ], - [ - 100.337168816, - -3.197360934999907 - ], - [ - 100.33920332100016, - -3.203220309999864 - ], - [ - 100.34245853000019, - -3.207696221999825 - ], - [ - 100.34734134200008, - -3.210544528999861 - ], - [ - 100.35450280000012, - -3.211521091999927 - ], - [ - 100.3601994150001, - -3.207452080999886 - ], - [ - 100.3558048840001, - -3.198337497999972 - ], - [ - 100.34400475400011, - -3.183526299999826 - ], - [ - 100.33765709700018, - -3.161553643999895 - ], - [ - 100.337168816, - -3.152927341999899 - ], - [ - 100.34351647200006, - -3.13640715899983 - ], - [ - 100.34522545700005, - -3.126560153999904 - ], - [ - 100.2923283210001, - -3.07708098799985 - ], - [ - 100.27735436300006, - -3.07293059699991 - ], - [ - 100.25928795700005, - -3.073174737999864 - ], - [ - 100.2482202480002, - -3.069431248 - ], - [ - 100.254649285, - -3.053317966999856 - ], - [ - 100.24415123800006, - -3.044040622999901 - ], - [ - 100.2132267590001, - -3.006931247999887 - ], - [ - 100.20679772200018, - -2.994886976999879 - ], - [ - 100.20362389400012, - -2.983819268999923 - ], - [ - 100.18946373800011, - -2.966566664999917 - ], - [ - 100.18628991000006, - -2.95387135199995 - ], - [ - 100.18848717500012, - -2.941664320999891 - ], - [ - 100.19776451900006, - -2.929294528999861 - ], - [ - 100.19996178500017, - -2.919854424999926 - ], - [ - 100.19752037900011, - -2.896254164999903 - ], - [ - 100.17945397200012, - -2.827325127999856 - ], - [ - 100.178965691, - -2.802911065999893 - ], - [ - 100.18913821700008, - -2.791192315999822 - ], - [ - 100.22730553500006, - -2.772637627999899 - ], - [ - 100.24024498800006, - -2.778252862999906 - ], - [ - 100.24903405000012, - -2.784356377999899 - ], - [ - 100.25538170700005, - -2.791436455999943 - ], - [ - 100.27507571700008, - -2.820489190999922 - ], - [ - 100.28150475400017, - -2.826104424999841 - ], - [ - 100.28638756600006, - -2.828708591999927 - ], - [ - 100.2908634770001, - -2.830661716999884 - ], - [ - 100.29615319100012, - -2.834161065999865 - ], - [ - 100.35434004000015, - -2.894463799999912 - ], - [ - 100.3851017590001, - -2.914646091999842 - ], - [ - 100.4158634770001, - -2.965915622999873 - ], - [ - 100.46753991000006, - -3.015313408999845 - ], - [ - 100.47144616000006, - -3.037855726999837 - ], - [ - 100.4720158210001, - -3.051690362999835 - ], - [ - 100.46753991000006, - -3.06698984199997 - ] - ] - ], - [ - [ - [ - 131.59815514400017, - -2.65390390399989 - ], - [ - 131.57886803500006, - -2.656019789999888 - ], - [ - 131.572520379, - -2.651055596999853 - ], - [ - 131.579356316, - -2.644626559999921 - ], - [ - 131.59937584700018, - -2.634860934999892 - ], - [ - 131.62598717500012, - -2.619561455999843 - ], - [ - 131.639903191, - -2.613702080999971 - ], - [ - 131.65463300899998, - -2.613213799999983 - ], - [ - 131.64405358200023, - -2.62867604 - ], - [ - 131.6225692070001, - -2.643649997999944 - ], - [ - 131.59815514400017, - -2.65390390399989 - ] - ] - ], - [ - [ - [ - 107.84815514400006, - -2.549899997999859 - ], - [ - 107.88347415500019, - -2.564222915000016 - ], - [ - 107.91968834700006, - -2.568617445999919 - ], - [ - 107.93620853000019, - -2.563571872999972 - ], - [ - 107.9884546230002, - -2.574151299999841 - ], - [ - 108.00513756600006, - -2.580254815999837 - ], - [ - 108.0140080090001, - -2.591078382999825 - ], - [ - 108.03239993600008, - -2.642347914999945 - ], - [ - 108.03980553500006, - -2.642347914999945 - ], - [ - 108.04623457100016, - -2.614922783999987 - ], - [ - 108.05307050900015, - -2.602797132999825 - ], - [ - 108.06657962300002, - -2.594496351999922 - ], - [ - 108.09791100400017, - -2.608168226999865 - ], - [ - 108.10417728000002, - -2.612399997999972 - ], - [ - 108.11451256600006, - -2.630629164999874 - ], - [ - 108.11841881600006, - -2.634942315999879 - ], - [ - 108.13559004000015, - -2.63925546699987 - ], - [ - 108.14958743600002, - -2.650323174999912 - ], - [ - 108.15894616000017, - -2.665785414999931 - ], - [ - 108.16277103000007, - -2.683282158999887 - ], - [ - 108.18279056100002, - -2.673516533999845 - ], - [ - 108.19776451900006, - -2.678155205999957 - ], - [ - 108.26726321700019, - -2.757419528999918 - ], - [ - 108.27613366000006, - -2.793877862999892 - ], - [ - 108.2908634770001, - -2.828708591999927 - ], - [ - 108.29371178500017, - -2.848402601999879 - ], - [ - 108.28874759200014, - -2.866631768999852 - ], - [ - 108.27914472700016, - -2.880140882999839 - ], - [ - 108.27003014400006, - -2.890801690999865 - ], - [ - 108.26579837300002, - -2.899590752999828 - ], - [ - 108.25668379000015, - -2.926202080999872 - ], - [ - 108.21558678500006, - -2.978692315999822 - ], - [ - 108.20435631600006, - -3.005466404 - ], - [ - 108.2049259770001, - -3.014580987999906 - ], - [ - 108.21021569100017, - -3.030450127999842 - ], - [ - 108.21062259200019, - -3.039646091999913 - ], - [ - 108.20777428500017, - -3.049411716999941 - ], - [ - 108.1993921230002, - -3.06861744599999 - ], - [ - 108.19752037900005, - -3.07708098799985 - ], - [ - 108.19532311300006, - -3.081475518999923 - ], - [ - 108.190684441, - -3.087497653999847 - ], - [ - 108.18604576900006, - -3.095472914999888 - ], - [ - 108.18384850400011, - -3.104750257999854 - ], - [ - 108.1876733730002, - -3.112074476999851 - ], - [ - 108.2049259770001, - -3.12590911299985 - ], - [ - 108.21062259200019, - -3.135837497999859 - ], - [ - 108.1876733730002, - -3.136895440999908 - ], - [ - 108.1521916020001, - -3.15243906 - ], - [ - 108.13209069100017, - -3.156345309999907 - ], - [ - 108.1087345710001, - -3.157159112999821 - ], - [ - 108.09083092500012, - -3.161390882999839 - ], - [ - 108.07911217500012, - -3.171807549999841 - ], - [ - 108.073985222, - -3.190362237999835 - ], - [ - 108.073985222, - -3.226006768999881 - ], - [ - 108.06413821700019, - -3.231052342 - ], - [ - 108.03614342500006, - -3.232028903999975 - ], - [ - 108.01197350400017, - -3.236504815999865 - ], - [ - 107.9939884770001, - -3.242445570999877 - ], - [ - 107.98096764400006, - -3.23984140399989 - ], - [ - 107.97095787900017, - -3.217705987999906 - ], - [ - 107.96973717500006, - -3.172133070999948 - ], - [ - 107.96607506600017, - -3.150974216999856 - ], - [ - 107.94141686300011, - -3.134454033999958 - ], - [ - 107.88843834700006, - -3.087497653999847 - ], - [ - 107.8904728520001, - -3.086114190999865 - ], - [ - 107.89136803500017, - -3.079278252999842 - ], - [ - 107.88917076900012, - -3.069594007999967 - ], - [ - 107.8821720710001, - -3.060153903999876 - ], - [ - 107.8704533210001, - -3.051690362999835 - ], - [ - 107.86500084700018, - -3.052666924999983 - ], - [ - 107.85906009200008, - -3.057305596999839 - ], - [ - 107.84473717500006, - -3.060153903999876 - ], - [ - 107.82545006600006, - -3.066176039999959 - ], - [ - 107.82545006600006, - -3.080661716999913 - ], - [ - 107.8411564460001, - -3.107842705999843 - ], - [ - 107.84180748800006, - -3.145440362999921 - ], - [ - 107.81519616, - -3.167250257999967 - ], - [ - 107.75314994000016, - -3.19845519199994 - ], - [ - 107.686271377, - -3.198206957999929 - ], - [ - 107.65883946100021, - -3.232633893999861 - ], - [ - 107.63139902600008, - -3.240863766 - ], - [ - 107.60279400700009, - -3.228857672999865 - ], - [ - 107.59449787800006, - -3.206238452999912 - ], - [ - 107.6052663130001, - -3.176545423999897 - ], - [ - 107.64079837300008, - -3.132582289999988 - ], - [ - 107.64258873800006, - -3.128350518999881 - ], - [ - 107.64039147200018, - -3.121677341999927 - ], - [ - 107.6355900400001, - -3.117608330999957 - ], - [ - 107.631114129, - -3.114515882999882 - ], - [ - 107.62468509200019, - -3.105401299999897 - ], - [ - 107.59791100400011, - -3.083916924999954 - ], - [ - 107.5935978520001, - -3.074965101999851 - ], - [ - 107.59343509200002, - -3.063164971999868 - ], - [ - 107.59449303500017, - -3.050469658999901 - ], - [ - 107.59424889400006, - -3.039646091999913 - ], - [ - 107.59034264400006, - -3.029229424999826 - ], - [ - 107.58521569100006, - -3.020277601999808 - ], - [ - 107.58106530000012, - -3.010674737999821 - ], - [ - 107.58057701900012, - -2.997979424999855 - ], - [ - 107.58594811300006, - -2.98560963299991 - ], - [ - 107.6043400400001, - -2.964043877999913 - ], - [ - 107.60840905000006, - -2.95387135199995 - ], - [ - 107.61101321700008, - -2.917901299999883 - ], - [ - 107.6053166020001, - -2.913750908999859 - ], - [ - 107.58741295700011, - -2.916680596999868 - ], - [ - 107.56267337300008, - -2.927666924999841 - ], - [ - 107.55298912900011, - -2.927992445999948 - ], - [ - 107.54712975400005, - -2.916680596999868 - ], - [ - 107.54908287900011, - -2.904961846999967 - ], - [ - 107.55795332100016, - -2.893975518999838 - ], - [ - 107.57056725400005, - -2.885837497999901 - ], - [ - 107.58399498800011, - -2.882500908999887 - ], - [ - 107.6033634770001, - -2.871026299999926 - ], - [ - 107.60962975400017, - -2.843682549999869 - ], - [ - 107.60572350400017, - -2.811781507999854 - ], - [ - 107.59424889400006, - -2.786309502999842 - ], - [ - 107.60710696700008, - -2.780938408999887 - ], - [ - 107.62305748800006, - -2.770603122999873 - ], - [ - 107.63672936300011, - -2.75855885199995 - ], - [ - 107.64258873800006, - -2.7484677059999 - ], - [ - 107.63868248800006, - -2.684991143999895 - ], - [ - 107.65455162900017, - -2.584893487999864 - ], - [ - 107.67025800900015, - -2.561455987999963 - ], - [ - 107.71143639400012, - -2.552911065999865 - ], - [ - 107.72779381600006, - -2.5531552059999 - ], - [ - 107.75660241000017, - -2.560642184999864 - ], - [ - 107.77295983200011, - -2.560316664999931 - ], - [ - 107.78907311300006, - -2.553806247999859 - ], - [ - 107.81836998800006, - -2.531914971999825 - ], - [ - 107.8343205090001, - -2.525079033999901 - ], - [ - 107.84815514400006, - -2.549899997999859 - ] - ] - ], - [ - [ - [ - 100.20411217500012, - -2.759942315999851 - ], - [ - 100.17237389400006, - -2.765557549999855 - ], - [ - 100.15894616000006, - -2.772637627999899 - ], - [ - 100.15137780000012, - -2.784844658999887 - ], - [ - 100.14519290500002, - -2.811130466999899 - ], - [ - 100.13851972700016, - -2.820489190999922 - ], - [ - 100.11524498800006, - -2.827894789999917 - ], - [ - 100.08985436300006, - -2.824395440999837 - ], - [ - 100.06666100400011, - -2.815524997999887 - ], - [ - 100.04965254000015, - -2.806817315999979 - ], - [ - 100.04476972700016, - -2.820896091999927 - ], - [ - 100.03834069100017, - -2.83375416499986 - ], - [ - 100.02930748800006, - -2.840101820999976 - ], - [ - 100.01563561300011, - -2.834161065999865 - ], - [ - 100.00782311300011, - -2.819512627999856 - ], - [ - 100.00700931100019, - -2.781914971999868 - ], - [ - 100.0013126960001, - -2.765313408999901 - ], - [ - 99.98682701900006, - -2.767185153999876 - ], - [ - 99.9884546230002, - -2.744886976999837 - ], - [ - 100.0013126960001, - -2.686700127999899 - ], - [ - 100.00049889400012, - -2.658868096999925 - ], - [ - 99.9962671230002, - -2.638767184999892 - ], - [ - 99.98601321700008, - -2.624688408999845 - ], - [ - 99.96713300900015, - -2.615004164999888 - ], - [ - 99.97575931100008, - -2.603448174999869 - ], - [ - 99.97559655000006, - -2.594903252999927 - ], - [ - 99.96713300900015, - -2.580254815999837 - ], - [ - 99.96143639400006, - -2.559014580999843 - ], - [ - 99.96094811300006, - -2.552911065999865 - ], - [ - 99.96729576900012, - -2.514906507999939 - ], - [ - 99.97461998800011, - -2.493910414999903 - ], - [ - 99.98414147200012, - -2.484633070999863 - ], - [ - 100.00294030000006, - -2.49089934699991 - ], - [ - 100.01368248800006, - -2.504815362999892 - ], - [ - 100.02173912900011, - -2.51873137799987 - ], - [ - 100.03239993600002, - -2.525079033999901 - ], - [ - 100.08708743600019, - -2.57626718499985 - ], - [ - 100.10759524800002, - -2.600274346999896 - ], - [ - 100.11744225400017, - -2.608168226999865 - ], - [ - 100.15211022200006, - -2.618584893999866 - ], - [ - 100.16667728000007, - -2.627862237999821 - ], - [ - 100.17261803500017, - -2.645765882999953 - ], - [ - 100.17798912900011, - -2.655938408999916 - ], - [ - 100.20142662900011, - -2.678155205999957 - ], - [ - 100.20679772200018, - -2.693536065999822 - ], - [ - 100.20972741000011, - -2.707696221999925 - ], - [ - 100.21517988400015, - -2.723565362999949 - ], - [ - 100.21859785200016, - -2.739353122999901 - ], - [ - 100.21517988400015, - -2.752862237999878 - ], - [ - 100.20411217500012, - -2.759942315999851 - ] - ] - ], - [ - [ - [ - 133.53907311300011, - -2.440118096999868 - ], - [ - 133.55388431100008, - -2.449883721999981 - ], - [ - 133.55396569100006, - -2.442966403999904 - ], - [ - 133.5602319670002, - -2.443047783999887 - ], - [ - 133.57081139400023, - -2.45094166499986 - ], - [ - 133.58375084700006, - -2.458672783999873 - ], - [ - 133.59180748800011, - -2.461521091999899 - ], - [ - 133.60547936300023, - -2.468031507999811 - ], - [ - 133.60580488400015, - -2.488946221999868 - ], - [ - 133.585215691, - -2.512627862999963 - ], - [ - 133.56299889400023, - -2.512872002999913 - ], - [ - 133.56169681100008, - -2.508721612999878 - ], - [ - 133.55738366000006, - -2.5043270809999 - ], - [ - 133.52328535200016, - -2.487969658999887 - ], - [ - 133.513519727, - -2.476006768999852 - ], - [ - 133.50709069100017, - -2.460219007999811 - ], - [ - 133.49789472700004, - -2.446384372999901 - ], - [ - 133.49000084700006, - -2.431247653999904 - ], - [ - 133.50586998800006, - -2.424493096999882 - ], - [ - 133.53907311300011, - -2.440118096999868 - ] - ] - ], - [ - [ - [ - 134.56690514400023, - -2.450453382999953 - ], - [ - 134.54965254000004, - -2.451348565999865 - ], - [ - 134.53728274800008, - -2.445733330999857 - ], - [ - 134.53443444100006, - -2.435642184999978 - ], - [ - 134.54639733200005, - -2.422621351999823 - ], - [ - 134.52149498800023, - -2.4066708309999 - ], - [ - 134.52426191499998, - -2.392266533999845 - ], - [ - 134.55372155000006, - -2.367364190999979 - ], - [ - 134.56023196700008, - -2.351495049999954 - ], - [ - 134.56421959700006, - -2.329847914999874 - ], - [ - 134.56690514400023, - -2.292901299999841 - ], - [ - 134.57683353000002, - -2.29851653399983 - ], - [ - 134.58130944100017, - -2.307875257999868 - ], - [ - 134.58228600400017, - -2.319756768999824 - ], - [ - 134.5812280610002, - -2.33269622199991 - ], - [ - 134.5812280610002, - -2.416436455999929 - ], - [ - 134.58366946700008, - -2.438409112999864 - ], - [ - 134.58025149800002, - -2.445082289999903 - ], - [ - 134.56690514400023, - -2.450453382999953 - ] - ] - ], - [ - [ - [ - 99.7072046230002, - -2.127699476999865 - ], - [ - 99.72136478000013, - -2.159112237999892 - ], - [ - 99.77540123800011, - -2.237562757999925 - ], - [ - 99.77588951900012, - -2.242445570999905 - ], - [ - 99.7742619150001, - -2.254327080999943 - ], - [ - 99.77540123800011, - -2.25872161299985 - ], - [ - 99.77881920700011, - -2.261651299999869 - ], - [ - 99.78581790500019, - -2.263441664999945 - ], - [ - 99.81462649800002, - -2.284356377999899 - ], - [ - 99.82325280000006, - -2.292901299999841 - ], - [ - 99.84961998800006, - -2.333916924999926 - ], - [ - 99.8587345710001, - -2.356866143999838 - ], - [ - 99.85792076900012, - -2.374769789999888 - ], - [ - 99.85792076900012, - -2.367364190999979 - ], - [ - 99.85336347700016, - -2.377618096999825 - ], - [ - 99.84620201900012, - -2.380059502999856 - ], - [ - 99.8396916020001, - -2.375258070999877 - ], - [ - 99.8333439460001, - -2.352308851999965 - ], - [ - 99.82455488400015, - -2.347588799999869 - ], - [ - 99.79957116, - -2.347426039999903 - ], - [ - 99.78809655000006, - -2.34441497199991 - ], - [ - 99.77995853000007, - -2.337009373 - ], - [ - 99.77214603000007, - -2.328220309999864 - ], - [ - 99.76172936300006, - -2.320896091999856 - ], - [ - 99.74976647200006, - -2.318047783999901 - ], - [ - 99.72510826900006, - -2.317071221999925 - ], - [ - 99.71338951900006, - -2.313409112999878 - ], - [ - 99.69922936300006, - -2.300876559999878 - ], - [ - 99.68702233200005, - -2.284926039999959 - ], - [ - 99.6717228520001, - -2.271254165000016 - ], - [ - 99.64844811300011, - -2.265557549999855 - ], - [ - 99.61085045700011, - -2.267185153999876 - ], - [ - 99.60352623800011, - -2.265557549999855 - ], - [ - 99.60254967500012, - -2.253024997999944 - ], - [ - 99.61158287900011, - -2.242771091999927 - ], - [ - 99.61646569100017, - -2.233575127999856 - ], - [ - 99.60352623800011, - -2.224053643999866 - ], - [ - 99.59766686300006, - -2.229099216999899 - ], - [ - 99.5939233730002, - -2.227797132999896 - ], - [ - 99.59148196700008, - -2.221368096999967 - ], - [ - 99.58985436300006, - -2.211032809999878 - ], - [ - 99.58301842500012, - -2.211032809999878 - ], - [ - 99.57618248800011, - -2.224053643999866 - ], - [ - 99.56771894600016, - -2.215101820999934 - ], - [ - 99.55567467500006, - -2.183038018999852 - ], - [ - 99.53126061300011, - -2.155938408999916 - ], - [ - 99.52767988400015, - -2.145440362999864 - ], - [ - 99.53101647200018, - -2.134209893999852 - ], - [ - 99.53842207100016, - -2.131768487999821 - ], - [ - 99.55225670700005, - -2.135349216999884 - ], - [ - 99.56446373800011, - -2.131117445999877 - ], - [ - 99.56226647200006, - -2.121677341999941 - ], - [ - 99.54883873800006, - -2.101169528999904 - ], - [ - 99.54835045700005, - -2.061455987999892 - ], - [ - 99.56495201900012, - -2.030857028999876 - ], - [ - 99.59400475400011, - -2.014825127999885 - ], - [ - 99.63135826900006, - -2.018487237999835 - ], - [ - 99.64332116000017, - -2.028415622999844 - ], - [ - 99.65186608200011, - -2.042087497999958 - ], - [ - 99.66285241000017, - -2.054294528999847 - ], - [ - 99.68262780000006, - -2.05950286299985 - ], - [ - 99.69434655000006, - -2.067803643999824 - ], - [ - 99.70053144600016, - -2.087497653999861 - ], - [ - 99.7072046230002, - -2.127699476999865 - ] - ] - ], - [ - [ - [ - 123.88786868600019, - -2.050876559999935 - ], - [ - 123.88965905000012, - -2.063246351999879 - ], - [ - 123.88697350400005, - -2.073907158999901 - ], - [ - 123.88054446700019, - -2.069431247999844 - ], - [ - 123.8693139980002, - -2.05331796699987 - ], - [ - 123.86426842500006, - -2.055108330999857 - ], - [ - 123.849864129, - -2.054864190999908 - ], - [ - 123.83936608200023, - -2.049086195999948 - ], - [ - 123.84538821700002, - -2.035577080999886 - ], - [ - 123.85987389400012, - -2.010511976999965 - ], - [ - 123.86744225400005, - -2.00554778399983 - ], - [ - 123.87671959700018, - -2.018487237999835 - ], - [ - 123.87891686300006, - -2.03232187299993 - ], - [ - 123.88786868600019, - -2.050876559999935 - ] - ] - ], - [ - [ - [ - 134.37745201900006, - -2.149834893999838 - ], - [ - 134.35987389400023, - -2.153252862999935 - ], - [ - 134.34034264400023, - -2.135349216999884 - ], - [ - 134.33236738400004, - -2.111097914999903 - ], - [ - 134.33326256600012, - -2.083265882999854 - ], - [ - 134.34034264400023, - -2.055840752999885 - ], - [ - 134.35059655000006, - -2.032647393999866 - ], - [ - 134.35670006600017, - -2.022881768999909 - ], - [ - 134.36451256600017, - -2.013767185 - ], - [ - 134.37378991, - -2.006931247999901 - ], - [ - 134.38502037900005, - -2.003594658999887 - ], - [ - 134.39747155000023, - -2.005791924999869 - ], - [ - 134.41065514400006, - -2.012465101999837 - ], - [ - 134.42156009200008, - -2.022230726999865 - ], - [ - 134.426524285, - -2.033298434999907 - ], - [ - 134.42628014400006, - -2.03972747199991 - ], - [ - 134.42432701900012, - -2.045993747999873 - ], - [ - 134.39747155000023, - -2.091973565999837 - ], - [ - 134.39014733200023, - -2.131442966999899 - ], - [ - 134.37745201900006, - -2.149834893999838 - ] - ] - ], - [ - [ - [ - 126.07585696700008, - -2.462985934999864 - ], - [ - 126.04615319100006, - -2.474216403999876 - ], - [ - 126.01343834700012, - -2.459567966999856 - ], - [ - 125.9845483730002, - -2.431329033999887 - ], - [ - 125.96599368600019, - -2.40211353999986 - ], - [ - 125.95777428500017, - -2.369235934999949 - ], - [ - 125.95476321700019, - -2.302178643999966 - ], - [ - 125.9461369150001, - -2.271742446 - ], - [ - 125.93726647200006, - -2.260837497999859 - ], - [ - 125.911875847, - -2.239678643999852 - ], - [ - 125.904551629, - -2.231377862999864 - ], - [ - 125.90040123800017, - -2.217705987999921 - ], - [ - 125.89771569100017, - -2.169366143999909 - ], - [ - 125.88770592500012, - -2.142347914999874 - ], - [ - 125.87338300900004, - -2.115492445999891 - ], - [ - 125.862559441, - -2.086602471999868 - ], - [ - 125.86353600400011, - -2.05331796699987 - ], - [ - 125.86996504000004, - -2.035577080999886 - ], - [ - 125.87940514400012, - -2.018487237999835 - ], - [ - 125.90259850400017, - -1.987888278999918 - ], - [ - 125.9163517590001, - -1.973890882999854 - ], - [ - 125.92457116000017, - -1.968194268999881 - ], - [ - 125.93336022200006, - -1.96453215899983 - ], - [ - 125.94459069100006, - -1.965427341999913 - ], - [ - 125.95525149800008, - -1.9711239559999 - ], - [ - 125.98536217500012, - -1.993747653999947 - ], - [ - 125.99341881600006, - -2.003594658999887 - ], - [ - 125.99878991000011, - -2.01523202899989 - ], - [ - 126.00098717500006, - -2.028252862999878 - ], - [ - 125.99732506600006, - -2.055352471999896 - ], - [ - 125.97877037900005, - -2.108168226999965 - ], - [ - 125.9728296230002, - -2.135349216999884 - ], - [ - 125.97722415500019, - -2.180352471999882 - ], - [ - 126.06511478000007, - -2.363946221999882 - ], - [ - 126.06910241000006, - -2.38445403399993 - ], - [ - 126.07447350400017, - -2.406508070999934 - ], - [ - 126.08423912900005, - -2.423923434999907 - ], - [ - 126.08806399800002, - -2.441094658999845 - ], - [ - 126.07585696700008, - -2.462985934999864 - ] - ] - ], - [ - [ - [ - 124.37208092500023, - -1.992608330999914 - ], - [ - 124.37029056100008, - -2.038995049999883 - ], - [ - 124.35840905000012, - -2.033298434999907 - ], - [ - 124.33472741000011, - -2.004978122999859 - ], - [ - 124.32545006600006, - -2.001153252999856 - ], - [ - 124.31421959700006, - -1.999444268999852 - ], - [ - 124.30469811300023, - -1.996026299999841 - ], - [ - 124.30062910199999, - -1.987481377999913 - ], - [ - 124.30567467500012, - -1.973402601999865 - ], - [ - 124.31812584700006, - -1.963962497999859 - ], - [ - 124.33383222699999, - -1.959242445999934 - ], - [ - 124.348887566, - -1.959567966999956 - ], - [ - 124.36622155000012, - -1.971286716999856 - ], - [ - 124.37208092500023, - -1.992608330999914 - ] - ] - ], - [ - [ - [ - 123.66382897200006, - -1.963311455999985 - ], - [ - 123.65699303500006, - -1.963311455999985 - ], - [ - 123.65162194100017, - -1.949395440999837 - ], - [ - 123.64958743600008, - -1.934177341999856 - ], - [ - 123.64958743600008, - -1.901788018999852 - ], - [ - 123.65699303500006, - -1.901788018999852 - ], - [ - 123.65699303500006, - -1.909356377999885 - ], - [ - 123.66439863400004, - -1.948907158999845 - ], - [ - 123.66382897200006, - -1.963311455999985 - ] - ] - ], - [ - [ - [ - 123.74048912900005, - -1.940524997999873 - ], - [ - 123.71168053500017, - -1.957126559999935 - ], - [ - 123.70557701900012, - -1.933770440999851 - ], - [ - 123.71290123800011, - -1.911716403999932 - ], - [ - 123.72608483200023, - -1.899997653999861 - ], - [ - 123.73804772200018, - -1.90789153399983 - ], - [ - 123.73951256600006, - -1.915948174999869 - ], - [ - 123.74634850400017, - -1.929131768999824 - ], - [ - 123.74577884200019, - -1.935967705999843 - ], - [ - 123.74048912900005, - -1.940524997999873 - ] - ] - ], - [ - [ - [ - 123.86443118600002, - -1.989434502999856 - ], - [ - 123.8693139980002, - -1.99814218499985 - ], - [ - 123.85621178500006, - -1.992445570999948 - ], - [ - 123.84782962300008, - -1.995538018999852 - ], - [ - 123.84058678500006, - -2.001641533999845 - ], - [ - 123.83179772200018, - -2.004978122999859 - ], - [ - 123.80909264400023, - -1.999688408999887 - ], - [ - 123.79420006600017, - -1.992120049999926 - ], - [ - 123.78736412900017, - -1.980645440999893 - ], - [ - 123.77328535200004, - -1.922621351999823 - ], - [ - 123.77173912900017, - -1.895603122999958 - ], - [ - 123.78736412900017, - -1.873955987999878 - ], - [ - 123.84473717500012, - -1.928643487999835 - ], - [ - 123.85238691500004, - -1.938734632999896 - ], - [ - 123.85743248800023, - -1.950372002999899 - ], - [ - 123.86443118600002, - -1.989434502999856 - ] - ] - ], - [ - [ - [ - 125.42212975400005, - -1.794122002999856 - ], - [ - 125.43083743600002, - -1.79827239399998 - ], - [ - 125.44019616000017, - -1.798028252999941 - ], - [ - 125.45948326900012, - -1.792657158999901 - ], - [ - 125.47413170700011, - -1.7811825499999 - ], - [ - 125.48324629000004, - -1.776950778999932 - ], - [ - 125.48747806100002, - -1.782403252999956 - ], - [ - 125.48780358200023, - -1.79021575299987 - ], - [ - 125.48910566500015, - -1.797784112999821 - ], - [ - 125.49195397200018, - -1.80339934699991 - ], - [ - 125.49708092500012, - -1.805759372999873 - ], - [ - 125.558848504, - -1.798028252999941 - ], - [ - 125.58985436300023, - -1.79908619599999 - ], - [ - 125.61036217500006, - -1.813164971999939 - ], - [ - 125.62533613400004, - -1.809828382999825 - ], - [ - 125.70289147200018, - -1.81926848799985 - ], - [ - 125.71273847699999, - -1.817803643999881 - ], - [ - 125.72396894599999, - -1.814060153999932 - ], - [ - 125.73487389400006, - -1.808689059999892 - ], - [ - 125.75562584700018, - -1.794528903999861 - ], - [ - 125.76563561300023, - -1.793715101999851 - ], - [ - 125.78785241, - -1.799493096999825 - ], - [ - 125.828868035, - -1.801527601999851 - ], - [ - 125.9461369150001, - -1.785821221999882 - ], - [ - 125.99341881600006, - -1.785821221999882 - ], - [ - 126.11670983200011, - -1.805759372999873 - ], - [ - 126.28882897200018, - -1.813164971999939 - ], - [ - 126.32911217500023, - -1.81926848799985 - ], - [ - 126.34148196700019, - -1.820000908999873 - ], - [ - 126.34522545700023, - -1.817640882999825 - ], - [ - 126.34449303500017, - -1.818780205999857 - ], - [ - 126.34327233200005, - -1.829847914999974 - ], - [ - 126.33594811300006, - -1.837985934999907 - ], - [ - 126.27214603000002, - -1.86728281 - ], - [ - 126.25806725400011, - -1.869073174999912 - ], - [ - 126.22348066499998, - -1.867771091999913 - ], - [ - 126.20150800899998, - -1.870538018999881 - ], - [ - 126.19044030000023, - -1.873793226999823 - ], - [ - 126.18572024800002, - -1.877618096999925 - ], - [ - 126.17994225400017, - -1.884454033999859 - ], - [ - 126.16700280000018, - -1.885023695999919 - ], - [ - 126.144786004, - -1.881442966999856 - ], - [ - 126.05909264400023, - -1.888278903999876 - ], - [ - 126.04997806100008, - -1.890313408999901 - ], - [ - 126.02426191499998, - -1.901788018999852 - ], - [ - 125.99073326900023, - -1.900567315999837 - ], - [ - 125.98023522200018, - -1.901788018999852 - ], - [ - 125.94849694100006, - -1.922946872999844 - ], - [ - 125.92758222700016, - -1.931410414999888 - ], - [ - 125.90821373800023, - -1.925713799999897 - ], - [ - 125.88770592500012, - -1.909274997999901 - ], - [ - 125.87175540500019, - -1.902520440999879 - ], - [ - 125.85596764400023, - -1.903415622999873 - ], - [ - 125.78744550900004, - -1.918715101999837 - ], - [ - 125.62029056100019, - -1.915622653999847 - ], - [ - 125.599864129, - -1.918633721999853 - ], - [ - 125.55274498800011, - -1.93279387799987 - ], - [ - 125.53109785200004, - -1.935967705999843 - ], - [ - 125.48340905000018, - -1.935967705999843 - ], - [ - 125.468516472, - -1.937758070999919 - ], - [ - 125.43213951900023, - -1.949639580999872 - ], - [ - 125.43799889400006, - -1.932549737999835 - ], - [ - 125.43970787900017, - -1.91326262799997 - ], - [ - 125.43775475400005, - -1.89511484199997 - ], - [ - 125.43213951900023, - -1.881442966999856 - ], - [ - 125.42335045700005, - -1.875095309999921 - ], - [ - 125.38062584700006, - -1.854099216999884 - ], - [ - 125.37183678500017, - -1.858330987999892 - ], - [ - 125.36638431100008, - -1.877129815999936 - ], - [ - 125.35645592500023, - -1.881442966999856 - ], - [ - 125.34880618600013, - -1.877862237999963 - ], - [ - 125.34205162900017, - -1.869317315999865 - ], - [ - 125.337168816, - -1.859144789999903 - ], - [ - 125.33529707100016, - -1.850681247999873 - ], - [ - 125.33814537900017, - -1.828057549999897 - ], - [ - 125.34693444100006, - -1.810967705999857 - ], - [ - 125.36207116000006, - -1.802422783999845 - ], - [ - 125.37794030000006, - -1.799248955999957 - ], - [ - 125.37891686300023, - -1.789971612999821 - ], - [ - 125.38404381600017, - -1.7811825499999 - ], - [ - 125.39063561300023, - -1.775974216999856 - ], - [ - 125.40211022200018, - -1.774672132999868 - ], - [ - 125.40967858200023, - -1.779229424999897 - ], - [ - 125.42212975400005, - -1.794122002999856 - ] - ] - ], - [ - [ - [ - 123.09669030000012, - -1.895277601999936 - ], - [ - 123.08472741000017, - -1.901788018999852 - ], - [ - 123.07276451900023, - -1.901625257999882 - ], - [ - 123.06739342500006, - -1.891696872999873 - ], - [ - 123.07007897200018, - -1.840752862999864 - ], - [ - 123.07447350400005, - -1.818942966999913 - ], - [ - 123.09017988400004, - -1.779961846999925 - ], - [ - 123.09343509200008, - -1.768243096999853 - ], - [ - 123.09457441499998, - -1.755059502999899 - ], - [ - 123.10206139400017, - -1.748467705999914 - ], - [ - 123.117442254, - -1.752862237999906 - ], - [ - 123.13103274800008, - -1.760918877999842 - ], - [ - 123.13282311300023, - -1.765313408999916 - ], - [ - 123.14323978000002, - -1.775485934999878 - ], - [ - 123.15154056100013, - -1.798760674999969 - ], - [ - 123.15284264400012, - -1.82382577899989 - ], - [ - 123.14242597700004, - -1.839776299999897 - ], - [ - 123.13013756600017, - -1.846774997999958 - ], - [ - 123.11703535199999, - -1.857842705999914 - ], - [ - 123.10645592500023, - -1.871189059999921 - ], - [ - 123.10206139400017, - -1.884860934999864 - ], - [ - 123.09669030000012, - -1.895277601999936 - ] - ] - ], - [ - [ - [ - 134.19166100400017, - -1.92148202899989 - ], - [ - 134.17514082099999, - -1.943454684999892 - ], - [ - 134.1616317070001, - -1.89511484199997 - ], - [ - 134.1616317070001, - -1.877536716999941 - ], - [ - 134.16895592500012, - -1.829847914999974 - ], - [ - 134.22681725400005, - -1.744235934999907 - ], - [ - 134.23585045700023, - -1.738539320999919 - ], - [ - 134.24822024800008, - -1.743910414999874 - ], - [ - 134.25001061300017, - -1.761488539999903 - ], - [ - 134.24480228000007, - -1.796075127999899 - ], - [ - 134.23633873800023, - -1.799411716999842 - ], - [ - 134.219981316, - -1.812595309999878 - ], - [ - 134.20801842500006, - -1.826836846999882 - ], - [ - 134.223887566, - -1.849053643999852 - ], - [ - 134.21241295700005, - -1.884209893999909 - ], - [ - 134.19166100400017, - -1.92148202899989 - ] - ] - ], - [ - [ - [ - 108.75879967500006, - -1.717461846999981 - ], - [ - 108.72461998800006, - -1.719414971999853 - ], - [ - 108.67725670700011, - -1.713799737999935 - ], - [ - 108.69141686300006, - -1.699151299999926 - ], - [ - 108.72315514400006, - -1.693617445999919 - ], - [ - 108.75709069100006, - -1.695407809999907 - ], - [ - 108.77808678500017, - -1.702732028999989 - ], - [ - 108.75879967500006, - -1.717461846999981 - ] - ] - ], - [ - [ - [ - 130.35718834700006, - -1.694919528999918 - ], - [ - 130.351817254, - -1.74138762799987 - ], - [ - 130.40626061300011, - -1.778985283999859 - ], - [ - 130.41797936300011, - -1.793552341999884 - ], - [ - 130.4313257170002, - -1.814629815999822 - ], - [ - 130.43995201900012, - -1.835707289999931 - ], - [ - 130.437754754, - -1.850681247999873 - ], - [ - 130.42807050900015, - -1.855726820999905 - ], - [ - 130.42042076900012, - -1.855645440999822 - ], - [ - 130.4157007170002, - -1.858086846999853 - ], - [ - 130.41179446700014, - -1.881768487999878 - ], - [ - 130.4057723320001, - -1.885023695999919 - ], - [ - 130.39698326900023, - -1.885430596999839 - ], - [ - 130.38648522200018, - -1.888278903999876 - ], - [ - 130.35499108200005, - -1.912204684999921 - ], - [ - 130.34424889400023, - -1.92848072699995 - ], - [ - 130.434336785, - -1.963311455999985 - ], - [ - 130.43685957100004, - -1.976332289999974 - ], - [ - 130.42986087300002, - -1.980238539999888 - ], - [ - 130.41797936300011, - -1.980726820999877 - ], - [ - 130.40626061300011, - -1.983819268999866 - ], - [ - 130.39844811300011, - -1.989678643999895 - ], - [ - 130.39389082100016, - -1.994805596999825 - ], - [ - 130.38990319100017, - -2.000664971999868 - ], - [ - 130.38306725400017, - -2.008396091999956 - ], - [ - 130.37354576900006, - -2.012790622999859 - ], - [ - 130.36548912900005, - -2.008558851999922 - ], - [ - 130.35759524800008, - -2.001641533999845 - ], - [ - 130.34839928500017, - -1.99814218499985 - ], - [ - 130.34001712300002, - -1.993422132999925 - ], - [ - 130.33952884200002, - -1.983330987999878 - ], - [ - 130.34245853000007, - -1.973565362999921 - ], - [ - 130.34498131600017, - -1.970147393999824 - ], - [ - 130.34302819100006, - -1.96493906 - ], - [ - 130.34107506600017, - -1.955336195999948 - ], - [ - 130.33814537900017, - -1.949639580999872 - ], - [ - 130.32699629000015, - -1.960544528999932 - ], - [ - 130.30884850400005, - -1.991469007999882 - ], - [ - 130.30054772200018, - -1.99814218499985 - ], - [ - 130.28711998800006, - -2.004571221999853 - ], - [ - 130.27523847700004, - -2.01913827899989 - ], - [ - 130.26498457099999, - -2.035251559999864 - ], - [ - 130.25611412900005, - -2.045830987999906 - ], - [ - 130.223399285, - -2.057793877999927 - ], - [ - 130.15430748800011, - -2.058770440999822 - ], - [ - 130.12647545700023, - -2.066989841999913 - ], - [ - 130.11947675900015, - -2.059014580999943 - ], - [ - 130.11304772200006, - -2.053155205999914 - ], - [ - 130.10645592500006, - -2.048760674999841 - ], - [ - 130.09848066500004, - -2.045830987999906 - ], - [ - 130.1085718110002, - -2.040459893999937 - ], - [ - 130.1128035820001, - -2.038995049999883 - ], - [ - 130.08692467500012, - -2.02613697699995 - ], - [ - 130.06592858200017, - -2.02263762799987 - ], - [ - 130.01286868600002, - -2.025485934999907 - ], - [ - 129.9689233730002, - -2.004978122999859 - ], - [ - 129.92554772200006, - -2.003838799999826 - ], - [ - 129.91700280000012, - -2.001560153999861 - ], - [ - 129.904063347, - -1.993259372999958 - ], - [ - 129.87338300900004, - -1.982028903999876 - ], - [ - 129.8562117850001, - -1.969496351999879 - ], - [ - 129.84083092500023, - -1.964043877999842 - ], - [ - 129.83432050900015, - -1.960137627999927 - ], - [ - 129.81641686300011, - -1.940850518999895 - ], - [ - 129.81055748800017, - -1.935967705999843 - ], - [ - 129.76807701900012, - -1.918145440999865 - ], - [ - 129.7438257170002, - -1.912204684999921 - ], - [ - 129.73292076900023, - -1.903741143999895 - ], - [ - 129.71485436300011, - -1.881442966999856 - ], - [ - 129.74529056100008, - -1.863457940999822 - ], - [ - 129.8725692070001, - -1.81926848799985 - ], - [ - 129.87623131600017, - -1.815850518999838 - ], - [ - 129.87720787900005, - -1.811944268999923 - ], - [ - 129.87761478000007, - -1.808282158999887 - ], - [ - 129.87940514400023, - -1.805759372999873 - ], - [ - 129.89527428500006, - -1.796807549999926 - ], - [ - 129.9050399100001, - -1.793715101999851 - ], - [ - 129.93873131600012, - -1.789239190999893 - ], - [ - 129.95875084700018, - -1.780694268999952 - ], - [ - 130.01197350400005, - -1.750176690999837 - ], - [ - 130.0307723320001, - -1.743829033999901 - ], - [ - 130.05176842500023, - -1.739434502999913 - ], - [ - 130.09603925899998, - -1.735446872999844 - ], - [ - 130.13705488400004, - -1.725274346999896 - ], - [ - 130.1604923840001, - -1.724297783999916 - ], - [ - 130.22046959700018, - -1.736016533999987 - ], - [ - 130.23170006600012, - -1.734307549999983 - ], - [ - 130.24822024800008, - -1.718845309999963 - ], - [ - 130.26775149800008, - -1.704522393999895 - ], - [ - 130.28907311300011, - -1.692152601999865 - ], - [ - 130.321543816, - -1.679131768999866 - ], - [ - 130.33228600400005, - -1.676690362999835 - ], - [ - 130.34294681100008, - -1.676690362999835 - ], - [ - 130.35336347700004, - -1.680108330999843 - ], - [ - 130.35718834700006, - -1.694919528999918 - ] - ] - ], - [ - [ - [ - 123.31771894600016, - -1.774509372999901 - ], - [ - 123.30128014400017, - -1.788344007999896 - ], - [ - 123.28028405000012, - -1.785821221999882 - ], - [ - 123.27100670700005, - -1.769301039999903 - ], - [ - 123.27979576900023, - -1.748223565999965 - ], - [ - 123.33025149800008, - -1.694919528999918 - ], - [ - 123.35613040500007, - -1.675876559999921 - ], - [ - 123.361094597, - -1.673760674999912 - ], - [ - 123.36573326900023, - -1.673109632999868 - ], - [ - 123.37614993600002, - -1.678806247999844 - ], - [ - 123.38200931100019, - -1.689629815999851 - ], - [ - 123.38282311300011, - -1.702243748 - ], - [ - 123.37818444100017, - -1.712823174999869 - ], - [ - 123.36980228000019, - -1.719903252999842 - ], - [ - 123.35027103000002, - -1.730889580999886 - ], - [ - 123.34180748800006, - -1.737969658999859 - ], - [ - 123.31771894600016, - -1.774509372999901 - ] - ] - ], - [ - [ - [ - 124.529551629, - -1.635674737999835 - ], - [ - 124.52784264400012, - -1.655450127999856 - ], - [ - 124.55632571700019, - -1.641208591999856 - ], - [ - 124.59278405000006, - -1.633233330999886 - ], - [ - 124.63282311300011, - -1.631117445999877 - ], - [ - 124.6876733730002, - -1.638360283999987 - ], - [ - 124.72901451900023, - -1.650567315999965 - ], - [ - 124.74293053500006, - -1.658868096999868 - ], - [ - 124.75700931100008, - -1.665134372999901 - ], - [ - 124.81519616, - -1.66969166499986 - ], - [ - 124.87159264400023, - -1.693047783999859 - ], - [ - 124.93816165500007, - -1.703871351999851 - ], - [ - 124.94361412900017, - -1.702894789999874 - ], - [ - 124.95069420700023, - -1.697686455999872 - ], - [ - 124.95557701900012, - -1.696465752999856 - ], - [ - 124.96070397200006, - -1.698337497999916 - ], - [ - 124.96810957100004, - -1.707289320999948 - ], - [ - 124.972911004, - -1.710137627999899 - ], - [ - 125.0001733730002, - -1.716729424999954 - ], - [ - 125.01042728000002, - -1.717461846999981 - ], - [ - 125.02295983200023, - -1.7230770809999 - ], - [ - 125.03467858200011, - -1.752129815999879 - ], - [ - 125.04802493600002, - -1.765313408999916 - ], - [ - 125.04981530000012, - -1.760511976999837 - ], - [ - 125.05355879000015, - -1.756524346999868 - ], - [ - 125.055430535, - -1.751641533999972 - ], - [ - 125.06763756600017, - -1.760430596999853 - ], - [ - 125.08155358200005, - -1.764743747999944 - ], - [ - 125.09603925900004, - -1.7640927059999 - ], - [ - 125.11003665500007, - -1.75847747199991 - ], - [ - 125.10035241, - -1.753106377999856 - ], - [ - 125.09644616, - -1.751641533999972 - ], - [ - 125.10303795700011, - -1.736993096999882 - ], - [ - 125.11491946700002, - -1.692152601999865 - ], - [ - 125.12029056100019, - -1.682793877999913 - ], - [ - 125.13070722699999, - -1.684991143999824 - ], - [ - 125.13746178500006, - -1.689629815999851 - ], - [ - 125.14226321700019, - -1.694268487999864 - ], - [ - 125.15015709700018, - -1.697686455999872 - ], - [ - 125.18523196700008, - -1.703871351999851 - ], - [ - 125.19532311300023, - -1.721937757999868 - ], - [ - 125.19646243600008, - -1.744235934999907 - ], - [ - 125.19141686300023, - -1.782403252999956 - ], - [ - 125.19678795700011, - -1.788750908999901 - ], - [ - 125.20834394600004, - -1.791110934999864 - ], - [ - 125.22022545700005, - -1.788995049999855 - ], - [ - 125.22543379000015, - -1.782403252999956 - ], - [ - 125.22730553500006, - -1.773044528999932 - ], - [ - 125.23161868600002, - -1.76140715899983 - ], - [ - 125.23975670700023, - -1.744805596999868 - ], - [ - 125.25342858200011, - -1.732842705999929 - ], - [ - 125.26872806100008, - -1.728204033999916 - ], - [ - 125.28402754000004, - -1.731052341999941 - ], - [ - 125.29810631600006, - -1.74138762799987 - ], - [ - 125.30005944100012, - -1.750909112999864 - ], - [ - 125.29363040500019, - -1.760918877999842 - ], - [ - 125.28492272200012, - -1.771416924999912 - ], - [ - 125.28077233200017, - -1.782403252999956 - ], - [ - 125.28484134200014, - -1.785902601999865 - ], - [ - 125.30583743600008, - -1.777927341999899 - ], - [ - 125.31478925899998, - -1.778985283999859 - ], - [ - 125.31983483200023, - -1.793389580999829 - ], - [ - 125.32162519600004, - -1.864353122999987 - ], - [ - 125.31836998800017, - -1.882582289999888 - ], - [ - 125.30884850400017, - -1.884942315999851 - ], - [ - 125.27393639400023, - -1.873955987999878 - ], - [ - 125.25123131600012, - -1.8734677059999 - ], - [ - 125.18824303500017, - -1.881442966999856 - ], - [ - 125.17953535199999, - -1.880303643999824 - ], - [ - 125.15845787900017, - -1.875095309999921 - ], - [ - 125.14763431100008, - -1.873955987999878 - ], - [ - 125.13754316500004, - -1.876885674999897 - ], - [ - 125.12094160200016, - -1.890720309999907 - ], - [ - 125.11003665500007, - -1.89511484199997 - ], - [ - 125.09115644600016, - -1.893649997999916 - ], - [ - 125.07081139400023, - -1.888848565999837 - ], - [ - 125.05046634200008, - -1.887953382999854 - ], - [ - 125.03101647200006, - -1.898532809999978 - ], - [ - 125.02263431100019, - -1.916273695999891 - ], - [ - 125.02116946700002, - -1.933363539999931 - ], - [ - 125.01351972700004, - -1.944268487999821 - ], - [ - 124.98658287900005, - -1.943454684999892 - ], - [ - 124.95923912900017, - -1.922458591999856 - ], - [ - 124.94629967500018, - -1.919610283999916 - ], - [ - 124.91456139400012, - -1.922458591999856 - ], - [ - 124.89112389400023, - -1.917250257999868 - ], - [ - 124.85328209700018, - -1.896905205999957 - ], - [ - 124.82829837300008, - -1.89511484199997 - ], - [ - 124.78598066500015, - -1.907972914999903 - ], - [ - 124.71159915500019, - -1.952406507999839 - ], - [ - 124.67115319100006, - -1.970147393999824 - ], - [ - 124.58171634200002, - -1.994235934999935 - ], - [ - 124.56519616000017, - -2.001641533999845 - ], - [ - 124.55445397200006, - -2.004978122999859 - ], - [ - 124.54322350400005, - -2.006524346999896 - ], - [ - 124.51417076900006, - -2.004978122999859 - ], - [ - 124.45281009200008, - -2.012465101999837 - ], - [ - 124.43091881600006, - -2.011651299999826 - ], - [ - 124.40601647200012, - -2.004082940999865 - ], - [ - 124.39722741000006, - -1.991387627999899 - ], - [ - 124.39258873800011, - -1.974297783999859 - ], - [ - 124.33594811300011, - -1.888116143999909 - ], - [ - 124.32911217500012, - -1.870782158999916 - ], - [ - 124.33139082100016, - -1.826918226999865 - ], - [ - 124.33822675899998, - -1.807793877999899 - ], - [ - 124.35254967500006, - -1.789239190999893 - ], - [ - 124.36890709700018, - -1.750746351999808 - ], - [ - 124.37305748800023, - -1.705010674999883 - ], - [ - 124.38493899800008, - -1.667901299999954 - ], - [ - 124.42481530000023, - -1.655450127999856 - ], - [ - 124.44239342500006, - -1.654392184999978 - ], - [ - 124.48861738399998, - -1.645684502999913 - ], - [ - 124.50326582099999, - -1.638360283999987 - ], - [ - 124.51807701900017, - -1.626234632999825 - ], - [ - 124.52654056100019, - -1.625664971999853 - ], - [ - 124.529551629, - -1.635674737999835 - ] - ] - ], - [ - [ - [ - 135.47730553500006, - -1.58993906 - ], - [ - 135.58301842500006, - -1.61386484199987 - ], - [ - 135.78646894599999, - -1.628106377999885 - ], - [ - 135.85596764400012, - -1.643975518999909 - ], - [ - 135.89673912900017, - -1.648044528999861 - ], - [ - 135.95728600400017, - -1.631524346999882 - ], - [ - 136.03248131600006, - -1.651950778999947 - ], - [ - 136.060313347, - -1.641778252999913 - ], - [ - 136.09888756600017, - -1.654717705999829 - ], - [ - 136.19125410200004, - -1.653903903999989 - ], - [ - 136.23218834700006, - -1.662286065999865 - ], - [ - 136.23698978000002, - -1.6664364559999 - ], - [ - 136.24561608200023, - -1.678399346999839 - ], - [ - 136.2526961600001, - -1.682793877999913 - ], - [ - 136.263519727, - -1.683689059999907 - ], - [ - 136.28785241000017, - -1.682061455999886 - ], - [ - 136.29704837300002, - -1.686455987999878 - ], - [ - 136.311778191, - -1.697849216999927 - ], - [ - 136.3326929050002, - -1.70964934699991 - ], - [ - 136.36817467500018, - -1.724297783999916 - ], - [ - 136.39031009200008, - -1.725762627999885 - ], - [ - 136.45394941500004, - -1.717461846999981 - ], - [ - 136.61890709700006, - -1.737969658999859 - ], - [ - 136.7046004570001, - -1.730564059999864 - ], - [ - 136.72315514400012, - -1.734307549999983 - ], - [ - 136.76075280000012, - -1.748467705999914 - ], - [ - 136.7768660820001, - -1.751641533999972 - ], - [ - 136.81446373800011, - -1.754164320999905 - ], - [ - 136.83082116, - -1.758396091999927 - ], - [ - 136.84848066500004, - -1.765313408999916 - ], - [ - 136.89926191500015, - -1.794610283999845 - ], - [ - 136.89942467500012, - -1.799493096999825 - ], - [ - 136.8883569670002, - -1.802504164999917 - ], - [ - 136.88135826900012, - -1.81617603999986 - ], - [ - 136.87232506600012, - -1.81926848799985 - ], - [ - 136.79420006600017, - -1.8207333309999 - ], - [ - 136.75977623800023, - -1.826104424999855 - ], - [ - 136.72982832100016, - -1.826104424999855 - ], - [ - 136.72559655000023, - -1.829847914999974 - ], - [ - 136.72250410200016, - -1.839532158999859 - ], - [ - 136.7150171230002, - -1.847263278999947 - ], - [ - 136.70484459700006, - -1.85222747199991 - ], - [ - 136.68287194100006, - -1.85637786299985 - ], - [ - 136.67432701900012, - -1.861911716999956 - ], - [ - 136.66635175900015, - -1.868422132999868 - ], - [ - 136.65674889400006, - -1.873955987999878 - ], - [ - 136.64486738400015, - -1.876397393999909 - ], - [ - 136.552989129, - -1.867120049999869 - ], - [ - 136.53256269600004, - -1.867771091999913 - ], - [ - 136.53256269600004, - -1.873955987999878 - ], - [ - 136.54004967500012, - -1.879571221999967 - ], - [ - 136.54615319100017, - -1.889092705999886 - ], - [ - 136.54639733200023, - -1.897881768999852 - ], - [ - 136.53630618600008, - -1.901788018999852 - ], - [ - 136.5249129570001, - -1.899997653999861 - ], - [ - 136.50660241000006, - -1.890801690999879 - ], - [ - 136.49854576900012, - -1.888278903999876 - ], - [ - 136.48633873800023, - -1.888441664999931 - ], - [ - 136.46583092500018, - -1.893731377999899 - ], - [ - 136.45394941500004, - -1.89511484199997 - ], - [ - 136.44385826900023, - -1.892836195999905 - ], - [ - 136.41309655000006, - -1.881442966999856 - ], - [ - 136.39714603000007, - -1.878187757999896 - ], - [ - 136.35743248800023, - -1.864027601999965 - ], - [ - 136.33765709700006, - -1.86093515399989 - ], - [ - 136.33204186300023, - -1.862969658999916 - ], - [ - 136.32300866000006, - -1.871840101999879 - ], - [ - 136.31714928500017, - -1.873955987999878 - ], - [ - 136.3170679050002, - -1.874688408999916 - ], - [ - 136.308441602, - -1.876071872999887 - ], - [ - 136.30030358200005, - -1.876234632999854 - ], - [ - 136.30046634200002, - -1.873955987999878 - ], - [ - 136.29029381600017, - -1.880466403999961 - ], - [ - 136.2838647800002, - -1.886976820999877 - ], - [ - 136.27865644599999, - -1.895765882999925 - ], - [ - 136.27320397200006, - -1.909356377999885 - ], - [ - 136.26636803500006, - -1.909356377999885 - ], - [ - 136.2609155610002, - -1.896905205999957 - ], - [ - 136.2526961600001, - -1.892347914999917 - ], - [ - 136.24268639400012, - -1.894463799999926 - ], - [ - 136.23218834700006, - -1.901788018999852 - ], - [ - 136.21607506600017, - -1.873304945999934 - ], - [ - 136.18482506600012, - -1.855889580999872 - ], - [ - 136.10865319100006, - -1.839776299999897 - ], - [ - 136.09831790500002, - -1.839450778999876 - ], - [ - 136.07715905000012, - -1.84091562299993 - ], - [ - 136.06714928500006, - -1.839776299999897 - ], - [ - 136.05811608200023, - -1.835219007999854 - ], - [ - 136.04322350400017, - -1.822035414999903 - ], - [ - 136.03638756600006, - -1.81926848799985 - ], - [ - 136.01417076900012, - -1.81804778399983 - ], - [ - 135.99756920700023, - -1.814385674999954 - ], - [ - 135.98414147200006, - -1.808200778999904 - ], - [ - 135.95736738400015, - -1.792250257999896 - ], - [ - 135.91236412900017, - -1.771661065999865 - ], - [ - 135.902598504, - -1.768731377999842 - ], - [ - 135.89486738400004, - -1.757500908999845 - ], - [ - 135.876231316, - -1.753676039999917 - ], - [ - 135.83432050900004, - -1.751641533999972 - ], - [ - 135.81568444100006, - -1.744724216999884 - ], - [ - 135.7838647800002, - -1.727715752999828 - ], - [ - 135.74878991, - -1.723565362999892 - ], - [ - 135.74154707099999, - -1.720472914999903 - ], - [ - 135.72852623800011, - -1.706963799999841 - ], - [ - 135.71802819100006, - -1.703301690999879 - ], - [ - 135.70582116000006, - -1.704766533999845 - ], - [ - 135.6909285820001, - -1.710137627999899 - ], - [ - 135.67994225400005, - -1.705336195999905 - ], - [ - 135.66830488400015, - -1.694105726999808 - ], - [ - 135.65609785200016, - -1.690199476999823 - ], - [ - 135.64616946700008, - -1.693129164999931 - ], - [ - 135.63160241000006, - -1.699883721999953 - ], - [ - 135.61622155000006, - -1.704196872999873 - ], - [ - 135.60474694100006, - -1.700127862999821 - ], - [ - 135.58082116000017, - -1.684258721999967 - ], - [ - 135.55453535200016, - -1.683282158999901 - ], - [ - 135.52662194100006, - -1.686211846999839 - ], - [ - 135.49789472700016, - -1.682793877999913 - ], - [ - 135.4838973320001, - -1.674981377999842 - ], - [ - 135.48023522200006, - -1.66619231599995 - ], - [ - 135.4786889980002, - -1.655450127999856 - ], - [ - 135.47120201900023, - -1.641778252999913 - ], - [ - 135.46599368600008, - -1.640313408999859 - ], - [ - 135.44922936300023, - -1.642673434999907 - ], - [ - 135.44320722700004, - -1.641778252999913 - ], - [ - 135.440684441, - -1.635674737999835 - ], - [ - 135.43962649800008, - -1.626560153999932 - ], - [ - 135.43620853000007, - -1.618096612999977 - ], - [ - 135.42652428500017, - -1.614434502999842 - ], - [ - 135.42221113399998, - -1.610772393999895 - ], - [ - 135.4339298840001, - -1.603122653999947 - ], - [ - 135.44971764400012, - -1.596856377999913 - ], - [ - 135.45753014400012, - -1.597426039999874 - ], - [ - 135.46355228000002, - -1.589532158999987 - ], - [ - 135.47730553500006, - -1.58993906 - ] - ] - ], - [ - [ - [ - 108.9642033210001, - -1.573418877999842 - ], - [ - 108.96753991000006, - -1.587985934999949 - ], - [ - 108.96436608200005, - -1.604180596999825 - ], - [ - 108.957286004, - -1.619561455999943 - ], - [ - 108.94825280000012, - -1.631524346999882 - ], - [ - 108.93327884200008, - -1.640801690999851 - ], - [ - 108.86980228000007, - -1.662286065999865 - ], - [ - 108.85816491000006, - -1.663995049999869 - ], - [ - 108.83122806100008, - -1.662286065999865 - ], - [ - 108.82837975400005, - -1.656996351999894 - ], - [ - 108.82520592500006, - -1.645114841999842 - ], - [ - 108.82341556100019, - -1.632419528999876 - ], - [ - 108.82439212300008, - -1.624688408999873 - ], - [ - 108.82984459700018, - -1.615899346999896 - ], - [ - 108.83228600400005, - -1.605401299999841 - ], - [ - 108.83155358200011, - -1.595147393999909 - ], - [ - 108.82748457100016, - -1.586602471999967 - ], - [ - 108.82105553500006, - -1.583265882999854 - ], - [ - 108.80420983200005, - -1.584893487999963 - ], - [ - 108.79330488400015, - -1.580336195999934 - ], - [ - 108.80713951900006, - -1.56503671699987 - ], - [ - 108.83106530000012, - -1.556084893999852 - ], - [ - 108.87598717500012, - -1.546156507999854 - ], - [ - 108.8868921230002, - -1.539727471999839 - ], - [ - 108.89283287900005, - -1.534274997999887 - ], - [ - 108.90056399800002, - -1.532891533999916 - ], - [ - 108.91684004000015, - -1.538750908999944 - ], - [ - 108.92855879000015, - -1.544854424999855 - ], - [ - 108.95573978000007, - -1.563571872999916 - ], - [ - 108.9642033210001, - -1.573418877999842 - ] - ] - ], - [ - [ - [ - 105.87574303500006, - -1.489190362999835 - ], - [ - 105.89429772200006, - -1.490817966999856 - ], - [ - 105.8943791020001, - -1.490817966999856 - ], - [ - 105.91374759200008, - -1.494235934999864 - ], - [ - 105.9217228520001, - -1.50448984199997 - ], - [ - 105.92750084700018, - -1.518975518999923 - ], - [ - 105.93946373800011, - -1.535332940999936 - ], - [ - 105.9476017590001, - -1.538995049999983 - ], - [ - 105.9588322270001, - -1.539808851999823 - ], - [ - 105.98047936300011, - -1.538750908999944 - ], - [ - 105.98707116000017, - -1.542087497999887 - ], - [ - 106.03394616000006, - -1.575860283999873 - ], - [ - 106.04151451900006, - -1.583591403999876 - ], - [ - 106.04558353000007, - -1.594008070999877 - ], - [ - 106.04444420700011, - -1.604099216999842 - ], - [ - 106.034434441, - -1.61305103999986 - ], - [ - 106.03191165500019, - -1.624688408999873 - ], - [ - 106.03191165500019, - -1.665948174999912 - ], - [ - 106.0354923840001, - -1.678317966999856 - ], - [ - 106.04371178500017, - -1.686130466999856 - ], - [ - 106.05290774800002, - -1.691501559999907 - ], - [ - 106.05933678500017, - -1.696465752999856 - ], - [ - 106.06373131600006, - -1.705254815999837 - ], - [ - 106.06934655000006, - -1.723402601999837 - ], - [ - 106.07300866000011, - -1.730564059999864 - ], - [ - 106.0789494150001, - -1.736097914999888 - ], - [ - 106.08570397200006, - -1.740329684999907 - ], - [ - 106.091075066, - -1.745700778999861 - ], - [ - 106.09343509200008, - -1.755059502999899 - ], - [ - 106.09449303500006, - -1.767185153999975 - ], - [ - 106.098399285, - -1.776950778999932 - ], - [ - 106.1058048840001, - -1.783461196 - ], - [ - 106.11793053500011, - -1.785821221999882 - ], - [ - 106.12696373800011, - -1.790134372999887 - ], - [ - 106.12647545700011, - -1.799981377999984 - ], - [ - 106.12273196700019, - -1.811211846999896 - ], - [ - 106.121348504, - -1.81926848799985 - ], - [ - 106.17457116000017, - -1.879082940999979 - ], - [ - 106.17945397200006, - -1.888278903999876 - ], - [ - 106.17481530000012, - -1.898207289999874 - ], - [ - 106.162364129, - -1.963311455999985 - ], - [ - 106.16260826900006, - -2.007012627999885 - ], - [ - 106.20069420700005, - -2.178155205999886 - ], - [ - 106.26417076900006, - -2.351332289999988 - ], - [ - 106.28907311300011, - -2.39348723799985 - ], - [ - 106.31885826900012, - -2.431329033999887 - ], - [ - 106.35401451900006, - -2.462985934999864 - ], - [ - 106.37086022200018, - -2.472344658999901 - ], - [ - 106.39616946700019, - -2.48211028399993 - ], - [ - 106.41911868600019, - -2.484958591999884 - ], - [ - 106.42920983200005, - -2.47380950299987 - ], - [ - 106.44109134200019, - -2.471368096999839 - ], - [ - 106.55339603000002, - -2.510430596999882 - ], - [ - 106.68295332100016, - -2.532484632999967 - ], - [ - 106.7483830090001, - -2.5570614559999 - ], - [ - 106.76905358200011, - -2.560316664999931 - ], - [ - 106.81544030000006, - -2.560967705999886 - ], - [ - 106.83326256600006, - -2.566582940999893 - ], - [ - 106.83326256600006, - -2.580254815999837 - ], - [ - 106.82642662900005, - -2.586032809999892 - ], - [ - 106.8186955090001, - -2.586195570999948 - ], - [ - 106.80974368600019, - -2.585219007999882 - ], - [ - 106.79908287900017, - -2.587090752999856 - ], - [ - 106.76596113400015, - -2.605645440999851 - ], - [ - 106.75538170700005, - -2.608168226999865 - ], - [ - 106.73804772200018, - -2.614434502999828 - ], - [ - 106.721934441, - -2.629327080999957 - ], - [ - 106.67481530000012, - -2.69980234199987 - ], - [ - 106.61198978000007, - -2.870375257999882 - ], - [ - 106.60377037900017, - -2.910251559999864 - ], - [ - 106.613047722, - -2.942559502999885 - ], - [ - 106.64893639400012, - -2.963799737999864 - ], - [ - 106.65992272200018, - -2.965915622999873 - ], - [ - 106.67432701900006, - -2.96689218499985 - ], - [ - 106.68295332100016, - -2.970635674999969 - ], - [ - 106.69255618600013, - -2.979261976999894 - ], - [ - 106.69825280000012, - -2.988213799999826 - ], - [ - 106.70582116000006, - -2.995212497999901 - ], - [ - 106.72087649800008, - -2.997979424999855 - ], - [ - 106.7384546230002, - -3.004571221999839 - ], - [ - 106.74577884200019, - -3.020114841999842 - ], - [ - 106.7449650400001, - -3.038344007999825 - ], - [ - 106.73829186300006, - -3.053317966999856 - ], - [ - 106.74756920700011, - -3.06861744599999 - ], - [ - 106.75196373800006, - -3.073663018999852 - ], - [ - 106.7444767590001, - -3.080498955999857 - ], - [ - 106.73568769600016, - -3.076755466999927 - ], - [ - 106.72828209700006, - -3.082126559999878 - ], - [ - 106.71957441500015, - -3.090101820999934 - ], - [ - 106.707286004, - -3.0941708309999 - ], - [ - 106.70036868600019, - -3.092217705999857 - ], - [ - 106.69369550900015, - -3.088555596999896 - ], - [ - 106.68702233200011, - -3.086846612999892 - ], - [ - 106.67066491000017, - -3.096123955999843 - ], - [ - 106.66529381600006, - -3.092217705999857 - ], - [ - 106.66130618600008, - -3.085219007999953 - ], - [ - 106.65577233200005, - -3.080498955999857 - ], - [ - 106.60124759200008, - -3.071058851999851 - ], - [ - 106.57374108200011, - -3.076755466999927 - ], - [ - 106.56641686300011, - -3.101657809999949 - ], - [ - 106.5564884770001, - -3.09685637799987 - ], - [ - 106.55274498800006, - -3.0941708309999 - ], - [ - 106.53223717500012, - -3.105645440999851 - ], - [ - 106.51710045700011, - -3.094821872999844 - ], - [ - 106.507578972, - -3.072442315999837 - ], - [ - 106.50440514400006, - -3.04989999799993 - ], - [ - 106.49968509200008, - -3.038995049999869 - ], - [ - 106.489024285, - -3.030043226999837 - ], - [ - 106.467051629, - -3.015313408999845 - ], - [ - 106.45899498800006, - -3.004327080999971 - ], - [ - 106.44703209700006, - -2.981133721999853 - ], - [ - 106.43604576900006, - -2.970635674999969 - ], - [ - 106.41651451900012, - -2.965508721999868 - ], - [ - 106.36866295700005, - -2.966973565999922 - ], - [ - 106.35035241, - -2.960707289999888 - ], - [ - 106.30201256600012, - -2.91326262799987 - ], - [ - 106.09400475400005, - -2.840590101999965 - ], - [ - 106.07390384200019, - -2.836195570999891 - ], - [ - 106.00245201900012, - -2.830743096999868 - ], - [ - 105.9865014980002, - -2.821221612999949 - ], - [ - 105.92253665500013, - -2.715997002999913 - ], - [ - 105.9075626960001, - -2.674574476999894 - ], - [ - 105.90162194100006, - -2.62867604 - ], - [ - 105.91236412900017, - -2.585625908999887 - ], - [ - 105.93262780000006, - -2.541924737999892 - ], - [ - 105.94434655000006, - -2.498793226999965 - ], - [ - 105.92888431100008, - -2.456719658999916 - ], - [ - 105.89747155000012, - -2.436130466999884 - ], - [ - 105.85938561300006, - -2.420098565999893 - ], - [ - 105.82878665500013, - -2.39511484199987 - ], - [ - 105.81902103000007, - -2.347426039999903 - ], - [ - 105.82553144600016, - -2.318536065999979 - ], - [ - 105.82593834700018, - -2.307224216999913 - ], - [ - 105.82341556100008, - -2.297539971999853 - ], - [ - 105.81470787900017, - -2.282321872999873 - ], - [ - 105.81055748800006, - -2.265883070999877 - ], - [ - 105.80079186300011, - -2.245538018999895 - ], - [ - 105.79859459700012, - -2.234551690999922 - ], - [ - 105.79908287900017, - -2.20086028399983 - ], - [ - 105.79574629000015, - -2.1718075499999 - ], - [ - 105.790293816, - -2.159763278999847 - ], - [ - 105.78044681100019, - -2.150811455999914 - ], - [ - 105.76441491, - -2.142185153999989 - ], - [ - 105.74756920700011, - -2.136000257999839 - ], - [ - 105.68873131600006, - -2.127699476999865 - ], - [ - 105.68384850400017, - -2.125420830999971 - ], - [ - 105.6736759770001, - -2.116875908999873 - ], - [ - 105.66944420700011, - -2.114841403999932 - ], - [ - 105.66309655000006, - -2.115411065999908 - ], - [ - 105.6521916020001, - -2.120538018999909 - ], - [ - 105.6482853520001, - -2.121514580999886 - ], - [ - 105.61622155000012, - -2.1176083309999 - ], - [ - 105.60743248800006, - -2.114841403999932 - ], - [ - 105.59376061300011, - -2.103610934999935 - ], - [ - 105.57764733200005, - -2.077080987999878 - ], - [ - 105.5657658210001, - -2.066989841999913 - ], - [ - 105.54224694100006, - -2.081801039999888 - ], - [ - 105.49122155000012, - -2.098402601999851 - ], - [ - 105.47022545700011, - -2.108005467 - ], - [ - 105.45036868600019, - -2.122653903999918 - ], - [ - 105.44109134200002, - -2.12379322699995 - ], - [ - 105.42188561300006, - -2.121514580999886 - ], - [ - 105.35694420700011, - -2.121514580999886 - ], - [ - 105.30640709700012, - -2.135023695999863 - ], - [ - 105.29835045700005, - -2.131524346999882 - ], - [ - 105.29314212300008, - -2.126234632999811 - ], - [ - 105.27149498800006, - -2.094903252999856 - ], - [ - 105.2679142590001, - -2.087497653999861 - ], - [ - 105.2298283210001, - -2.070082289999888 - ], - [ - 105.21290123800006, - -2.066989841999913 - ], - [ - 105.17896569100012, - -2.069919528999932 - ], - [ - 105.16114342500012, - -2.073907158999901 - ], - [ - 105.14747155000006, - -2.080010674999897 - ], - [ - 105.12794030000012, - -2.044610283999972 - ], - [ - 105.12549889400006, - -2.004082940999865 - ], - [ - 105.13591556100008, - -1.965508721999896 - ], - [ - 105.15430748800011, - -1.935967705999843 - ], - [ - 105.18360436300011, - -1.91692473799985 - ], - [ - 105.29835045700005, - -1.873955987999878 - ], - [ - 105.37566165500019, - -1.821872653999932 - ], - [ - 105.40235436300011, - -1.783298434999949 - ], - [ - 105.39454186300011, - -1.737969658999859 - ], - [ - 105.35523522200012, - -1.71502044099995 - ], - [ - 105.33545983200005, - -1.69793059699991 - ], - [ - 105.34302819100006, - -1.690199476999823 - ], - [ - 105.35108483200005, - -1.686781507999811 - ], - [ - 105.351328972, - -1.678480726999823 - ], - [ - 105.34603925900015, - -1.658868096999868 - ], - [ - 105.34986412900005, - -1.648695570999905 - ], - [ - 105.35914147200012, - -1.643812757999854 - ], - [ - 105.37029056100013, - -1.640557549999897 - ], - [ - 105.3802189460001, - -1.634942315999979 - ], - [ - 105.38379967500012, - -1.629082940999851 - ], - [ - 105.38933353000013, - -1.61386484199987 - ], - [ - 105.39454186300011, - -1.607598565999837 - ], - [ - 105.400157097, - -1.606215101999851 - ], - [ - 105.41285241000017, - -1.60751718499985 - ], - [ - 105.418711785, - -1.604180596999825 - ], - [ - 105.45964603000007, - -1.562920830999872 - ], - [ - 105.47169030000006, - -1.558363539999917 - ], - [ - 105.51807701900012, - -1.559828382999882 - ], - [ - 105.53679446700019, - -1.555271091999842 - ], - [ - 105.54639733200005, - -1.549004815999879 - ], - [ - 105.55372155000006, - -1.54111093499999 - ], - [ - 105.5657658210001, - -1.531914971999839 - ], - [ - 105.59408613400015, - -1.525567315999908 - ], - [ - 105.61101321700019, - -1.540215752999828 - ], - [ - 105.61890709700018, - -1.565199476999837 - ], - [ - 105.62110436300006, - -1.590264580999843 - ], - [ - 105.6287541020001, - -1.614027601999837 - ], - [ - 105.64844811300006, - -1.633233330999886 - ], - [ - 105.67497806100019, - -1.647230726999851 - ], - [ - 105.70289147200006, - -1.655450127999856 - ], - [ - 105.69141686300011, - -1.671319268999881 - ], - [ - 105.6517033210001, - -1.706963799999841 - ], - [ - 105.64975019600016, - -1.721856377999885 - ], - [ - 105.66309655000006, - -1.739678643999866 - ], - [ - 105.68181399800014, - -1.755791924999841 - ], - [ - 105.69556725400005, - -1.765313408999916 - ], - [ - 105.71509850400005, - -1.773532809999921 - ], - [ - 105.72820071700019, - -1.772556247999859 - ], - [ - 105.74122155000006, - -1.767998955999985 - ], - [ - 105.76099694100012, - -1.765313408999916 - ], - [ - 105.76563561300011, - -1.768975518999881 - ], - [ - 105.77263431100019, - -1.786797783999859 - ], - [ - 105.77808678500006, - -1.792657158999901 - ], - [ - 105.78541100400005, - -1.794040622999873 - ], - [ - 105.81275475400005, - -1.792657158999901 - ], - [ - 105.80469811300011, - -1.772637627999842 - ], - [ - 105.79167728000019, - -1.753676039999917 - ], - [ - 105.76099694100012, - -1.720879815999908 - ], - [ - 105.75098717500012, - -1.703057549999841 - ], - [ - 105.75082441500015, - -1.6835263 - ], - [ - 105.75757897200018, - -1.645196221999825 - ], - [ - 105.75464928500017, - -1.642673434999907 - ], - [ - 105.73707116000006, - -1.614434502999842 - ], - [ - 105.73389733200005, - -1.605238539999874 - ], - [ - 105.73170006600017, - -1.589043877999828 - ], - [ - 105.72974694100006, - -1.580336195999934 - ], - [ - 105.72396894600016, - -1.56609465899983 - ], - [ - 105.71664472700016, - -1.552422783999887 - ], - [ - 105.70728600400005, - -1.540622654 - ], - [ - 105.69556725400005, - -1.531914971999839 - ], - [ - 105.71998131600017, - -1.524183851999837 - ], - [ - 105.80909264400006, - -1.525648695999891 - ], - [ - 105.83432050900015, - -1.517836195999891 - ], - [ - 105.87574303500006, - -1.489190362999835 - ] - ] - ], - [ - [ - [ - 123.56885826900023, - -1.600844007999882 - ], - [ - 123.58130944100006, - -1.602634372999958 - ], - [ - 123.59034264400017, - -1.598728122999873 - ], - [ - 123.60059655000012, - -1.603285415 - ], - [ - 123.61036217500023, - -1.611586195999905 - ], - [ - 123.616465691, - -1.62460702899989 - ], - [ - 123.61597741000006, - -1.640313408999859 - ], - [ - 123.61410566500015, - -1.652439059999935 - ], - [ - 123.60873457100004, - -1.6742489559999 - ], - [ - 123.60865319100006, - -1.688734632999854 - ], - [ - 123.601328972, - -1.702813408999972 - ], - [ - 123.58643639400006, - -1.712985934999935 - ], - [ - 123.57927493600002, - -1.71607838299991 - ], - [ - 123.57488040500007, - -1.719984632999825 - ], - [ - 123.564219597, - -1.721937757999868 - ], - [ - 123.55396569100017, - -1.720635674999869 - ], - [ - 123.54542076900017, - -1.721856377999885 - ], - [ - 123.53435306100002, - -1.716566664999988 - ], - [ - 123.52214603000007, - -1.705824476999894 - ], - [ - 123.51514733200005, - -1.703383070999863 - ], - [ - 123.51172936300017, - -1.709405205999872 - ], - [ - 123.503672722, - -1.712823174999869 - ], - [ - 123.4935001960001, - -1.70964934699991 - ], - [ - 123.48731530000012, - -1.699965101999936 - ], - [ - 123.48487389400006, - -1.693536065999837 - ], - [ - 123.477793816, - -1.668633721999981 - ], - [ - 123.47559655000012, - -1.64910247199991 - ], - [ - 123.47852623800023, - -1.634535414999974 - ], - [ - 123.4783634770001, - -1.619561455999943 - ], - [ - 123.48080488400004, - -1.615004164999903 - ], - [ - 123.48275800900015, - -1.610446872999873 - ], - [ - 123.48804772200006, - -1.603285415 - ], - [ - 123.49268639400017, - -1.594984632999854 - ], - [ - 123.49146569100006, - -1.584730726999908 - ], - [ - 123.48503665500002, - -1.57968515399989 - ], - [ - 123.47950280000012, - -1.577080987999892 - ], - [ - 123.47689863400004, - -1.570245049999954 - ], - [ - 123.47673587300008, - -1.562758070999905 - ], - [ - 123.477793816, - -1.557712497999873 - ], - [ - 123.48194420700023, - -1.544691664999888 - ], - [ - 123.49089603000019, - -1.524509372999859 - ], - [ - 123.500743035, - -1.509372653999861 - ], - [ - 123.51140384200002, - -1.505629165 - ], - [ - 123.52068118600019, - -1.504815362999821 - ], - [ - 123.52523847700004, - -1.498223565999837 - ], - [ - 123.5232853520001, - -1.482679945999934 - ], - [ - 123.52906334700006, - -1.480238539999903 - ], - [ - 123.53736412900005, - -1.485039971999882 - ], - [ - 123.54468834700006, - -1.497002862999821 - ], - [ - 123.56006920700005, - -1.545993747999887 - ], - [ - 123.55925540500007, - -1.555759373 - ], - [ - 123.55591881600006, - -1.56340911299985 - ], - [ - 123.55738366000011, - -1.581149997999844 - ], - [ - 123.56885826900023, - -1.600844007999882 - ] - ] - ], - [ - [ - [ - 135.128672722, - -1.476739190999908 - ], - [ - 135.15088951900006, - -1.483005466999856 - ], - [ - 135.2047632170002, - -1.477715752999885 - ], - [ - 135.22754967500023, - -1.487562757999896 - ], - [ - 135.23926842500012, - -1.489678643999824 - ], - [ - 135.28565514400012, - -1.476739190999908 - ], - [ - 135.29664147200006, - -1.480401299999869 - ], - [ - 135.30502363400004, - -1.485284112999921 - ], - [ - 135.31568444100006, - -1.487888278999918 - ], - [ - 135.33399498800011, - -1.484144789999888 - ], - [ - 135.31185957100004, - -1.510186455999872 - ], - [ - 135.27540123800017, - -1.522230726999965 - ], - [ - 135.18685957100016, - -1.525648695999891 - ], - [ - 135.10434004000015, - -1.518243096999896 - ], - [ - 135.0968530610002, - -1.508558851999851 - ], - [ - 135.09839928500006, - -1.48902760199995 - ], - [ - 135.10906009200008, - -1.47380950299997 - ], - [ - 135.128672722, - -1.476739190999908 - ] - ] - ], - [ - [ - [ - 127.33708743600019, - -1.353773695999863 - ], - [ - 127.34571373800006, - -1.365655205999914 - ], - [ - 127.35417728000002, - -1.365329684999892 - ], - [ - 127.36255944100017, - -1.362562757999839 - ], - [ - 127.37110436300011, - -1.367445570999905 - ], - [ - 127.38135826900023, - -1.397067966999856 - ], - [ - 127.37875410200004, - -1.405450127999899 - ], - [ - 127.36117597699999, - -1.408379815999837 - ], - [ - 127.3478296230002, - -1.41277434699991 - ], - [ - 127.32667076900012, - -1.431817315999908 - ], - [ - 127.316661004, - -1.436293226999865 - ], - [ - 127.28419030000012, - -1.425388278999975 - ], - [ - 127.28581790500007, - -1.400323174999897 - ], - [ - 127.30453535200004, - -1.377699476999837 - ], - [ - 127.32349694100006, - -1.37428150799991 - ], - [ - 127.32545006600017, - -1.368829033999887 - ], - [ - 127.327403191, - -1.365411065999879 - ], - [ - 127.32886803500017, - -1.361260674999841 - ], - [ - 127.33025149800008, - -1.353773695999863 - ], - [ - 127.33708743600019, - -1.353773695999863 - ] - ] - ], - [ - [ - [ - 127.83082116, - -1.431573174999869 - ], - [ - 127.85173587300008, - -1.436293226999865 - ], - [ - 127.85840905000023, - -1.4340145809999 - ], - [ - 127.87549889400006, - -1.424004815999822 - ], - [ - 127.88575280000012, - -1.42205169099995 - ], - [ - 127.89893639400023, - -1.426690362999892 - ], - [ - 127.91911868600019, - -1.445733330999886 - ], - [ - 127.9298608730002, - -1.449965101999808 - ], - [ - 128.008067254, - -1.504571221999953 - ], - [ - 128.026621941, - -1.529473565999908 - ], - [ - 128.0353296230002, - -1.538750908999944 - ], - [ - 128.04672285200016, - -1.546319268999909 - ], - [ - 128.07064863400004, - -1.556735934999978 - ], - [ - 128.08033287900017, - -1.562920830999872 - ], - [ - 128.08961022200006, - -1.567315362999935 - ], - [ - 128.0983992850001, - -1.565687757999825 - ], - [ - 128.10670006600017, - -1.561944268999895 - ], - [ - 128.11451256600017, - -1.559828382999882 - ], - [ - 128.12631269600004, - -1.563653252999899 - ], - [ - 128.13461347700004, - -1.57284921699987 - ], - [ - 128.14519290500007, - -1.594008070999877 - ], - [ - 128.15902754000015, - -1.636976821 - ], - [ - 128.15113366000017, - -1.66969166499986 - ], - [ - 128.1264754570001, - -1.693617445999919 - ], - [ - 128.090586785, - -1.710137627999899 - ], - [ - 128.05152428500006, - -1.714532158999873 - ], - [ - 127.93344160200016, - -1.682793877999913 - ], - [ - 127.91309655000006, - -1.682386976999908 - ], - [ - 127.87696373800023, - -1.693454684999864 - ], - [ - 127.85474694100017, - -1.696465752999856 - ], - [ - 127.70329837300002, - -1.690199476999823 - ], - [ - 127.68458092500023, - -1.695570570999863 - ], - [ - 127.669688347, - -1.707289320999948 - ], - [ - 127.65805097699999, - -1.719008071000019 - ], - [ - 127.64869225400017, - -1.724297783999916 - ], - [ - 127.56885826900023, - -1.732191664999974 - ], - [ - 127.53272545700011, - -1.731377862999963 - ], - [ - 127.49415123800023, - -1.717461846999981 - ], - [ - 127.43262780000018, - -1.686455987999878 - ], - [ - 127.37867272200006, - -1.632256768999909 - ], - [ - 127.38306725400005, - -1.610609632999839 - ], - [ - 127.39861087300002, - -1.573500257999825 - ], - [ - 127.39828535200004, - -1.554294528999947 - ], - [ - 127.39649498800023, - -1.540297132999811 - ], - [ - 127.39926191499998, - -1.527601820999934 - ], - [ - 127.41285241000006, - -1.511407158999887 - ], - [ - 127.40357506600017, - -1.491631768999866 - ], - [ - 127.40943444100006, - -1.473402601999965 - ], - [ - 127.42009524800008, - -1.456312757999925 - ], - [ - 127.42579186300023, - -1.43938567499994 - ], - [ - 127.42839603000007, - -1.415134372999873 - ], - [ - 127.43531334700006, - -1.41220468499985 - ], - [ - 127.45997155000023, - -1.428887627999885 - ], - [ - 127.481700066, - -1.448174737999821 - ], - [ - 127.48780358200011, - -1.449965101999808 - ], - [ - 127.49390709700018, - -1.444756768999909 - ], - [ - 127.51099694100006, - -1.421319268999923 - ], - [ - 127.51465905000006, - -1.41220468499985 - ], - [ - 127.52149498800011, - -1.401055596999825 - ], - [ - 127.62452233200017, - -1.329522393999881 - ], - [ - 127.63428795700011, - -1.32870859199987 - ], - [ - 127.71355228000007, - -1.344984632999811 - ], - [ - 127.74105878999998, - -1.354750257999839 - ], - [ - 127.76539147200006, - -1.368422132999882 - ], - [ - 127.77588951900023, - -1.384454033999873 - ], - [ - 127.78484134200008, - -1.402439059999907 - ], - [ - 127.80567467500023, - -1.419203382999825 - ], - [ - 127.83082116, - -1.431573174999869 - ] - ] - ], - [ - [ - [ - 109.17693118600008, - -1.27849700299997 - ], - [ - 109.14421634200002, - -1.311455987999864 - ], - [ - 109.13851972700016, - -1.314141533999845 - ], - [ - 109.13599694100006, - -1.30917734199997 - ], - [ - 109.13379967500006, - -1.297133070999877 - ], - [ - 109.12842858200011, - -1.296563408999987 - ], - [ - 109.12159264400006, - -1.29989999799993 - ], - [ - 109.11491946700014, - -1.298516533999859 - ], - [ - 109.11573326900006, - -1.303887627999913 - ], - [ - 109.10824629000015, - -1.304457289999874 - ], - [ - 109.10075931100019, - -1.300551039999888 - ], - [ - 109.10132897200018, - -1.292413018999952 - ], - [ - 109.10792076900006, - -1.284600518999881 - ], - [ - 109.11475670700005, - -1.280205987999892 - ], - [ - 109.12281334700018, - -1.27849700299997 - ], - [ - 109.13257897200006, - -1.278008721999981 - ], - [ - 109.14372806100008, - -1.273532809999935 - ], - [ - 109.16130618600019, - -1.256605726999851 - ], - [ - 109.17017662900005, - -1.257582289999917 - ], - [ - 109.18189537900005, - -1.266208591999927 - ], - [ - 109.17693118600008, - -1.27849700299997 - ] - ] - ], - [ - [ - [ - 127.69760175900015, - -1.231133721999853 - ], - [ - 127.69288170700023, - -1.249444268999909 - ], - [ - 127.68067467500018, - -1.264255466999884 - ], - [ - 127.66602623800023, - -1.271905205999914 - ], - [ - 127.64584394600004, - -1.270603122999916 - ], - [ - 127.59034264400006, - -1.243910414999974 - ], - [ - 127.55258222700004, - -1.236911716999913 - ], - [ - 127.53150475400017, - -1.23788827899989 - ], - [ - 127.52214603000007, - -1.247735283999987 - ], - [ - 127.51490319100006, - -1.262139580999957 - ], - [ - 127.49830162900017, - -1.259209893999937 - ], - [ - 127.4788517590001, - -1.249607028999876 - ], - [ - 127.46338951900023, - -1.243910414999974 - ], - [ - 127.46070397200018, - -1.235772393999881 - ], - [ - 127.473887566, - -1.217705987999864 - ], - [ - 127.50163821700019, - -1.189385674999912 - ], - [ - 127.51644941500015, - -1.179294528999932 - ], - [ - 127.53150475400017, - -1.172621351999894 - ], - [ - 127.54721113400015, - -1.171075127999856 - ], - [ - 127.6101994150001, - -1.193129164999931 - ], - [ - 127.62745201900006, - -1.207614841999884 - ], - [ - 127.67448978000019, - -1.209730726999894 - ], - [ - 127.68995201900012, - -1.213799737999864 - ], - [ - 127.69760175900015, - -1.231133721999853 - ] - ] - ], - [ - [ - [ - 109.23414147200006, - -1.224541924999869 - ], - [ - 109.223399285, - -1.227146091999956 - ], - [ - 109.21851647200006, - -1.220391533999845 - ], - [ - 109.21851647200006, - -1.206638278999918 - ], - [ - 109.219981316, - -1.198011976999823 - ], - [ - 109.223887566, - -1.191338799999855 - ], - [ - 109.242442254, - -1.17441171699987 - ], - [ - 109.24870853000007, - -1.170830987999906 - ], - [ - 109.25464928500017, - -1.169366143999852 - ], - [ - 109.264903191, - -1.174981377999842 - ], - [ - 109.26514733200005, - -1.187920830999857 - ], - [ - 109.25977623800011, - -1.20224374799993 - ], - [ - 109.25294030000006, - -1.212497653999947 - ], - [ - 109.24577884200002, - -1.217868747999916 - ], - [ - 109.23414147200006, - -1.224541924999869 - ] - ] - ], - [ - [ - [ - 123.20101972700016, - -1.155205987999821 - ], - [ - 123.24610436300023, - -1.223402601999837 - ], - [ - 123.23707116000006, - -1.232679945999891 - ], - [ - 123.23047936300023, - -1.241794528999876 - ], - [ - 123.22217858200005, - -1.248711846999882 - ], - [ - 123.20785566499998, - -1.251397393999866 - ], - [ - 123.20183353000019, - -1.256524346999868 - ], - [ - 123.19874108200011, - -1.268731377999856 - ], - [ - 123.19760175900015, - -1.295505466999856 - ], - [ - 123.20167076900012, - -1.30730559699991 - ], - [ - 123.21045983200005, - -1.316827080999914 - ], - [ - 123.21998131600017, - -1.324965101999922 - ], - [ - 123.22575931100002, - -1.332696221999853 - ], - [ - 123.22803795700011, - -1.348402601999823 - ], - [ - 123.22779381600017, - -1.379652601999879 - ], - [ - 123.23194420700011, - -1.394707940999893 - ], - [ - 123.25538170700011, - -1.377129815999865 - ], - [ - 123.27214603000019, - -1.354750257999839 - ], - [ - 123.30079186300006, - -1.305922132999839 - ], - [ - 123.30469811300006, - -1.302829684999864 - ], - [ - 123.31657962300014, - -1.296482029 - ], - [ - 123.32113691500015, - -1.292413018999952 - ], - [ - 123.33545983200023, - -1.271905205999914 - ], - [ - 123.34441165500019, - -1.242608330999886 - ], - [ - 123.35222415500007, - -1.229180596999981 - ], - [ - 123.36597741000017, - -1.223402601999837 - ], - [ - 123.38363691500004, - -1.22429778399983 - ], - [ - 123.39283287900017, - -1.223565362999892 - ], - [ - 123.40007571700019, - -1.220391533999845 - ], - [ - 123.40691165500013, - -1.219496351999851 - ], - [ - 123.409922722, - -1.228204033999916 - ], - [ - 123.41179446700019, - -1.239841403999932 - ], - [ - 123.41407311300017, - -1.247735283999987 - ], - [ - 123.42847741000006, - -1.257745049999883 - ], - [ - 123.43523196700008, - -1.250664971999839 - ], - [ - 123.44166100400017, - -1.237725518999824 - ], - [ - 123.45508873800006, - -1.230889580999985 - ], - [ - 123.46501712300008, - -1.236260674999869 - ], - [ - 123.48682701900012, - -1.259209893999937 - ], - [ - 123.50310306100008, - -1.264418226999851 - ], - [ - 123.52173912900005, - -1.26628997199991 - ], - [ - 123.53907311300023, - -1.272719007999825 - ], - [ - 123.55095462300008, - -1.284763278999932 - ], - [ - 123.55372155000023, - -1.303399346999825 - ], - [ - 123.55176842500012, - -1.324314059999878 - ], - [ - 123.5384220710001, - -1.360609632999967 - ], - [ - 123.53345787900005, - -1.381117445999934 - ], - [ - 123.53484134200019, - -1.412286065999837 - ], - [ - 123.53345787900005, - -1.42205169099995 - ], - [ - 123.52857506600017, - -1.433038018999824 - ], - [ - 123.50310306100008, - -1.460056247999873 - ], - [ - 123.46216881600006, - -1.494317315999851 - ], - [ - 123.45386803500006, - -1.498793226999808 - ], - [ - 123.43572024800008, - -1.503106377999899 - ], - [ - 123.42758222700004, - -1.507989190999879 - ], - [ - 123.40837649800008, - -1.516534112999892 - ], - [ - 123.38119550900015, - -1.498304945999919 - ], - [ - 123.3621525400001, - -1.511407158999887 - ], - [ - 123.357188347, - -1.472914320999976 - ], - [ - 123.35010826900017, - -1.45671965899993 - ], - [ - 123.33179772200012, - -1.449965101999808 - ], - [ - 123.32764733200017, - -1.444594007999854 - ], - [ - 123.32813561300023, - -1.432875257999868 - ], - [ - 123.32683353000007, - -1.421156507999868 - ], - [ - 123.31771894600016, - -1.415785414999917 - ], - [ - 123.30551191499998, - -1.416110934999935 - ], - [ - 123.29639733200011, - -1.417657158999887 - ], - [ - 123.28858483200011, - -1.421563408999873 - ], - [ - 123.28028405000012, - -1.428887627999885 - ], - [ - 123.25879967500012, - -1.465997002999899 - ], - [ - 123.24984785200016, - -1.510674737999864 - ], - [ - 123.25228925900004, - -1.600844007999882 - ], - [ - 123.25049889400012, - -1.62273528399983 - ], - [ - 123.24333743600008, - -1.632419528999876 - ], - [ - 123.23552493600019, - -1.627048434999921 - ], - [ - 123.23194420700011, - -1.604180596999825 - ], - [ - 123.22681725400011, - -1.593357028999918 - ], - [ - 123.21517988399998, - -1.595472914999931 - ], - [ - 123.17839603000019, - -1.622491143999881 - ], - [ - 123.16993248800017, - -1.619398695999976 - ], - [ - 123.16439863400015, - -1.609633070999948 - ], - [ - 123.15674889400012, - -1.600844007999882 - ], - [ - 123.12387129000004, - -1.591485283999859 - ], - [ - 123.11589603000007, - -1.586602471999967 - ], - [ - 123.11068769600016, - -1.576918226999837 - ], - [ - 123.10914147200006, - -1.565687757999825 - ], - [ - 123.11182701900012, - -1.556329033999972 - ], - [ - 123.11890709700018, - -1.552422783999887 - ], - [ - 123.13086998800011, - -1.547621351999808 - ], - [ - 123.17725670700005, - -1.518243096999896 - ], - [ - 123.184825066, - -1.485609632999854 - ], - [ - 123.16358483200023, - -1.353773695999863 - ], - [ - 123.16488691500004, - -1.322035414999903 - ], - [ - 123.16358483200023, - -1.312188408999972 - ], - [ - 123.15943444100017, - -1.306247653999861 - ], - [ - 123.15235436300023, - -1.300551039999888 - ], - [ - 123.14551842500012, - -1.299981377999913 - ], - [ - 123.13697350400017, - -1.324476820999934 - ], - [ - 123.12354576900012, - -1.332777601999837 - ], - [ - 123.10792076900012, - -1.338555596999882 - ], - [ - 123.09457441499998, - -1.346368096999882 - ], - [ - 123.07195071700002, - -1.393975518999866 - ], - [ - 123.06397545700005, - -1.401625257999896 - ], - [ - 123.05339603000002, - -1.40846119599999 - ], - [ - 123.04517662900005, - -1.424493096999981 - ], - [ - 123.03321373800011, - -1.456231377999941 - ], - [ - 123.01392662900017, - -1.485609632999854 - ], - [ - 122.99317467500018, - -1.509209893999895 - ], - [ - 122.91993248800011, - -1.574476820999891 - ], - [ - 122.89584394599999, - -1.589532158999987 - ], - [ - 122.87403405000023, - -1.584567966999941 - ], - [ - 122.81202233200011, - -1.443617445999877 - ], - [ - 122.80738366000017, - -1.401625257999896 - ], - [ - 122.81088300900015, - -1.358086846999953 - ], - [ - 122.82081139400023, - -1.313734632999839 - ], - [ - 122.8361108730002, - -1.274021091999913 - ], - [ - 122.89869225400005, - -1.184340101999879 - ], - [ - 122.91382897200006, - -1.176364841999913 - ], - [ - 122.93580162900005, - -1.179864190999822 - ], - [ - 122.9715275400001, - -1.19443124799993 - ], - [ - 122.98536217500006, - -1.19605885199995 - ], - [ - 122.997325066, - -1.190362237999878 - ], - [ - 123.01710045700023, - -1.172621351999894 - ], - [ - 123.02979576900012, - -1.168877862999864 - ], - [ - 123.07422936300011, - -1.16269296699997 - ], - [ - 123.11207116000006, - -1.16269296699997 - ], - [ - 123.11833743600019, - -1.165785414999874 - ], - [ - 123.1251733730002, - -1.17278411299985 - ], - [ - 123.13379967500012, - -1.179864190999822 - ], - [ - 123.14625084700006, - -1.183200778999847 - ], - [ - 123.15935306100019, - -1.179294528999932 - ], - [ - 123.16309655000023, - -1.169854424999841 - ], - [ - 123.16431725400017, - -1.158379815999879 - ], - [ - 123.17042076900023, - -1.148370049999983 - ], - [ - 123.18287194100017, - -1.142266533999916 - ], - [ - 123.18946373800023, - -1.145277601999908 - ], - [ - 123.19418379000015, - -1.151625257999854 - ], - [ - 123.20101972700016, - -1.155205987999821 - ] - ] - ], - [ - [ - [ - 129.960703972, - -1.176364841999913 - ], - [ - 129.95329837300014, - -1.189629815999851 - ], - [ - 129.92725670700023, - -1.210381768999937 - ], - [ - 129.9253035820001, - -1.205173434999864 - ], - [ - 129.92269941500004, - -1.200860283999859 - ], - [ - 129.92074629000015, - -1.195977471999967 - ], - [ - 129.92042076900023, - -1.189385674999912 - ], - [ - 129.882090691, - -1.219659112999906 - ], - [ - 129.859222852, - -1.233168226999879 - ], - [ - 129.83090254000015, - -1.237074476999879 - ], - [ - 129.8725692070001, - -1.210219007999882 - ], - [ - 129.87940514400023, - -1.202894789999888 - ], - [ - 129.87419681100002, - -1.196954033999944 - ], - [ - 129.86182701900012, - -1.200453382999854 - ], - [ - 129.84961998800011, - -1.206963799999841 - ], - [ - 129.84457441499998, - -1.210381768999937 - ], - [ - 129.833262566, - -1.211846612999821 - ], - [ - 129.76270592500023, - -1.210381768999937 - ], - [ - 129.74390709700018, - -1.199883721999882 - ], - [ - 129.74878991000006, - -1.185804945999934 - ], - [ - 129.76742597700004, - -1.172051690999822 - ], - [ - 129.85865319100006, - -1.142022393999866 - ], - [ - 129.87940514400023, - -1.141534112999878 - ], - [ - 129.89633222700004, - -1.154229424999855 - ], - [ - 129.91700280000012, - -1.156426690999837 - ], - [ - 129.93767337300002, - -1.156508070999919 - ], - [ - 129.95443769600016, - -1.16269296699997 - ], - [ - 129.960703972, - -1.176364841999913 - ] - ] - ], - [ - [ - [ - 109.6062931650001, - -0.974704684999892 - ], - [ - 109.63965905000006, - -0.996270440999893 - ], - [ - 109.65674889400012, - -1.003676039999888 - ], - [ - 109.67457116, - -1.003594658999987 - ], - [ - 109.68620853000013, - -0.996840101999865 - ], - [ - 109.69507897200006, - -0.988539320999891 - ], - [ - 109.70460045700005, - -0.983819268999966 - ], - [ - 109.7234806650001, - -0.987074476999837 - ], - [ - 109.73926842500012, - -0.998711846999925 - ], - [ - 109.75131269600016, - -1.014906507999882 - ], - [ - 109.75977623800011, - -1.0316708309999 - ], - [ - 109.75977623800011, - -1.103936455999886 - ], - [ - 109.76295006600006, - -1.109551690999879 - ], - [ - 109.77003014400012, - -1.11492278399993 - ], - [ - 109.77711022200018, - -1.121758721999868 - ], - [ - 109.78028405000006, - -1.131605726999965 - ], - [ - 109.77686608200005, - -1.140801690999851 - ], - [ - 109.76807701900006, - -1.146905205999929 - ], - [ - 109.74610436300006, - -1.155205987999821 - ], - [ - 109.69825280000012, - -1.190524997999844 - ], - [ - 109.68775475400017, - -1.19605885199995 - ], - [ - 109.67448978000002, - -1.199395440999893 - ], - [ - 109.60132897200006, - -1.230075778999975 - ], - [ - 109.56950931100013, - -1.247735283999987 - ], - [ - 109.5359806650001, - -1.259047132999882 - ], - [ - 109.50245201900006, - -1.292168877999913 - ], - [ - 109.47868899800002, - -1.298516533999859 - ], - [ - 109.46558678500017, - -1.293389580999929 - ], - [ - 109.44499759200002, - -1.28134531 - ], - [ - 109.42554772200006, - -1.266859632999882 - ], - [ - 109.41724694100006, - -1.254489841999842 - ], - [ - 109.42066491000017, - -1.231622002999842 - ], - [ - 109.44450931100008, - -1.168877862999864 - ], - [ - 109.45232181100002, - -1.00400156 - ], - [ - 109.45923912900005, - -0.985446872999987 - ], - [ - 109.4754337900001, - -0.976983330999872 - ], - [ - 109.49122155000006, - -0.979180596999853 - ], - [ - 109.52515709700018, - -0.988457940999908 - ], - [ - 109.54420006600017, - -0.9906552059999 - ], - [ - 109.55616295700011, - -0.987481377999842 - ], - [ - 109.57715905000006, - -0.97332122199991 - ], - [ - 109.58790123800006, - -0.970310153999989 - ], - [ - 109.6062931650001, - -0.974704684999892 - ] - ] - ], - [ - [ - [ - 128.39275149800008, - -1.035414321000019 - ], - [ - 128.37289472700016, - -1.037692966999913 - ], - [ - 128.36508222700016, - -1.036390882999825 - ], - [ - 128.36890709700018, - -1.03411223799985 - ], - [ - 128.36166425900015, - -1.033623955999943 - ], - [ - 128.34376061300011, - -1.029961846999896 - ], - [ - 128.33033287900005, - -1.020196221999868 - ], - [ - 128.32683353000002, - -1.006605726999823 - ], - [ - 128.3296004570001, - -0.991631768999881 - ], - [ - 128.3296004570001, - -0.978692315999865 - ], - [ - 128.30543053500017, - -0.962172132999896 - ], - [ - 128.30046634200002, - -0.955498955999843 - ], - [ - 128.30152428500017, - -0.95110442499994 - ], - [ - 128.3061629570001, - -0.943291924999869 - ], - [ - 128.31421959700006, - -0.939385674999869 - ], - [ - 128.32349694100012, - -0.941338799999912 - ], - [ - 128.33090253999998, - -0.949151299999897 - ], - [ - 128.33545983200023, - -0.960870049999897 - ], - [ - 128.34083092500006, - -0.969984632999967 - ], - [ - 128.3580835300002, - -0.979668877999842 - ], - [ - 128.36736087300008, - -0.98837656 - ], - [ - 128.4034936860002, - -0.995293877999828 - ], - [ - 128.41146894600016, - -1.009535414999931 - ], - [ - 128.40674889400023, - -1.025974216999927 - ], - [ - 128.39275149800008, - -1.035414321000019 - ] - ] - ], - [ - [ - [ - 134.92798912900017, - -1.072035414999874 - ], - [ - 134.94361412900005, - -1.079522393999923 - ], - [ - 134.96192467500012, - -1.070570570999905 - ], - [ - 134.97852623800006, - -1.027601820999948 - ], - [ - 134.9982202480002, - -1.018649998 - ], - [ - 134.99301191500004, - -1.033298434999921 - ], - [ - 134.99122155000023, - -1.049248955999929 - ], - [ - 134.9913843110002, - -1.08294036299985 - ], - [ - 134.9567163420002, - -1.12851327899989 - ], - [ - 134.9425561860002, - -1.133965752999842 - ], - [ - 134.92579186300006, - -1.135511976999879 - ], - [ - 134.89210045700005, - -1.134698174999869 - ], - [ - 134.87842858200023, - -1.130791924999954 - ], - [ - 134.86353600400017, - -1.121026299999841 - ], - [ - 134.85157311300023, - -1.108656507999896 - ], - [ - 134.83513431100008, - -1.071465752999899 - ], - [ - 134.81283613400004, - -1.049899997999972 - ], - [ - 134.80005944100017, - -1.027764580999914 - ], - [ - 134.81641686300006, - -1.000664971999967 - ], - [ - 134.8185327480002, - -0.995782158999916 - ], - [ - 134.82007897200006, - -0.976983330999872 - ], - [ - 134.82593834700018, - -0.965752862999949 - ], - [ - 134.82984459700018, - -0.960625908999859 - ], - [ - 134.83375084700018, - -0.956638278999876 - ], - [ - 134.8491317070001, - -0.944431247999901 - ], - [ - 134.86280358200023, - -0.937595309999963 - ], - [ - 134.87777753999998, - -0.936130467 - ], - [ - 134.92359459700018, - -0.949965101999908 - ], - [ - 134.93751061300017, - -0.957614841999856 - ], - [ - 134.94361412900005, - -0.966892184999892 - ], - [ - 134.9455672540001, - -0.975192966999884 - ], - [ - 134.9546004570001, - -0.9906552059999 - ], - [ - 134.9567163420002, - -1.000664971999967 - ], - [ - 134.95573978000007, - -1.008884372999887 - ], - [ - 134.95142662900005, - -1.024346612999906 - ], - [ - 134.95045006600017, - -1.035332940999865 - ], - [ - 134.93213951900012, - -1.057712497999887 - ], - [ - 134.92798912900017, - -1.072035414999874 - ] - ] - ], - [ - [ - [ - 98.91797936300006, - -0.940118096999896 - ], - [ - 98.93751061300011, - -0.960056247999887 - ], - [ - 98.94581139400012, - -0.984633070999976 - ], - [ - 98.9393009770001, - -1.003676039999888 - ], - [ - 98.93238366, - -0.996840101999865 - ], - [ - 98.92481530000006, - -0.992445570999891 - ], - [ - 98.91602623800011, - -0.990492445999934 - ], - [ - 98.90528405000006, - -0.9906552059999 - ], - [ - 98.9129337900001, - -1.006117445999919 - ], - [ - 98.92188561300006, - -1.017510674999969 - ], - [ - 98.92945397200018, - -1.029961846999896 - ], - [ - 98.9324650400001, - -1.049004815999979 - ], - [ - 98.9383244150001, - -1.065118096999953 - ], - [ - 98.95240319100017, - -1.075453382999882 - ], - [ - 98.96810957100016, - -1.083672783999958 - ], - [ - 98.9803166020001, - -1.093682549999855 - ], - [ - 98.98926842500006, - -1.111097914999917 - ], - [ - 99.00171959700006, - -1.144707940999936 - ], - [ - 99.010996941, - -1.158868096999868 - ], - [ - 99.02662194100012, - -1.174248955999914 - ], - [ - 99.0325626960001, - -1.182549737999892 - ], - [ - 99.03492272200018, - -1.192803643999909 - ], - [ - 99.03638756600006, - -1.205498955999886 - ], - [ - 99.0403751960001, - -1.210137627999899 - ], - [ - 99.04704837300008, - -1.213799737999864 - ], - [ - 99.06430097700016, - -1.234551690999865 - ], - [ - 99.067637566, - -1.24138762799987 - ], - [ - 99.06959069100006, - -1.251397393999866 - ], - [ - 99.06519616000017, - -1.251885674999855 - ], - [ - 99.05738366000017, - -1.26148854 - ], - [ - 99.0530705090001, - -1.272637627999842 - ], - [ - 99.05909264400006, - -1.278008721999981 - ], - [ - 99.07764733200011, - -1.283379815999865 - ], - [ - 99.08741295700005, - -1.296807549999855 - ], - [ - 99.09644616000006, - -1.332696221999853 - ], - [ - 99.11670983200005, - -1.366631768999895 - ], - [ - 99.14405358200011, - -1.389092705999886 - ], - [ - 99.16472415500002, - -1.414239190999879 - ], - [ - 99.165293816, - -1.456231377999941 - ], - [ - 99.15577233200011, - -1.451267184999907 - ], - [ - 99.13054446700008, - -1.428887627999885 - ], - [ - 99.12427819100012, - -1.428887627999885 - ], - [ - 99.13062584700006, - -1.448174737999821 - ], - [ - 99.1458439460001, - -1.469414971999896 - ], - [ - 99.17888431100008, - -1.504571221999953 - ], - [ - 99.18824303500011, - -1.510349216999927 - ], - [ - 99.19703209700006, - -1.512872002999856 - ], - [ - 99.20362389400006, - -1.51726653399983 - ], - [ - 99.206309441, - -1.528903903999932 - ], - [ - 99.206309441, - -1.556084893999852 - ], - [ - 99.20972741000006, - -1.572930596999853 - ], - [ - 99.21941165500019, - -1.579766533999873 - ], - [ - 99.23365319100017, - -1.580824476999823 - ], - [ - 99.251231316, - -1.580336195999934 - ], - [ - 99.2620548840001, - -1.58668385199995 - ], - [ - 99.27247155000012, - -1.601820570999948 - ], - [ - 99.278086785, - -1.62004973799985 - ], - [ - 99.27442467500006, - -1.634942315999979 - ], - [ - 99.28687584700018, - -1.653741143999852 - ], - [ - 99.29428144600016, - -1.686211846999839 - ], - [ - 99.29200280000006, - -1.718926690999865 - ], - [ - 99.27442467500006, - -1.737969658999859 - ], - [ - 99.26148522200006, - -1.66969166499986 - ], - [ - 99.25416100400011, - -1.654473565999879 - ], - [ - 99.2267358730002, - -1.614434502999842 - ], - [ - 99.21404056100002, - -1.623630466999913 - ], - [ - 99.20875084700006, - -1.625746351999837 - ], - [ - 99.20004316500015, - -1.628106377999885 - ], - [ - 99.21078535200016, - -1.638929945999877 - ], - [ - 99.24537194100017, - -1.715508721999939 - ], - [ - 99.25505618600002, - -1.756036065999879 - ], - [ - 99.25489342500006, - -1.77206796699987 - ], - [ - 99.24415123800006, - -1.778985283999859 - ], - [ - 99.23080488400015, - -1.777032158999916 - ], - [ - 99.20818118600019, - -1.770603122999901 - ], - [ - 99.18213951900012, - -1.773695570999891 - ], - [ - 99.16456139400006, - -1.778415622999887 - ], - [ - 99.14820397200006, - -1.785821221999882 - ], - [ - 99.13428795700005, - -1.796075127999899 - ], - [ - 99.11850019600016, - -1.802341403999861 - ], - [ - 99.10059655000006, - -1.799411716999842 - ], - [ - 98.98568769600016, - -1.740004164999888 - ], - [ - 98.96013431100019, - -1.713067315999908 - ], - [ - 98.89869225400011, - -1.687758070999877 - ], - [ - 98.88477623800011, - -1.679375908999916 - ], - [ - 98.84302819100017, - -1.621270440999865 - ], - [ - 98.83814537900011, - -1.617852471999939 - ], - [ - 98.82642662900011, - -1.612481377999899 - ], - [ - 98.8226017590001, - -1.607598565999837 - ], - [ - 98.83033287900011, - -1.570245049999954 - ], - [ - 98.81169681100002, - -1.528985283999916 - ], - [ - 98.65137780000006, - -1.298516533999859 - ], - [ - 98.63550866, - -1.289646091999899 - ], - [ - 98.63086998800006, - -1.284844658999916 - ], - [ - 98.63005618600008, - -1.280205987999892 - ], - [ - 98.63160241, - -1.269219658999845 - ], - [ - 98.63086998800006, - -1.264418226999851 - ], - [ - 98.61378014400006, - -1.229180596999981 - ], - [ - 98.60694420700011, - -1.220391533999845 - ], - [ - 98.59376061300006, - -1.198418877999828 - ], - [ - 98.59791100400011, - -1.176934502999885 - ], - [ - 98.62403405000006, - -1.134698174999869 - ], - [ - 98.64283287900011, - -1.093926690999893 - ], - [ - 98.64893639400012, - -1.072035414999874 - ], - [ - 98.65137780000006, - -1.049004815999979 - ], - [ - 98.6497501960001, - -1.004327080999843 - ], - [ - 98.65162194100017, - -0.98202890399989 - ], - [ - 98.65821373800006, - -0.963474216999884 - ], - [ - 98.66846764400006, - -0.954359632999811 - ], - [ - 98.68482506600012, - -0.948011976999865 - ], - [ - 98.70411217500012, - -0.944105726999879 - ], - [ - 98.72364342500012, - -0.942966403999932 - ], - [ - 98.73796634200019, - -0.9457333309999 - ], - [ - 98.76905358200011, - -0.956475518999909 - ], - [ - 98.78858483200005, - -0.956638278999876 - ], - [ - 98.80323326900012, - -0.949802341999941 - ], - [ - 98.8274845710001, - -0.927178643999895 - ], - [ - 98.84001712300008, - -0.922458591999884 - ], - [ - 98.88282311300006, - -0.91318124799993 - ], - [ - 98.898203972, - -0.915704033999845 - ], - [ - 98.89161217500006, - -0.935479424999954 - ], - [ - 98.91797936300006, - -0.940118096999896 - ] - ] - ], - [ - [ - [ - 130.93490644600016, - -0.925876559999892 - ], - [ - 130.93970787900005, - -0.932305596999896 - ], - [ - 130.94483483200017, - -0.932305596999896 - ], - [ - 130.96078535200016, - -0.922946872999873 - ], - [ - 130.98031660200016, - -0.917657158999887 - ], - [ - 131.02662194100006, - -0.913995049999841 - ], - [ - 131.03077233200005, - -0.913018487999864 - ], - [ - 131.03484134200002, - -0.914808851999851 - ], - [ - 131.04379316500015, - -0.922458591999884 - ], - [ - 131.05274498800011, - -0.932305596999896 - ], - [ - 131.07488040500007, - -0.966892184999892 - ], - [ - 131.07618248800017, - -0.974297783999887 - ], - [ - 131.06153405000023, - -0.989922783999873 - ], - [ - 131.05738366, - -1.000664971999967 - ], - [ - 131.05933678500017, - -1.004978122999887 - ], - [ - 131.068614129, - -1.021254164999917 - ], - [ - 131.07178795700005, - -1.0316708309999 - ], - [ - 131.072520379, - -1.077569268999881 - ], - [ - 131.03736412900005, - -1.226332289999945 - ], - [ - 131.01465905000012, - -1.268975518999895 - ], - [ - 131.00977623800023, - -1.288669528999932 - ], - [ - 131.00660241000017, - -1.31080494599999 - ], - [ - 130.99756920700017, - -1.3324520809999 - ], - [ - 130.98259524800014, - -1.348565362999878 - ], - [ - 130.96192467500012, - -1.353773695999863 - ], - [ - 130.948496941, - -1.348402601999823 - ], - [ - 130.93238366000006, - -1.326592705999943 - ], - [ - 130.92090905000012, - -1.319594007999882 - ], - [ - 130.90821373800023, - -1.321465752999842 - ], - [ - 130.89470462300008, - -1.32870859199987 - ], - [ - 130.87940514400012, - -1.340101820999919 - ], - [ - 130.86304772200018, - -1.337172132999811 - ], - [ - 130.85328209700006, - -1.330661716999913 - ], - [ - 130.8289494150001, - -1.291436455999886 - ], - [ - 130.82048587300002, - -1.281670830999857 - ], - [ - 130.79737389400006, - -1.264418226999851 - ], - [ - 130.7697046230002, - -1.248223565999893 - ], - [ - 130.75806725400017, - -1.238213799999912 - ], - [ - 130.74968509200014, - -1.223402601999837 - ], - [ - 130.74878991000006, - -1.216973565999837 - ], - [ - 130.7502547540001, - -1.202732028999918 - ], - [ - 130.74968509200014, - -1.19605885199995 - ], - [ - 130.7462671230002, - -1.190036716999856 - ], - [ - 130.74187259200002, - -1.186293226999837 - ], - [ - 130.73780358200005, - -1.184340101999879 - ], - [ - 130.7360132170002, - -1.183200778999847 - ], - [ - 130.73226972700016, - -1.167901299999883 - ], - [ - 130.7312117850001, - -1.158379815999879 - ], - [ - 130.72925866000006, - -1.150811455999843 - ], - [ - 130.72234134200008, - -1.141534112999878 - ], - [ - 130.71176191499998, - -1.132500908999958 - ], - [ - 130.70346113400004, - -1.127373955999857 - ], - [ - 130.69597415500007, - -1.120700778999904 - ], - [ - 130.68824303500006, - -1.107354424999897 - ], - [ - 130.71013431100008, - -1.092868747999844 - ], - [ - 130.71192467500023, - -1.069919528999861 - ], - [ - 130.7018335300002, - -1.045098565999893 - ], - [ - 130.68824303500006, - -1.024834893999895 - ], - [ - 130.64942467500012, - -0.98837656 - ], - [ - 130.64975019600016, - -0.973809502999899 - ], - [ - 130.68067467500012, - -0.956638278999876 - ], - [ - 130.79004967500006, - -0.929294528999904 - ], - [ - 130.83057701900012, - -0.907484632999854 - ], - [ - 130.86850019600004, - -0.893812757999825 - ], - [ - 130.891856316, - -0.889906507999825 - ], - [ - 130.91293379000015, - -0.894219658999916 - ], - [ - 130.92904707100004, - -0.911553643999909 - ], - [ - 130.93490644600016, - -0.925876559999892 - ] - ] - ], - [ - [ - [ - 130.83912194100006, - -0.767510674999841 - ], - [ - 130.85206139400023, - -0.769219658999845 - ], - [ - 130.85718834700006, - -0.768731377999856 - ], - [ - 130.87354576900023, - -0.764580987999821 - ], - [ - 130.87940514400012, - -0.764743747999887 - ], - [ - 130.88941491000017, - -0.768161716999884 - ], - [ - 130.90601647200006, - -0.776625257999839 - ], - [ - 130.91724694100006, - -0.778415622999916 - ], - [ - 130.92457116000006, - -0.780694268999895 - ], - [ - 130.91675866000017, - -0.785739841999913 - ], - [ - 130.90479576900023, - -0.790297132999953 - ], - [ - 130.89991295700017, - -0.791436455999985 - ], - [ - 130.89112389400012, - -0.794854424999912 - ], - [ - 130.8824975920002, - -0.795993747999859 - ], - [ - 130.87574303500006, - -0.7992489559999 - ], - [ - 130.87322024800002, - -0.808851820999877 - ], - [ - 130.876719597, - -0.817559502999856 - ], - [ - 130.88428795700005, - -0.819512627999899 - ], - [ - 130.89161217500006, - -0.820407809999892 - ], - [ - 130.8937280610002, - -0.82626718499985 - ], - [ - 130.88965905000023, - -0.832777601999837 - ], - [ - 130.8816024100001, - -0.839532158999958 - ], - [ - 130.87183678500006, - -0.844659112999892 - ], - [ - 130.8475041020001, - -0.851006768999909 - ], - [ - 130.81934655000012, - -0.870293877999941 - ], - [ - 130.80079186300011, - -0.874607028999861 - ], - [ - 130.76221764400012, - -0.876641533999887 - ], - [ - 130.617930535, - -0.908461195999919 - ], - [ - 130.54346764400023, - -0.913832289999874 - ], - [ - 130.51002037900017, - -0.922458591999884 - ], - [ - 130.51002037900017, - -0.914971612999906 - ], - [ - 130.51986738400004, - -0.91130950299987 - ], - [ - 130.52369225400005, - -0.908786716999856 - ], - [ - 130.50359134200008, - -0.90740325299987 - ], - [ - 130.48731530000023, - -0.903903903999961 - ], - [ - 130.47543378999998, - -0.905938408999987 - ], - [ - 130.46851647200018, - -0.922458591999884 - ], - [ - 130.46168053500017, - -0.922458591999884 - ], - [ - 130.45264733200005, - -0.910577080999843 - ], - [ - 130.43677819100006, - -0.913262627999913 - ], - [ - 130.400157097, - -0.929294528999904 - ], - [ - 130.40943444100017, - -0.912041924999897 - ], - [ - 130.42774498800023, - -0.902927341999984 - ], - [ - 130.44068444100006, - -0.89316171699987 - ], - [ - 130.434336785, - -0.874607028999861 - ], - [ - 130.44752037900005, - -0.860935153999918 - ], - [ - 130.44841556100008, - -0.818617445999905 - ], - [ - 130.46168053500017, - -0.805108330999929 - ], - [ - 130.46127363400015, - -0.816013278999918 - ], - [ - 130.46168053500017, - -0.819431247999916 - ], - [ - 130.46851647200018, - -0.819431247999916 - ], - [ - 130.47071373800006, - -0.806735934999949 - ], - [ - 130.47852623800006, - -0.799899997999844 - ], - [ - 130.490000847, - -0.7992489559999 - ], - [ - 130.50318444100017, - -0.805108330999929 - ], - [ - 130.49463951900023, - -0.827894789999874 - ], - [ - 130.5190535820001, - -0.83961353999986 - ], - [ - 130.5509546230002, - -0.834161065999908 - ], - [ - 130.56470787900005, - -0.805108330999929 - ], - [ - 130.57398522200018, - -0.809828382999854 - ], - [ - 130.58041425899998, - -0.815606377999913 - ], - [ - 130.58464603000013, - -0.823174737999864 - ], - [ - 130.58643639400012, - -0.833103122999859 - ], - [ - 130.6158960300002, - -0.811781507999896 - ], - [ - 130.63119550900015, - -0.806247653999961 - ], - [ - 130.64665774800008, - -0.812595309999907 - ], - [ - 130.64503014400023, - -0.814222914999931 - ], - [ - 130.64380944100006, - -0.814873955999886 - ], - [ - 130.64258873800011, - -0.816013278999918 - ], - [ - 130.64112389400023, - -0.819431247999916 - ], - [ - 130.65430748800011, - -0.823988539999874 - ], - [ - 130.66391035200016, - -0.82089609199997 - ], - [ - 130.67188561300023, - -0.815199476999808 - ], - [ - 130.68067467500012, - -0.812595309999907 - ], - [ - 130.69459069100017, - -0.815199476999808 - ], - [ - 130.71851647200006, - -0.824314059999978 - ], - [ - 130.73275800900015, - -0.82626718499985 - ], - [ - 130.7579858730002, - -0.818942966999927 - ], - [ - 130.78028405000023, - -0.805922132999939 - ], - [ - 130.80014082100016, - -0.801446221999882 - ], - [ - 130.81788170700023, - -0.819431247999916 - ], - [ - 130.81918379000015, - -0.809665622999887 - ], - [ - 130.81755618600013, - -0.805922132999939 - ], - [ - 130.81104576900012, - -0.798923434999878 - ], - [ - 130.81657962300002, - -0.788262627999927 - ], - [ - 130.80062910200004, - -0.769952080999872 - ], - [ - 130.8042098320001, - -0.757256768999824 - ], - [ - 130.81185957100004, - -0.764743747999887 - ], - [ - 130.81999759200008, - -0.767347914999874 - ], - [ - 130.83912194100006, - -0.767510674999841 - ] - ] - ], - [ - [ - [ - 135.42335045700023, - -0.654880466999899 - ], - [ - 135.429453972, - -0.65545012799987 - ], - [ - 135.44092858200017, - -0.652439059999878 - ], - [ - 135.4467879570001, - -0.652113539999945 - ], - [ - 135.4524845710001, - -0.654229424999855 - ], - [ - 135.463145379, - -0.661390882999811 - ], - [ - 135.46900475400017, - -0.664239190999851 - ], - [ - 135.49878991000017, - -0.672458591999927 - ], - [ - 135.55128014400012, - -0.677178643999852 - ], - [ - 135.56267337300008, - -0.676364841999842 - ], - [ - 135.58334394599999, - -0.666680596999882 - ], - [ - 135.5924585300002, - -0.67546965899993 - ], - [ - 135.60157311300006, - -0.695896091999913 - ], - [ - 135.66651451900023, - -0.682793877999856 - ], - [ - 135.67725670700005, - -0.685642184999892 - ], - [ - 135.67945397200006, - -0.691338799999954 - ], - [ - 135.688731316, - -0.708672783999944 - ], - [ - 135.6909285820001, - -0.719821872999873 - ], - [ - 135.69507897200006, - -0.729587497999916 - ], - [ - 135.70492597700016, - -0.726739190999879 - ], - [ - 135.71631920700023, - -0.719496351999851 - ], - [ - 135.72510826900012, - -0.716403903999876 - ], - [ - 135.75709069100017, - -0.739353122999944 - ], - [ - 135.77751712300008, - -0.748711846999896 - ], - [ - 135.78646894599999, - -0.740329684999921 - ], - [ - 135.79281660200004, - -0.72918059699991 - ], - [ - 135.80860436300006, - -0.714125257999896 - ], - [ - 135.8283797540001, - -0.700860283999873 - ], - [ - 135.84742272200018, - -0.695896091999913 - ], - [ - 135.8693139980002, - -0.703789971999882 - ], - [ - 135.89356530000012, - -0.721123955999872 - ], - [ - 135.96631920700005, - -0.796075127999842 - ], - [ - 136.04558353000002, - -0.853204033999901 - ], - [ - 136.06576582100016, - -0.871677341999842 - ], - [ - 136.0776473320001, - -0.899997653999876 - ], - [ - 136.0846460300002, - -0.910251559999907 - ], - [ - 136.09253991000017, - -0.918877862999821 - ], - [ - 136.10499108200005, - -0.927829684999935 - ], - [ - 136.10906009200002, - -0.940118096999896 - ], - [ - 136.11182701900012, - -0.953789971999839 - ], - [ - 136.1147567070001, - -0.963474216999884 - ], - [ - 136.12973066500015, - -0.978448174999826 - ], - [ - 136.1481225920002, - -0.991387627999842 - ], - [ - 136.1635848320001, - -1.004978122999887 - ], - [ - 136.17335045700017, - -1.031345309999878 - ], - [ - 136.18734785200004, - -1.04957447699995 - ], - [ - 136.19629967500023, - -1.066582940999837 - ], - [ - 136.20875084700018, - -1.064060153999904 - ], - [ - 136.22055097700004, - -1.056735934999907 - ], - [ - 136.22461998800011, - -1.05282968499999 - ], - [ - 136.24594160200016, - -1.04876067499994 - ], - [ - 136.27344811300011, - -1.047295830999886 - ], - [ - 136.297129754, - -1.054375908999859 - ], - [ - 136.30730228000007, - -1.076348565999865 - ], - [ - 136.3167423840001, - -1.08562590899983 - ], - [ - 136.37566165500002, - -1.093682549999855 - ], - [ - 136.3849389980002, - -1.107517184999864 - ], - [ - 136.38111412900017, - -1.123223565999822 - ], - [ - 136.368418816, - -1.136163018999838 - ], - [ - 136.35132897200018, - -1.141534112999878 - ], - [ - 136.34066816500004, - -1.147393487999835 - ], - [ - 136.29363040500002, - -1.183200778999847 - ], - [ - 136.2306421230002, - -1.192966403999876 - ], - [ - 136.214691602, - -1.199476820999877 - ], - [ - 136.20118248800011, - -1.207940362999906 - ], - [ - 136.18165123800023, - -1.215427341999884 - ], - [ - 136.16065514400012, - -1.220879815999822 - ], - [ - 136.14283287900005, - -1.223402601999837 - ], - [ - 136.09945722700016, - -1.215997002999856 - ], - [ - 136.03638756600006, - -1.176446221999896 - ], - [ - 135.99138431100008, - -1.168877862999864 - ], - [ - 135.96851647200006, - -1.172621351999894 - ], - [ - 135.92994225400017, - -1.186293226999837 - ], - [ - 135.906016472, - -1.189385674999912 - ], - [ - 135.88502037900017, - -1.183038018999881 - ], - [ - 135.86402428500006, - -1.167575778999861 - ], - [ - 135.84620201900017, - -1.147637627999956 - ], - [ - 135.83432050900004, - -1.12851327899989 - ], - [ - 135.8282983730002, - -1.107842705999886 - ], - [ - 135.83432050900004, - -1.049004815999979 - ], - [ - 135.83106530000018, - -1.03964609199987 - ], - [ - 135.81641686300017, - -1.020277601999851 - ], - [ - 135.8132430350001, - -1.014906507999882 - ], - [ - 135.81177819100006, - -1.003513279 - ], - [ - 135.7994897800002, - -0.970310153999989 - ], - [ - 135.78101647200006, - -0.872653903999989 - ], - [ - 135.76539147200018, - -0.839288018999838 - ], - [ - 135.74097741, - -0.81902434699991 - ], - [ - 135.71908613399998, - -0.824802341999884 - ], - [ - 135.699961785, - -0.844903252999842 - ], - [ - 135.68409264400006, - -0.867120049999883 - ], - [ - 135.66081790500007, - -0.887139580999943 - ], - [ - 135.64063561300023, - -0.881605726999837 - ], - [ - 135.48487389400006, - -0.757256768999824 - ], - [ - 135.47901451900023, - -0.768731377999856 - ], - [ - 135.47974694100017, - -0.780205987999906 - ], - [ - 135.4917098320001, - -0.805108330999929 - ], - [ - 135.45866946700008, - -0.792738539999903 - ], - [ - 135.4226180350001, - -0.762383721999839 - ], - [ - 135.3937280610002, - -0.723402601999936 - ], - [ - 135.3698836600001, - -0.653497002999828 - ], - [ - 135.37037194100017, - -0.635918877999899 - ], - [ - 135.3893335300002, - -0.627618096999825 - ], - [ - 135.39893639400006, - -0.631036065999837 - ], - [ - 135.41456139400023, - -0.648695570999934 - ], - [ - 135.42335045700023, - -0.654880466999899 - ] - ] - ], - [ - [ - [ - 127.31804446700019, - -0.780043226999851 - ], - [ - 127.31983483200005, - -0.793633721999896 - ], - [ - 127.27881920700005, - -0.805596612999835 - ], - [ - 127.26880944100017, - -0.805108330999929 - ], - [ - 127.26490319100017, - -0.802015882999854 - ], - [ - 127.25310306100013, - -0.788995049999954 - ], - [ - 127.24830162900005, - -0.785251559999935 - ], - [ - 127.21656334700018, - -0.782403252999899 - ], - [ - 127.18018639400012, - -0.783868096999853 - ], - [ - 127.15552819100012, - -0.772393487999821 - ], - [ - 127.15894616, - -0.730645440999879 - ], - [ - 127.16895592500006, - -0.710219007999811 - ], - [ - 127.18018639400012, - -0.69312916499986 - ], - [ - 127.1893009770001, - -0.674981377999941 - ], - [ - 127.19459069100006, - -0.635186455999872 - ], - [ - 127.20085696700019, - -0.622816664999917 - ], - [ - 127.21404056100008, - -0.615411065999851 - ], - [ - 127.24415123800011, - -0.613946221999882 - ], - [ - 127.25082441500015, - -0.614922783999859 - ], - [ - 127.25660241, - -0.616957289999888 - ], - [ - 127.26124108200023, - -0.62021249799993 - ], - [ - 127.24878991, - -0.637627862999892 - ], - [ - 127.25513756600006, - -0.650485934999921 - ], - [ - 127.26807701900023, - -0.661228122999844 - ], - [ - 127.27507571700002, - -0.67253997199991 - ], - [ - 127.27800540500007, - -0.675713799999969 - ], - [ - 127.29175866000017, - -0.694512627999842 - ], - [ - 127.29615319100006, - -0.702732028999932 - ], - [ - 127.29721113400004, - -0.712579033999859 - ], - [ - 127.29517662900017, - -0.733656507999882 - ], - [ - 127.29615319100006, - -0.743747653999847 - ], - [ - 127.31804446700019, - -0.780043226999851 - ] - ] - ], - [ - [ - [ - 130.68799889400012, - -0.463148695999962 - ], - [ - 130.68344160200016, - -0.47722747199991 - ], - [ - 130.65455162900005, - -0.516696872999887 - ], - [ - 130.64112389400023, - -0.527520440999965 - ], - [ - 130.5963647800002, - -0.538506768999838 - ], - [ - 130.58106530000023, - -0.539239190999865 - ], - [ - 130.57154381600006, - -0.531996351999851 - ], - [ - 130.58366946700002, - -0.523858330999829 - ], - [ - 130.59766686300011, - -0.49081796699987 - ], - [ - 130.5968530610002, - -0.464532158999944 - ], - [ - 130.56470787900005, - -0.476739190999922 - ], - [ - 130.56226647200018, - -0.481052341999842 - ], - [ - 130.55827884200014, - -0.495049737999977 - ], - [ - 130.55445397200012, - -0.50090911299985 - ], - [ - 130.54761803500017, - -0.505303643999824 - ], - [ - 130.53370201900012, - -0.509860934999864 - ], - [ - 130.52711022200006, - -0.514336846999839 - ], - [ - 130.51710045700023, - -0.517754815999851 - ], - [ - 130.46168053500017, - -0.525160414999917 - ], - [ - 130.47046959700006, - -0.514336846999839 - ], - [ - 130.48243248800006, - -0.509209893999909 - ], - [ - 130.49252363400015, - -0.503350518999881 - ], - [ - 130.49634850400005, - -0.490411065999865 - ], - [ - 130.48113040500007, - -0.495782158999916 - ], - [ - 130.46949303500017, - -0.490329684999892 - ], - [ - 130.46094811300023, - -0.478122653999904 - ], - [ - 130.45484459700006, - -0.463799737999835 - ], - [ - 130.46355228000007, - -0.465508721999839 - ], - [ - 130.46859785200016, - -0.467217705999843 - ], - [ - 130.47217858200023, - -0.470310153999918 - ], - [ - 130.47584069100012, - -0.476739190999922 - ], - [ - 130.48218834700006, - -0.464532158999944 - ], - [ - 130.49382571700002, - -0.450127862999892 - ], - [ - 130.50505618600002, - -0.441338799999826 - ], - [ - 130.51002037900017, - -0.4457333309999 - ], - [ - 130.51343834700018, - -0.461846612999963 - ], - [ - 130.52247155000012, - -0.468926690999851 - ], - [ - 130.53516686300006, - -0.468926690999851 - ], - [ - 130.55046634200002, - -0.463799737999835 - ], - [ - 130.55933678500017, - -0.455987237999835 - ], - [ - 130.56959069100012, - -0.444105726999879 - ], - [ - 130.58228600400017, - -0.433200778999989 - ], - [ - 130.60613040500007, - -0.426690362999906 - ], - [ - 130.61011803500006, - -0.422621351999865 - ], - [ - 130.61312910200004, - -0.417575779 - ], - [ - 130.61744225400005, - -0.412530205999886 - ], - [ - 130.62501061300006, - -0.409600518999866 - ], - [ - 130.63209069100006, - -0.41130950299987 - ], - [ - 130.64584394600016, - -0.419366143999909 - ], - [ - 130.67025800900004, - -0.43027109199997 - ], - [ - 130.67758222700004, - -0.435804945999905 - ], - [ - 130.6863712900001, - -0.449151299999826 - ], - [ - 130.68799889400012, - -0.463148695999962 - ] - ] - ], - [ - [ - [ - 129.8881942070001, - -0.494724216999956 - ], - [ - 129.87794030000018, - -0.5023739559999 - ], - [ - 129.8644311860002, - -0.49863046699987 - ], - [ - 129.851410352, - -0.481622002999984 - ], - [ - 129.84408613400004, - -0.462334893999952 - ], - [ - 129.84424889400017, - -0.444268487999935 - ], - [ - 129.84888756600017, - -0.432386976999808 - ], - [ - 129.85450280000006, - -0.426527601999851 - ], - [ - 129.859629754, - -0.422946872999887 - ], - [ - 129.87378991000006, - -0.414971612999835 - ], - [ - 129.89234459700006, - -0.409356377999828 - ], - [ - 129.90235436300011, - -0.408461195999934 - ], - [ - 129.91000410200016, - -0.413506768999952 - ], - [ - 129.9161889980002, - -0.427422783999845 - ], - [ - 129.91382897200006, - -0.442559502999842 - ], - [ - 129.90853925899998, - -0.449395440999865 - ], - [ - 129.90284264400012, - -0.459161065999893 - ], - [ - 129.89714603000002, - -0.479180596999953 - ], - [ - 129.8881942070001, - -0.494724216999956 - ] - ] - ], - [ - [ - [ - 121.85385175900004, - -0.401055596999853 - ], - [ - 121.89551842500006, - -0.42839934699991 - ], - [ - 121.90170332100016, - -0.437188408999887 - ], - [ - 121.91065514400006, - -0.460381768999909 - ], - [ - 121.91602623800023, - -0.469903252999913 - ], - [ - 121.91358483200011, - -0.486423434999892 - ], - [ - 121.90642337300008, - -0.499281507999825 - ], - [ - 121.89478600400017, - -0.507907809999921 - ], - [ - 121.87842858200023, - -0.510918877999913 - ], - [ - 121.87452233200023, - -0.505954684999878 - ], - [ - 121.847911004, - -0.483330987999906 - ], - [ - 121.83472741000006, - -0.476739190999922 - ], - [ - 121.84644616000006, - -0.500258070999891 - ], - [ - 121.84473717500023, - -0.507989190999893 - ], - [ - 121.83090254000015, - -0.510918877999913 - ], - [ - 121.81657962300008, - -0.507745049999855 - ], - [ - 121.80128014400012, - -0.493584893999923 - ], - [ - 121.79004967500012, - -0.490411065999865 - ], - [ - 121.746348504, - -0.483656507999839 - ], - [ - 121.73536217500023, - -0.47991301899998 - ], - [ - 121.72559655000012, - -0.483086846999868 - ], - [ - 121.700938347, - -0.535088799999841 - ], - [ - 121.68897545700011, - -0.54314544099995 - ], - [ - 121.6717228520001, - -0.55038827899989 - ], - [ - 121.65455162900005, - -0.552422783999916 - ], - [ - 121.64226321700019, - -0.545586846999981 - ], - [ - 121.64177493600019, - -0.531019789999874 - ], - [ - 121.65015709700018, - -0.512627862999835 - ], - [ - 121.6798608730002, - -0.468926690999851 - ], - [ - 121.689707879, - -0.458184502999828 - ], - [ - 121.70191491000011, - -0.449639580999985 - ], - [ - 121.73422285200004, - -0.434991143999895 - ], - [ - 121.74089603000007, - -0.429131768999937 - ], - [ - 121.75212649800008, - -0.401055596999853 - ], - [ - 121.77857506600006, - -0.424574476999808 - ], - [ - 121.79948978000013, - -0.420505466999856 - ], - [ - 121.82211347700016, - -0.406670830999857 - ], - [ - 121.85385175900004, - -0.401055596999853 - ] - ] - ], - [ - [ - [ - 132.4371850920002, - -0.347100518999923 - ], - [ - 132.6792098320001, - -0.368910414999888 - ], - [ - 132.70915774800008, - -0.360039971999839 - ], - [ - 132.90528405000018, - -0.453220309999878 - ], - [ - 132.9254663420002, - -0.456312757999868 - ], - [ - 132.93677819100017, - -0.454034112999892 - ], - [ - 132.95980879000015, - -0.44198984199987 - ], - [ - 132.97510826900012, - -0.444756768999923 - ], - [ - 132.97868899800008, - -0.451836846999896 - ], - [ - 132.97868899800008, - -0.460870049999897 - ], - [ - 132.98340905000006, - -0.469903252999913 - ], - [ - 132.99968509200014, - -0.480889580999957 - ], - [ - 133.03353925899998, - -0.497328382999953 - ], - [ - 133.04835045700017, - -0.507907809999921 - ], - [ - 133.0573022800002, - -0.511163018999952 - ], - [ - 133.06959069100006, - -0.511895440999979 - ], - [ - 133.08985436300023, - -0.510918877999913 - ], - [ - 133.0952254570001, - -0.513767184999949 - ], - [ - 133.10670006600006, - -0.527520440999965 - ], - [ - 133.11329186300023, - -0.531996351999851 - ], - [ - 133.12322024800002, - -0.533379815999837 - ], - [ - 133.14470462300008, - -0.531182549999841 - ], - [ - 133.15479576900012, - -0.531996351999851 - ], - [ - 133.2889103520001, - -0.628513278999989 - ], - [ - 133.31495201900023, - -0.653985283999916 - ], - [ - 133.326019727, - -0.678806247999873 - ], - [ - 133.33562259200008, - -0.690362237999977 - ], - [ - 133.3790796230002, - -0.717705987999864 - ], - [ - 133.39161217500012, - -0.72323984199997 - ], - [ - 133.55836022200006, - -0.743747653999847 - ], - [ - 133.56267337300002, - -0.745212497999901 - ], - [ - 133.5672306650001, - -0.748304945999891 - ], - [ - 133.57276451900012, - -0.750909112999878 - ], - [ - 133.57935631600017, - -0.750583591999856 - ], - [ - 133.58619225400017, - -0.736911716999913 - ], - [ - 133.59245853000002, - -0.732110283999845 - ], - [ - 133.59750410200016, - -0.726739190999879 - ], - [ - 133.60474694100017, - -0.725681248 - ], - [ - 133.61695397200018, - -0.733656507999882 - ], - [ - 133.63306725400005, - -0.741875908999958 - ], - [ - 133.65609785200004, - -0.747002862999892 - ], - [ - 133.74537194100006, - -0.750746351999823 - ], - [ - 133.75912519600016, - -0.745212497999901 - ], - [ - 133.75123131600017, - -0.730645440999879 - ], - [ - 133.75993899800008, - -0.720879815999922 - ], - [ - 133.7740991550002, - -0.717217705999886 - ], - [ - 133.79037519600004, - -0.718519789999874 - ], - [ - 133.80591881600006, - -0.72323984199997 - ], - [ - 133.81226647200018, - -0.727634372999873 - ], - [ - 133.82984459700012, - -0.743747653999847 - ], - [ - 133.83838951900012, - -0.743096612999892 - ], - [ - 133.85084069100006, - -0.739190362999977 - ], - [ - 133.90723717500006, - -0.731133721999868 - ], - [ - 133.94841556100008, - -0.731540622999873 - ], - [ - 133.96387780000006, - -0.729587497999916 - ], - [ - 133.9772241550002, - -0.72323984199997 - ], - [ - 133.99488366, - -0.73333098799985 - ], - [ - 134.05640709700018, - -0.795179945999934 - ], - [ - 134.0667423840001, - -0.802422783999859 - ], - [ - 134.08936608200023, - -0.807549737999878 - ], - [ - 134.1007593110002, - -0.812595309999907 - ], - [ - 134.10914147200018, - -0.820082289999959 - ], - [ - 134.12533613400004, - -0.83879973799985 - ], - [ - 134.1349389980002, - -0.846774997999901 - ], - [ - 134.163828972, - -0.858086846999882 - ], - [ - 134.17212975400017, - -0.863864841999842 - ], - [ - 134.17123457099999, - -0.875909112999864 - ], - [ - 134.15154056100008, - -0.882989190999908 - ], - [ - 134.08871503999998, - -0.890069268999881 - ], - [ - 134.07447350400017, - -0.894952080999857 - ], - [ - 134.06812584700006, - -0.90740325299987 - ], - [ - 134.0665796230002, - -0.932305596999896 - ], - [ - 134.05892988399998, - -0.948174737999921 - ], - [ - 134.04468834700018, - -0.951348565999979 - ], - [ - 134.03614342500023, - -0.957777601999823 - ], - [ - 134.07797285200016, - -1.045586846999882 - ], - [ - 134.0905054050002, - -1.062676690999922 - ], - [ - 134.09506269600004, - -1.071954033999887 - ], - [ - 134.09799238400015, - -1.093438408999916 - ], - [ - 134.103770379, - -1.103936455999886 - ], - [ - 134.11215254000015, - -1.115411065999837 - ], - [ - 134.12745201900023, - -1.148370049999983 - ], - [ - 134.14144941499998, - -1.165785414999874 - ], - [ - 134.159922722, - -1.18368906 - ], - [ - 134.17847741, - -1.197442315999851 - ], - [ - 134.1928817070001, - -1.202894789999888 - ], - [ - 134.20378665500007, - -1.21257903399993 - ], - [ - 134.26742597700004, - -1.330254815999908 - ], - [ - 134.28199303500017, - -1.350192966999899 - ], - [ - 134.23910566499998, - -1.416273695999905 - ], - [ - 134.23047936300006, - -1.436293226999865 - ], - [ - 134.23047936300006, - -1.476739190999908 - ], - [ - 134.22144616000017, - -1.54404062299993 - ], - [ - 134.21583092500006, - -1.560316664999874 - ], - [ - 134.20720462300008, - -1.573500257999825 - ], - [ - 134.15430748800011, - -1.628350518999824 - ], - [ - 134.13900800900015, - -1.638116143999866 - ], - [ - 134.12598717500018, - -1.652276299999969 - ], - [ - 134.11719811300011, - -1.655450127999856 - ], - [ - 134.10531660200016, - -1.657484632999882 - ], - [ - 134.09644616, - -1.663181247999859 - ], - [ - 134.09034264400012, - -1.671807549999869 - ], - [ - 134.08708743600008, - -1.682793877999913 - ], - [ - 134.0892033210001, - -1.697035414999917 - ], - [ - 134.10352623800017, - -1.737725518999909 - ], - [ - 134.14486738399998, - -1.939141533999901 - ], - [ - 134.1495874360002, - -2.015313408999873 - ], - [ - 134.14861087300002, - -2.025485934999907 - ], - [ - 134.14975019600016, - -2.028985283999987 - ], - [ - 134.15284264400023, - -2.033786716999899 - ], - [ - 134.15552819100006, - -2.039483330999872 - ], - [ - 134.15528405000006, - -2.045830987999906 - ], - [ - 134.15137780000006, - -2.047295830999872 - ], - [ - 134.14429772200006, - -2.045830987999906 - ], - [ - 134.13786868600013, - -2.045342705999829 - ], - [ - 134.1349389980002, - -2.049574476999851 - ], - [ - 134.11963951900023, - -2.11386484199987 - ], - [ - 134.1206160820001, - -2.135349216999884 - ], - [ - 134.12614993600002, - -2.144952080999872 - ], - [ - 134.14234459700018, - -2.1547177059999 - ], - [ - 134.14861087300002, - -2.1625302059999 - ], - [ - 134.152110222, - -2.175469658999987 - ], - [ - 134.15162194100006, - -2.184991143999895 - ], - [ - 134.14966881600017, - -2.194594007999882 - ], - [ - 134.14861087300002, - -2.207207940999865 - ], - [ - 134.15170332100004, - -2.22763437299993 - ], - [ - 134.16570071700008, - -2.259698174999912 - ], - [ - 134.16895592500012, - -2.279229424999897 - ], - [ - 134.16277103000007, - -2.301690362999977 - ], - [ - 134.1616317070001, - -2.310235283999916 - ], - [ - 134.16480553500017, - -2.320489190999851 - ], - [ - 134.17945397200018, - -2.33562590899993 - ], - [ - 134.18262780000023, - -2.34441497199991 - ], - [ - 134.18572024800002, - -2.361911716999856 - ], - [ - 134.19336998800006, - -2.379082940999879 - ], - [ - 134.20435631600006, - -2.39511484199987 - ], - [ - 134.21680748800023, - -2.408949476999879 - ], - [ - 134.25912519600016, - -2.440524997999873 - ], - [ - 134.27084394600016, - -2.465020440999979 - ], - [ - 134.28435306100013, - -2.479261976999894 - ], - [ - 134.30014082100016, - -2.49195728999986 - ], - [ - 134.31299889400006, - -2.498304945999976 - ], - [ - 134.31934655000012, - -2.505303643999881 - ], - [ - 134.3302514980002, - -2.522230726999865 - ], - [ - 134.3375757170002, - -2.541924737999892 - ], - [ - 134.34546959700018, - -2.576592705999872 - ], - [ - 134.3636173840001, - -2.617852471999839 - ], - [ - 134.36150149800008, - -2.634942315999879 - ], - [ - 134.38135826900017, - -2.653985283999873 - ], - [ - 134.39063561300011, - -2.681084893999895 - ], - [ - 134.40170332100016, - -2.744805596999853 - ], - [ - 134.40902754000015, - -2.755140882999854 - ], - [ - 134.42074629000015, - -2.766045830999843 - ], - [ - 134.43165123800023, - -2.77939218499985 - ], - [ - 134.44027754000004, - -2.808282158999944 - ], - [ - 134.46387780000018, - -2.854668877999913 - ], - [ - 134.46387780000018, - -2.862074476999823 - ], - [ - 134.48861738400015, - -2.861260674999897 - ], - [ - 134.50554446700002, - -2.853773695999919 - ], - [ - 134.53272545700023, - -2.834161065999865 - ], - [ - 134.52662194100006, - -2.821954033999887 - ], - [ - 134.5190535820001, - -2.778903903999861 - ], - [ - 134.51465905000012, - -2.769626559999907 - ], - [ - 134.50318444100017, - -2.750909112999835 - ], - [ - 134.49927819100017, - -2.738539320999891 - ], - [ - 134.49838300899998, - -2.724867445999948 - ], - [ - 134.50025475400005, - -2.69695403399983 - ], - [ - 134.49927819100017, - -2.683282158999887 - ], - [ - 134.49463951900023, - -2.670098565999837 - ], - [ - 134.48145592500012, - -2.64544036299985 - ], - [ - 134.47754967500012, - -2.634942315999879 - ], - [ - 134.47396894600004, - -2.606540622999844 - ], - [ - 134.47437584700006, - -2.580743096999825 - ], - [ - 134.4780379570001, - -2.558038018999866 - ], - [ - 134.48438561300023, - -2.539320570999905 - ], - [ - 134.49634850400017, - -2.517836195999877 - ], - [ - 134.50928795700017, - -2.507745049999912 - ], - [ - 134.55372155000006, - -2.491469007999882 - ], - [ - 134.54118899800008, - -2.486748955999872 - ], - [ - 134.53451582100004, - -2.478773695999905 - ], - [ - 134.53565514400023, - -2.469984632999854 - ], - [ - 134.54639733200005, - -2.462985934999864 - ], - [ - 134.55632571700008, - -2.4647763 - ], - [ - 134.57699628999998, - -2.480726820999948 - ], - [ - 134.584239129, - -2.484633070999863 - ], - [ - 134.60425866000017, - -2.488457940999879 - ], - [ - 134.62305748800023, - -2.498142184999921 - ], - [ - 134.63843834700018, - -2.511163018999909 - ], - [ - 134.648203972, - -2.525079033999901 - ], - [ - 134.65805097700004, - -2.562758070999962 - ], - [ - 134.66684003999998, - -2.825616143999852 - ], - [ - 134.67001386800004, - -2.837660414999945 - ], - [ - 134.7013452480002, - -2.958672783999859 - ], - [ - 134.72706139400017, - -2.985772393999966 - ], - [ - 134.77222741, - -2.977634372999873 - ], - [ - 134.82781009200008, - -2.913750908999859 - ], - [ - 134.85132897200012, - -2.899834893999866 - ], - [ - 134.86109459700006, - -2.94003671699987 - ], - [ - 134.8518172540001, - -3.003676040000016 - ], - [ - 134.84685306100002, - -3.018487237999821 - ], - [ - 134.84245853000007, - -3.023044528999861 - ], - [ - 134.83692467500023, - -3.025811455999914 - ], - [ - 134.83106530000012, - -3.030205987999892 - ], - [ - 134.8263452480002, - -3.039646091999913 - ], - [ - 134.82422936300006, - -3.050388278999918 - ], - [ - 134.8263452480002, - -3.083916924999954 - ], - [ - 134.81666100400005, - -3.121840101999894 - ], - [ - 134.8185327480002, - -3.136325778999847 - ], - [ - 134.85368899800008, - -3.147881768999952 - ], - [ - 134.86117597700004, - -3.162692966999927 - ], - [ - 134.86793053500017, - -3.204034112999878 - ], - [ - 134.86963951900017, - -3.209161065999879 - ], - [ - 134.87305748800006, - -3.213148695999948 - ], - [ - 134.87476647200018, - -3.217705987999906 - ], - [ - 134.87452233200023, - -3.217950127999856 - ], - [ - 134.87598717500012, - -3.231866143999838 - ], - [ - 134.87476647200018, - -3.232028903999975 - ], - [ - 134.880625847, - -3.242933851999865 - ], - [ - 134.8859155610002, - -3.249769789999888 - ], - [ - 134.89893639400006, - -3.262790622999958 - ], - [ - 134.91439863400004, - -3.268812757999882 - ], - [ - 134.93181399800008, - -3.261651299999926 - ], - [ - 134.96412194100012, - -3.238213799999869 - ], - [ - 134.96257571700008, - -3.249444268999866 - ], - [ - 134.95679772200018, - -3.269463799999841 - ], - [ - 134.9567163420002, - -3.279880467 - ], - [ - 134.96029707099999, - -3.285332940999865 - ], - [ - 134.97461998800006, - -3.300876559999864 - ], - [ - 134.98471113400015, - -3.329685153999975 - ], - [ - 135.0021264980002, - -3.336114190999908 - ], - [ - 135.04607181100002, - -3.3344052059999 - ], - [ - 135.06910241, - -3.338555596999839 - ], - [ - 135.0971785820001, - -3.35751718499985 - ], - [ - 135.1115014980002, - -3.361748955999957 - ], - [ - 135.275645379, - -3.368584893999895 - ], - [ - 135.2960718110002, - -3.372002862999892 - ], - [ - 135.32203209700018, - -3.386488539999945 - ], - [ - 135.34083092500012, - -3.389743747999887 - ], - [ - 135.36231530000023, - -3.386163018999824 - ], - [ - 135.403086785, - -3.371840101999837 - ], - [ - 135.470469597, - -3.363051039999874 - ], - [ - 135.48894290500007, - -3.356703382999839 - ], - [ - 135.50538170700023, - -3.348077080999843 - ], - [ - 135.52173912900017, - -3.335544528999932 - ], - [ - 135.56364993600008, - -3.289727471999839 - ], - [ - 135.5691024100001, - -3.281670830999985 - ], - [ - 135.57325280000023, - -3.270114841999884 - ], - [ - 135.57439212300008, - -3.258070570999863 - ], - [ - 135.57048587300008, - -3.248711846999839 - ], - [ - 135.57374108200023, - -3.241306247999844 - ], - [ - 135.60157311300006, - -3.204034112999878 - ], - [ - 135.63892662900005, - -3.178155205999857 - ], - [ - 135.719004754, - -3.148614190999979 - ], - [ - 135.75171959700006, - -3.128350518999881 - ], - [ - 135.76710045700005, - -3.108819268999909 - ], - [ - 135.76319420700005, - -3.09954192499994 - ], - [ - 135.75196373800006, - -3.091729424999869 - ], - [ - 135.74561608200023, - -3.07708098799985 - ], - [ - 135.74740644600004, - -3.070000908999972 - ], - [ - 135.75180097700004, - -3.062107028999918 - ], - [ - 135.75733483200023, - -3.05584075299987 - ], - [ - 135.76490319100017, - -3.052178643999824 - ], - [ - 135.76685631600006, - -3.04989999799993 - ], - [ - 135.76978600400005, - -3.047539971999882 - ], - [ - 135.7756453790001, - -3.046482028999932 - ], - [ - 135.7994897800002, - -3.053317966999856 - ], - [ - 135.81690514400023, - -3.042901299999869 - ], - [ - 135.8431095710001, - -3.011976820999919 - ], - [ - 135.88851972700016, - -3.000095309999864 - ], - [ - 135.909922722, - -2.985772393999966 - ], - [ - 135.92652428500017, - -2.965915622999873 - ], - [ - 135.936778191, - -2.943454684999878 - ], - [ - 135.93588300900004, - -2.927178643999852 - ], - [ - 135.92497806100002, - -2.89039478999986 - ], - [ - 135.92676842500012, - -2.878838799999841 - ], - [ - 135.95191491, - -2.852146091999899 - ], - [ - 135.96045983200023, - -2.837660414999945 - ], - [ - 135.96461022200018, - -2.820489190999922 - ], - [ - 135.96461022200018, - -2.775811455999957 - ], - [ - 135.96957441500004, - -2.770114841999884 - ], - [ - 135.99236087300002, - -2.752048434999878 - ], - [ - 135.99878991000006, - -2.744805596999853 - ], - [ - 136.01295006600017, - -2.74700286299985 - ], - [ - 136.02320397200012, - -2.707696221999925 - ], - [ - 136.03638756600006, - -2.69695403399983 - ], - [ - 136.04542076900017, - -2.696221612999892 - ], - [ - 136.05567467500006, - -2.693454684999921 - ], - [ - 136.06373131600006, - -2.688164971999853 - ], - [ - 136.06714928500006, - -2.679864190999879 - ], - [ - 136.07227623800023, - -2.672621351999851 - ], - [ - 136.08448326900012, - -2.668064059999907 - ], - [ - 136.10865319100006, - -2.662774346999839 - ], - [ - 136.19743899800008, - -2.624444268999895 - ], - [ - 136.23682701900017, - -2.596123955999943 - ], - [ - 136.26636803500006, - -2.560316664999931 - ], - [ - 136.2760522800002, - -2.540134372999916 - ], - [ - 136.28239993600013, - -2.519707940999851 - ], - [ - 136.28874759200008, - -2.45012786299985 - ], - [ - 136.29395592500023, - -2.433526299999969 - ], - [ - 136.3024194670002, - -2.420830987999835 - ], - [ - 136.33448326900017, - -2.384535415 - ], - [ - 136.34408613400015, - -2.368259372999972 - ], - [ - 136.34815514400012, - -2.351250908999916 - ], - [ - 136.34717858200023, - -2.340264580999872 - ], - [ - 136.34253991, - -2.31910572699995 - ], - [ - 136.34009850400017, - -2.289239190999879 - ], - [ - 136.34197024800002, - -2.283379815999922 - ], - [ - 136.34815514400012, - -2.271742446 - ], - [ - 136.36207116000017, - -2.25212981599995 - ], - [ - 136.38086998800023, - -2.234063408999845 - ], - [ - 136.40381920700023, - -2.219659112999963 - ], - [ - 136.43018639400012, - -2.211032809999878 - ], - [ - 136.48145592500023, - -2.211032809999878 - ], - [ - 136.4929305350001, - -2.207126559999963 - ], - [ - 136.52214603000002, - -2.191338799999841 - ], - [ - 136.53256269600004, - -2.189873955999957 - ], - [ - 136.53679446700008, - -2.19898853999986 - ], - [ - 136.53370201900017, - -2.213067315999908 - ], - [ - 136.53296959700006, - -2.225844007999854 - ], - [ - 136.54346764400012, - -2.231377862999864 - ], - [ - 136.56820722700016, - -2.233005466999884 - ], - [ - 136.59473717500023, - -2.237562757999925 - ], - [ - 136.60206139400023, - -2.249769789999903 - ], - [ - 136.605235222, - -2.252048434999878 - ], - [ - 136.61304772200012, - -2.250909112999935 - ], - [ - 136.6264754570001, - -2.246270440999822 - ], - [ - 136.63282311300023, - -2.245049737999906 - ], - [ - 136.64649498800017, - -2.246351820999905 - ], - [ - 136.68392988399998, - -2.25872161299985 - ], - [ - 136.7046004570001, - -2.237562757999925 - ], - [ - 136.71697024800008, - -2.239190362999864 - ], - [ - 136.7371525400001, - -2.249444268999881 - ], - [ - 136.74927819100017, - -2.252048434999878 - ], - [ - 136.75863691500004, - -2.248711846999853 - ], - [ - 136.76547285200004, - -2.241631768999895 - ], - [ - 136.7708439460001, - -2.234633070999905 - ], - [ - 136.7768660820001, - -2.231377862999864 - ], - [ - 136.80591881600017, - -2.226739190999851 - ], - [ - 136.81446373800011, - -2.224053643999866 - ], - [ - 136.86719811300006, - -2.188164971999953 - ], - [ - 136.92701256600006, - -2.176202080999843 - ], - [ - 136.93848717500006, - -2.172539971999967 - ], - [ - 136.943125847, - -2.163506768999881 - ], - [ - 136.94581139400012, - -2.152276299999869 - ], - [ - 136.9515080090001, - -2.142185153999989 - ], - [ - 136.98145592500023, - -2.126560154 - ], - [ - 137.02409915500007, - -2.118422132999811 - ], - [ - 137.15430748800023, - -2.111504815999908 - ], - [ - 137.17847741000006, - -2.106133721999939 - ], - [ - 137.194590691, - -2.097344658999887 - ], - [ - 137.22632897200018, - -2.074395440999979 - ], - [ - 137.23365319100017, - -2.060967705999985 - ], - [ - 137.22527103000013, - -2.038995049999883 - ], - [ - 137.20264733200023, - -2.018812757999868 - ], - [ - 137.191172722, - -2.004571221999853 - ], - [ - 137.194590691, - -1.99814218499985 - ], - [ - 137.20533287900005, - -1.992608330999914 - ], - [ - 137.21013431100013, - -1.979261976999823 - ], - [ - 137.20964603000002, - -1.96347421699987 - ], - [ - 137.20484459700006, - -1.949639580999872 - ], - [ - 137.19385826900006, - -1.94394296699997 - ], - [ - 137.1674910820001, - -1.934340101999823 - ], - [ - 137.156993035, - -1.929131768999824 - ], - [ - 137.1017358730002, - -1.888278903999876 - ], - [ - 137.11182701900006, - -1.874769789999888 - ], - [ - 137.11557050900004, - -1.854424737999906 - ], - [ - 137.11540774800002, - -1.809340101999837 - ], - [ - 137.12354576900023, - -1.79745859199997 - ], - [ - 137.1428328790001, - -1.787041924999897 - ], - [ - 137.34880618600002, - -1.710137627999899 - ], - [ - 137.46485436300006, - -1.641778252999913 - ], - [ - 137.4858504570001, - -1.632500908999859 - ], - [ - 137.49219811300023, - -1.628106377999885 - ], - [ - 137.49854576900006, - -1.620782158999958 - ], - [ - 137.51026451900017, - -1.604099216999842 - ], - [ - 137.51636803500006, - -1.600844007999882 - ], - [ - 137.532481316, - -1.597751559999907 - ], - [ - 137.7944442070001, - -1.484144789999888 - ], - [ - 137.83912194100006, - -1.4711239559999 - ], - [ - 137.88314863400015, - -1.470472914999945 - ], - [ - 137.92481530000012, - -1.484144789999888 - ], - [ - 137.93246504000015, - -1.491306247999844 - ], - [ - 137.95557701900012, - -1.518243096999896 - ], - [ - 137.96501712300014, - -1.52263762799997 - ], - [ - 137.98316491000006, - -1.541924737999835 - ], - [ - 137.98926842500012, - -1.546156507999854 - ], - [ - 138.002207879, - -1.547784112999864 - ], - [ - 138.0114038420002, - -1.552015882999882 - ], - [ - 138.05762780000006, - -1.599053643999895 - ], - [ - 138.0748804050002, - -1.610284112999906 - ], - [ - 138.118907097, - -1.616875908999873 - ], - [ - 138.2291772800002, - -1.64910247199991 - ], - [ - 138.35670006600017, - -1.710137627999899 - ], - [ - 138.52751712300002, - -1.75847747199991 - ], - [ - 138.59750410200016, - -1.769789320999891 - ], - [ - 138.61963951900023, - -1.778090101999865 - ], - [ - 138.6652124360002, - -1.789157809999907 - ], - [ - 138.73519941499998, - -1.843926690999922 - ], - [ - 138.80323326900023, - -1.920830987999835 - ], - [ - 138.84278405000006, - -1.949639580999872 - ], - [ - 138.86215254000004, - -1.955743096999853 - ], - [ - 138.92807050900015, - -1.957126559999935 - ], - [ - 138.9495548840001, - -1.959893487999977 - ], - [ - 139.106700066, - -2.012790622999859 - ], - [ - 139.28321373800017, - -2.121840101999908 - ], - [ - 139.38404381600006, - -2.155694268999966 - ], - [ - 139.44011478000007, - -2.185723565999922 - ], - [ - 139.45533287900005, - -2.189873955999957 - ], - [ - 139.46876061300011, - -2.195082289999874 - ], - [ - 139.51498457100004, - -2.231377862999864 - ], - [ - 139.67823326900023, - -2.292901299999841 - ], - [ - 139.7807723320001, - -2.354668877999842 - ], - [ - 139.82211347700016, - -2.367364190999979 - ], - [ - 139.86475670700005, - -2.372002862999835 - ], - [ - 140.05933678500006, - -2.354261976999837 - ], - [ - 140.08619225400005, - -2.343682549999883 - ], - [ - 140.0971785820001, - -2.323663018999909 - ], - [ - 140.10474694100006, - -2.320082290000016 - ], - [ - 140.1212671230002, - -2.326836846999882 - ], - [ - 140.14503014400012, - -2.341241143999852 - ], - [ - 140.15113366, - -2.337334893999852 - ], - [ - 140.15259850400017, - -2.322442315999893 - ], - [ - 140.157969597, - -2.320896091999856 - ], - [ - 140.16570071700002, - -2.325372002999913 - ], - [ - 140.16797936300011, - -2.331719658999845 - ], - [ - 140.16879316500004, - -2.339288018999895 - ], - [ - 140.17221113400004, - -2.347426039999903 - ], - [ - 140.21021569100006, - -2.40211353999986 - ], - [ - 140.22543379000004, - -2.405368747999901 - ], - [ - 140.28834069100006, - -2.431084893999937 - ], - [ - 140.31128991000006, - -2.446954033999873 - ], - [ - 140.33228600400017, - -2.455743096999853 - ], - [ - 140.35043378999998, - -2.443047783999887 - ], - [ - 140.36101321700002, - -2.449802342 - ], - [ - 140.37126712300008, - -2.448663018999966 - ], - [ - 140.379649285, - -2.441094658999845 - ], - [ - 140.38453209700018, - -2.429457289999917 - ], - [ - 140.37989342500018, - -2.419528904 - ], - [ - 140.368907097, - -2.412041924999855 - ], - [ - 140.36394290500007, - -2.404880466999913 - ], - [ - 140.3771264980002, - -2.395277601999837 - ], - [ - 140.38851972700016, - -2.397067966999913 - ], - [ - 140.48316491000017, - -2.43222421699997 - ], - [ - 140.50066165500013, - -2.435723565999879 - ], - [ - 140.60759524800008, - -2.439385674999841 - ], - [ - 140.73080488400015, - -2.491469007999882 - ], - [ - 140.74463951900023, - -2.499118747999987 - ], - [ - 140.74675540500007, - -2.516696872999844 - ], - [ - 140.74089603000002, - -2.549574476999837 - ], - [ - 140.73609459700006, - -2.563653252999956 - ], - [ - 140.69857832100004, - -2.608168226999865 - ], - [ - 140.70435631600017, - -2.616957289999931 - ], - [ - 140.71322675900004, - -2.626722914999959 - ], - [ - 140.72380618600008, - -2.633965752999899 - ], - [ - 140.73462975400017, - -2.634942315999879 - ], - [ - 140.740000847, - -2.627699476999936 - ], - [ - 140.74073326900023, - -2.616306247999887 - ], - [ - 140.74268639400012, - -2.605564059999878 - ], - [ - 140.751719597, - -2.600762627999885 - ], - [ - 140.75709069100017, - -2.603936455999857 - ], - [ - 140.77564537900017, - -2.618096612999878 - ], - [ - 140.78549238399998, - -2.621270440999837 - ], - [ - 140.79558353000007, - -2.619398695999877 - ], - [ - 140.81804446700008, - -2.611016533999901 - ], - [ - 140.8296004570001, - -2.608168226999865 - ], - [ - 140.92212975400017, - -2.608168226999865 - ], - [ - 140.96501712300008, - -2.600762627999885 - ], - [ - 140.97413170700023, - -2.60051848799985 - ], - [ - 140.97445722700016, - -2.60051848799985 - ], - [ - 140.97446391400152, - -2.600518107070869 - ], - [ - 140.97447473200012, - -2.631207783999869 - ], - [ - 140.97390629100013, - -2.807321064999826 - ], - [ - 140.9732861740001, - -3.002451272999849 - ], - [ - 140.97235599800004, - -3.250601500999863 - ], - [ - 140.97318282100005, - -3.581744079999851 - ], - [ - 140.97354455600023, - -3.800025329999855 - ], - [ - 140.97421635000003, - -4.002286884999904 - ], - [ - 140.9747331140001, - -4.173645934999868 - ], - [ - 140.97576664300007, - -4.595945739999905 - ], - [ - 140.97623173000008, - -4.773712666999899 - ], - [ - 140.97687079100004, - -4.98848605899984 - ], - [ - 140.97690352400016, - -4.99948699999986 - ], - [ - 140.97690352400016, - -5.002277526999819 - ], - [ - 140.97690352400016, - -5.197407734999928 - ], - [ - 140.97690352400016, - -5.322878112999916 - ], - [ - 140.97690352400016, - -5.363805846999838 - ], - [ - 140.97690352400016, - -5.62115447899987 - ], - [ - 140.97690352400016, - -5.806466165999908 - ], - [ - 140.97690352400016, - -6.002113137999871 - ], - [ - 140.97690352400016, - -6.229386087999913 - ], - [ - 140.97690352400016, - -6.335116067999849 - ], - [ - 140.97287276200015, - -6.336563008999846 - ], - [ - 140.96372603400008, - -6.348035175999868 - ], - [ - 140.95866174400012, - -6.368085631999818 - ], - [ - 140.9538558350001, - -6.37015268999987 - ], - [ - 140.95282230600012, - -6.373770039999854 - ], - [ - 140.95499271700012, - -6.379661152999859 - ], - [ - 140.96465621000013, - -6.38803273499984 - ], - [ - 140.96708500200018, - -6.393923847999829 - ], - [ - 140.96315759300003, - -6.404259134999933 - ], - [ - 140.95561283400016, - -6.411287129999849 - ], - [ - 140.95018680900003, - -6.418935241999833 - ], - [ - 140.95282230600012, - -6.431750996999909 - ], - [ - 140.94155684400008, - -6.430924173999884 - ], - [ - 140.93101485200017, - -6.431440937999824 - ], - [ - 140.92129968300006, - -6.4339214069999 - ], - [ - 140.91251469000017, - -6.438572285999868 - ], - [ - 140.92316003500017, - -6.439812519999805 - ], - [ - 140.92998132400012, - -6.444980163999901 - ], - [ - 140.93318526200008, - -6.453765156999793 - ], - [ - 140.93282352700018, - -6.465960794999901 - ], - [ - 140.94858483900018, - -6.46554738399989 - ], - [ - 140.95313236600012, - -6.480533548999858 - ], - [ - 140.95018680900003, - -6.4987236529999 - ], - [ - 140.94346887200018, - -6.507508645999806 - ], - [ - 140.92822432500023, - -6.509679055999882 - ], - [ - 140.92098962400016, - -6.516396992999901 - ], - [ - 140.91876753800008, - -6.527869160999913 - ], - [ - 140.91783736200003, - -6.55308725999987 - ], - [ - 140.91509851100008, - -6.558461608999835 - ], - [ - 140.90987919100016, - -6.561355488999823 - ], - [ - 140.9016109630002, - -6.56207895899982 - ], - [ - 140.89298099800024, - -6.565386249999918 - ], - [ - 140.89649499600003, - -6.573034362999806 - ], - [ - 140.90331628400017, - -6.582129413999866 - ], - [ - 140.90496993100012, - -6.589467467999867 - ], - [ - 140.8905522060002, - -6.599802754999871 - ], - [ - 140.87391239500008, - -6.603420104999856 - ], - [ - 140.85928796400012, - -6.608381041999806 - ], - [ - 140.85039961800018, - -6.623573913999834 - ], - [ - 140.86492069500005, - -6.630601908999836 - ], - [ - 140.86579919400018, - -6.649205423999888 - ], - [ - 140.85716923100014, - -6.682174986999854 - ], - [ - 140.85174320500008, - -6.693957213999852 - ], - [ - 140.84921106000016, - -6.702845559999872 - ], - [ - 140.85039961800018, - -6.712974140999918 - ], - [ - 140.85784102400012, - -6.723619486999908 - ], - [ - 140.87871830300017, - -6.742223001999861 - ], - [ - 140.88450606300015, - -6.753901875999844 - ], - [ - 140.88269738800008, - -6.76061981199986 - ], - [ - 140.8732406010001, - -6.773642272999894 - ], - [ - 140.87086348600016, - -6.778396503999886 - ], - [ - 140.87417077700005, - -6.789455260999901 - ], - [ - 140.8824390060001, - -6.798240254999882 - ], - [ - 140.9016109630002, - -6.812192890999881 - ], - [ - 140.9067269290001, - -6.828212584999918 - ], - [ - 140.90832889800012, - -6.849296569999865 - ], - [ - 140.91602868700002, - -6.86273244199981 - ], - [ - 140.93969649300007, - -6.856324564999866 - ], - [ - 140.94331384400013, - -6.888053893999881 - ], - [ - 140.96217574100015, - -6.897975768999885 - ], - [ - 140.97716190600013, - -6.89663218199982 - ], - [ - 140.9770068770001, - -7.004739277999889 - ], - [ - 140.9770068770001, - -7.157081399999882 - ], - [ - 140.97690352400016, - -7.282758482999839 - ], - [ - 140.97690352400016, - -7.32368621799985 - ], - [ - 140.97690352400016, - -7.587546080999843 - ], - [ - 140.97690352400016, - -7.772857767999895 - ], - [ - 140.97690352400016, - -7.962096862999914 - ], - [ - 140.97690352400016, - -8.001991068999857 - ], - [ - 140.9770068770001, - -8.170146178999843 - ], - [ - 140.97731693600016, - -8.434936217999791 - ], - [ - 140.97762699400008, - -8.611152851999861 - ], - [ - 140.9775236410002, - -8.79822153699989 - ], - [ - 140.97716190600013, - -8.991077981999894 - ], - [ - 140.97700716985187, - -9.106149628253178 - ], - [ - 140.9769800140002, - -9.106133721999882 - ], - [ - 140.97681725400005, - -9.106052341999899 - ], - [ - 140.93262780000023, - -9.080173434999892 - ], - [ - 140.92107181100002, - -9.079278252999899 - ], - [ - 140.85694420700005, - -9.049086195999891 - ], - [ - 140.62159264400023, - -8.806735934999878 - ], - [ - 140.50749759200002, - -8.638116143999895 - ], - [ - 140.45289147200018, - -8.586683851999808 - ], - [ - 140.44629967500012, - -8.577569268999909 - ], - [ - 140.37810306100008, - -8.522230726999823 - ], - [ - 140.36768639400006, - -8.508396091999913 - ], - [ - 140.36345462300008, - -8.490817966999884 - ], - [ - 140.35401451900023, - -8.48853932099982 - ], - [ - 140.30144290500002, - -8.467461846999882 - ], - [ - 140.26661217500006, - -8.43084075299987 - ], - [ - 140.25163821700002, - -8.408949476999837 - ], - [ - 140.0319116550002, - -8.246351820999863 - ], - [ - 139.98812910200004, - -8.192478122999916 - ], - [ - 139.97364342500006, - -8.165215752999842 - ], - [ - 139.97071373800017, - -8.142185153999861 - ], - [ - 139.97974694100017, - -8.121514580999857 - ], - [ - 139.9977319670002, - -8.103773695999863 - ], - [ - 140.02149498800011, - -8.089532158999859 - ], - [ - 140.03492272200012, - -8.086846612999878 - ], - [ - 140.04810631600006, - -8.08660247199984 - ], - [ - 140.05836022200018, - -8.081963799999897 - ], - [ - 140.06234785200016, - -8.06617603999986 - ], - [ - 140.06568444100017, - -8.02947356599985 - ], - [ - 140.05681399800002, - -7.99618905999985 - ], - [ - 140.05404707100016, - -7.97161223799985 - ], - [ - 140.06055748800006, - -7.948337497999916 - ], - [ - 140.08301842500018, - -7.932549737999878 - ], - [ - 140.11158287900017, - -7.946547132999839 - ], - [ - 140.12867272200012, - -7.936130466999856 - ], - [ - 140.15170332100016, - -7.884698174999855 - ], - [ - 140.13510175900004, - -7.892673434999907 - ], - [ - 140.11898847700004, - -7.914808851999879 - ], - [ - 140.10035241000006, - -7.91952890399989 - ], - [ - 140.07496178500006, - -7.920017184999878 - ], - [ - 140.06104576900023, - -7.92441171699987 - ], - [ - 140.05396569100017, - -7.936211846999839 - ], - [ - 140.04566491, - -7.980157158999859 - ], - [ - 140.04184003999998, - -8.045505466999842 - ], - [ - 140.03402754000004, - -8.058770440999865 - ], - [ - 140.015391472, - -8.073663018999824 - ], - [ - 139.97364342500006, - -8.09693775799984 - ], - [ - 139.93238366000006, - -8.108575127999842 - ], - [ - 139.76880944100017, - -8.110446872999901 - ], - [ - 139.63054446700008, - -8.124932549999855 - ], - [ - 139.59937584700018, - -8.13543059699984 - ], - [ - 139.54664147200018, - -8.166192315999822 - ], - [ - 139.51498457100004, - -8.17888762799987 - ], - [ - 139.43531334700006, - -8.196954033999887 - ], - [ - 139.39519290500007, - -8.200941664999874 - ], - [ - 139.35670006600006, - -8.199395440999837 - ], - [ - 139.31950931100008, - -8.190199476999851 - ], - [ - 139.28337649800014, - -8.17253997199984 - ], - [ - 139.25464928500017, - -8.146091403999861 - ], - [ - 139.24000084700006, - -8.110609632999868 - ], - [ - 139.24024498800011, - -8.10182057099982 - ], - [ - 139.2425236340001, - -8.090508721999825 - ], - [ - 139.24610436300023, - -8.079522393999866 - ], - [ - 139.25025475400017, - -8.072686455999857 - ], - [ - 139.25171959700006, - -8.067478122999859 - ], - [ - 139.24789472700004, - -8.048760674999883 - ], - [ - 139.24512780000006, - -8.01506926899988 - ], - [ - 139.24008222700004, - -8.002862237999821 - ], - [ - 139.21892337300002, - -7.97966887799987 - ], - [ - 139.23487389400023, - -7.975355726999879 - ], - [ - 139.25171959700006, - -7.982191664999888 - ], - [ - 139.26937910200016, - -7.986260674999855 - ], - [ - 139.28785241000017, - -7.973402601999837 - ], - [ - 139.24293053500017, - -7.956963799999841 - ], - [ - 139.21713300900015, - -7.951348565999837 - ], - [ - 139.20590254000015, - -7.963148695999806 - ], - [ - 139.20679772200006, - -7.97429778399983 - ], - [ - 139.21119225400005, - -7.994073174999841 - ], - [ - 139.21216881600012, - -8.00416432099982 - ], - [ - 139.21412194100006, - -8.00709400799984 - ], - [ - 139.22486412900017, - -8.00872161299985 - ], - [ - 139.22950280000006, - -8.011325778999847 - ], - [ - 139.23218834700018, - -8.017836195999848 - ], - [ - 139.230235222, - -8.02288176899988 - ], - [ - 139.22706139400023, - -8.028090101999865 - ], - [ - 139.22445722700016, - -8.07439544099985 - ], - [ - 139.20118248800023, - -8.09563567499984 - ], - [ - 139.1227319670002, - -8.117445570999806 - ], - [ - 139.0895288420002, - -8.133558851999865 - ], - [ - 138.9733179050002, - -8.229913018999866 - ], - [ - 138.96338951900006, - -8.245538018999852 - ], - [ - 138.95948326900006, - -8.26523202899989 - ], - [ - 138.9572046230002, - -8.270765882999811 - ], - [ - 138.95118248800011, - -8.281345309999864 - ], - [ - 138.94336998800011, - -8.29119231599988 - ], - [ - 138.9352319670002, - -8.295586846999868 - ], - [ - 138.92107181100008, - -8.29485442499984 - ], - [ - 138.91439863400004, - -8.292087497999873 - ], - [ - 138.8764754570001, - -8.218682549999869 - ], - [ - 138.8530379570001, - -8.183851820999834 - ], - [ - 138.84278405000006, - -8.161309502999842 - ], - [ - 138.83855228000007, - -8.138360283999859 - ], - [ - 138.84278405000006, - -8.117445570999806 - ], - [ - 138.858653191, - -8.101332289999917 - ], - [ - 138.9007267590001, - -8.092380466999884 - ], - [ - 138.92123457100004, - -8.079522393999866 - ], - [ - 138.9253035820001, - -8.070489190999865 - ], - [ - 138.92432701900012, - -8.060642184999935 - ], - [ - 138.92017662900017, - -8.052422783999845 - ], - [ - 138.9057723320001, - -8.043633721999868 - ], - [ - 138.90552819100017, - -8.030694268999866 - ], - [ - 138.91098066500004, - -8.007582289999917 - ], - [ - 138.91098066500004, - -7.922539971999896 - ], - [ - 138.91537519599999, - -7.903252862999864 - ], - [ - 138.9274194670002, - -7.894138278999876 - ], - [ - 138.9663192070001, - -7.884698174999855 - ], - [ - 138.993988477, - -7.865492445999806 - ], - [ - 139.0022892590001, - -7.835707289999888 - ], - [ - 139.00717207100016, - -7.754327080999829 - ], - [ - 139.03451582100004, - -7.690362237999835 - ], - [ - 139.04509524800008, - -7.675225518999838 - ], - [ - 139.04818769600016, - -7.668064059999892 - ], - [ - 139.05494225400017, - -7.634209893999824 - ], - [ - 139.05941816500015, - -7.622735283999873 - ], - [ - 139.06934655000023, - -7.613946221999825 - ], - [ - 139.0808211600001, - -7.606052341999842 - ], - [ - 139.08920332100016, - -7.596774997999887 - ], - [ - 139.09302819100017, - -7.559991143999895 - ], - [ - 139.07105553500017, - -7.532647393999838 - ], - [ - 139.0358992850001, - -7.515232028999861 - ], - [ - 139.00049889400006, - -7.50790780999985 - ], - [ - 138.95801842500012, - -7.507256768999895 - ], - [ - 138.94434655000006, - -7.497002862999878 - ], - [ - 138.93490644600016, - -7.448825778999918 - ], - [ - 138.92554772200006, - -7.42734140399989 - ], - [ - 138.88607832100016, - -7.360935153999861 - ], - [ - 138.86548912900005, - -7.336032809999921 - ], - [ - 138.8405867850001, - -7.314548434999892 - ], - [ - 138.76661217500012, - -7.265394789999874 - ], - [ - 138.75098717500023, - -7.257745049999855 - ], - [ - 138.74561608200005, - -7.250664971999882 - ], - [ - 138.73878014400023, - -7.243584893999824 - ], - [ - 138.72925866000017, - -7.240411065999865 - ], - [ - 138.70850670700017, - -7.23919036299985 - ], - [ - 138.69996178500006, - -7.237074476999837 - ], - [ - 138.69125410200016, - -7.233575127999842 - ], - [ - 138.67701256600006, - -7.223402601999808 - ], - [ - 138.66635175900004, - -7.209893487999821 - ], - [ - 138.66749108200023, - -7.197849216999899 - ], - [ - 138.68824303500006, - -7.192640882999825 - ], - [ - 138.9045516290001, - -7.199395440999851 - ], - [ - 138.945160352, - -7.20623137799987 - ], - [ - 138.96168053500017, - -7.214532158999845 - ], - [ - 138.99097741000017, - -7.236016533999873 - ], - [ - 139.00391686300011, - -7.240411065999865 - ], - [ - 139.15707441500015, - -7.243096612999835 - ], - [ - 139.17457116, - -7.236993096999853 - ], - [ - 139.18824303500006, - -7.215020440999837 - ], - [ - 139.19947350400005, - -7.188734632999825 - ], - [ - 139.21461022200006, - -7.166924737999864 - ], - [ - 139.24000084700006, - -7.158461195999834 - ], - [ - 139.24000084700006, - -7.151055596999839 - ], - [ - 139.22185306100008, - -7.143975518999881 - ], - [ - 139.20606530000012, - -7.150485934999864 - ], - [ - 139.181407097, - -7.175469658999887 - ], - [ - 139.1673283210001, - -7.195489190999851 - ], - [ - 139.159434441, - -7.203220309999864 - ], - [ - 139.14722741000006, - -7.20623137799987 - ], - [ - 139.10352623800023, - -7.20623137799987 - ], - [ - 139.06055748800011, - -7.212497653999918 - ], - [ - 139.03760826900012, - -7.211846612999864 - ], - [ - 139.01937910200004, - -7.194431247999901 - ], - [ - 138.9663192070001, - -7.164727471999868 - ], - [ - 138.94613691500015, - -7.157159112999835 - ], - [ - 138.9253035820001, - -7.153008721999882 - ], - [ - 138.85808353000007, - -7.14959075299987 - ], - [ - 138.84253991000006, - -7.145603122999901 - ], - [ - 138.81478925900015, - -7.130547783999887 - ], - [ - 138.76197350400017, - -7.113864841999842 - ], - [ - 138.75342858200005, - -7.106622002999828 - ], - [ - 138.74781334700018, - -7.098239841999856 - ], - [ - 138.6461694670002, - -6.999688408999873 - ], - [ - 138.57203209700006, - -6.942478122999901 - ], - [ - 138.56153405000006, - -6.918633721999825 - ], - [ - 138.5813908210001, - -6.890883070999848 - ], - [ - 138.59742272200018, - -6.881442966999842 - ], - [ - 138.61255944100017, - -6.87721119599982 - ], - [ - 138.65406334700006, - -6.876641533999845 - ], - [ - 138.67457116, - -6.88111744599982 - ], - [ - 138.71583092500018, - -6.897719007999868 - ], - [ - 138.73975670700023, - -6.897149346999896 - ], - [ - 138.75635826900006, - -6.887953382999825 - ], - [ - 138.783457879, - -6.861748955999886 - ], - [ - 138.79810631600006, - -6.856215101999865 - ], - [ - 138.88379967500012, - -6.84937916499986 - ], - [ - 138.91724694100006, - -6.8422177059999 - ], - [ - 138.93148847700016, - -6.842543226999837 - ], - [ - 138.94044030000006, - -6.84547291499986 - ], - [ - 138.95980879000004, - -6.854424737999878 - ], - [ - 138.96973717500012, - -6.856215101999865 - ], - [ - 138.98943118600008, - -6.865899346999839 - ], - [ - 139.0177514980002, - -6.908623955999843 - ], - [ - 139.03793379000004, - -6.91822682099982 - ], - [ - 139.06869550900004, - -6.942152601999879 - ], - [ - 139.07276451900017, - -6.948825778999847 - ], - [ - 139.08253014400012, - -6.953301690999893 - ], - [ - 139.10352623800023, - -6.959161065999851 - ], - [ - 139.117930535, - -6.968194268999852 - ], - [ - 139.12647545700023, - -6.971612237999864 - ], - [ - 139.140391472, - -6.972914320999863 - ], - [ - 139.181895379, - -6.971449476999808 - ], - [ - 139.19223066500004, - -6.972914320999863 - ], - [ - 139.18043053500006, - -6.959161065999851 - ], - [ - 139.15674889400023, - -6.954034112999835 - ], - [ - 139.13331139400023, - -6.952406507999811 - ], - [ - 139.1227319670002, - -6.948988539999903 - ], - [ - 139.11548912900017, - -6.941013278999847 - ], - [ - 139.06869550900004, - -6.91822682099982 - ], - [ - 138.99976647200006, - -6.852715752999885 - ], - [ - 138.9663192070001, - -6.835707289999917 - ], - [ - 138.92367597700016, - -6.825778903999904 - ], - [ - 138.85670006600017, - -6.820000908999859 - ], - [ - 138.83790123800011, - -6.814548434999907 - ], - [ - 138.8224389980002, - -6.806084893999866 - ], - [ - 138.76840253999998, - -6.756605726999823 - ], - [ - 138.74577884200002, - -6.740166924999826 - ], - [ - 138.70045006600006, - -6.728204033999887 - ], - [ - 138.68344160200016, - -6.714532158999859 - ], - [ - 138.67286217500012, - -6.69491952899989 - ], - [ - 138.67090905000023, - -6.671807549999855 - ], - [ - 138.68246503999998, - -6.645114841999913 - ], - [ - 138.70289147200006, - -6.64544036299985 - ], - [ - 138.74317467500023, - -6.664971612999835 - ], - [ - 138.7631942070001, - -6.670179945999834 - ], - [ - 138.82911217500023, - -6.705987237999835 - ], - [ - 138.70899498800023, - -6.629652601999808 - ], - [ - 138.67758222700004, - -6.602959893999881 - ], - [ - 138.63160241000017, - -6.544122002999899 - ], - [ - 138.61939537900017, - -6.534763278999861 - ], - [ - 138.603770379, - -6.527927341999842 - ], - [ - 138.46607506600017, - -6.40211353999986 - ], - [ - 138.42115319100017, - -6.318536065999893 - ], - [ - 138.4135848320001, - -6.291436455999872 - ], - [ - 138.39535566500004, - -6.253187757999825 - ], - [ - 138.39039147200018, - -6.233656507999854 - ], - [ - 138.3921004570001, - -6.186211846999825 - ], - [ - 138.39039147200018, - -6.171563408999916 - ], - [ - 138.37208092500012, - -6.124281507999854 - ], - [ - 138.36980228000007, - -6.106377862999892 - ], - [ - 138.36548912900005, - -6.091729424999883 - ], - [ - 138.34669030000012, - -6.071221612999835 - ], - [ - 138.34253991000006, - -6.05828215899983 - ], - [ - 138.33912194100006, - -6.042575778999861 - ], - [ - 138.27637780000018, - -5.946221612999864 - ], - [ - 138.26246178500017, - -5.914727471999853 - ], - [ - 138.27084394600016, - -5.886976820999877 - ], - [ - 138.30420983200023, - -5.868259372999901 - ], - [ - 138.37671959700006, - -5.855645440999837 - ], - [ - 138.40398196700002, - -5.835707289999931 - ], - [ - 138.38550866, - -5.837334893999866 - ], - [ - 138.34253991000006, - -5.848809502999899 - ], - [ - 138.32203209700012, - -5.851006768999895 - ], - [ - 138.208750847, - -5.825290622999859 - ], - [ - 138.18213951900006, - -5.809665622999873 - ], - [ - 138.17798912900005, - -5.804457289999874 - ], - [ - 138.17554772200012, - -5.795668226999808 - ], - [ - 138.16960696700008, - -5.786553643999824 - ], - [ - 138.15756269600016, - -5.773695570999806 - ], - [ - 138.25196373800011, - -5.718926690999865 - ], - [ - 138.30665123800017, - -5.695733330999843 - ], - [ - 138.36296634200002, - -5.678806247999859 - ], - [ - 138.34310957100004, - -5.670179945999848 - ], - [ - 138.32032311300011, - -5.671156507999825 - ], - [ - 138.27735436300023, - -5.678806247999859 - ], - [ - 138.25269616000006, - -5.679864190999908 - ], - [ - 138.23267662900017, - -5.683851820999877 - ], - [ - 138.21387780000023, - -5.691989841999899 - ], - [ - 138.17188561300023, - -5.716973565999822 - ], - [ - 138.15202884200002, - -5.7230770809999 - ], - [ - 138.10596764400012, - -5.726006768999838 - ], - [ - 138.08578535200016, - -5.739922783999901 - ], - [ - 138.08326256600006, - -5.738213799999897 - ], - [ - 138.08155358200023, - -5.734307549999897 - ], - [ - 138.07105553500017, - -5.728610934999921 - ], - [ - 138.06910241000006, - -5.719659112999892 - ], - [ - 138.06918379000004, - -5.708428643999895 - ], - [ - 138.06812584700006, - -5.698011976999808 - ], - [ - 138.05738366000006, - -5.657810153999904 - ], - [ - 138.05339603000007, - -5.612969658999887 - ], - [ - 138.05486087300002, - -5.589613539999888 - ], - [ - 138.05982506600017, - -5.575290622999901 - ], - [ - 138.06861412900005, - -5.565036716999884 - ], - [ - 138.08179772200018, - -5.554620049999883 - ], - [ - 138.09180748800006, - -5.550062757999854 - ], - [ - 138.1012475920002, - -5.548516533999901 - ], - [ - 138.10792076900023, - -5.544854424999855 - ], - [ - 138.10971113400015, - -5.534112237999835 - ], - [ - 138.10531660200016, - -5.530938408999873 - ], - [ - 138.08497155000023, - -5.522230726999879 - ], - [ - 138.07813561300023, - -5.520440362999892 - ], - [ - 138.06421959700018, - -5.511163018999852 - ], - [ - 138.06421959700018, - -5.48943450299987 - ], - [ - 138.0743921230002, - -5.444756768999824 - ], - [ - 138.0748804050002, - -5.419610283999845 - ], - [ - 138.07105553500017, - -5.409926039999874 - ], - [ - 138.06137129000004, - -5.403741143999909 - ], - [ - 138.05811608200005, - -5.420342705999872 - ], - [ - 138.05128014400023, - -5.431817315999822 - ], - [ - 138.04078209700018, - -5.436130466999913 - ], - [ - 138.0265405610002, - -5.431084893999881 - ], - [ - 138.03484134200008, - -5.454766533999901 - ], - [ - 138.03598066499998, - -5.474786065999865 - ], - [ - 138.0256453790001, - -5.484958591999913 - ], - [ - 137.99927819100017, - -5.4789364559999 - ], - [ - 137.98658287900005, - -5.469984632999882 - ], - [ - 137.95899498800011, - -5.431084893999881 - ], - [ - 137.91456139400012, - -5.386895440999908 - ], - [ - 137.908457879, - -5.363051039999917 - ], - [ - 137.92481530000012, - -5.32870859199987 - ], - [ - 137.90414472700004, - -5.323500257999882 - ], - [ - 137.85336347700016, - -5.361586195999863 - ], - [ - 137.82178795700005, - -5.362888278999861 - ], - [ - 137.81397545700005, - -5.358168226999851 - ], - [ - 137.80860436300011, - -5.352959893999866 - ], - [ - 137.78296959700006, - -5.317966403999861 - ], - [ - 137.78012129000004, - -5.315036716999842 - ], - [ - 137.78288821700008, - -5.297539971999882 - ], - [ - 137.80152428500017, - -5.270440362999864 - ], - [ - 137.80811608200023, - -5.253024997999887 - ], - [ - 137.77100670700023, - -5.272393487999906 - ], - [ - 137.7516382170002, - -5.277764580999857 - ], - [ - 137.73243248800023, - -5.273370049999883 - ], - [ - 137.71558678500006, - -5.256524346999882 - ], - [ - 137.70630944100017, - -5.221937757999882 - ], - [ - 137.690684441, - -5.211358330999829 - ], - [ - 137.68213951900006, - -5.212660414999917 - ], - [ - 137.67261803500017, - -5.217543226999808 - ], - [ - 137.66285241000006, - -5.220310153999861 - ], - [ - 137.64698326900012, - -5.211846612999821 - ], - [ - 137.6163843110002, - -5.205173434999864 - ], - [ - 137.59839928500017, - -5.196384372999887 - ], - [ - 137.57984459700006, - -5.181898695999848 - ], - [ - 137.57422936300017, - -5.167087497999873 - ], - [ - 137.59506269600004, - -5.156833591999856 - ], - [ - 137.59506269600004, - -5.149997653999918 - ], - [ - 137.58082116000006, - -5.142998955999857 - ], - [ - 137.57276451900012, - -5.120782158999887 - ], - [ - 137.56104576900012, - -5.115817966999842 - ], - [ - 137.55616295700023, - -5.121026299999841 - ], - [ - 137.540293816, - -5.144219658999873 - ], - [ - 137.533050977, - -5.149997653999918 - ], - [ - 137.51929772200018, - -5.148532809999864 - ], - [ - 137.5092879570001, - -5.142022393999881 - ], - [ - 137.49219811300023, - -5.123223565999837 - ], - [ - 137.4819442070001, - -5.117364190999879 - ], - [ - 137.4738061860002, - -5.115004164999917 - ], - [ - 137.46810957100004, - -5.110039971999882 - ], - [ - 137.46485436300006, - -5.095879815999851 - ], - [ - 137.43262780000023, - -5.103448174999897 - ], - [ - 137.40357506600006, - -5.097588799999855 - ], - [ - 137.37777754000004, - -5.082452080999857 - ], - [ - 137.35564212300002, - -5.061781507999854 - ], - [ - 137.36329186300006, - -5.054620049999897 - ], - [ - 137.36801191499998, - -5.046319268999824 - ], - [ - 137.36996504000004, - -5.036879164999903 - ], - [ - 137.36915123800011, - -5.026462497999916 - ], - [ - 137.36304772200006, - -5.026462497999916 - ], - [ - 137.34961998800023, - -5.040459893999881 - ], - [ - 137.3346460300002, - -5.030938408999887 - ], - [ - 137.30787194100012, - -4.999118747999844 - ], - [ - 137.30933678500017, - -5.021661065999837 - ], - [ - 137.30160566500015, - -5.026625257999882 - ], - [ - 137.27654056100008, - -5.020196221999868 - ], - [ - 137.26807701900012, - -5.013848565999837 - ], - [ - 137.26710045700023, - -4.999444268999866 - ], - [ - 137.28256269600016, - -4.939711195999806 - ], - [ - 137.27881920700023, - -4.936618747999901 - ], - [ - 137.23243248800017, - -4.969414971999825 - ], - [ - 137.224375847, - -4.982110283999887 - ], - [ - 137.23210696700002, - -4.999118747999844 - ], - [ - 137.21900475400017, - -5.013360283999859 - ], - [ - 137.16944420700023, - -4.991143487999892 - ], - [ - 137.15211022200006, - -4.974379164999874 - ], - [ - 137.149668816, - -4.94508228999986 - ], - [ - 137.11540774800002, - -4.979180596999868 - ], - [ - 137.090098504, - -4.96013762799987 - ], - [ - 137.08773847700016, - -4.94304778399983 - ], - [ - 137.09595787900005, - -4.921644789999959 - ], - [ - 137.1017358730002, - -4.889255466999956 - ], - [ - 137.09498131600017, - -4.889255466999956 - ], - [ - 137.07300866000006, - -4.923923434999935 - ], - [ - 137.04184004000015, - -4.94304778399983 - ], - [ - 137.00652103000007, - -4.9457333309999 - ], - [ - 136.95386803500006, - -4.922784112999821 - ], - [ - 136.946543816, - -4.917657158999901 - ], - [ - 136.94410241000017, - -4.910332940999893 - ], - [ - 136.94996178500006, - -4.899021091999913 - ], - [ - 136.96192467500023, - -4.891045830999943 - ], - [ - 136.97364342500023, - -4.885023695999848 - ], - [ - 136.97885175900015, - -4.87957122199991 - ], - [ - 136.96924889400017, - -4.869561455999829 - ], - [ - 136.94727623800023, - -4.875583591999842 - ], - [ - 136.8745223320001, - -4.919854424999883 - ], - [ - 136.8537703790001, - -4.928155205999872 - ], - [ - 136.83179772200018, - -4.931410414999917 - ], - [ - 136.82211347700004, - -4.928317966999927 - ], - [ - 136.81185957099999, - -4.920342705999872 - ], - [ - 136.803965691, - -4.91025156 - ], - [ - 136.800629102, - -4.900485934999878 - ], - [ - 136.80298912900005, - -4.882907809999935 - ], - [ - 136.79916425900004, - -4.880059502999899 - ], - [ - 136.78638756600017, - -4.876153252999984 - ], - [ - 136.76343834700018, - -4.874118747999958 - ], - [ - 136.7531030610002, - -4.880059502999899 - ], - [ - 136.74317467500006, - -4.881524346999868 - ], - [ - 136.69581139400023, - -4.846856377999885 - ], - [ - 136.6264754570001, - -4.822849216999927 - ], - [ - 136.53785241, - -4.773614190999922 - ], - [ - 136.46371504000015, - -4.736016533999845 - ], - [ - 136.44019616, - -4.715264580999843 - ], - [ - 136.43344160200016, - -4.712334893999824 - ], - [ - 136.41309655000006, - -4.71168385199995 - ], - [ - 136.40284264400023, - -4.707696221999882 - ], - [ - 136.37566165500002, - -4.683770440999837 - ], - [ - 136.35547936300011, - -4.677422783999887 - ], - [ - 136.26734459700012, - -4.676202080999872 - ], - [ - 136.177012566, - -4.649590752999842 - ], - [ - 136.14665774800002, - -4.626397393999895 - ], - [ - 136.1460067070001, - -4.622328382999854 - ], - [ - 136.12191816500015, - -4.619317315999851 - ], - [ - 136.10670006600017, - -4.612074476999908 - ], - [ - 136.09473717500023, - -4.60312265399989 - ], - [ - 136.0807397800002, - -4.594984632999868 - ], - [ - 136.06299889400012, - -4.590590101999894 - ], - [ - 136.04965253999998, - -4.590020440999822 - ], - [ - 136.0358179050002, - -4.58603280999985 - ], - [ - 136.015879754, - -4.571465752999913 - ], - [ - 135.970469597, - -4.51962656 - ], - [ - 135.95045006600006, - -4.5062802059999 - ], - [ - 135.91228274800008, - -4.498142184999878 - ], - [ - 135.82894941500015, - -4.498630466999956 - ], - [ - 135.79273522200006, - -4.485772393999852 - ], - [ - 135.77621504000015, - -4.494561455999914 - ], - [ - 135.75033613400015, - -4.497247002999885 - ], - [ - 135.72461998800011, - -4.495293877999842 - ], - [ - 135.70801842500023, - -4.489190362999864 - ], - [ - 135.69955488400004, - -4.487237237999906 - ], - [ - 135.65609785200016, - -4.485772393999852 - ], - [ - 135.61426842500023, - -4.474704684999907 - ], - [ - 135.60474694100006, - -4.468438408999944 - ], - [ - 135.58741295700017, - -4.460381768999824 - ], - [ - 135.466563347, - -4.446058851999837 - ], - [ - 135.44361412900005, - -4.440687757999882 - ], - [ - 135.429535352, - -4.430433851999851 - ], - [ - 135.41334069100006, - -4.436293226999808 - ], - [ - 135.35914147200018, - -4.443617445999806 - ], - [ - 135.33057701900012, - -4.439873955999872 - ], - [ - 135.27198326900023, - -4.458428643999881 - ], - [ - 135.22779381600017, - -4.461195570999834 - ], - [ - 135.18555748800023, - -4.448907158999873 - ], - [ - 134.95915774800008, - -4.318617445999919 - ], - [ - 134.94312584700006, - -4.305922132999953 - ], - [ - 134.93620853000007, - -4.290215752999984 - ], - [ - 134.9274194670002, - -4.275648695999877 - ], - [ - 134.90658613400004, - -4.264092705999857 - ], - [ - 134.88184655000023, - -4.256117445999806 - ], - [ - 134.86109459700006, - -4.252373955999857 - ], - [ - 134.82349694100006, - -4.259372653999847 - ], - [ - 134.82007897200006, - -4.259209893999881 - ], - [ - 134.809825066, - -4.25408294099995 - ], - [ - 134.79224694100017, - -4.238702080999914 - ], - [ - 134.73975670700023, - -4.204034112999935 - ], - [ - 134.73340905000012, - -4.197523695999863 - ], - [ - 134.730723504, - -4.18759530999985 - ], - [ - 134.72584069100006, - -4.150079033999845 - ], - [ - 134.72388756600012, - -4.142510674999969 - ], - [ - 134.70639082100016, - -4.137302341999884 - ], - [ - 134.6811629570001, - -4.136814059999907 - ], - [ - 134.65805097700004, - -4.133396091999899 - ], - [ - 134.648203972, - -4.11874765399989 - ], - [ - 134.65528405000006, - -4.099786065999879 - ], - [ - 134.68775475400017, - -4.073174737999921 - ], - [ - 134.69654381600006, - -4.053155205999872 - ], - [ - 134.69410241000017, - -4.04517994599982 - ], - [ - 134.68067467500012, - -4.032891533999859 - ], - [ - 134.67603600400017, - -4.02646249799993 - ], - [ - 134.67457116, - -4.016289971999896 - ], - [ - 134.67920983200023, - -3.960707289999945 - ], - [ - 134.68848717500006, - -3.947442315999837 - ], - [ - 134.70337975400005, - -3.940362237999864 - ], - [ - 134.72388756600012, - -3.937758070999877 - ], - [ - 134.74089603000007, - -3.939548434999864 - ], - [ - 134.78223717500012, - -3.949151299999841 - ], - [ - 134.86443118600008, - -3.953220309999892 - ], - [ - 134.88209069100017, - -3.95761484199987 - ], - [ - 134.90707441500004, - -3.975518487999921 - ], - [ - 134.91627037900017, - -3.978692315999979 - ], - [ - 134.92774498800011, - -3.976657809999864 - ], - [ - 134.93572024800008, - -3.971937757999868 - ], - [ - 134.94141686300023, - -3.967217705999857 - ], - [ - 134.94703209700006, - -3.965020440999865 - ], - [ - 134.96745853000002, - -3.95183684699991 - ], - [ - 134.97095787900005, - -3.947930596999825 - ], - [ - 134.96778405000023, - -3.936781507999896 - ], - [ - 134.96029707099999, - -3.939385674999897 - ], - [ - 134.95142662900005, - -3.947198174999969 - ], - [ - 134.94361412900005, - -3.951348565999837 - ], - [ - 134.93091881600017, - -3.948337498 - ], - [ - 134.92383873800023, - -3.943129164999917 - ], - [ - 134.92123457100004, - -3.93865325299987 - ], - [ - 134.922618035, - -3.937758070999877 - ], - [ - 134.92066491000017, - -3.93474700299987 - ], - [ - 134.92090905000012, - -3.930922132999939 - ], - [ - 134.92042076900012, - -3.926853122999887 - ], - [ - 134.91627037900017, - -3.92343515399989 - ], - [ - 134.90845787900017, - -3.922539971999896 - ], - [ - 134.9018660820001, - -3.925225518999866 - ], - [ - 134.895762566, - -3.928969007999896 - ], - [ - 134.888926629, - -3.930922132999939 - ], - [ - 134.84457441500015, - -3.930108330999929 - ], - [ - 134.77003014400012, - -3.918226820999891 - ], - [ - 134.69223066500004, - -3.914808851999965 - ], - [ - 134.68604576900023, - -3.913506768999966 - ], - [ - 134.67579186300023, - -3.908379815999865 - ], - [ - 134.66968834700006, - -3.914239190999822 - ], - [ - 134.66602623800011, - -3.924004815999851 - ], - [ - 134.66236412900005, - -3.930922132999939 - ], - [ - 134.633555535, - -3.945082289999959 - ], - [ - 134.62029056100008, - -3.954685153999861 - ], - [ - 134.61459394599999, - -3.968438408999873 - ], - [ - 134.6115014980002, - -3.988213799999897 - ], - [ - 134.60222415500007, - -4.00066497199991 - ], - [ - 134.58716881600006, - -4.008070570999891 - ], - [ - 134.53256269600016, - -4.022067966999856 - ], - [ - 134.52523847700016, - -4.02646249799993 - ], - [ - 134.50912519599999, - -4.015883070999891 - ], - [ - 134.48438561300023, - -3.990492445999863 - ], - [ - 134.46387780000018, - -3.978692315999979 - ], - [ - 134.47836347700004, - -3.961602471999939 - ], - [ - 134.46697024800008, - -3.943291924999883 - ], - [ - 134.44703209700018, - -3.926446221999882 - ], - [ - 134.43653405000012, - -3.913506768999966 - ], - [ - 134.430430535, - -3.907810153999904 - ], - [ - 134.41675866000017, - -3.904554945999863 - ], - [ - 134.39210045700005, - -3.90300872199991 - ], - [ - 134.37525475400017, - -3.899102471999825 - ], - [ - 134.33350670700023, - -3.86882903399983 - ], - [ - 134.351410352, - -3.899102471999825 - ], - [ - 134.36036217500012, - -3.925957940999893 - ], - [ - 134.34896894600016, - -3.94345468499985 - ], - [ - 134.30616295700005, - -3.944512627999899 - ], - [ - 134.30616295700005, - -3.951348565999837 - ], - [ - 134.31861412900017, - -3.958184502999842 - ], - [ - 134.32960045700023, - -3.968438408999873 - ], - [ - 134.33741295700023, - -3.981215101999823 - ], - [ - 134.34034264400023, - -3.996026299999969 - ], - [ - 134.32667076900012, - -4.019707940999908 - ], - [ - 134.31527754000015, - -4.020277601999879 - ], - [ - 134.30933678500006, - -4.015557549999869 - ], - [ - 134.30600019600004, - -4.009535414999945 - ], - [ - 134.30274498800017, - -4.006605726999837 - ], - [ - 134.29273522200018, - -4.000176690999837 - ], - [ - 134.28386478000002, - -3.985935153999918 - ], - [ - 134.27222741000006, - -3.971449476999879 - ], - [ - 134.25440514400023, - -3.965020440999865 - ], - [ - 134.23487389400017, - -3.962660414999988 - ], - [ - 134.21119225400005, - -3.955336195999806 - ], - [ - 134.19117272200018, - -3.943536065999922 - ], - [ - 134.18262780000023, - -3.927178643999909 - ], - [ - 134.18148847700004, - -3.917575778999847 - ], - [ - 134.17628014400023, - -3.900323174999841 - ], - [ - 134.17514082099999, - -3.893324476999851 - ], - [ - 134.17042076900006, - -3.888116143999866 - ], - [ - 134.15967858200005, - -3.892754815999879 - ], - [ - 134.14812259200002, - -3.900079033999972 - ], - [ - 134.14112389400017, - -3.90300872199991 - ], - [ - 134.13396243600013, - -3.890069268999909 - ], - [ - 134.14421634200008, - -3.874769789999945 - ], - [ - 134.18580162900005, - -3.842543226999808 - ], - [ - 134.19263756600006, - -3.835544529 - ], - [ - 134.19092858200023, - -3.826267184999878 - ], - [ - 134.17310631600017, - -3.787855726999865 - ], - [ - 134.1616317070001, - -3.771661065999908 - ], - [ - 134.14698326900012, - -3.757582289999874 - ], - [ - 134.12745201900023, - -3.745293877999913 - ], - [ - 134.12224368600002, - -3.753676039999874 - ], - [ - 134.12330162900017, - -3.760918877999899 - ], - [ - 134.12647545700023, - -3.76873137799997 - ], - [ - 134.12745201900023, - -3.779473565999893 - ], - [ - 134.12647545700023, - -3.799248955999914 - ], - [ - 134.12240644599999, - -3.80535247199991 - ], - [ - 134.11036217500006, - -3.81755950299997 - ], - [ - 134.09180748800006, - -3.823988539999903 - ], - [ - 134.07447350400017, - -3.812920830999857 - ], - [ - 134.05738366000006, - -3.798109632999882 - ], - [ - 134.03931725400005, - -3.793145440999837 - ], - [ - 134.02320397200006, - -3.805108330999872 - ], - [ - 133.99935957100016, - -3.846286716999927 - ], - [ - 133.9876408210001, - -3.855157158999887 - ], - [ - 133.97103925900004, - -3.850274346999825 - ], - [ - 133.95899498800011, - -3.837579033999859 - ], - [ - 133.91334069100017, - -3.729424737999878 - ], - [ - 133.8960067070001, - -3.702406507999925 - ], - [ - 133.8527124360002, - -3.653903903999947 - ], - [ - 133.84359785200004, - -3.638360283999944 - ], - [ - 133.84009850400005, - -3.618340752999885 - ], - [ - 133.84099368600013, - -3.597751559999864 - ], - [ - 133.83814537900017, - -3.590427341999856 - ], - [ - 133.82984459700012, - -3.587579033999901 - ], - [ - 133.8225203790001, - -3.589939059999949 - ], - [ - 133.81324303500006, - -3.595391533999901 - ], - [ - 133.80445397200018, - -3.602308851999894 - ], - [ - 133.79908287900005, - -3.608819268999895 - ], - [ - 133.79542076900017, - -3.631524346999839 - ], - [ - 133.80339603000002, - -3.654066665 - ], - [ - 133.81413821700002, - -3.67538827899989 - ], - [ - 133.82325280000012, - -3.704522393999852 - ], - [ - 133.82911217500018, - -3.714450778999847 - ], - [ - 133.82927493600002, - -3.721856377999842 - ], - [ - 133.81576582100016, - -3.724786065999865 - ], - [ - 133.80982506600006, - -3.720310153999975 - ], - [ - 133.79908287900005, - -3.690687757999854 - ], - [ - 133.79021243600008, - -3.680352471999839 - ], - [ - 133.7775985040001, - -3.669122002999927 - ], - [ - 133.76295006600017, - -3.660251559999892 - ], - [ - 133.74756920700023, - -3.656508070999863 - ], - [ - 133.7325952480002, - -3.662855726999894 - ], - [ - 133.716563347, - -3.672784112999892 - ], - [ - 133.70313561300023, - -3.672621351999837 - ], - [ - 133.69605553500017, - -3.649102471999868 - ], - [ - 133.70728600400017, - -3.630303643999824 - ], - [ - 133.7097274100001, - -3.621758721999981 - ], - [ - 133.70801842500012, - -3.610121351999894 - ], - [ - 133.69841556100013, - -3.590264580999971 - ], - [ - 133.68978925900004, - -3.564548434999935 - ], - [ - 133.64820397200006, - -3.505059502999899 - ], - [ - 133.64144941499998, - -3.483656507999868 - ], - [ - 133.641856316, - -3.461602471999868 - ], - [ - 133.65316816499998, - -3.444431247999844 - ], - [ - 133.678965691, - -3.437432549999855 - ], - [ - 133.6967879570001, - -3.427422783999958 - ], - [ - 133.70215905000023, - -3.404392184999907 - ], - [ - 133.70020592500012, - -3.379001559999963 - ], - [ - 133.68336022200012, - -3.304945570999919 - ], - [ - 133.68311608200017, - -3.232517184999963 - ], - [ - 133.69092858200023, - -3.216078382999967 - ], - [ - 133.7097274100001, - -3.232028903999975 - ], - [ - 133.71387780000023, - -3.224704684999892 - ], - [ - 133.71583092500006, - -3.215915623 - ], - [ - 133.716563347, - -3.193780205999843 - ], - [ - 133.72242272200006, - -3.183038018999838 - ], - [ - 133.73568769599999, - -3.18336353999986 - ], - [ - 133.758067254, - -3.190362237999835 - ], - [ - 133.77116946700008, - -3.175469658999887 - ], - [ - 133.78394616000006, - -3.131442966999956 - ], - [ - 133.80250084700006, - -3.122165622999916 - ], - [ - 133.8226017590001, - -3.115655205999914 - ], - [ - 133.84644616000017, - -3.087090752999842 - ], - [ - 133.8639429050002, - -3.080498955999857 - ], - [ - 133.88282311300023, - -3.091566664999903 - ], - [ - 133.89909915500007, - -3.112969658999845 - ], - [ - 133.91407311300011, - -3.126560153999904 - ], - [ - 133.92945397200006, - -3.114678643999937 - ], - [ - 133.92359459700012, - -3.111016533999901 - ], - [ - 133.91944420700005, - -3.106377862999878 - ], - [ - 133.91675866000017, - -3.099867445999962 - ], - [ - 133.915782097, - -3.090915622999859 - ], - [ - 133.91228274800014, - -3.083428643999966 - ], - [ - 133.904063347, - -3.079359632999825 - ], - [ - 133.89478600400017, - -3.07683684699991 - ], - [ - 133.88770592500012, - -3.073663018999852 - ], - [ - 133.87891686300023, - -3.065524997999916 - ], - [ - 133.870371941, - -3.055108330999843 - ], - [ - 133.8639429050002, - -3.042087497999859 - ], - [ - 133.8605249360002, - -3.025974216999884 - ], - [ - 133.863047722, - -3.008233330999886 - ], - [ - 133.87769616000006, - -2.979261976999894 - ], - [ - 133.88160241000006, - -2.963799737999864 - ], - [ - 133.87964928500017, - -2.95224374799993 - ], - [ - 133.87435957099999, - -2.940606377999842 - ], - [ - 133.8673608730002, - -2.93035247199991 - ], - [ - 133.8605249360002, - -2.922946873 - ], - [ - 133.84376061300006, - -2.927829684999892 - ], - [ - 133.82569420700017, - -2.928887627999856 - ], - [ - 133.81755618600008, - -2.934747002999885 - ], - [ - 133.82984459700012, - -2.95387135199995 - ], - [ - 133.82789147200006, - -2.959649346999839 - ], - [ - 133.81519616000017, - -2.983575127999885 - ], - [ - 133.80909264400012, - -3.010186455999843 - ], - [ - 133.80160566500004, - -3.01816171699997 - ], - [ - 133.73414147200006, - -3.052666924999983 - ], - [ - 133.71998131600006, - -3.063571872999873 - ], - [ - 133.69092858200023, - -3.092868747999901 - ], - [ - 133.668223504, - -3.122165622999916 - ], - [ - 133.65552819100006, - -3.188897393999881 - ], - [ - 133.66334069100006, - -3.361504815999837 - ], - [ - 133.62769616000017, - -3.416273695999948 - ], - [ - 133.61361738400015, - -3.421970309999935 - ], - [ - 133.558848504, - -3.433282158999916 - ], - [ - 133.55103600400005, - -3.431573174999912 - ], - [ - 133.5455835300002, - -3.4242489559999 - ], - [ - 133.52849368600002, - -3.386651299999912 - ], - [ - 133.52466881600006, - -3.382256768999838 - ], - [ - 133.51400800899998, - -3.378350518999838 - ], - [ - 133.51319420700005, - -3.384372653999932 - ], - [ - 133.51856530000023, - -3.403252862999864 - ], - [ - 133.51937910200016, - -3.430840752999885 - ], - [ - 133.51197350400017, - -3.43865325299987 - ], - [ - 133.49057050900004, - -3.437432549999855 - ], - [ - 133.49057050900004, - -3.444268487999878 - ], - [ - 133.51124108200023, - -3.45517343499985 - ], - [ - 133.55062910200004, - -3.468682549999826 - ], - [ - 133.56910241000006, - -3.481866143999881 - ], - [ - 133.5822860040001, - -3.500176690999837 - ], - [ - 133.59017988400015, - -3.522230726999922 - ], - [ - 133.59180748800011, - -3.545342705999886 - ], - [ - 133.58619225400017, - -3.566582940999865 - ], - [ - 133.57593834700006, - -3.580498955999857 - ], - [ - 133.55925540500002, - -3.596449476999865 - ], - [ - 133.53988691500004, - -3.609551690999837 - ], - [ - 133.52165774800014, - -3.614922783999887 - ], - [ - 133.50562584700006, - -3.622328382999953 - ], - [ - 133.40886478000002, - -3.722426039999903 - ], - [ - 133.39665774800008, - -3.75595468499985 - ], - [ - 133.40870201900017, - -3.80055104 - ], - [ - 133.44019616000017, - -3.827569268999866 - ], - [ - 133.45557701900012, - -3.846937757999882 - ], - [ - 133.45337975400005, - -3.865411065999822 - ], - [ - 133.44312584700018, - -3.872816664999903 - ], - [ - 133.4207462900001, - -3.880547783999901 - ], - [ - 133.41179446700008, - -3.886163018999909 - ], - [ - 133.40308678500017, - -3.896416924999926 - ], - [ - 133.3881942070001, - -3.92343515399989 - ], - [ - 133.269379102, - -4.052015882999839 - ], - [ - 133.25098717500023, - -4.0668270809999 - ], - [ - 133.21094811300023, - -4.078383070999834 - ], - [ - 133.16391035200004, - -4.076267184999907 - ], - [ - 133.07911217500023, - -4.060642184999921 - ], - [ - 133.05152428500006, - -4.061211846999981 - ], - [ - 133.03516686300011, - -4.070082289999945 - ], - [ - 133.0074975920002, - -4.104668877999842 - ], - [ - 132.98991946700008, - -4.113946221999896 - ], - [ - 132.96941165500002, - -4.111993096999853 - ], - [ - 132.9181421230002, - -4.091078382999882 - ], - [ - 132.91228274800002, - -4.090264580999872 - ], - [ - 132.9077254570001, - -4.088148695999863 - ], - [ - 132.901621941, - -4.081149997999887 - ], - [ - 132.89625084700006, - -4.068942966999913 - ], - [ - 132.89698326900006, - -4.048272393999895 - ], - [ - 132.89136803500017, - -4.036716403999876 - ], - [ - 132.88111412900017, - -4.027764580999929 - ], - [ - 132.85938561300011, - -4.01653411299985 - ], - [ - 132.8499455090001, - -4.009698174999912 - ], - [ - 132.84115644600004, - -3.998142184999978 - ], - [ - 132.83155358200023, - -3.975355726999865 - ], - [ - 132.82585696700008, - -3.965020440999865 - ], - [ - 132.81690514400012, - -3.95761484199987 - ], - [ - 132.80567467500012, - -3.949965101999851 - ], - [ - 132.79590905000006, - -3.940606377999913 - ], - [ - 132.79175866000006, - -3.927178643999909 - ], - [ - 132.79639733200005, - -3.918145440999908 - ], - [ - 132.80681399800008, - -3.922133070999891 - ], - [ - 132.82585696700008, - -3.937758070999877 - ], - [ - 132.82634524800002, - -3.926446221999882 - ], - [ - 132.82455488400015, - -3.916436455999985 - ], - [ - 132.80209394600016, - -3.858168226999894 - ], - [ - 132.78793379000004, - -3.844008070999863 - ], - [ - 132.784922722, - -3.837823174999897 - ], - [ - 132.7858992850001, - -3.803969007999839 - ], - [ - 132.784922722, - -3.793145440999837 - ], - [ - 132.73096764400012, - -3.682305596999882 - ], - [ - 132.7296655610002, - -3.649102471999868 - ], - [ - 132.75611412900017, - -3.62753671699987 - ], - [ - 132.7971297540001, - -3.634047132999854 - ], - [ - 132.84229576900023, - -3.646579684999864 - ], - [ - 132.88111412900017, - -3.642836195999834 - ], - [ - 132.89014733200005, - -3.634535414999931 - ], - [ - 132.8907983730002, - -3.626885674999912 - ], - [ - 132.8883569670002, - -3.618584893999923 - ], - [ - 132.88795006600017, - -3.608819268999895 - ], - [ - 132.89161217500023, - -3.594903252999913 - ], - [ - 132.89625084700006, - -3.586358330999886 - ], - [ - 132.91187584700006, - -3.570245049999912 - ], - [ - 132.927500847, - -3.561130466999927 - ], - [ - 132.93181399800014, - -3.554131768999937 - ], - [ - 132.9254663420002, - -3.543226820999877 - ], - [ - 132.91529381600006, - -3.534844658999916 - ], - [ - 132.90756269600004, - -3.529961846999853 - ], - [ - 132.90113366000006, - -3.524021092 - ], - [ - 132.8947860040001, - -3.511895440999837 - ], - [ - 132.88086998800011, - -3.475355726999965 - ], - [ - 132.87159264400017, - -3.471368096999896 - ], - [ - 132.8499455090001, - -3.470961195999891 - ], - [ - 132.83187910200016, - -3.461032809999978 - ], - [ - 132.82113691500015, - -3.437432549999855 - ], - [ - 132.81275475400017, - -3.389743747999887 - ], - [ - 132.81185957099999, - -3.366631768999852 - ], - [ - 132.81902103000002, - -3.303643487999821 - ], - [ - 132.81169681100002, - -3.281670830999985 - ], - [ - 132.7944442070001, - -3.271661065999822 - ], - [ - 132.77409915500002, - -3.269789320999948 - ], - [ - 132.74073326900023, - -3.276543877999885 - ], - [ - 132.73389733200023, - -3.279961846999981 - ], - [ - 132.7296655610002, - -3.286065362999892 - ], - [ - 132.72934003999998, - -3.298435154 - ], - [ - 132.73755944100017, - -3.321058851999894 - ], - [ - 132.7332462900001, - -3.330987237999892 - ], - [ - 132.714121941, - -3.340020440999893 - ], - [ - 132.69214928500017, - -3.338148695999934 - ], - [ - 132.67115319100006, - -3.328545830999943 - ], - [ - 132.6544702480002, - -3.313897393999852 - ], - [ - 132.64893639400012, - -3.304864190999837 - ], - [ - 132.63404381600006, - -3.27239348799985 - ], - [ - 132.62614993600008, - -3.262627862999821 - ], - [ - 132.6030379570001, - -3.241875908999916 - ], - [ - 132.6022241550002, - -3.231866143999838 - ], - [ - 132.61638431100002, - -3.224867445999948 - ], - [ - 132.62989342500012, - -3.21510182099999 - ], - [ - 132.62720787900005, - -3.197360934999907 - ], - [ - 132.62061608200023, - -3.192315362999878 - ], - [ - 132.59644616000006, - -3.179375908999873 - ], - [ - 132.58936608200005, - -3.176853122999859 - ], - [ - 132.58179772200006, - -3.170342705999872 - ], - [ - 132.57260175900015, - -3.14218515399989 - ], - [ - 132.56861412900017, - -3.135837497999859 - ], - [ - 132.56324303500006, - -3.13046640399989 - ], - [ - 132.55933678500006, - -3.118747653999989 - ], - [ - 132.5530705090001, - -3.107028903999918 - ], - [ - 132.54118899800014, - -3.101657809999949 - ], - [ - 132.53394616, - -3.097344658999859 - ], - [ - 132.51465905000018, - -3.078057549999826 - ], - [ - 132.507090691, - -3.073663018999852 - ], - [ - 132.495860222, - -3.070570570999863 - ], - [ - 132.48845462300002, - -3.063083591999884 - ], - [ - 132.48243248800023, - -3.053887627999828 - ], - [ - 132.47584069100006, - -3.046482028999932 - ], - [ - 132.36573326900023, - -2.985284112999977 - ], - [ - 132.33985436300011, - -2.977634372999873 - ], - [ - 132.34229576900023, - -2.95818450299987 - ], - [ - 132.3256942070001, - -2.946547132999868 - ], - [ - 132.27767988400004, - -2.936618747999944 - ], - [ - 132.266856316, - -2.935479424999912 - ], - [ - 132.23316491, - -2.936618747999944 - ], - [ - 132.2198999360002, - -2.934258721999896 - ], - [ - 132.20948326900012, - -2.928969007999839 - ], - [ - 132.19971764400023, - -2.922539971999825 - ], - [ - 132.18832441499998, - -2.916680596999868 - ], - [ - 132.18458092500023, - -2.936211846999939 - ], - [ - 132.16879316500004, - -2.946465752999885 - ], - [ - 132.15105228000013, - -2.946709893999824 - ], - [ - 132.14063561300023, - -2.936618747999944 - ], - [ - 132.13135826900006, - -2.941338799999869 - ], - [ - 132.12330162900005, - -2.94231536299985 - ], - [ - 132.11524498800011, - -2.940524997999859 - ], - [ - 132.10645592500023, - -2.936618747999944 - ], - [ - 132.11109459700006, - -2.954278252999956 - ], - [ - 132.10124759200002, - -2.959893487999878 - ], - [ - 132.075450066, - -2.957696221999882 - ], - [ - 132.07349694100017, - -2.951429945999919 - ], - [ - 132.05795332100016, - -2.916680596999868 - ], - [ - 132.0387475920002, - -2.92644622199991 - ], - [ - 131.99691816499998, - -2.914808851999808 - ], - [ - 131.98218834700018, - -2.929782809999935 - ], - [ - 131.9760848320001, - -2.929782809999935 - ], - [ - 131.97787519599999, - -2.914646091999842 - ], - [ - 131.98454837300002, - -2.907647393999866 - ], - [ - 131.99366295700023, - -2.903090101999908 - ], - [ - 132.00342858200005, - -2.896172783999916 - ], - [ - 132.0128686860002, - -2.885918877999885 - ], - [ - 132.01775149800008, - -2.878594658999887 - ], - [ - 132.02393639400023, - -2.854668877999913 - ], - [ - 132.00570722700016, - -2.85271575299987 - ], - [ - 131.98975670700023, - -2.848402601999879 - ], - [ - 131.98975670700023, - -2.84099700299997 - ], - [ - 132.00440514400023, - -2.837090752999885 - ], - [ - 132.02247155000018, - -2.829034112999864 - ], - [ - 132.03785241, - -2.817559502999913 - ], - [ - 132.0444442070001, - -2.803399346999882 - ], - [ - 132.03500410200016, - -2.79355234199987 - ], - [ - 132.0128686860002, - -2.790948174999954 - ], - [ - 131.96558678500006, - -2.793145440999865 - ], - [ - 131.95801842500006, - -2.788181247999901 - ], - [ - 131.97266686300011, - -2.776950778999989 - ], - [ - 132.01026451900012, - -2.759047132999939 - ], - [ - 132.02719160200016, - -2.759047132999939 - ], - [ - 132.0444442070001, - -2.761163018999866 - ], - [ - 132.0582788420002, - -2.75855885199995 - ], - [ - 132.06544030000012, - -2.744805596999853 - ], - [ - 132.07422936300011, - -2.755791924999897 - ], - [ - 132.0815535820001, - -2.757907809999907 - ], - [ - 132.08423912900017, - -2.751722914999945 - ], - [ - 132.07846113400004, - -2.738539320999891 - ], - [ - 132.0880639980002, - -2.735609632999882 - ], - [ - 132.1303817070001, - -2.738539320999891 - ], - [ - 132.15577233200023, - -2.733493747999873 - ], - [ - 132.18148847700016, - -2.724867445999948 - ], - [ - 132.16016686300011, - -2.715590101999823 - ], - [ - 132.1108504570001, - -2.719414971999825 - ], - [ - 132.11329186300023, - -2.704359632999811 - ], - [ - 132.12134850400017, - -2.697930596999896 - ], - [ - 132.16163170700005, - -2.683282158999887 - ], - [ - 132.18148847700016, - -2.683282158999887 - ], - [ - 132.19483483200005, - -2.678317966999842 - ], - [ - 132.20191491000006, - -2.676446221999953 - ], - [ - 132.311778191, - -2.676446221999953 - ], - [ - 132.3256942070001, - -2.679864190999879 - ], - [ - 132.36719811300011, - -2.69695403399983 - ], - [ - 132.38200931100008, - -2.699314059999878 - ], - [ - 132.4155379570001, - -2.69695403399983 - ], - [ - 132.40805097700004, - -2.69695403399983 - ], - [ - 132.41309655000018, - -2.696465752999842 - ], - [ - 132.42847741, - -2.69695403399983 - ], - [ - 132.42432701900006, - -2.710381768999824 - ], - [ - 132.43002363400015, - -2.721449476999851 - ], - [ - 132.43336022200018, - -2.732191664999874 - ], - [ - 132.421153191, - -2.744805596999853 - ], - [ - 132.43783613400015, - -2.745049737999892 - ], - [ - 132.45997155000012, - -2.732679945999948 - ], - [ - 132.47584069100006, - -2.73113372199991 - ], - [ - 132.47584069100006, - -2.724867445999948 - ], - [ - 132.46892337300008, - -2.707614841999941 - ], - [ - 132.484629754, - -2.699476820999934 - ], - [ - 132.50635826900006, - -2.698011976999879 - ], - [ - 132.51734459700006, - -2.700778903999932 - ], - [ - 132.52540123800006, - -2.710544528999961 - ], - [ - 132.54428144600004, - -2.713799737999835 - ], - [ - 132.56674238400004, - -2.714532158999859 - ], - [ - 132.585703972, - -2.717461846999882 - ], - [ - 132.62061608200023, - -2.740899346999939 - ], - [ - 132.67904707100004, - -2.801690362999878 - ], - [ - 132.71599368600008, - -2.814222914999888 - ], - [ - 132.72828209700006, - -2.813164971999839 - ], - [ - 132.736582879, - -2.809991143999866 - ], - [ - 132.75505618600002, - -2.796563408999873 - ], - [ - 132.76368248800023, - -2.786309502999842 - ], - [ - 132.7768660820001, - -2.779229424999883 - ], - [ - 132.83529707100016, - -2.736016533999887 - ], - [ - 132.85303795700017, - -2.717461846999882 - ], - [ - 132.9030054050002, - -2.645928643999838 - ], - [ - 132.92774498800006, - -2.627699476999936 - ], - [ - 132.94939212300008, - -2.580254815999837 - ], - [ - 133.00831139400012, - -2.51441822699995 - ], - [ - 133.0171004570001, - -2.494886976999879 - ], - [ - 133.03353925899998, - -2.479424737999949 - ], - [ - 133.11215253999998, - -2.442803643999838 - ], - [ - 133.13770592500006, - -2.435723565999879 - ], - [ - 133.14389082100016, - -2.434991143999852 - ], - [ - 133.15154056100008, - -2.432875257999925 - ], - [ - 133.1588647800002, - -2.429864190999922 - ], - [ - 133.16472415500002, - -2.426039320999919 - ], - [ - 133.17286217500023, - -2.422051690999851 - ], - [ - 133.18018639400023, - -2.423760674999855 - ], - [ - 133.18751061300023, - -2.427666924999841 - ], - [ - 133.19629967500012, - -2.429457289999917 - ], - [ - 133.21314537900005, - -2.426364841999842 - ], - [ - 133.23959394599999, - -2.41676197699995 - ], - [ - 133.25847415500002, - -2.416436455999929 - ], - [ - 133.31234785200016, - -2.443047783999887 - ], - [ - 133.31763756600006, - -2.456719658999916 - ], - [ - 133.32056725400017, - -2.491875908999887 - ], - [ - 133.326019727, - -2.505140882999825 - ], - [ - 133.33838951900023, - -2.496189059999878 - ], - [ - 133.35377037900017, - -2.49627044099995 - ], - [ - 133.36898847700016, - -2.502536716999913 - ], - [ - 133.38070722700004, - -2.511976820999919 - ], - [ - 133.39031009200014, - -2.526625257999839 - ], - [ - 133.3921004570001, - -2.538669528999861 - ], - [ - 133.3881942070001, - -2.566582940999893 - ], - [ - 133.38835696700008, - -2.652276299999869 - ], - [ - 133.38070722700004, - -2.676446221999953 - ], - [ - 133.4030054050002, - -2.675225518999937 - ], - [ - 133.40805097700004, - -2.659600518999952 - ], - [ - 133.40186608200023, - -2.615004164999888 - ], - [ - 133.40455162900005, - -2.591403903999847 - ], - [ - 133.41098066500004, - -2.56650156 - ], - [ - 133.43799889400006, - -2.503024997999901 - ], - [ - 133.44556725400005, - -2.494724216999913 - ], - [ - 133.4565535820001, - -2.498304945999976 - ], - [ - 133.4586694670002, - -2.506931247999901 - ], - [ - 133.4565535820001, - -2.54615650799991 - ], - [ - 133.461192254, - -2.595310153999932 - ], - [ - 133.45899498800023, - -2.618096612999878 - ], - [ - 133.45036868600013, - -2.642347914999945 - ], - [ - 133.465098504, - -2.636163018999895 - ], - [ - 133.47315514400023, - -2.615980726999865 - ], - [ - 133.47689863399998, - -2.570407809999907 - ], - [ - 133.47478274800008, - -2.558363539999888 - ], - [ - 133.47087649800008, - -2.54509856599995 - ], - [ - 133.46908613399998, - -2.532159112999864 - ], - [ - 133.47348066500015, - -2.521661065999893 - ], - [ - 133.4850366550002, - -2.516534112999878 - ], - [ - 133.49252363400015, - -2.523532809999864 - ], - [ - 133.49740644600004, - -2.533949476999851 - ], - [ - 133.50945071700008, - -2.550062757999825 - ], - [ - 133.51221764400012, - -2.572198174999897 - ], - [ - 133.5187280610002, - -2.58961353999986 - ], - [ - 133.53834069100017, - -2.587090752999856 - ], - [ - 133.53956139400006, - -2.583265882999839 - ], - [ - 133.53972415500007, - -2.568780205999886 - ], - [ - 133.54175866000017, - -2.563571872999972 - ], - [ - 133.54737389400006, - -2.560804945999919 - ], - [ - 133.55958092500023, - -2.56161874799993 - ], - [ - 133.56568444100006, - -2.560316664999931 - ], - [ - 133.58562259200014, - -2.552422783999873 - ], - [ - 133.5952254570001, - -2.545668226999922 - ], - [ - 133.60670006600006, - -2.532484632999967 - ], - [ - 133.61524498800017, - -2.541110934999892 - ], - [ - 133.62232506600006, - -2.541761976999837 - ], - [ - 133.6284285820001, - -2.539646091999927 - ], - [ - 133.63396243600002, - -2.539320570999905 - ], - [ - 133.64063561300011, - -2.542901299999869 - ], - [ - 133.66724694100006, - -2.563409112999835 - ], - [ - 133.6733504570001, - -2.574802341999884 - ], - [ - 133.67546634200002, - -2.588067315999822 - ], - [ - 133.67628014400023, - -2.649021091999913 - ], - [ - 133.67188561300023, - -2.659437757999896 - ], - [ - 133.66846764400023, - -2.670830987999864 - ], - [ - 133.68238366000006, - -2.717461846999882 - ], - [ - 133.69174238400015, - -2.704278252999828 - ], - [ - 133.69239342500012, - -2.691501559999878 - ], - [ - 133.68978925900004, - -2.676202080999914 - ], - [ - 133.68921959700006, - -2.656019789999888 - ], - [ - 133.69336998800006, - -2.637302341999927 - ], - [ - 133.70679772200018, - -2.597832940999865 - ], - [ - 133.7097274100001, - -2.577243747999916 - ], - [ - 133.7097274100001, - -2.521172783999901 - ], - [ - 133.713145379, - -2.511976820999919 - ], - [ - 133.73503665500007, - -2.516778252999828 - ], - [ - 133.7474064460001, - -2.529229424999926 - ], - [ - 133.76433353000007, - -2.566582940999893 - ], - [ - 133.78541100400017, - -2.597751559999963 - ], - [ - 133.79908287900005, - -2.642347914999945 - ], - [ - 133.81104576900023, - -2.653985283999873 - ], - [ - 133.81690514400012, - -2.649021091999913 - ], - [ - 133.81918379000015, - -2.632989190999837 - ], - [ - 133.81959069100017, - -2.611586195999962 - ], - [ - 133.82789147200006, - -2.549899997999859 - ], - [ - 133.82300866000017, - -2.539320570999905 - ], - [ - 133.82178795700005, - -2.535577080999872 - ], - [ - 133.80884850400017, - -2.520196221999839 - ], - [ - 133.80591881600006, - -2.518243096999882 - ], - [ - 133.80396569100017, - -2.506768487999835 - ], - [ - 133.80486087300008, - -2.497002862999977 - ], - [ - 133.80958092500006, - -2.487481377999899 - ], - [ - 133.81959069100017, - -2.477227471999868 - ], - [ - 133.80176842500012, - -2.470310153999876 - ], - [ - 133.7672632170002, - -2.471937757999896 - ], - [ - 133.75123131600017, - -2.462985934999864 - ], - [ - 133.74097741000017, - -2.445896091999913 - ], - [ - 133.74724368600013, - -2.437920830999872 - ], - [ - 133.76319420700023, - -2.435723565999879 - ], - [ - 133.78174889400023, - -2.435723565999879 - ], - [ - 133.82618248800023, - -2.426202080999886 - ], - [ - 133.85010826900012, - -2.424248955999843 - ], - [ - 133.8605249360002, - -2.432549737999821 - ], - [ - 133.86622155000006, - -2.442966403999904 - ], - [ - 133.89332116, - -2.465997002999956 - ], - [ - 133.90211022200018, - -2.477227471999868 - ], - [ - 133.90837649800014, - -2.477227471999868 - ], - [ - 133.89649498800006, - -2.457940362999835 - ], - [ - 133.8764754570001, - -2.432875257999925 - ], - [ - 133.86646569100006, - -2.411390882999811 - ], - [ - 133.88461347700004, - -2.40211353999986 - ], - [ - 133.95460045700023, - -2.409112237999835 - ], - [ - 133.98658287900005, - -2.406182549999912 - ], - [ - 134.00513756600006, - -2.388441664999917 - ], - [ - 133.94890384200008, - -2.390394789999874 - ], - [ - 133.92090905000012, - -2.387627862999906 - ], - [ - 133.89869225400017, - -2.377618096999825 - ], - [ - 133.89454186300023, - -2.363376559999921 - ], - [ - 133.94507897200006, - -2.343926690999822 - ], - [ - 133.96355228000007, - -2.326429945999877 - ], - [ - 133.93783613400004, - -2.32732512799987 - ], - [ - 133.89283287900005, - -2.340264580999872 - ], - [ - 133.8673608730002, - -2.341241143999852 - ], - [ - 133.8673608730002, - -2.333916924999926 - ], - [ - 133.91358483200023, - -2.319512627999956 - ], - [ - 133.93441816499998, - -2.308689059999878 - ], - [ - 133.949961785, - -2.292901299999841 - ], - [ - 133.95704186300017, - -2.272637627999828 - ], - [ - 133.95972741000006, - -2.246677341999927 - ], - [ - 133.95736738399998, - -2.22144947699995 - ], - [ - 133.949961785, - -2.2035458309999 - ], - [ - 133.93970787900017, - -2.25505950299997 - ], - [ - 133.92896569100017, - -2.274183851999865 - ], - [ - 133.90837649800014, - -2.25872161299985 - ], - [ - 133.90211022200018, - -2.25872161299985 - ], - [ - 133.87419681100002, - -2.281670830999829 - ], - [ - 133.85474694100006, - -2.294122002999856 - ], - [ - 133.84009850400005, - -2.299737237999935 - ], - [ - 133.82349694100017, - -2.294854424999883 - ], - [ - 133.80730228000013, - -2.271172783999944 - ], - [ - 133.79566491, - -2.265557549999855 - ], - [ - 133.79200280000023, - -2.2601864559999 - ], - [ - 133.79916425900004, - -2.24863046699987 - ], - [ - 133.81316165500007, - -2.23691171699997 - ], - [ - 133.84750410200004, - -2.227715752999913 - ], - [ - 133.863047722, - -2.21795012799987 - ], - [ - 133.87476647200012, - -2.204685153999932 - ], - [ - 133.88160241000006, - -2.189873955999957 - ], - [ - 133.90137780000023, - -2.198418877999899 - ], - [ - 133.91700280000023, - -2.190850518999852 - ], - [ - 133.93197675900015, - -2.177504164999931 - ], - [ - 133.949961785, - -2.169366143999909 - ], - [ - 133.94312584700018, - -2.1625302059999 - ], - [ - 133.93116295700023, - -2.168633721999882 - ], - [ - 133.91293379000015, - -2.175225518999866 - ], - [ - 133.89795983200023, - -2.175469658999987 - ], - [ - 133.89527428500017, - -2.1625302059999 - ], - [ - 133.90040123800006, - -2.159274997999859 - ], - [ - 133.92188561300011, - -2.152764580999857 - ], - [ - 133.92945397200006, - -2.148858330999872 - ], - [ - 133.93279056100008, - -2.142266533999972 - ], - [ - 133.93531334700018, - -2.125664971999839 - ], - [ - 133.93970787900017, - -2.118259372999844 - ], - [ - 133.94044030000012, - -2.107598565999822 - ], - [ - 133.92221113400004, - -2.104424737999935 - ], - [ - 133.89909915500007, - -2.106377862999977 - ], - [ - 133.88461347700004, - -2.111423435 - ], - [ - 133.87916100400017, - -2.110772393999881 - ], - [ - 133.86850019600016, - -2.108168226999965 - ], - [ - 133.85816491000006, - -2.107354424999954 - ], - [ - 133.85368899800008, - -2.111423435 - ], - [ - 133.8385522800002, - -2.136000257999839 - ], - [ - 133.833262566, - -2.142185153999989 - ], - [ - 133.82447350400005, - -2.145440362999864 - ], - [ - 133.80762780000023, - -2.146579684999892 - ], - [ - 133.79908287900005, - -2.148858330999872 - ], - [ - 133.773203972, - -2.165297132999868 - ], - [ - 133.76433353000007, - -2.169366143999909 - ], - [ - 133.7260848320001, - -2.170505466999941 - ], - [ - 133.70997155000023, - -2.175551039999888 - ], - [ - 133.70346113400015, - -2.193617445999905 - ], - [ - 133.69581139400012, - -2.197849216999927 - ], - [ - 133.678965691, - -2.204278252999927 - ], - [ - 133.66211998800011, - -2.213962497999901 - ], - [ - 133.6544702480002, - -2.227715752999913 - ], - [ - 133.6518660820001, - -2.234144789999917 - ], - [ - 133.64576256600012, - -2.236016533999887 - ], - [ - 133.63819420700023, - -2.233656507999839 - ], - [ - 133.63086998800023, - -2.227715752999913 - ], - [ - 133.623301629, - -2.225274346999882 - ], - [ - 133.61304772200018, - -2.228285414999888 - ], - [ - 133.59359785200016, - -2.237562757999925 - ], - [ - 133.59685306100013, - -2.195082289999874 - ], - [ - 133.59359785200016, - -2.183038018999852 - ], - [ - 133.57715905000006, - -2.220472914999974 - ], - [ - 133.56462649800008, - -2.237888278999947 - ], - [ - 133.54859459700018, - -2.245049737999906 - ], - [ - 133.5330509770001, - -2.238457940999837 - ], - [ - 133.521250847, - -2.209649346999896 - ], - [ - 133.50416100400017, - -2.2035458309999 - ], - [ - 133.50416100400017, - -2.211032809999878 - ], - [ - 133.51465905000023, - -2.226006768999909 - ], - [ - 133.49976647200018, - -2.230726820999919 - ], - [ - 133.47608483200005, - -2.23154062299993 - ], - [ - 133.44556725400005, - -2.237888278999947 - ], - [ - 133.40723717500012, - -2.222263278999961 - ], - [ - 133.3881942070001, - -2.217217705999843 - ], - [ - 133.3416447270001, - -2.222751559999949 - ], - [ - 133.31657962300008, - -2.222588799999983 - ], - [ - 133.30551191500015, - -2.214043877999885 - ], - [ - 133.296153191, - -2.204196872999944 - ], - [ - 133.2742619150001, - -2.206312757999953 - ], - [ - 133.23121178500006, - -2.217217705999843 - ], - [ - 133.19214928500017, - -2.214288018999824 - ], - [ - 133.16944420700023, - -2.216892184999921 - ], - [ - 133.135020379, - -2.238457940999837 - ], - [ - 133.11231530000023, - -2.242933851999894 - ], - [ - 133.06609134200008, - -2.245049737999906 - ], - [ - 133.02019290500007, - -2.255791924999826 - ], - [ - 132.9812117850001, - -2.272149346999839 - ], - [ - 132.9436141290001, - -2.283379815999922 - ], - [ - 132.901621941, - -2.279229424999897 - ], - [ - 132.8395288420002, - -2.249118747999859 - ], - [ - 132.81592858200023, - -2.245049737999906 - ], - [ - 132.79330488399998, - -2.249444268999881 - ], - [ - 132.77076256600012, - -2.260023695999934 - ], - [ - 132.69874108200005, - -2.305352471999853 - ], - [ - 132.68873131600017, - -2.307224216999913 - ], - [ - 132.68067467500023, - -2.303155205999943 - ], - [ - 132.67562910200004, - -2.295993747999916 - ], - [ - 132.6692814460001, - -2.289157809999978 - ], - [ - 132.65796959700012, - -2.286065362999821 - ], - [ - 132.63672936300011, - -2.277276299999855 - ], - [ - 132.62671959700006, - -2.25644296699987 - ], - [ - 132.62094160200016, - -2.23154062299993 - ], - [ - 132.61353600400017, - -2.211032809999878 - ], - [ - 132.60279381600017, - -2.201755466999913 - ], - [ - 132.58301842500023, - -2.190850518999852 - ], - [ - 132.5603947270001, - -2.18564218499985 - ], - [ - 132.54118899800014, - -2.193617445999905 - ], - [ - 132.52369225400017, - -2.204196872999944 - ], - [ - 132.4553328790001, - -2.217217705999843 - ], - [ - 132.3849389980002, - -2.256524346999853 - ], - [ - 132.34791100400017, - -2.270114841999984 - ], - [ - 132.30567467500023, - -2.265557549999855 - ], - [ - 132.28052819100006, - -2.249769789999903 - ], - [ - 132.26465905000012, - -2.228285414999888 - ], - [ - 132.25196373800017, - -2.204766533999916 - ], - [ - 132.23617597700004, - -2.183038018999852 - ], - [ - 132.21452884200014, - -2.165785414999945 - ], - [ - 132.0734155610002, - -2.105157158999873 - ], - [ - 132.04835045700005, - -2.08318450299987 - ], - [ - 132.0444442070001, - -2.05950286299985 - ], - [ - 132.052582227, - -2.052829684999892 - ], - [ - 132.08008873800023, - -2.037692966999884 - ], - [ - 132.08594811300006, - -2.028903904 - ], - [ - 132.090586785, - -2.015557549999912 - ], - [ - 132.101817254, - -2.006931247999901 - ], - [ - 132.12696373800011, - -1.99814218499985 - ], - [ - 132.09961998800011, - -2.001234632999839 - ], - [ - 132.05323326900023, - -2.015394789999945 - ], - [ - 132.02735436300023, - -2.018487237999835 - ], - [ - 132.00342858200005, - -1.983819268999866 - ], - [ - 131.98324629000015, - -1.972588799999855 - ], - [ - 131.97291100400005, - -1.964613539999903 - ], - [ - 131.96859785200004, - -1.953383070999905 - ], - [ - 131.9710392590001, - -1.943129164999959 - ], - [ - 131.97543379000015, - -1.932224216999899 - ], - [ - 131.97730553500006, - -1.921644789999945 - ], - [ - 131.97234134200008, - -1.912367445999976 - ], - [ - 131.96469160200004, - -1.908868096999896 - ], - [ - 131.95687910200016, - -1.907647393999881 - ], - [ - 131.94922936300011, - -1.904473565999822 - ], - [ - 131.94190514400012, - -1.89511484199997 - ], - [ - 131.93832441500015, - -1.883721612999835 - ], - [ - 131.94190514400012, - -1.850681247999873 - ], - [ - 131.9410913420002, - -1.837497653999918 - ], - [ - 131.93824303500017, - -1.828301690999936 - ], - [ - 131.92774498800011, - -1.805759372999873 - ], - [ - 131.94922936300011, - -1.794691664999917 - ], - [ - 131.96338951900023, - -1.77849700299987 - ], - [ - 131.97535241000017, - -1.760430596999853 - ], - [ - 131.98975670700023, - -1.744805596999868 - ], - [ - 132.00709069100006, - -1.732191664999974 - ], - [ - 132.01832116000006, - -1.721286716999913 - ], - [ - 132.02247155000018, - -1.706312757999882 - ], - [ - 132.01832116000006, - -1.682793877999913 - ], - [ - 132.018809441, - -1.684014580999929 - ], - [ - 132.0201929050002, - -1.685642184999949 - ], - [ - 132.02198326900006, - -1.683851820999962 - ], - [ - 132.02393639400023, - -1.675957940999908 - ], - [ - 132.00098717500023, - -1.677911065999851 - ], - [ - 131.96753991000017, - -1.697198174999883 - ], - [ - 131.9272567070001, - -1.706231377999899 - ], - [ - 131.91749108200005, - -1.707289320999948 - ], - [ - 131.90967858200005, - -1.703301690999879 - ], - [ - 131.90040123800011, - -1.690199476999823 - ], - [ - 131.90113366000006, - -1.684177341999984 - ], - [ - 131.90577233200005, - -1.677422783999873 - ], - [ - 131.90870201900012, - -1.672051690999908 - ], - [ - 131.90137780000012, - -1.667657158999916 - ], - [ - 131.895274285, - -1.662855726999837 - ], - [ - 131.88941491000017, - -1.657159112999864 - ], - [ - 131.88672936300006, - -1.65203215899993 - ], - [ - 131.89356530000012, - -1.611016533999845 - ], - [ - 131.89673912900017, - -1.601495049999926 - ], - [ - 131.91089928500017, - -1.590264580999843 - ], - [ - 131.91407311300023, - -1.583428643999909 - ], - [ - 131.92058353000007, - -1.579196872999901 - ], - [ - 131.94906660200016, - -1.573337497999859 - ], - [ - 131.95557701900023, - -1.569756768999966 - ], - [ - 131.97632897200006, - -1.548597914999874 - ], - [ - 131.98218834700018, - -1.538750908999944 - ], - [ - 131.9640405610002, - -1.538750908999944 - ], - [ - 131.90577233200005, - -1.567071221999896 - ], - [ - 131.87989342500018, - -1.573500257999825 - ], - [ - 131.8888452480002, - -1.556573174999841 - ], - [ - 131.88347415500002, - -1.55087655999985 - ], - [ - 131.87126712300008, - -1.553155205999914 - ], - [ - 131.85938561300011, - -1.559828382999882 - ], - [ - 131.8214624360002, - -1.598239841999884 - ], - [ - 131.80486087300002, - -1.607598565999837 - ], - [ - 131.797618035, - -1.580824476999823 - ], - [ - 131.80640709700018, - -1.549981377999856 - ], - [ - 131.81104576900012, - -1.520440362999977 - ], - [ - 131.7911889980002, - -1.497735283999859 - ], - [ - 131.78972415500002, - -1.525648695999891 - ], - [ - 131.78402754000015, - -1.547458591999842 - ], - [ - 131.7716577480002, - -1.563246351999894 - ], - [ - 131.7501733730002, - -1.573500257999825 - ], - [ - 131.72315514400023, - -1.571954033999958 - ], - [ - 131.7077742850001, - -1.555840752999984 - ], - [ - 131.70671634200002, - -1.534763278999876 - ], - [ - 131.7229110040001, - -1.518243096999896 - ], - [ - 131.70378665500002, - -1.511000257999882 - ], - [ - 131.68506920700023, - -1.514906507999882 - ], - [ - 131.66635175899998, - -1.52239348799985 - ], - [ - 131.64722741, - -1.525648695999891 - ], - [ - 131.6287541020001, - -1.520928643999966 - ], - [ - 131.613536004, - -1.511163018999852 - ], - [ - 131.58871504000015, - -1.487562757999896 - ], - [ - 131.57309004000015, - -1.480157158999916 - ], - [ - 131.55250084700006, - -1.476983330999857 - ], - [ - 131.5201929050002, - -1.476739190999908 - ], - [ - 131.51392662900017, - -1.47519296699987 - ], - [ - 131.50782311300006, - -1.47193775799991 - ], - [ - 131.50049889400017, - -1.469659112999935 - ], - [ - 131.489512566, - -1.470472914999945 - ], - [ - 131.47754967500006, - -1.474053643999838 - ], - [ - 131.46908613400015, - -1.47909921699987 - ], - [ - 131.46566816500004, - -1.486586195999919 - ], - [ - 131.46900475400017, - -1.497735283999859 - ], - [ - 131.45687910200016, - -1.502862237999949 - ], - [ - 131.44613691500015, - -1.503838799999926 - ], - [ - 131.43653405000018, - -1.501722914999917 - ], - [ - 131.42750084700006, - -1.497735283999859 - ], - [ - 131.4049585300002, - -1.469903252999885 - ], - [ - 131.40064537900017, - -1.467054945999948 - ], - [ - 131.3966577480002, - -1.46103280999985 - ], - [ - 131.3898218110002, - -1.45680104 - ], - [ - 131.38721764400006, - -1.450778903999918 - ], - [ - 131.39698326900012, - -1.43938567499994 - ], - [ - 131.4018660820001, - -1.427341403999847 - ], - [ - 131.39535566499998, - -1.413750908999887 - ], - [ - 131.38363691500004, - -1.401950778999918 - ], - [ - 131.372813347, - -1.394707940999893 - ], - [ - 131.34213300900004, - -1.403578382999839 - ], - [ - 131.32227623800011, - -1.401055596999825 - ], - [ - 131.27711022200018, - -1.37428150799991 - ], - [ - 131.27491295700005, - -1.391859632999939 - ], - [ - 131.29200280000012, - -1.410088799999841 - ], - [ - 131.33497155000006, - -1.43938567499994 - ], - [ - 131.33692467500012, - -1.453057549999883 - ], - [ - 131.32374108200005, - -1.469170830999857 - ], - [ - 131.30518639400017, - -1.483086846999839 - ], - [ - 131.29151451900023, - -1.490980726999823 - ], - [ - 131.25733483200023, - -1.497735283999859 - ], - [ - 131.22543379000004, - -1.515557549999826 - ], - [ - 131.2057397800002, - -1.523614190999865 - ], - [ - 131.19849694100006, - -1.521254164999988 - ], - [ - 131.19288170700017, - -1.494805596999839 - ], - [ - 131.18653405000012, - -1.485039971999882 - ], - [ - 131.177500847, - -1.477308851999879 - ], - [ - 131.16724694100017, - -1.470472914999945 - ], - [ - 131.12631269600016, - -1.453301690999922 - ], - [ - 131.08643639400012, - -1.451267184999907 - ], - [ - 131.00359134200008, - -1.456231377999941 - ], - [ - 130.97730553500006, - -1.452894789999917 - ], - [ - 130.9602970710001, - -1.446221612999878 - ], - [ - 130.95093834700006, - -1.433689059999878 - ], - [ - 130.94825280000018, - -1.41220468499985 - ], - [ - 130.95313561300023, - -1.405043226999894 - ], - [ - 130.98585045700005, - -1.391289971999967 - ], - [ - 130.9995223320001, - -1.379082940999908 - ], - [ - 131.00440514400006, - -1.372328382999868 - ], - [ - 131.03012129000004, - -1.298516533999859 - ], - [ - 131.027598504, - -1.284112237999892 - ], - [ - 131.03003991000006, - -1.27556731599995 - ], - [ - 131.04078209700006, - -1.271905205999914 - ], - [ - 131.04216556100002, - -1.267836195999948 - ], - [ - 131.05738366, - -1.247735283999987 - ], - [ - 131.07447350400017, - -1.237562757999868 - ], - [ - 131.15528405000023, - -1.224541924999869 - ], - [ - 131.18165123800023, - -1.217217705999872 - ], - [ - 131.18864993600002, - -1.207207940999879 - ], - [ - 131.20215905000012, - -1.16269296699997 - ], - [ - 131.2316186860002, - -1.126071872999859 - ], - [ - 131.23617597700004, - -1.117282809999978 - ], - [ - 131.23951256600017, - -1.105645440999893 - ], - [ - 131.25416100400017, - -1.08025481599995 - ], - [ - 131.25733483200023, - -1.062676690999922 - ], - [ - 131.25367272200018, - -1.027601820999948 - ], - [ - 131.25709069100012, - -1.01433684699991 - ], - [ - 131.27100670700005, - -1.003676039999888 - ], - [ - 131.26636803500006, - -0.987888278999847 - ], - [ - 131.27149498800017, - -0.949395440999936 - ], - [ - 131.26351972700004, - -0.929294528999904 - ], - [ - 131.27019290500007, - -0.926853122999873 - ], - [ - 131.29151451900023, - -0.914971612999906 - ], - [ - 131.25025475400017, - -0.872653903999989 - ], - [ - 131.23536217500012, - -0.846449476999879 - ], - [ - 131.24301191500015, - -0.819431247999916 - ], - [ - 131.3322046230002, - -0.792738539999903 - ], - [ - 131.37354576900023, - -0.787855726999922 - ], - [ - 131.38754316500004, - -0.782647393999838 - ], - [ - 131.39877363400004, - -0.766289971999825 - ], - [ - 131.42676842500023, - -0.759454033999987 - ], - [ - 131.43799889400023, - -0.754001559999864 - ], - [ - 131.45036868600008, - -0.750095309999878 - ], - [ - 131.48829186300011, - -0.746840101999837 - ], - [ - 131.49634850400005, - -0.740329684999921 - ], - [ - 131.50294030000012, - -0.73333098799985 - ], - [ - 131.51791425900015, - -0.731703382999839 - ], - [ - 131.53419030000018, - -0.733493747999916 - ], - [ - 131.54476972700004, - -0.736911716999913 - ], - [ - 131.52344811300023, - -0.761976820999919 - ], - [ - 131.51661217500023, - -0.774346612999864 - ], - [ - 131.5167749360002, - -0.785251559999935 - ], - [ - 131.53288821700008, - -0.782647393999838 - ], - [ - 131.55347741, - -0.776788018999895 - ], - [ - 131.57129967500006, - -0.769219658999845 - ], - [ - 131.57886803500006, - -0.761000257999854 - ], - [ - 131.59017988400004, - -0.756524346999967 - ], - [ - 131.77955162900017, - -0.719170830999829 - ], - [ - 131.86345462300008, - -0.691989842 - ], - [ - 131.87647545700017, - -0.68962981599995 - ], - [ - 131.88428795700023, - -0.681898695999948 - ], - [ - 131.90845787900017, - -0.633884372999873 - ], - [ - 131.9519149100001, - -0.588799737999892 - ], - [ - 131.97885175900015, - -0.566664320999919 - ], - [ - 132.00342858200005, - -0.551853122999859 - ], - [ - 132.05600019600004, - -0.534274997999916 - ], - [ - 132.06885826900023, - -0.531996351999851 - ], - [ - 132.07488040500007, - -0.523370049999841 - ], - [ - 132.09205162900017, - -0.483005466999884 - ], - [ - 132.09961998800011, - -0.469903252999913 - ], - [ - 132.15088951900023, - -0.435723565999837 - ], - [ - 132.1662703790001, - -0.432224216999842 - ], - [ - 132.19988040500013, - -0.414646091999984 - ], - [ - 132.23715253999998, - -0.401543877999842 - ], - [ - 132.27003014400006, - -0.384535414999874 - ], - [ - 132.28793379000004, - -0.381117445999948 - ], - [ - 132.3127547540001, - -0.379327080999872 - ], - [ - 132.39665774800008, - -0.353448174999869 - ], - [ - 132.4371850920002, - -0.347100518999923 - ] - ] - ], - [ - [ - [ - 104.54851321700019, - -0.398044528999932 - ], - [ - 104.59294681100013, - -0.44841887799997 - ], - [ - 104.59937584700006, - -0.463799737999835 - ], - [ - 104.5916447270001, - -0.483575127999856 - ], - [ - 104.57300866000006, - -0.500420830999857 - ], - [ - 104.53419030000012, - -0.528578382999925 - ], - [ - 104.52662194100017, - -0.547621351999837 - ], - [ - 104.52198326900006, - -0.596612237999892 - ], - [ - 104.51124108200011, - -0.613946221999882 - ], - [ - 104.4767358730002, - -0.614027601999865 - ], - [ - 104.44711347700016, - -0.588067315999865 - ], - [ - 104.42042076900006, - -0.574965101999894 - ], - [ - 104.3938908210001, - -0.613946221999882 - ], - [ - 104.38363691500015, - -0.653497002999828 - ], - [ - 104.37582441500015, - -0.660088799999983 - ], - [ - 104.3562931650001, - -0.661716404 - ], - [ - 104.34603925900015, - -0.579196873 - ], - [ - 104.3357853520001, - -0.542657158999873 - ], - [ - 104.3263452480002, - -0.529880466999842 - ], - [ - 104.31202233200005, - -0.531996351999851 - ], - [ - 104.25586998800011, - -0.475518487999906 - ], - [ - 104.25367272200006, - -0.460056247999887 - ], - [ - 104.26319420700005, - -0.446221612999977 - ], - [ - 104.27702884200002, - -0.413018487999963 - ], - [ - 104.2840275400001, - -0.401055596999853 - ], - [ - 104.31185957100016, - -0.378350518999895 - ], - [ - 104.32471764400012, - -0.364841403999918 - ], - [ - 104.33253014400006, - -0.346449476999879 - ], - [ - 104.33936608200011, - -0.346449476999879 - ], - [ - 104.34555097700016, - -0.363702080999886 - ], - [ - 104.33480879000015, - -0.40488046699987 - ], - [ - 104.33936608200011, - -0.42839934699991 - ], - [ - 104.34603925900015, - -0.42839934699991 - ], - [ - 104.34831790500002, - -0.407403252999885 - ], - [ - 104.35287519600016, - -0.38738372199991 - ], - [ - 104.3597111340001, - -0.38738372199991 - ], - [ - 104.3826603520001, - -0.401462497999859 - ], - [ - 104.415782097, - -0.381931247999958 - ], - [ - 104.46957441500015, - -0.332126559999892 - ], - [ - 104.48926842500012, - -0.349379164999988 - ], - [ - 104.49675540500019, - -0.353936455999857 - ], - [ - 104.51823978000019, - -0.362562757999854 - ], - [ - 104.52491295700005, - -0.366875908999944 - ], - [ - 104.53093509200008, - -0.373467705999843 - ], - [ - 104.54135175900015, - -0.389336846999868 - ], - [ - 104.54851321700019, - -0.398044528999932 - ] - ] - ], - [ - [ - [ - 122.04371178500011, - -0.334649346999825 - ], - [ - 122.05144290500019, - -0.342054945999905 - ], - [ - 122.05404707099999, - -0.355157158999873 - ], - [ - 122.05307050900004, - -0.373711846999882 - ], - [ - 122.042735222, - -0.393487237999892 - ], - [ - 122.02662194100006, - -0.406914971999896 - ], - [ - 122.00660241000017, - -0.410739841999899 - ], - [ - 121.98487389400012, - -0.401055596999853 - ], - [ - 121.964121941, - -0.413344007999896 - ], - [ - 121.9318139980002, - -0.414646091999984 - ], - [ - 121.89869225400005, - -0.407484632999868 - ], - [ - 121.87501061300023, - -0.394789320999891 - ], - [ - 121.86085045700011, - -0.377862237999906 - ], - [ - 121.86011803500017, - -0.367445571 - ], - [ - 121.86500084700006, - -0.357842705999857 - ], - [ - 121.86817467500012, - -0.343031507999882 - ], - [ - 121.87232506600006, - -0.33261484199997 - ], - [ - 121.88233483200023, - -0.330010674999883 - ], - [ - 121.90235436300011, - -0.332126559999892 - ], - [ - 121.90333092500006, - -0.333916924999969 - ], - [ - 121.9083764980002, - -0.337334893999895 - ], - [ - 121.91553795700017, - -0.340020440999879 - ], - [ - 121.92351321700019, - -0.339613539999874 - ], - [ - 121.92481530000012, - -0.334567966999842 - ], - [ - 121.92269941499998, - -0.3163388 - ], - [ - 121.926524285, - -0.312269789999888 - ], - [ - 121.96656334700006, - -0.314711195999919 - ], - [ - 121.97803795700011, - -0.318536065999851 - ], - [ - 122.00440514400006, - -0.330254815999922 - ], - [ - 122.0135197270001, - -0.331963799999926 - ], - [ - 122.02955162900017, - -0.332126559999892 - ], - [ - 122.04371178500011, - -0.334649346999825 - ] - ] - ], - [ - [ - [ - 127.63200931100002, - -0.415297132999939 - ], - [ - 127.63591556100002, - -0.416192315999851 - ], - [ - 127.64779707100016, - -0.414320570999962 - ], - [ - 127.65170332100016, - -0.415297132999939 - ], - [ - 127.65853925899998, - -0.42839934699991 - ], - [ - 127.666270379, - -0.435723565999837 - ], - [ - 127.68311608200011, - -0.460056247999887 - ], - [ - 127.68799889400006, - -0.480645440999837 - ], - [ - 127.67652428500006, - -0.503513278999932 - ], - [ - 127.61768639400023, - -0.573174737999906 - ], - [ - 127.60767662900017, - -0.593845309999921 - ], - [ - 127.60401451900012, - -0.617120049999855 - ], - [ - 127.60645592500023, - -0.629082940999879 - ], - [ - 127.613047722, - -0.636407158999887 - ], - [ - 127.62289472700004, - -0.64023202899989 - ], - [ - 127.63502037900005, - -0.641289971999939 - ], - [ - 127.64747155000023, - -0.64430103999986 - ], - [ - 127.65113366, - -0.652439059999878 - ], - [ - 127.65137780000023, - -0.685804945999948 - ], - [ - 127.64966881600006, - -0.696709893999838 - ], - [ - 127.65267988400015, - -0.707207940999979 - ], - [ - 127.66602623800023, - -0.716403903999876 - ], - [ - 127.67823326900023, - -0.717705987999864 - ], - [ - 127.69019616000017, - -0.713636976999823 - ], - [ - 127.70118248800011, - -0.706801039999974 - ], - [ - 127.71013431100008, - -0.699314059999921 - ], - [ - 127.72510826900006, - -0.694024346999853 - ], - [ - 127.78956139400017, - -0.68962981599995 - ], - [ - 127.80469811300017, - -0.694105726999837 - ], - [ - 127.84864342500012, - -0.712985934999864 - ], - [ - 127.85792076900023, - -0.719821872999873 - ], - [ - 127.861094597, - -0.725762627999984 - ], - [ - 127.87517337300008, - -0.744317315999908 - ], - [ - 127.87826582100004, - -0.754001559999864 - ], - [ - 127.87842858200011, - -0.760186455999843 - ], - [ - 127.87956790500002, - -0.763360283999901 - ], - [ - 127.88266035200004, - -0.764580987999821 - ], - [ - 127.88892662900017, - -0.764743747999887 - ], - [ - 127.898203972, - -0.767347914999874 - ], - [ - 127.898203972, - -0.773532809999935 - ], - [ - 127.89193769600016, - -0.785251559999935 - ], - [ - 127.88819420700023, - -0.802178643999909 - ], - [ - 127.876231316, - -0.817803643999895 - ], - [ - 127.83082116, - -0.859144789999931 - ], - [ - 127.82227623800011, - -0.86435312299993 - ], - [ - 127.8126733730002, - -0.866631768999895 - ], - [ - 127.79948978000007, - -0.867120049999883 - ], - [ - 127.78663170700023, - -0.870375257999925 - ], - [ - 127.76531009200008, - -0.884535414999945 - ], - [ - 127.75489342500006, - -0.88762786299985 - ], - [ - 127.74878991, - -0.885349216999956 - ], - [ - 127.72754967500012, - -0.867120049999883 - ], - [ - 127.71778405000006, - -0.862237237999821 - ], - [ - 127.69402103000019, - -0.854668877999956 - ], - [ - 127.68311608200011, - -0.853610934999907 - ], - [ - 127.68018639400006, - -0.850274346999882 - ], - [ - 127.67847741000017, - -0.84335702899989 - ], - [ - 127.67383873800023, - -0.836195570999934 - ], - [ - 127.662364129, - -0.833103122999859 - ], - [ - 127.65349368600008, - -0.827406507999882 - ], - [ - 127.65349368600008, - -0.814629815999837 - ], - [ - 127.65853925899998, - -0.791436455999985 - ], - [ - 127.65552819100017, - -0.780938408999845 - ], - [ - 127.650645379, - -0.771172783999887 - ], - [ - 127.64478600400017, - -0.762953382999896 - ], - [ - 127.63819420700011, - -0.757256768999824 - ], - [ - 127.62574303500017, - -0.752373955999843 - ], - [ - 127.62045332099999, - -0.755547783999901 - ], - [ - 127.61638431100008, - -0.761488539999931 - ], - [ - 127.60743248800011, - -0.764743747999887 - ], - [ - 127.58969160200004, - -0.768731377999856 - ], - [ - 127.53565514400023, - -0.798923434999878 - ], - [ - 127.46989993600008, - -0.81845468499985 - ], - [ - 127.45769290500007, - -0.815606377999913 - ], - [ - 127.45248457100016, - -0.802015882999854 - ], - [ - 127.45053144600004, - -0.792901299999869 - ], - [ - 127.4415796230002, - -0.77288176899998 - ], - [ - 127.43726647200018, - -0.729099216999927 - ], - [ - 127.43946373800011, - -0.716403903999876 - ], - [ - 127.47071373800023, - -0.652520440999851 - ], - [ - 127.47022545700005, - -0.641289971999939 - ], - [ - 127.467051629, - -0.639825127999885 - ], - [ - 127.43604576900006, - -0.630629164999917 - ], - [ - 127.42693118600019, - -0.62558359199997 - ], - [ - 127.40886478000007, - -0.624200127999899 - ], - [ - 127.39861087300002, - -0.62021249799993 - ], - [ - 127.39730879000015, - -0.616875908999901 - ], - [ - 127.39535566499998, - -0.604668877999828 - ], - [ - 127.39234459700018, - -0.599704684999878 - ], - [ - 127.38746178500006, - -0.597426039999903 - ], - [ - 127.37452233200011, - -0.594008070999976 - ], - [ - 127.37110436300011, - -0.592868747999944 - ], - [ - 127.35328209700006, - -0.562920830999971 - ], - [ - 127.35075931100013, - -0.555271091999856 - ], - [ - 127.34441165500019, - -0.544610283999916 - ], - [ - 127.31397545700023, - -0.522230726999808 - ], - [ - 127.30298912900017, - -0.510918877999913 - ], - [ - 127.29525800900015, - -0.49431731599995 - ], - [ - 127.2911889980002, - -0.476820570999905 - ], - [ - 127.29184004000015, - -0.46013762799987 - ], - [ - 127.29957116000017, - -0.4457333309999 - ], - [ - 127.31177819100006, - -0.432224216999842 - ], - [ - 127.32243899800008, - -0.416924737999878 - ], - [ - 127.32935631600017, - -0.398044528999932 - ], - [ - 127.33025149800008, - -0.373711846999882 - ], - [ - 127.32813561300023, - -0.36516692499994 - ], - [ - 127.316661004, - -0.339613539999874 - ], - [ - 127.33041425900004, - -0.339450778999904 - ], - [ - 127.35075931100013, - -0.328708591999884 - ], - [ - 127.36117597699999, - -0.325860283999859 - ], - [ - 127.372813347, - -0.329034112999906 - ], - [ - 127.38282311300011, - -0.336358330999829 - ], - [ - 127.39861087300002, - -0.353936455999857 - ], - [ - 127.40503991000006, - -0.358656507999868 - ], - [ - 127.41146894600016, - -0.362399997999887 - ], - [ - 127.41651451900012, - -0.367771091999856 - ], - [ - 127.42058353000007, - -0.388929945999948 - ], - [ - 127.42652428500017, - -0.401462497999859 - ], - [ - 127.43531334700006, - -0.411228122999887 - ], - [ - 127.44629967500012, - -0.415297132999939 - ], - [ - 127.46094811300011, - -0.406833591999913 - ], - [ - 127.46892337300008, - -0.386407158999845 - ], - [ - 127.47413170700005, - -0.363213799999897 - ], - [ - 127.48047936300011, - -0.346449476999879 - ], - [ - 127.48666425900015, - -0.34246184699991 - ], - [ - 127.49586022200006, - -0.339125257999882 - ], - [ - 127.504161004, - -0.335137627999984 - ], - [ - 127.50782311300006, - -0.329034112999906 - ], - [ - 127.50879967500023, - -0.320733330999843 - ], - [ - 127.51156660199999, - -0.310642184999878 - ], - [ - 127.51685631600017, - -0.30193450299997 - ], - [ - 127.52418053500017, - -0.298028252999885 - ], - [ - 127.52816816500015, - -0.298760674999912 - ], - [ - 127.52979576900006, - -0.300713799999954 - ], - [ - 127.53077233200017, - -0.303155205999985 - ], - [ - 127.53223717500012, - -0.304945570999891 - ], - [ - 127.56617272200018, - -0.316501559999907 - ], - [ - 127.57862389400006, - -0.324965101999865 - ], - [ - 127.58350670700023, - -0.343031507999882 - ], - [ - 127.58887780000012, - -0.351983330999985 - ], - [ - 127.61231530000006, - -0.366306247999972 - ], - [ - 127.61768639400023, - -0.377536716999884 - ], - [ - 127.61915123800011, - -0.388604424999841 - ], - [ - 127.62256920700011, - -0.39959075299997 - ], - [ - 127.62720787900005, - -0.408949476999823 - ], - [ - 127.63200931100002, - -0.415297132999939 - ] - ] - ], - [ - [ - [ - 104.49252363400015, - -0.308770440999908 - ], - [ - 104.48650149800008, - -0.310723565999851 - ], - [ - 104.4788517590001, - -0.309991143999824 - ], - [ - 104.46957441500015, - -0.312269789999888 - ], - [ - 104.45622806100008, - -0.318617446 - ], - [ - 104.4461369150001, - -0.320082289999888 - ], - [ - 104.41822350400017, - -0.318536065999851 - ], - [ - 104.40650475400017, - -0.311781507999811 - ], - [ - 104.40088951900006, - -0.297295830999857 - ], - [ - 104.40495853000002, - -0.283379815999965 - ], - [ - 104.42123457100016, - -0.278090101999808 - ], - [ - 104.47999108200005, - -0.271254164999888 - ], - [ - 104.48780358200005, - -0.274102471999839 - ], - [ - 104.49366295700011, - -0.281182549999883 - ], - [ - 104.49708092500012, - -0.289971612999864 - ], - [ - 104.49708092500012, - -0.298597914999945 - ], - [ - 104.49252363400015, - -0.308770440999908 - ] - ] - ], - [ - [ - [ - 122.14454186300017, - -0.373955987999821 - ], - [ - 122.13941491000006, - -0.384209893999852 - ], - [ - 122.12387129000015, - -0.392673434999892 - ], - [ - 122.11500084700018, - -0.388929945999948 - ], - [ - 122.10718834700012, - -0.38225676899998 - ], - [ - 122.09473717500006, - -0.381117445999948 - ], - [ - 122.08985436300011, - -0.389255466999884 - ], - [ - 122.08887780000023, - -0.401543877999842 - ], - [ - 122.08464603000002, - -0.40781015399989 - ], - [ - 122.07056725400017, - -0.398044528999932 - ], - [ - 122.05990644600016, - -0.353936455999857 - ], - [ - 122.06031334700006, - -0.329278252999856 - ], - [ - 122.06560306100002, - -0.296075127999842 - ], - [ - 122.07667076900017, - -0.269138278999961 - ], - [ - 122.09473717500006, - -0.263848565999893 - ], - [ - 122.10157311300011, - -0.315362237999963 - ], - [ - 122.10580488400004, - -0.321384372999887 - ], - [ - 122.13168379000004, - -0.33798593499985 - ], - [ - 122.13795006600017, - -0.34726327899989 - ], - [ - 122.14323978000007, - -0.360446872999844 - ], - [ - 122.14454186300017, - -0.373955987999821 - ] - ] - ], - [ - [ - [ - 127.21363366000006, - -0.25017669099995 - ], - [ - 127.22038821700019, - -0.257582289999945 - ], - [ - 127.22820071700008, - -0.251722914999988 - ], - [ - 127.23487389400023, - -0.251722914999988 - ], - [ - 127.24138431100002, - -0.256442966999913 - ], - [ - 127.24830162900005, - -0.263848565999893 - ], - [ - 127.25456790500019, - -0.275648695999877 - ], - [ - 127.263926629, - -0.279473565999879 - ], - [ - 127.29249108200011, - -0.278090101999808 - ], - [ - 127.29712975400005, - -0.28191497199991 - ], - [ - 127.29607181100008, - -0.290297132999882 - ], - [ - 127.29224694100006, - -0.299574476999922 - ], - [ - 127.28874759200008, - -0.305433851999879 - ], - [ - 127.28288821700014, - -0.307305596999853 - ], - [ - 127.26490319100017, - -0.30624765399989 - ], - [ - 127.25782311300023, - -0.308851820999891 - ], - [ - 127.25131269600004, - -0.32333749799993 - ], - [ - 127.25473066500015, - -0.338799737999864 - ], - [ - 127.26335696700002, - -0.353122653999847 - ], - [ - 127.27198326900023, - -0.363457940999936 - ], - [ - 127.27702884200008, - -0.373467705999843 - ], - [ - 127.28077233200011, - -0.388604424999841 - ], - [ - 127.28003991000017, - -0.402520440999908 - ], - [ - 127.26156660200016, - -0.414646091999984 - ], - [ - 127.26197350400017, - -0.428806247999916 - ], - [ - 127.26880944100017, - -0.456312757999868 - ], - [ - 127.26596113400015, - -0.464532158999944 - ], - [ - 127.25660241, - -0.477634372999916 - ], - [ - 127.25196373800006, - -0.497165622999987 - ], - [ - 127.2462671230002, - -0.496351820999976 - ], - [ - 127.23959394600016, - -0.491794528999847 - ], - [ - 127.23462975400011, - -0.490411065999865 - ], - [ - 127.21094811300006, - -0.513278903999961 - ], - [ - 127.19874108200011, - -0.520603122999887 - ], - [ - 127.17945397200006, - -0.525160414999917 - ], - [ - 127.11736087300002, - -0.525160414999917 - ], - [ - 127.11996504000004, - -0.517998955999886 - ], - [ - 127.12159264400023, - -0.514906507999811 - ], - [ - 127.124766472, - -0.510918877999913 - ], - [ - 127.10857181100008, - -0.501071872999901 - ], - [ - 127.11255944100006, - -0.49187590899983 - ], - [ - 127.12435957100004, - -0.485284112999864 - ], - [ - 127.13103274800008, - -0.483005466999884 - ], - [ - 127.13062584700006, - -0.470147393999866 - ], - [ - 127.12614993600019, - -0.456719658999873 - ], - [ - 127.11988366000006, - -0.446221612999977 - ], - [ - 127.11394290500002, - -0.44198984199987 - ], - [ - 127.102305535, - -0.437758070999948 - ], - [ - 127.102305535, - -0.427422783999845 - ], - [ - 127.11052493600019, - -0.4047177059999 - ], - [ - 127.11052493600019, - -0.377536716999884 - ], - [ - 127.11255944100006, - -0.369398695999877 - ], - [ - 127.116953972, - -0.365655205999929 - ], - [ - 127.12183678500011, - -0.363457940999936 - ], - [ - 127.124766472, - -0.360039971999839 - ], - [ - 127.12256920700023, - -0.337334893999895 - ], - [ - 127.11426842500023, - -0.310235283999873 - ], - [ - 127.11036217500023, - -0.287692966999884 - ], - [ - 127.12110436300017, - -0.278090101999808 - ], - [ - 127.12818444100006, - -0.276136976999865 - ], - [ - 127.15381920700011, - -0.265720309999864 - ], - [ - 127.16211998800006, - -0.260837497999901 - ], - [ - 127.17481530000023, - -0.25554778399983 - ], - [ - 127.20346113400004, - -0.257256768999838 - ], - [ - 127.21363366000006, - -0.25017669099995 - ] - ] - ], - [ - [ - [ - 98.48682701900012, - -0.510918877999913 - ], - [ - 98.4964298840001, - -0.520928643999909 - ], - [ - 98.50269616000006, - -0.535414320999948 - ], - [ - 98.50440514400006, - -0.5512020809999 - ], - [ - 98.50049889400006, - -0.56560637799987 - ], - [ - 98.49366295700005, - -0.56560637799987 - ], - [ - 98.492930535, - -0.557875257999854 - ], - [ - 98.49138431100008, - -0.553887627999885 - ], - [ - 98.4891056650001, - -0.550713799999912 - ], - [ - 98.48682701900012, - -0.545586846999981 - ], - [ - 98.47925866000017, - -0.553155205999857 - ], - [ - 98.4734806650001, - -0.556735934999921 - ], - [ - 98.46745853000019, - -0.556084893999866 - ], - [ - 98.45899498800006, - -0.551853122999859 - ], - [ - 98.46778405000012, - -0.53883228999986 - ], - [ - 98.46208743600002, - -0.529473565999837 - ], - [ - 98.44792728000002, - -0.526299737999949 - ], - [ - 98.43165123800006, - -0.531996351999851 - ], - [ - 98.42554772200012, - -0.5433895809999 - ], - [ - 98.42188561300006, - -0.561781507999939 - ], - [ - 98.42042076900006, - -0.579034112999864 - ], - [ - 98.4220483730002, - -0.58660247199991 - ], - [ - 98.39031009200008, - -0.577080987999821 - ], - [ - 98.3167423840001, - -0.535088799999841 - ], - [ - 98.27515709700012, - -0.525160414999917 - ], - [ - 98.28419030000012, - -0.521742445999919 - ], - [ - 98.2950952480002, - -0.513360283999944 - ], - [ - 98.30201256600017, - -0.510918877999913 - ], - [ - 98.3118595710001, - -0.511976820999962 - ], - [ - 98.32927493600008, - -0.518731377999913 - ], - [ - 98.3361108730002, - -0.517754815999851 - ], - [ - 98.3421330090001, - -0.5062802059999 - ], - [ - 98.36402428500006, - -0.44198984199987 - ], - [ - 98.36597741000017, - -0.422051690999893 - ], - [ - 98.36264082100016, - -0.380140882999882 - ], - [ - 98.36402428500006, - -0.360039971999839 - ], - [ - 98.368907097, - -0.349216403999932 - ], - [ - 98.38941491000017, - -0.320896091999899 - ], - [ - 98.39812259200002, - -0.312269789999888 - ], - [ - 98.40544681100008, - -0.308851820999891 - ], - [ - 98.4134220710001, - -0.306735934999878 - ], - [ - 98.42066491000006, - -0.303806247999859 - ], - [ - 98.42546634200014, - -0.298597914999945 - ], - [ - 98.42611738400015, - -0.288181247999873 - ], - [ - 98.41863040500019, - -0.257582289999945 - ], - [ - 98.42920983200005, - -0.243829033999845 - ], - [ - 98.44068444100012, - -0.246514580999914 - ], - [ - 98.45118248800006, - -0.25839609199987 - ], - [ - 98.49341881600017, - -0.329196872999873 - ], - [ - 98.50733483200005, - -0.364922783999901 - ], - [ - 98.50049889400006, - -0.38738372199991 - ], - [ - 98.51026451900012, - -0.403741143999838 - ], - [ - 98.51238040500019, - -0.422946872999887 - ], - [ - 98.50879967500012, - -0.442559502999842 - ], - [ - 98.50196373800011, - -0.460544528999876 - ], - [ - 98.50456790500013, - -0.473565362999864 - ], - [ - 98.50163821700019, - -0.486097914999874 - ], - [ - 98.49512780000012, - -0.49863046699987 - ], - [ - 98.48682701900012, - -0.510918877999913 - ] - ] - ], - [ - [ - [ - 103.75652103000019, - -0.346449476999879 - ], - [ - 103.74935957100016, - -0.348809502999927 - ], - [ - 103.71241295700011, - -0.346449476999879 - ], - [ - 103.69825280000006, - -0.349541924999954 - ], - [ - 103.67066491000006, - -0.363702080999886 - ], - [ - 103.657481316, - -0.366875908999944 - ], - [ - 103.649668816, - -0.370049737999835 - ], - [ - 103.62623131600006, - -0.384209893999852 - ], - [ - 103.61255944100012, - -0.38738372199991 - ], - [ - 103.60401451900006, - -0.383477471999825 - ], - [ - 103.5926212900001, - -0.376153252999913 - ], - [ - 103.58033287900017, - -0.372002862999878 - ], - [ - 103.56812584700018, - -0.377536716999884 - ], - [ - 103.54664147200006, - -0.382989190999837 - ], - [ - 103.49000084700018, - -0.361586195999877 - ], - [ - 103.461680535, - -0.366875908999944 - ], - [ - 103.46062259200008, - -0.333916924999969 - ], - [ - 103.48511803500011, - -0.286797783999972 - ], - [ - 103.52214603000002, - -0.243829033999845 - ], - [ - 103.55787194100006, - -0.223402601999865 - ], - [ - 103.5745548840001, - -0.224704684999864 - ], - [ - 103.62867272200018, - -0.234307549999926 - ], - [ - 103.64039147200006, - -0.240655205999872 - ], - [ - 103.64958743600002, - -0.254815362999892 - ], - [ - 103.67066491000006, - -0.262627862999878 - ], - [ - 103.7127384770001, - -0.269707940999851 - ], - [ - 103.73462975400017, - -0.281182549999883 - ], - [ - 103.75611412900017, - -0.301202080999943 - ], - [ - 103.76685631600017, - -0.324639580999843 - ], - [ - 103.75652103000019, - -0.346449476999879 - ] - ] - ], - [ - [ - [ - 122.189707879, - -0.205254815999865 - ], - [ - 122.17725670700011, - -0.230401299999841 - ], - [ - 122.18962649800014, - -0.230157158999901 - ], - [ - 122.20264733200011, - -0.232191664999917 - ], - [ - 122.21322675900015, - -0.237562757999967 - ], - [ - 122.21762129000015, - -0.247165622999859 - ], - [ - 122.22095787900017, - -0.25017669099995 - ], - [ - 122.2351994150001, - -0.2582333309999 - ], - [ - 122.23878014400023, - -0.263848565999893 - ], - [ - 122.23650149800008, - -0.273370049999897 - ], - [ - 122.23015384200002, - -0.274346612999878 - ], - [ - 122.22291100400005, - -0.270196221999839 - ], - [ - 122.21762129000015, - -0.263848565999893 - ], - [ - 122.21143639400006, - -0.263848565999893 - ], - [ - 122.19996178500006, - -0.267754815999979 - ], - [ - 122.16439863400015, - -0.249444268999923 - ], - [ - 122.14625084700006, - -0.244073174999883 - ], - [ - 122.14437910199999, - -0.233005466999927 - ], - [ - 122.15837649800008, - -0.211358330999857 - ], - [ - 122.17709394600004, - -0.196384372999916 - ], - [ - 122.189707879, - -0.205254815999865 - ] - ] - ], - [ - [ - [ - 122.32781009200008, - -0.230564059999907 - ], - [ - 122.34538821700008, - -0.238702080999829 - ], - [ - 122.35938561300023, - -0.249281507999868 - ], - [ - 122.36915123800006, - -0.263848565999893 - ], - [ - 122.36491946700008, - -0.282159112999949 - ], - [ - 122.36793053500017, - -0.304457289999903 - ], - [ - 122.3751733730002, - -0.325616143999909 - ], - [ - 122.38266035200016, - -0.339613539999874 - ], - [ - 122.37598717500012, - -0.346449476999879 - ], - [ - 122.35425866000006, - -0.321709893999909 - ], - [ - 122.32154381600012, - -0.257907809999878 - ], - [ - 122.29330488400004, - -0.237237237999864 - ], - [ - 122.28858483200023, - -0.237969658999972 - ], - [ - 122.27328535200016, - -0.243747653999861 - ], - [ - 122.26612389400012, - -0.244073174999883 - ], - [ - 122.26050866, - -0.240980726999894 - ], - [ - 122.24561608200005, - -0.223402601999865 - ], - [ - 122.22885175900015, - -0.20794036299985 - ], - [ - 122.22584069100006, - -0.199395440999908 - ], - [ - 122.23194420700023, - -0.188734632999967 - ], - [ - 122.24073326900012, - -0.195407809999935 - ], - [ - 122.26734459700006, - -0.205010674999826 - ], - [ - 122.2727970710001, - -0.206149997999859 - ], - [ - 122.27711022200018, - -0.213962497999844 - ], - [ - 122.28728274800014, - -0.218845309999907 - ], - [ - 122.32781009200008, - -0.230564059999907 - ] - ] - ], - [ - [ - [ - 121.62452233200011, - -0.198418877999842 - ], - [ - 121.60027103000013, - -0.203220309999921 - ], - [ - 121.57455488400015, - -0.182549737999906 - ], - [ - 121.56910241000006, - -0.144789320999948 - ], - [ - 121.59742272200018, - -0.124688408999987 - ], - [ - 121.63314863400004, - -0.124688408999987 - ], - [ - 121.64966881600017, - -0.14739348799985 - ], - [ - 121.64258873800011, - -0.17685312299993 - ], - [ - 121.62452233200011, - -0.198418877999842 - ] - ] - ], - [ - [ - [ - 130.82471764400023, - -0.003838799999869 - ], - [ - 130.96192467500012, - -0.044732354999908 - ], - [ - 130.96656334700006, - -0.048109632999839 - ], - [ - 130.96998131600006, - -0.053521416999871 - ], - [ - 130.97364342500012, - -0.057183527 - ], - [ - 130.97901451900023, - -0.055352471999939 - ], - [ - 130.98682701900023, - -0.048150322999916 - ], - [ - 130.9905705090001, - -0.046156507999882 - ], - [ - 131.019786004, - -0.038628838999912 - ], - [ - 131.02670332100004, - -0.037896416999885 - ], - [ - 131.04460696700008, - -0.038262627999899 - ], - [ - 131.05640709700006, - -0.041029554999952 - ], - [ - 131.05779056100013, - -0.049086195999905 - ], - [ - 131.04379316500015, - -0.065240166999871 - ], - [ - 131.05982506600006, - -0.066420179999895 - ], - [ - 131.08619225400005, - -0.071547132999896 - ], - [ - 131.11353600400005, - -0.073663018999824 - ], - [ - 131.12671959700018, - -0.076429945999877 - ], - [ - 131.15365644600004, - -0.085707289999917 - ], - [ - 131.16187584700006, - -0.092380466999884 - ], - [ - 131.17042076900023, - -0.101657809999935 - ], - [ - 131.18002363400004, - -0.110039971999896 - ], - [ - 131.19157962300008, - -0.113702080999857 - ], - [ - 131.19662519599999, - -0.119235934999864 - ], - [ - 131.20191491000017, - -0.13005950299987 - ], - [ - 131.21159915500002, - -0.137872002999941 - ], - [ - 131.22950280000006, - -0.134209893999895 - ], - [ - 131.23389733200005, - -0.13811614399998 - ], - [ - 131.2385360040001, - -0.139825127999984 - ], - [ - 131.25367272200018, - -0.140313408999972 - ], - [ - 131.26368248800006, - -0.14267343499985 - ], - [ - 131.26929772200018, - -0.147556247999916 - ], - [ - 131.27393639400012, - -0.152439059999878 - ], - [ - 131.29737389400006, - -0.159274997999901 - ], - [ - 131.30591881600012, - -0.171075127999956 - ], - [ - 131.31820722700016, - -0.203057549999954 - ], - [ - 131.30486087300002, - -0.217543226999908 - ], - [ - 131.29883873800023, - -0.226657809999907 - ], - [ - 131.297618035, - -0.237237237999864 - ], - [ - 131.30665123800023, - -0.251397393999966 - ], - [ - 131.33855228000007, - -0.277601820999919 - ], - [ - 131.34546959700006, - -0.288181247999873 - ], - [ - 131.34009850400017, - -0.296075127999842 - ], - [ - 131.316661004, - -0.299574476999922 - ], - [ - 131.31137129000004, - -0.308851820999891 - ], - [ - 131.30665123800023, - -0.321221612999835 - ], - [ - 131.29672285200004, - -0.328545830999829 - ], - [ - 131.2872827480002, - -0.337172132999839 - ], - [ - 131.28394616000017, - -0.353936455999857 - ], - [ - 131.2794702480002, - -0.351739190999865 - ], - [ - 131.26807701900023, - -0.348565362999977 - ], - [ - 131.26351972700004, - -0.346449476999879 - ], - [ - 131.26221764400012, - -0.368340752999828 - ], - [ - 131.25294030000023, - -0.384372653999989 - ], - [ - 131.23796634200014, - -0.389255466999884 - ], - [ - 131.21924889400023, - -0.377536716999884 - ], - [ - 131.18091881600006, - -0.346449476999879 - ], - [ - 131.1577254570001, - -0.332940362999821 - ], - [ - 131.14747155000018, - -0.335870049999841 - ], - [ - 131.14307701900006, - -0.332126559999892 - ], - [ - 131.1128035820001, - -0.332126559999892 - ], - [ - 131.10434004000015, - -0.328220309999907 - ], - [ - 131.10222415500002, - -0.324395440999893 - ], - [ - 131.09848066500004, - -0.322930596999839 - ], - [ - 131.0854598320001, - -0.325860283999859 - ], - [ - 131.06983483200023, - -0.332940362999821 - ], - [ - 131.023285352, - -0.366875908999944 - ], - [ - 131.02182050900015, - -0.352959893999881 - ], - [ - 131.01563561300006, - -0.349867445999976 - ], - [ - 130.99610436300011, - -0.353936455999857 - ], - [ - 130.99586022200006, - -0.354913018999838 - ], - [ - 130.99105879000015, - -0.357028903999932 - ], - [ - 130.98438561300011, - -0.359144789999945 - ], - [ - 130.97901451900023, - -0.360039971999839 - ], - [ - 130.97046959700006, - -0.358005466999913 - ], - [ - 130.95826256600006, - -0.348565362999977 - ], - [ - 130.95167076900006, - -0.346449476999879 - ], - [ - 130.93091881600017, - -0.315362237999963 - ], - [ - 130.90528405000012, - -0.29843515399989 - ], - [ - 130.89991295700017, - -0.291192315999879 - ], - [ - 130.90723717500023, - -0.28492604 - ], - [ - 130.89307701900023, - -0.264336846999882 - ], - [ - 130.87940514400012, - -0.254082940999865 - ], - [ - 130.86329186300023, - -0.250583591999956 - ], - [ - 130.83423912900017, - -0.249281507999868 - ], - [ - 130.81690514400017, - -0.244886976999894 - ], - [ - 130.80762780000012, - -0.244073174999883 - ], - [ - 130.79672285200004, - -0.239190362999906 - ], - [ - 130.79444420700005, - -0.228204033999859 - ], - [ - 130.79737389400006, - -0.209242445999934 - ], - [ - 130.79224694100017, - -0.189873955999829 - ], - [ - 130.7848413420002, - -0.179375908999859 - ], - [ - 130.730235222, - -0.130466403999876 - ], - [ - 130.719493035, - -0.114108981999863 - ], - [ - 130.71550540500002, - -0.093194268999895 - ], - [ - 130.70704186300011, - -0.096286716999884 - ], - [ - 130.70118248800023, - -0.096449476999851 - ], - [ - 130.68824303500006, - -0.093194268999895 - ], - [ - 130.69271894600004, - -0.086358330999872 - ], - [ - 130.69556725400005, - -0.079522393999866 - ], - [ - 130.67701256600006, - -0.077894789999931 - ], - [ - 130.65007571700008, - -0.079766533999901 - ], - [ - 130.62525475400005, - -0.08497486799989 - ], - [ - 130.61304772200006, - -0.093194268999895 - ], - [ - 130.6374617850001, - -0.098728122999916 - ], - [ - 130.64722741000006, - -0.103855075999917 - ], - [ - 130.65406334700006, - -0.113702080999857 - ], - [ - 130.63607832100004, - -0.113457940999908 - ], - [ - 130.62623131600017, - -0.125746351999865 - ], - [ - 130.62924238399998, - -0.140720309999978 - ], - [ - 130.66537519600004, - -0.154392184999921 - ], - [ - 130.6823836600001, - -0.16985442499994 - ], - [ - 130.71778405000012, - -0.216973565999936 - ], - [ - 130.73878014400023, - -0.255791924999869 - ], - [ - 130.74268639400023, - -0.274672132999896 - ], - [ - 130.75098717500012, - -0.287530205999829 - ], - [ - 130.79273522200006, - -0.30722421699987 - ], - [ - 130.81104576900012, - -0.318536065999851 - ], - [ - 130.81544030000012, - -0.302178643999838 - ], - [ - 130.82032311300006, - -0.294122002999899 - ], - [ - 130.82813561300006, - -0.291436455999914 - ], - [ - 130.87191816500004, - -0.293226820999905 - ], - [ - 130.88705488400004, - -0.296482028999847 - ], - [ - 130.8937280610002, - -0.302015882999953 - ], - [ - 130.8966577480002, - -0.312107028999932 - ], - [ - 130.90381920700023, - -0.317559502999956 - ], - [ - 130.91285241000017, - -0.321058851999865 - ], - [ - 130.92090905000012, - -0.325860283999859 - ], - [ - 130.929535352, - -0.336114190999879 - ], - [ - 130.94011478000007, - -0.3558895809999 - ], - [ - 130.94825280000018, - -0.366875908999944 - ], - [ - 130.94027754000004, - -0.370863539999931 - ], - [ - 130.93140709700018, - -0.37900155999985 - ], - [ - 130.92400149800008, - -0.388604424999841 - ], - [ - 130.92090905000012, - -0.398044528999932 - ], - [ - 130.91675866000017, - -0.406019789999903 - ], - [ - 130.90650475400005, - -0.413018487999963 - ], - [ - 130.86548912900005, - -0.429294528999904 - ], - [ - 130.77930748800006, - -0.445082289999945 - ], - [ - 130.75603274800008, - -0.445977471999939 - ], - [ - 130.73308353000007, - -0.441501559999892 - ], - [ - 130.71550540500002, - -0.42839934699991 - ], - [ - 130.70606530000012, - -0.410251559999921 - ], - [ - 130.68067467500012, - -0.339613539999874 - ], - [ - 130.693614129, - -0.331312757999882 - ], - [ - 130.69597415500007, - -0.318129165000016 - ], - [ - 130.69255618600008, - -0.303480726999837 - ], - [ - 130.68824303500006, - -0.291192315999879 - ], - [ - 130.60914147200006, - -0.314060153999876 - ], - [ - 130.57911217500012, - -0.333916924999969 - ], - [ - 130.56470787900005, - -0.373711846999882 - ], - [ - 130.57154381600006, - -0.373711846999882 - ], - [ - 130.58228600400017, - -0.366143487999835 - ], - [ - 130.57862389400012, - -0.383884373 - ], - [ - 130.56153405000018, - -0.427015882999839 - ], - [ - 130.55445397200012, - -0.433526299999841 - ], - [ - 130.54737389400023, - -0.436130466999927 - ], - [ - 130.54420006600017, - -0.432061455999957 - ], - [ - 130.54574629000004, - -0.420179945999919 - ], - [ - 130.5584416020001, - -0.38738372199991 - ], - [ - 130.54118899800008, - -0.38250090899993 - ], - [ - 130.54053795700023, - -0.367933851999823 - ], - [ - 130.54542076900012, - -0.347751559999878 - ], - [ - 130.54420006600017, - -0.325860283999859 - ], - [ - 130.53793379000004, - -0.316501559999907 - ], - [ - 130.52222741000017, - -0.30193450299997 - ], - [ - 130.51612389400006, - -0.291192315999879 - ], - [ - 130.51710045700023, - -0.282647393999937 - ], - [ - 130.52247155000012, - -0.274834893999866 - ], - [ - 130.52654056100008, - -0.266778252999913 - ], - [ - 130.52369225400005, - -0.257582289999945 - ], - [ - 130.50660241000017, - -0.250258070999934 - ], - [ - 130.48568769600004, - -0.255303643999881 - ], - [ - 130.45484459700006, - -0.271254164999888 - ], - [ - 130.45118248800011, - -0.274183851999823 - ], - [ - 130.44450931100008, - -0.283135674999926 - ], - [ - 130.441172722, - -0.28492604 - ], - [ - 130.43555748800011, - -0.282891533999887 - ], - [ - 130.43238366000006, - -0.273695570999919 - ], - [ - 130.42750084700018, - -0.271254164999888 - ], - [ - 130.4084578790001, - -0.269707940999851 - ], - [ - 130.39975019600004, - -0.267673434999907 - ], - [ - 130.39275149800014, - -0.263848565999893 - ], - [ - 130.38217207100016, - -0.275648695999877 - ], - [ - 130.3756616550002, - -0.274590752999913 - ], - [ - 130.37086022200018, - -0.267998955999929 - ], - [ - 130.36597741000006, - -0.263848565999893 - ], - [ - 130.33887780000012, - -0.262872002999828 - ], - [ - 130.33814537900017, - -0.263848565999893 - ], - [ - 130.31625410200004, - -0.259942315999908 - ], - [ - 130.3108016290001, - -0.257582289999945 - ], - [ - 130.30738366000017, - -0.251885674999954 - ], - [ - 130.30469811300011, - -0.242771091999884 - ], - [ - 130.30054772200018, - -0.234144789999959 - ], - [ - 130.29371178500006, - -0.230401299999841 - ], - [ - 130.26539147200012, - -0.224786065999851 - ], - [ - 130.23243248800023, - -0.212823174999912 - ], - [ - 130.21705162900017, - -0.200860283999873 - ], - [ - 130.241953972, - -0.195570570999905 - ], - [ - 130.25017337300014, - -0.197442315999865 - ], - [ - 130.26758873800011, - -0.206149997999859 - ], - [ - 130.27662194100012, - -0.209242445999934 - ], - [ - 130.27995853000002, - -0.208672783999873 - ], - [ - 130.30323326900023, - -0.208672783999873 - ], - [ - 130.30396569100017, - -0.209242445999934 - ], - [ - 130.33855228000007, - -0.203220309999921 - ], - [ - 130.35670006600017, - -0.201836846999939 - ], - [ - 130.36915123800011, - -0.206149997999859 - ], - [ - 130.38355553500006, - -0.214450778999932 - ], - [ - 130.39861087300008, - -0.214450778999932 - ], - [ - 130.41285241000017, - -0.208428643999838 - ], - [ - 130.42408287900017, - -0.199314059999935 - ], - [ - 130.42986087300002, - -0.186293226999936 - ], - [ - 130.4166772800002, - -0.184177341999927 - ], - [ - 130.39771569100017, - -0.183363539999917 - ], - [ - 130.38648522200018, - -0.175062757999854 - ], - [ - 130.40267988400004, - -0.16985442499994 - ], - [ - 130.41211998800023, - -0.157321872999859 - ], - [ - 130.41374759200008, - -0.141534112999906 - ], - [ - 130.40626061300011, - -0.127373955999886 - ], - [ - 130.39771569100017, - -0.145928643999895 - ], - [ - 130.38461347700004, - -0.157484632999825 - ], - [ - 130.37403405000023, - -0.155857028999975 - ], - [ - 130.37224368600008, - -0.134209893999895 - ], - [ - 130.36597741000006, - -0.134209893999895 - ], - [ - 130.36133873800011, - -0.14324309699991 - ], - [ - 130.35482832099999, - -0.146661065999822 - ], - [ - 130.34693444100006, - -0.145440362999906 - ], - [ - 130.33814537900017, - -0.140313408999972 - ], - [ - 130.34131920700023, - -0.154473565999822 - ], - [ - 130.347504102, - -0.168389580999886 - ], - [ - 130.35075931100008, - -0.180352471999825 - ], - [ - 130.34498131600017, - -0.188734632999967 - ], - [ - 130.33301842500023, - -0.188246351999808 - ], - [ - 130.31706790500007, - -0.181817315999879 - ], - [ - 130.30307050899998, - -0.172946872999844 - ], - [ - 130.29712975400017, - -0.165215752999828 - ], - [ - 130.29395592500006, - -0.152032158999873 - ], - [ - 130.27979576900017, - -0.131442966999842 - ], - [ - 130.27662194100012, - -0.117120049999855 - ], - [ - 130.2806095710001, - -0.104994398999949 - ], - [ - 130.290782097, - -0.099216403999904 - ], - [ - 130.30404707100016, - -0.099867445999948 - ], - [ - 130.317637566, - -0.106784763999855 - ], - [ - 130.32349694100006, - -0.102634372999901 - ], - [ - 130.32911217500023, - -0.096612237999906 - ], - [ - 130.33423912900017, - -0.088962497999958 - ], - [ - 130.33814537900017, - -0.079522393999866 - ], - [ - 130.34310957100004, - -0.093519789999917 - ], - [ - 130.34498131600017, - -0.10906340899983 - ], - [ - 130.34839928500017, - -0.12184010199995 - ], - [ - 130.358653191, - -0.127373955999886 - ], - [ - 130.3686629570001, - -0.12184010199995 - ], - [ - 130.36915123800011, - -0.108330987999892 - ], - [ - 130.36426842500012, - -0.092380466999884 - ], - [ - 130.358653191, - -0.079522393999866 - ], - [ - 130.38086998800006, - -0.073663018999824 - ], - [ - 130.39429772200018, - -0.082818291999899 - ], - [ - 130.40699303500006, - -0.097263278999861 - ], - [ - 130.42750084700018, - -0.106784763999855 - ], - [ - 130.42335045700023, - -0.086195570999905 - ], - [ - 130.42066491000017, - -0.079522393999866 - ], - [ - 130.42750084700018, - -0.079522393999866 - ], - [ - 130.42986087300002, - -0.08660247199991 - ], - [ - 130.434336785, - -0.093194268999895 - ], - [ - 130.47779381600006, - -0.075494072999973 - ], - [ - 130.49854576900023, - -0.062676690999865 - ], - [ - 130.51002037900017, - -0.044732354999908 - ], - [ - 130.51954186300006, - -0.049655856999877 - ], - [ - 130.528086785, - -0.056410414999988 - ], - [ - 130.54420006600017, - -0.072686455999929 - ], - [ - 130.54542076900012, - -0.068617445999877 - ], - [ - 130.55046634200002, - -0.058444919999843 - ], - [ - 130.55274498800011, - -0.06308359199987 - ], - [ - 130.5561629570001, - -0.067925713999941 - ], - [ - 130.5584416020001, - -0.072686455999929 - ], - [ - 130.56080162900005, - -0.065606377999885 - ], - [ - 130.57154381600006, - -0.044732354999908 - ], - [ - 130.57496178500017, - -0.048597914999917 - ], - [ - 130.58643639400012, - -0.058444919999843 - ], - [ - 130.59522545700005, - -0.047214450999931 - ], - [ - 130.6227319670002, - -0.051771742999875 - ], - [ - 130.64112389400023, - -0.044732354999908 - ], - [ - 130.66098066500015, - -0.044732354999908 - ], - [ - 130.6910913420002, - -0.035739841999884 - ], - [ - 130.71631920700023, - -0.033257744999872 - ], - [ - 130.72234134200008, - -0.052178643999881 - ], - [ - 130.73609459700018, - -0.046888929999824 - ], - [ - 130.76547285200016, - -0.049981377999899 - ], - [ - 130.78386478000013, - -0.044732354999908 - ], - [ - 130.77686608200023, - -0.037286065999922 - ], - [ - 130.7688908210001, - -0.03252532299993 - ], - [ - 130.75977623800011, - -0.030531507999896 - ], - [ - 130.74968509200014, - -0.031101169999872 - ], - [ - 130.76148522200018, - -0.018365166999914 - ], - [ - 130.779063347, - -0.00896575299997 - ], - [ - 130.80062910200004, - -0.003838799999869 - ], - [ - 130.82471764400023, - -0.003838799999869 - ] - ] - ], - [ - [ - [ - 98.559825066, - -0.278252862999864 - ], - [ - 98.55518639400012, - -0.318536065999851 - ], - [ - 98.55518639400012, - -0.312269789999888 - ], - [ - 98.55176842500006, - -0.322198174999897 - ], - [ - 98.54322350400017, - -0.334079684999935 - ], - [ - 98.54151451900006, - -0.343031507999882 - ], - [ - 98.54265384200019, - -0.354180596999896 - ], - [ - 98.54786217500006, - -0.36923593499999 - ], - [ - 98.54900149800002, - -0.381117445999948 - ], - [ - 98.54151451900006, - -0.381117445999948 - ], - [ - 98.51246178500017, - -0.319024346999839 - ], - [ - 98.40552819100006, - -0.168226820999919 - ], - [ - 98.3899845710001, - -0.140394789999874 - ], - [ - 98.36329186300011, - -0.074395440999851 - ], - [ - 98.34351647200018, - -0.044732354999908 - ], - [ - 98.33187910200016, - -0.036797783999845 - ], - [ - 98.31592858200005, - -0.028334242999904 - ], - [ - 98.30176842500006, - -0.018731377999828 - ], - [ - 98.29566491000006, - -0.007256768999966 - ], - [ - 98.304453972, - -0.00172291499986 - ], - [ - 98.32496178500017, - 0.003973700000117 - ], - [ - 98.36402428500006, - 0.010484117000118 - ], - [ - 98.4060978520001, - -0.007378838999941 - ], - [ - 98.44336998800006, - -0.052015882999825 - ], - [ - 98.469981316, - -0.107517184999963 - ], - [ - 98.47999108200011, - -0.158379815999908 - ], - [ - 98.49732506600017, - -0.199802341999913 - ], - [ - 98.53223717500012, - -0.239353122999873 - ], - [ - 98.559825066, - -0.278252862999864 - ] - ] - ], - [ - [ - [ - 104.58790123800006, - 0.008286851000037 - ], - [ - 104.62037194100017, - -0.004245700999874 - ], - [ - 104.67554772200012, - -0.053806247999901 - ], - [ - 104.68132571700008, - -0.065240166999871 - ], - [ - 104.64722741000006, - -0.072686455999929 - ], - [ - 104.64722741000006, - -0.080743096999882 - ], - [ - 104.65251712300002, - -0.08953215899993 - ], - [ - 104.65943444100006, - -0.096530856999919 - ], - [ - 104.66456139400006, - -0.09937916499986 - ], - [ - 104.67546634200014, - -0.095798434999892 - ], - [ - 104.68311608200005, - -0.08961354 - ], - [ - 104.69190514400012, - -0.087497653999904 - ], - [ - 104.70582116000011, - -0.096286716999884 - ], - [ - 104.73658287900017, - -0.127373955999886 - ], - [ - 104.75391686300006, - -0.170586846999967 - ], - [ - 104.76628665500019, - -0.188246351999808 - ], - [ - 104.78777103000002, - -0.195570570999905 - ], - [ - 104.81413821700002, - -0.192803643999852 - ], - [ - 104.82032311300011, - -0.184340101999894 - ], - [ - 104.81983483200011, - -0.169610283999901 - ], - [ - 104.82593834700018, - -0.147719007999882 - ], - [ - 104.84888756600017, - -0.139580987999864 - ], - [ - 104.8772892590001, - -0.166599216999899 - ], - [ - 104.92896569100006, - -0.237237237999864 - ], - [ - 105.01148522200006, - -0.281508070999905 - ], - [ - 105.00269616000017, - -0.294854424999826 - ], - [ - 104.9817814460001, - -0.290704033999887 - ], - [ - 104.95655358200005, - -0.281182549999883 - ], - [ - 104.93523196700019, - -0.278090101999808 - ], - [ - 104.91716556100019, - -0.287530205999829 - ], - [ - 104.92017662900017, - -0.29900481599995 - ], - [ - 104.93067467500006, - -0.313409112999921 - ], - [ - 104.93523196700019, - -0.332126559999892 - ], - [ - 104.8816837900001, - -0.308363539999903 - ], - [ - 104.86353600400011, - -0.305433851999879 - ], - [ - 104.851328972, - -0.301202080999943 - ], - [ - 104.8328556650001, - -0.282403252999899 - ], - [ - 104.77808678500017, - -0.257582289999945 - ], - [ - 104.76343834700006, - -0.242933851999851 - ], - [ - 104.75074303500011, - -0.227146091999899 - ], - [ - 104.73552493600013, - -0.214450778999932 - ], - [ - 104.712657097, - -0.209242445999934 - ], - [ - 104.67090905000006, - -0.211602471999896 - ], - [ - 104.65495853000007, - -0.215915622999887 - ], - [ - 104.64039147200006, - -0.223402601999865 - ], - [ - 104.61695397200006, - -0.24032968499985 - ], - [ - 104.60621178500006, - -0.244073174999883 - ], - [ - 104.60035241, - -0.243584893999895 - ], - [ - 104.58513431100002, - -0.237237237999864 - ], - [ - 104.5799259770001, - -0.24032968499985 - ], - [ - 104.57105553500017, - -0.248467705999857 - ], - [ - 104.56299889400006, - -0.253513278999975 - ], - [ - 104.55054772200006, - -0.267998955999929 - ], - [ - 104.54135175900015, - -0.271254164999888 - ], - [ - 104.5286564460001, - -0.269952080999971 - ], - [ - 104.52393639400006, - -0.265883070999919 - ], - [ - 104.5218205090001, - -0.259372653999932 - ], - [ - 104.5174259770001, - -0.25017669099995 - ], - [ - 104.50733483200005, - -0.236097915 - ], - [ - 104.4978947270001, - -0.228122653999876 - ], - [ - 104.48389733200005, - -0.224379164999931 - ], - [ - 104.45932050900015, - -0.223402601999865 - ], - [ - 104.44711347700016, - -0.220961196 - ], - [ - 104.43995201900012, - -0.214288018999866 - ], - [ - 104.43637129000015, - -0.204359632999953 - ], - [ - 104.43555748800006, - -0.192152601999894 - ], - [ - 104.43726647200006, - -0.181084893999852 - ], - [ - 104.44190514400006, - -0.175551039999931 - ], - [ - 104.45590254000015, - -0.168226820999919 - ], - [ - 104.4944767590001, - -0.135674737999949 - ], - [ - 104.51075280000006, - -0.113702080999857 - ], - [ - 104.5174259770001, - -0.089450778999947 - ], - [ - 104.52507571700014, - -0.007745049999954 - ], - [ - 104.53736412900017, - 0.021307684000107 - ], - [ - 104.558360222, - 0.003078518000123 - ], - [ - 104.55982506600017, - 0.010158596000096 - ], - [ - 104.56381269600016, - 0.022609768000024 - ], - [ - 104.56462649800008, - 0.030340887000122 - ], - [ - 104.57162519600016, - 0.017645575000145 - ], - [ - 104.58790123800006, - 0.008286851000037 - ] - ] - ], - [ - [ - [ - 129.54997806100008, - -0.214125257999811 - ], - [ - 129.540293816, - -0.216729424999897 - ], - [ - 129.52613366000017, - -0.214613539999888 - ], - [ - 129.51677493600008, - -0.208754164999945 - ], - [ - 129.50196373800006, - -0.188734632999967 - ], - [ - 129.45826256600017, - -0.113702080999857 - ], - [ - 129.37289472700016, - -0.079522393999866 - ], - [ - 129.37037194100006, - -0.066338799999912 - ], - [ - 129.3722436860002, - -0.050347588999912 - ], - [ - 129.37159264400023, - -0.036797783999845 - ], - [ - 129.36166425900015, - -0.031101169999872 - ], - [ - 129.33757571700014, - 0.00678131699999 - ], - [ - 129.33277428500006, - 0.011379299000112 - ], - [ - 129.3100692070001, - 0.024847723 - ], - [ - 129.29908287900005, - 0.033433335000097 - ], - [ - 129.29346764400023, - 0.036322333000129 - ], - [ - 129.29029381600017, - 0.040594794000057 - ], - [ - 129.29346764400023, - 0.047674872000101 - ], - [ - 129.3004663420002, - 0.050604559000121 - ], - [ - 129.30925540500007, - 0.048041083000115 - ], - [ - 129.45980879000004, - -0.080173434999907 - ], - [ - 129.51270592500006, - -0.114353122999901 - ], - [ - 129.53687584700018, - -0.134209893999895 - ], - [ - 129.55762780000012, - -0.158786716999913 - ], - [ - 129.56739342500023, - -0.175551039999931 - ], - [ - 129.57154381600017, - -0.192152601999894 - ], - [ - 129.56820722700016, - -0.200127862999935 - ], - [ - 129.5602319670002, - -0.208103122999901 - ], - [ - 129.54997806100008, - -0.214125257999811 - ] - ] - ], - [ - [ - [ - 127.40886478000007, - 0.147040106000105 - ], - [ - 127.43881269600004, - 0.139715887000023 - ], - [ - 127.45248457100016, - 0.1402041690001 - ], - [ - 127.44825280000023, - 0.134263414000159 - ], - [ - 127.44019616, - 0.120266018000024 - ], - [ - 127.45997155000023, - -0.003838799999869 - ], - [ - 127.46168053500006, - -0.025160415000016 - ], - [ - 127.46029707100016, - -0.038872979999951 - ], - [ - 127.45289147200018, - -0.041029554999952 - ], - [ - 127.43604576900006, - -0.02768320099986 - ], - [ - 127.43262780000018, - -0.020806572999945 - ], - [ - 127.43189537900005, - -0.011569919999886 - ], - [ - 127.43262780000018, - 0.00678131699999 - ], - [ - 127.42994225400011, - 0.008286851000037 - ], - [ - 127.41285241000006, - 0.023504950000017 - ], - [ - 127.41187584700018, - 0.016099351000108 - ], - [ - 127.40967858200005, - 0.010565497000101 - ], - [ - 127.40552819100006, - 0.006496486000131 - ], - [ - 127.39861087300002, - 0.003078518000123 - ], - [ - 127.391368035, - 0.026027736000032 - ], - [ - 127.391368035, - 0.053045966000155 - ], - [ - 127.39861087300002, - 0.106105861 - ], - [ - 127.40886478000007, - 0.147040106000105 - ] - ] - ], - [ - [ - [ - 98.62541622300014, - 0.17515444500016 - ], - [ - 98.67314881800004, - 0.169812204000095 - ], - [ - 98.71735171300011, - 0.175119907000152 - ], - [ - 98.74386804200017, - 0.166265774000038 - ], - [ - 98.766855252, - 0.166260799000071 - ], - [ - 98.80574359100015, - 0.160915958000061 - ], - [ - 98.83579891300022, - 0.141468860000103 - ], - [ - 98.85168541500016, - 0.109621341000164 - ], - [ - 98.84458901000019, - 0.084859408000113 - ], - [ - 98.80215138800011, - 0.086636337000144 - ], - [ - 98.76325605100013, - 0.086647611000103 - ], - [ - 98.72612544600005, - 0.074284580000096 - ], - [ - 98.68900355200006, - 0.07077530300009 - ], - [ - 98.65012344900018, - 0.079621516000159 - ], - [ - 98.62008145400014, - 0.086702748000135 - ], - [ - 98.57588254200019, - 0.08675018600016 - ], - [ - 98.5387398820001, - 0.090335129000039 - ], - [ - 98.52813318600008, - 0.111575879000057 - ], - [ - 98.52460056700008, - 0.145197070000123 - ], - [ - 98.54759660600004, - 0.159326621000091 - ], - [ - 98.59004914400012, - 0.171655865000062 - ], - [ - 98.62541622300014, - 0.17515444500016 - ] - ] - ], - [ - [ - [ - 104.4396264980002, - 0.146185614000103 - ], - [ - 104.4900822270001, - 0.082586981000119 - ], - [ - 104.49708092500012, - 0.071275132000139 - ], - [ - 104.48585045700011, - 0.065822658000101 - ], - [ - 104.47950280000006, - 0.063950914000131 - ], - [ - 104.46957441500015, - 0.063788153000175 - ], - [ - 104.47999108200005, - 0.045111395000106 - ], - [ - 104.48308353000007, - 0.035711981000162 - ], - [ - 104.48340905000006, - 0.023504950000017 - ], - [ - 104.47657311300006, - 0.023504950000017 - ], - [ - 104.45915774800008, - 0.047308661000088 - ], - [ - 104.41138756600006, - 0.091701565000122 - ], - [ - 104.40137780000006, - 0.119086005 - ], - [ - 104.4075626960001, - 0.119086005 - ], - [ - 104.411875847, - 0.114569403000118 - ], - [ - 104.41602623800006, - 0.111721096000082 - ], - [ - 104.42872155000012, - 0.106105861 - ], - [ - 104.423594597, - 0.11220937700007 - ], - [ - 104.40870201900006, - 0.150946356000105 - ], - [ - 104.40674889400012, - 0.161200262000136 - ], - [ - 104.40788821700002, - 0.17059967700007 - ], - [ - 104.41391035200016, - 0.175848700000145 - ], - [ - 104.42115319100017, - 0.17275625200007 - ], - [ - 104.42839603000019, - 0.163763739000132 - ], - [ - 104.4396264980002, - 0.146185614000103 - ] - ] - ], - [ - [ - [ - 104.51197350400017, - 0.232896226000136 - ], - [ - 104.5310978520001, - 0.215969143000152 - ], - [ - 104.53052819100017, - 0.219061591000056 - ], - [ - 104.53239993600002, - 0.222886460000069 - ], - [ - 104.5354923840001, - 0.226385809000149 - ], - [ - 104.53882897200006, - 0.228257554000109 - ], - [ - 104.54322350400011, - 0.227443752000099 - ], - [ - 104.54810631600017, - 0.224310614000132 - ], - [ - 104.68873131600006, - 0.071275132000139 - ], - [ - 104.7078556650001, - 0.043646552000141 - ], - [ - 104.70289147200018, - 0.032782294000143 - ], - [ - 104.68392988400015, - 0.036281643000137 - ], - [ - 104.66089928500017, - 0.051418361000131 - ], - [ - 104.63990319100006, - 0.070054429000123 - ], - [ - 104.633555535, - 0.078111070000162 - ], - [ - 104.62614993600002, - 0.102240302 - ], - [ - 104.61980228000019, - 0.10578034100007 - ], - [ - 104.60621178500006, - 0.091782945000105 - ], - [ - 104.59522545700011, - 0.101629950000117 - ], - [ - 104.57886803500017, - 0.124904690000136 - ], - [ - 104.56836998800011, - 0.136786200000174 - ], - [ - 104.5657658210001, - 0.142726955000114 - ], - [ - 104.56421959700018, - 0.158148505000142 - ], - [ - 104.56153405000006, - 0.161281643000109 - ], - [ - 104.55339603000007, - 0.161525783000158 - ], - [ - 104.5467228520001, - 0.162502346000124 - ], - [ - 104.54070071700019, - 0.165228583000101 - ], - [ - 104.53419030000012, - 0.17059967700007 - ], - [ - 104.52979576900012, - 0.1773135440001 - ], - [ - 104.52735436300011, - 0.189886786000102 - ], - [ - 104.52491295700005, - 0.1954613300001 - ], - [ - 104.49854576900006, - 0.223293361000074 - ], - [ - 104.49366295700011, - 0.231146552000141 - ], - [ - 104.49024498800006, - 0.242621161000088 - ], - [ - 104.50220787900011, - 0.238267320000105 - ], - [ - 104.51197350400017, - 0.232896226000136 - ] - ] - ], - [ - [ - [ - 102.8753361340001, - 0.284084377000013 - ], - [ - 102.84701582100016, - 0.278062242000175 - ], - [ - 102.83912194100017, - 0.290961005000099 - ], - [ - 102.85450280000012, - 0.303168036000088 - ], - [ - 102.88453209700018, - 0.315252997000172 - ], - [ - 102.9139103520001, - 0.320257880000128 - ], - [ - 102.92725670700011, - 0.310858466000099 - ], - [ - 102.90772545700011, - 0.298529364000146 - ], - [ - 102.8753361340001, - 0.284084377000013 - ] - ] - ], - [ - [ - [ - 104.41138756600006, - 0.294419664000102 - ], - [ - 104.4051212900001, - 0.292141018000123 - ], - [ - 104.39958743600008, - 0.294989325000159 - ], - [ - 104.39551842500012, - 0.300930080000015 - ], - [ - 104.39185631600006, - 0.31659577 - ], - [ - 104.3868921230002, - 0.319281317000062 - ], - [ - 104.38021894600016, - 0.320379950000103 - ], - [ - 104.37354576900012, - 0.324530341000127 - ], - [ - 104.34693444100006, - 0.359930731000134 - ], - [ - 104.33936608200011, - 0.365464584999984 - ], - [ - 104.34148196700019, - 0.366359768000066 - ], - [ - 104.34831790500002, - 0.370510158000101 - ], - [ - 104.35181725400011, - 0.371242580000128 - ], - [ - 104.35816491000006, - 0.368882554000081 - ], - [ - 104.37623131600017, - 0.354315497000144 - ], - [ - 104.40552819100017, - 0.338812567000133 - ], - [ - 104.41618899800014, - 0.328802802000141 - ], - [ - 104.42139733200011, - 0.317938544000071 - ], - [ - 104.42017662900011, - 0.306301174000154 - ], - [ - 104.41138756600006, - 0.294419664000102 - ] - ] - ], - [ - [ - [ - 127.41716556100008, - 0.312933661000116 - ], - [ - 127.39625084700018, - 0.281073309000092 - ], - [ - 127.35816491, - 0.283514716000042 - ], - [ - 127.34750410200016, - 0.296128648000106 - ], - [ - 127.34107506600006, - 0.31464264500012 - ], - [ - 127.33790123800011, - 0.333970445000062 - ], - [ - 127.33708743600019, - 0.348781643000038 - ], - [ - 127.34327233200023, - 0.361395575000103 - ], - [ - 127.35873457100016, - 0.37128327000012 - ], - [ - 127.37891686300011, - 0.377671617000132 - ], - [ - 127.39869225400005, - 0.379584052000013 - ], - [ - 127.41871178500017, - 0.353989976000122 - ], - [ - 127.41716556100008, - 0.312933661000116 - ] - ] - ], - [ - [ - [ - 103.0813908210001, - 0.579291083000086 - ], - [ - 103.07699629000015, - 0.574774481000119 - ], - [ - 103.07146243600002, - 0.57721588700015 - ], - [ - 103.06446373800006, - 0.585191148000106 - ], - [ - 103.05787194100017, - 0.596380927000126 - ], - [ - 103.04566491000011, - 0.627834377000056 - ], - [ - 103.04330488400015, - 0.640448309000121 - ], - [ - 103.0408634770001, - 0.646714585000083 - ], - [ - 103.03728274800002, - 0.652655341000099 - ], - [ - 103.03663170700011, - 0.657538153000161 - ], - [ - 103.04330488400015, - 0.660956122000087 - ], - [ - 103.05543053500006, - 0.658677476000193 - ], - [ - 103.06576582100016, - 0.649237372000087 - ], - [ - 103.07398522200006, - 0.636460679000052 - ], - [ - 103.07960045700005, - 0.62441640800013 - ], - [ - 103.08432050900015, - 0.608547268000024 - ], - [ - 103.08545983200011, - 0.600083726000165 - ], - [ - 103.08497155000012, - 0.592027085000126 - ], - [ - 103.0813908210001, - 0.579291083000086 - ] - ] - ], - [ - [ - [ - 103.49789472700016, - 0.627020575000046 - ], - [ - 103.48902428500017, - 0.619940497000158 - ], - [ - 103.4720158210001, - 0.622992254999986 - ], - [ - 103.46924889400006, - 0.637396552000126 - ], - [ - 103.47388756600017, - 0.653469143000109 - ], - [ - 103.47901451900012, - 0.660956122000087 - ], - [ - 103.48585045700011, - 0.667385158000087 - ], - [ - 103.49952233200005, - 0.695502020000092 - ], - [ - 103.50635826900006, - 0.701890367000104 - ], - [ - 103.5174259770001, - 0.698431708000101 - ], - [ - 103.5218205090001, - 0.689846096000011 - ], - [ - 103.5213322270001, - 0.67865631700009 - ], - [ - 103.5179142590001, - 0.667629299000126 - ], - [ - 103.50611412900011, - 0.640773830000143 - ], - [ - 103.49789472700016, - 0.627020575000046 - ] - ] - ], - [ - [ - [ - 103.18336022200006, - 0.514837958000101 - ], - [ - 103.17066491000017, - 0.51373932500006 - ], - [ - 103.1531681650001, - 0.52383047100011 - ], - [ - 103.14047285200016, - 0.539374091000113 - ], - [ - 103.13599694100017, - 0.556219794000114 - ], - [ - 103.13672936300011, - 0.573879299000126 - ], - [ - 103.15894616000017, - 0.664780992000189 - ], - [ - 103.17920983200011, - 0.695502020000092 - ], - [ - 103.21176191500015, - 0.708156643000066 - ], - [ - 103.23023522200018, - 0.704169012000165 - ], - [ - 103.2469181650001, - 0.694037177000126 - ], - [ - 103.26148522200006, - 0.680324611000103 - ], - [ - 103.27320397200006, - 0.665676174000083 - ], - [ - 103.28516686300006, - 0.64638906500015 - ], - [ - 103.29363040500019, - 0.625433661000017 - ], - [ - 103.29786217500012, - 0.604722398000177 - ], - [ - 103.29997806100002, - 0.575425523000163 - ], - [ - 103.2957462900001, - 0.549383856000105 - ], - [ - 103.28077233200011, - 0.538031317000119 - ], - [ - 103.19556725400011, - 0.52045319200009 - ], - [ - 103.18336022200006, - 0.514837958000101 - ] - ] - ], - [ - [ - [ - 104.28760826900006, - 0.650783596000124 - ], - [ - 104.27735436300006, - 0.626166083000044 - ], - [ - 104.2664494150001, - 0.633002020000148 - ], - [ - 104.26026451900012, - 0.643377997000059 - ], - [ - 104.2498478520001, - 0.667181708000129 - ], - [ - 104.22201582100016, - 0.696030992000161 - ], - [ - 104.21583092500006, - 0.708156643000066 - ], - [ - 104.24146569100006, - 0.695379950000117 - ], - [ - 104.27051842500012, - 0.675034898000035 - ], - [ - 104.28760826900006, - 0.650783596000124 - ] - ] - ], - [ - [ - [ - 104.74903405000012, - 0.722601630000028 - ], - [ - 104.73926842500006, - 0.716253973000079 - ], - [ - 104.73145592500006, - 0.722479559000135 - ], - [ - 104.72071373800006, - 0.737860419000171 - ], - [ - 104.72486412900017, - 0.74966054900014 - ], - [ - 104.74097741000017, - 0.748928127000113 - ], - [ - 104.75416100400011, - 0.737250067000119 - ], - [ - 104.74903405000012, - 0.722601630000028 - ] - ] - ], - [ - [ - [ - 127.43140709700006, - 0.750921942000062 - ], - [ - 127.43604576900006, - 0.747219143000109 - ], - [ - 127.43946373800011, - 0.742865302000126 - ], - [ - 127.44483483200023, - 0.727443752000099 - ], - [ - 127.44825280000023, - 0.706610419000029 - ], - [ - 127.44906660200016, - 0.685003973000107 - ], - [ - 127.44629967500012, - 0.667181708000129 - ], - [ - 127.43392988400015, - 0.652167059000107 - ], - [ - 127.41089928500011, - 0.632269598000121 - ], - [ - 127.38868248800023, - 0.618841864000117 - ], - [ - 127.37867272200006, - 0.623032945000148 - ], - [ - 127.373301629, - 0.633490302000126 - ], - [ - 127.36361738400015, - 0.648260809000121 - ], - [ - 127.35865319100017, - 0.665838934000149 - ], - [ - 127.37574303500006, - 0.698797919000114 - ], - [ - 127.3849389980002, - 0.757147528000033 - ], - [ - 127.39454186300006, - 0.752590236000074 - ], - [ - 127.40381920700023, - 0.750392971000082 - ], - [ - 127.41211998800011, - 0.751654364000089 - ], - [ - 127.41846764400023, - 0.757147528000033 - ], - [ - 127.42562910199999, - 0.754217841000013 - ], - [ - 127.43140709700006, - 0.750921942000062 - ] - ] - ], - [ - [ - [ - 134.33863366000006, - 0.737534898000149 - ], - [ - 134.32252037900017, - 0.730536200000174 - ], - [ - 134.30486087300008, - 0.732896226000122 - ], - [ - 134.3004663420002, - 0.74347565300009 - ], - [ - 134.310313347, - 0.75649648600016 - ], - [ - 134.3268335300002, - 0.766180731000119 - ], - [ - 134.34294681100008, - 0.765204169000143 - ], - [ - 134.34693444100006, - 0.752020575000103 - ], - [ - 134.33863366000006, - 0.737534898000149 - ] - ] - ], - [ - [ - [ - 103.10450280000006, - 0.735419012000136 - ], - [ - 103.09229576900012, - 0.72235748899999 - ], - [ - 103.0862736340001, - 0.724676825000046 - ], - [ - 103.08082116000017, - 0.734279690000108 - ], - [ - 103.07715905000012, - 0.745510158000116 - ], - [ - 103.07585696700019, - 0.752834377000113 - ], - [ - 103.07715905000012, - 0.760891018000152 - ], - [ - 103.0802514980002, - 0.76862213700015 - ], - [ - 103.08472741000006, - 0.775702216000127 - ], - [ - 103.0945744150001, - 0.786037502000127 - ], - [ - 103.10035241000006, - 0.790187893000081 - ], - [ - 103.10661868600019, - 0.792954820000134 - ], - [ - 103.11280358200005, - 0.792954820000134 - ], - [ - 103.12094160200016, - 0.779974677000126 - ], - [ - 103.11622155000006, - 0.757757880000085 - ], - [ - 103.10450280000006, - 0.735419012000136 - ] - ] - ], - [ - [ - [ - 104.62045332100016, - 0.777044989000117 - ], - [ - 104.61353600400017, - 0.765855210000097 - ], - [ - 104.60189863400015, - 0.764349677000055 - ], - [ - 104.57203209700006, - 0.770819403000147 - ], - [ - 104.55396569100006, - 0.770697333 - ], - [ - 104.54102623800006, - 0.766587632000125 - ], - [ - 104.51124108200011, - 0.750311591000099 - ], - [ - 104.51189212300008, - 0.773749091000084 - ], - [ - 104.52344811300011, - 0.788397528000175 - ], - [ - 104.5423283210001, - 0.795884507000054 - ], - [ - 104.56462649800008, - 0.798163153000118 - ], - [ - 104.60564212300008, - 0.793890692000119 - ], - [ - 104.62159264400006, - 0.787420966000028 - ], - [ - 104.62045332100016, - 0.777044989000117 - ] - ] - ], - [ - [ - [ - 104.27735436300006, - 0.787909247000016 - ], - [ - 104.27759850400011, - 0.76430898600016 - ], - [ - 104.27979576900006, - 0.747056382000054 - ], - [ - 104.28589928500017, - 0.730373440000108 - ], - [ - 104.29769941500015, - 0.708156643000066 - ], - [ - 104.2840275400001, - 0.708156643000066 - ], - [ - 104.27442467500012, - 0.703436591000141 - ], - [ - 104.26482181100008, - 0.702215887000122 - ], - [ - 104.25538170700005, - 0.704901434000107 - ], - [ - 104.23609459700012, - 0.718451239000075 - ], - [ - 104.21452884200019, - 0.721177476000136 - ], - [ - 104.20557701900006, - 0.726060289000117 - ], - [ - 104.19166100400017, - 0.745998440000093 - ], - [ - 104.18824303500017, - 0.764471747000115 - ], - [ - 104.19581139400012, - 0.779974677000126 - ], - [ - 104.21583092500006, - 0.791327216000113 - ], - [ - 104.23389733200011, - 0.786444403000132 - ], - [ - 104.24488366000017, - 0.786525783000116 - ], - [ - 104.2498478520001, - 0.794745184000121 - ], - [ - 104.25416100400011, - 0.797837632000096 - ], - [ - 104.26368248800011, - 0.799139716000099 - ], - [ - 104.27295983200005, - 0.796535549000097 - ], - [ - 104.27735436300006, - 0.787909247000016 - ] - ] - ], - [ - [ - [ - 103.72486412900011, - 0.766506252000141 - ], - [ - 103.71338951900006, - 0.762437242000189 - ], - [ - 103.70093834700006, - 0.765692450000131 - ], - [ - 103.69507897200012, - 0.773911851000051 - ], - [ - 103.68881269600016, - 0.791652736000046 - ], - [ - 103.66651451900012, - 0.823635158000044 - ], - [ - 103.66773522200006, - 0.839667059000035 - ], - [ - 103.70264733200005, - 0.814154364000117 - ], - [ - 103.71810957100016, - 0.798081773000135 - ], - [ - 103.72730553500006, - 0.779852606000162 - ], - [ - 103.72486412900011, - 0.766506252000141 - ] - ] - ], - [ - [ - [ - 104.64283287900017, - 0.806830145000035 - ], - [ - 104.63038170700005, - 0.806545315000093 - ], - [ - 104.62549889400006, - 0.810695705000128 - ], - [ - 104.6302189460001, - 0.816351630000113 - ], - [ - 104.63542728000019, - 0.828558661000088 - ], - [ - 104.63917076900012, - 0.847967841000099 - ], - [ - 104.64861087300002, - 0.857896226000108 - ], - [ - 104.65943444100006, - 0.845892645000077 - ], - [ - 104.66277103000007, - 0.834214585000083 - ], - [ - 104.66325931100008, - 0.829087632000068 - ], - [ - 104.66138756600017, - 0.820135809000135 - ], - [ - 104.6565861340001, - 0.813869533000087 - ], - [ - 104.65154056100008, - 0.809963283000101 - ], - [ - 104.64283287900017, - 0.806830145000035 - ] - ] - ], - [ - [ - [ - 127.34693444100012, - 0.757391669000071 - ], - [ - 127.331309441, - 0.756415106000176 - ], - [ - 127.31283613399998, - 0.757147528000033 - ], - [ - 127.30339603000019, - 0.764878648000121 - ], - [ - 127.29330488400004, - 0.782660223000107 - ], - [ - 127.28565514400006, - 0.802150783000101 - ], - [ - 127.282481316, - 0.814886786000059 - ], - [ - 127.28882897200006, - 0.836900131999982 - ], - [ - 127.30486087300002, - 0.855169989000046 - ], - [ - 127.32488040500019, - 0.862860419000143 - ], - [ - 127.36345462300008, - 0.840969143000123 - ], - [ - 127.37435957100016, - 0.826239325000131 - ], - [ - 127.37696373800023, - 0.807766018000109 - ], - [ - 127.37110436300011, - 0.78449127800009 - ], - [ - 127.36003665500007, - 0.765082098000079 - ], - [ - 127.34693444100012, - 0.757391669000071 - ] - ] - ], - [ - [ - [ - 103.52442467500012, - 0.79848867400014 - ], - [ - 103.52344811300011, - 0.777818101000136 - ], - [ - 103.49048912900017, - 0.821275132 - ], - [ - 103.4759220710001, - 0.832220770000134 - ], - [ - 103.44027754000015, - 0.844224351000165 - ], - [ - 103.42579186300011, - 0.854396877000028 - ], - [ - 103.4212345710001, - 0.873236395000063 - ], - [ - 103.43083743600008, - 0.867661851000136 - ], - [ - 103.48853600400011, - 0.845445054000081 - ], - [ - 103.49732506600017, - 0.840236721000096 - ], - [ - 103.50554446700008, - 0.833970445000134 - ], - [ - 103.51270592500012, - 0.826808986000103 - ], - [ - 103.51872806100013, - 0.818426825000131 - ], - [ - 103.52320397200018, - 0.807928778000075 - ], - [ - 103.52442467500012, - 0.79848867400014 - ] - ] - ], - [ - [ - [ - 103.94141686300011, - 0.775702216000127 - ], - [ - 103.93287194100017, - 0.770331122000158 - ], - [ - 103.92139733200005, - 0.772772528000019 - ], - [ - 103.91138756600006, - 0.780747789000145 - ], - [ - 103.89503014400012, - 0.810248114000132 - ], - [ - 103.88746178500017, - 0.818019924000126 - ], - [ - 103.85173587300008, - 0.835353908000116 - ], - [ - 103.84595787900017, - 0.84247467700007 - ], - [ - 103.84229576900006, - 0.850653387000165 - ], - [ - 103.81861412900011, - 0.880072333000072 - ], - [ - 103.81861412900011, - 0.88621653900006 - ], - [ - 103.86329186300006, - 0.876898505000099 - ], - [ - 103.89820397200018, - 0.853338934000149 - ], - [ - 103.9241642590001, - 0.822455145000021 - ], - [ - 103.94214928500006, - 0.791327216000113 - ], - [ - 103.94141686300011, - 0.775702216000127 - ] - ] - ], - [ - [ - [ - 103.45948326900012, - 0.658107815000051 - ], - [ - 103.43433678500006, - 0.647284247000144 - ], - [ - 103.41570071700008, - 0.657375393000024 - ], - [ - 103.40308678500017, - 0.678208726000094 - ], - [ - 103.39372806100008, - 0.698797919000114 - ], - [ - 103.38379967500006, - 0.708156643000066 - ], - [ - 103.3455509770001, - 0.763373114000075 - ], - [ - 103.34050540500007, - 0.784002997000101 - ], - [ - 103.3387150400001, - 0.804917709999984 - ], - [ - 103.3411564460001, - 0.817368882000082 - ], - [ - 103.35035241000017, - 0.839178778000047 - ], - [ - 103.35743248800006, - 0.872463283000044 - ], - [ - 103.36988366000017, - 0.886053778000175 - ], - [ - 103.38550866000006, - 0.888861395000049 - ], - [ - 103.40088951900006, - 0.880072333000072 - ], - [ - 103.41000410200016, - 0.864569403000147 - ], - [ - 103.41749108200005, - 0.84650299700013 - ], - [ - 103.4275822270001, - 0.831610419000086 - ], - [ - 103.45972741000017, - 0.820379950000174 - ], - [ - 103.47046959700018, - 0.807928778000075 - ], - [ - 103.48902428500017, - 0.777044989000117 - ], - [ - 103.50196373800011, - 0.763373114000075 - ], - [ - 103.50684655000006, - 0.755438544000029 - ], - [ - 103.51002037900011, - 0.742865302000126 - ], - [ - 103.4803166020001, - 0.685248114000061 - ], - [ - 103.45948326900012, - 0.658107815000051 - ] - ] - ], - [ - [ - [ - 103.837657097, - 0.769517320000148 - ], - [ - 103.83228600400017, - 0.765366929000109 - ], - [ - 103.82667076900006, - 0.765692450000131 - ], - [ - 103.82105553500006, - 0.768947658000087 - ], - [ - 103.80128014400012, - 0.784247137000136 - ], - [ - 103.76392662900017, - 0.804917709999984 - ], - [ - 103.74634850400011, - 0.822739976000051 - ], - [ - 103.73047936300011, - 0.847560940000093 - ], - [ - 103.72624759200019, - 0.873236395000063 - ], - [ - 103.743418816, - 0.893744208000101 - ], - [ - 103.75025475400011, - 0.888861395000049 - ], - [ - 103.7677514980002, - 0.884344794000171 - ], - [ - 103.77759850400011, - 0.880072333000072 - ], - [ - 103.80176842500012, - 0.852728583000015 - ], - [ - 103.81706790500007, - 0.84170156500015 - ], - [ - 103.83106530000012, - 0.816351630000113 - ], - [ - 103.83952884200008, - 0.788397528000175 - ], - [ - 103.837657097, - 0.769517320000148 - ] - ] - ], - [ - [ - [ - 103.47934004000015, - 0.878851630000057 - ], - [ - 103.46900475400011, - 0.869614976000179 - ], - [ - 103.458262566, - 0.869696356000162 - ], - [ - 103.44467207100016, - 0.873602606000077 - ], - [ - 103.43295332100016, - 0.880682684000121 - ], - [ - 103.4280705090001, - 0.890041408000073 - ], - [ - 103.42156009200019, - 0.896714585000112 - ], - [ - 103.41041100400017, - 0.904730536000073 - ], - [ - 103.40707441500015, - 0.911444403000104 - ], - [ - 103.4534611340001, - 0.920558986000017 - ], - [ - 103.462168816, - 0.918931382 - ], - [ - 103.47266686300006, - 0.908840236000117 - ], - [ - 103.47950280000012, - 0.893622137000136 - ], - [ - 103.47934004000015, - 0.878851630000057 - ] - ] - ], - [ - [ - [ - 104.17212975400011, - 0.883490302 - ], - [ - 104.18482506600017, - 0.880072333000072 - ], - [ - 104.22608483200011, - 0.880072333000072 - ], - [ - 104.24146569100006, - 0.877020575000174 - ], - [ - 104.25782311300006, - 0.868597723000121 - ], - [ - 104.26628665500013, - 0.855861721000082 - ], - [ - 104.25749759200008, - 0.839667059000035 - ], - [ - 104.25025475400011, - 0.830023505000057 - ], - [ - 104.239512566, - 0.822455145000021 - ], - [ - 104.18751061300006, - 0.799261786000073 - ], - [ - 104.17644290500019, - 0.79848867400014 - ], - [ - 104.16749108200005, - 0.804917709999984 - ], - [ - 104.16114342500006, - 0.818793036000145 - ], - [ - 104.15601647200006, - 0.84638092700007 - ], - [ - 104.14763431100008, - 0.858954169000157 - ], - [ - 104.1341251960001, - 0.867254950000131 - ], - [ - 104.10718834700006, - 0.872992255000113 - ], - [ - 104.09229576900006, - 0.880072333000072 - ], - [ - 104.09937584700006, - 0.894761460000069 - ], - [ - 104.09400475400017, - 0.933091539000188 - ], - [ - 104.09913170700011, - 0.948919989000132 - ], - [ - 104.11255944100017, - 0.952582098 - ], - [ - 104.12769616000017, - 0.942531643000109 - ], - [ - 104.15748131600017, - 0.91079336100016 - ], - [ - 104.16293379000015, - 0.901922919000029 - ], - [ - 104.16635175900015, - 0.891791083000058 - ], - [ - 104.17212975400011, - 0.883490302 - ] - ] - ], - [ - [ - [ - 103.9090275400001, - 1.005926825000145 - ], - [ - 103.94214928500006, - 0.996079820000119 - ], - [ - 103.95199629000015, - 0.987941799000112 - ], - [ - 103.96143639400006, - 0.974798895000148 - ], - [ - 103.96729576900012, - 0.960109768000137 - ], - [ - 103.96664472700016, - 0.947211005000128 - ], - [ - 103.95883222700016, - 0.939764716000155 - ], - [ - 103.94629967500006, - 0.935614325000031 - ], - [ - 103.93279056100019, - 0.934027411 - ], - [ - 103.92164147200018, - 0.934637762000136 - ], - [ - 103.91138756600006, - 0.937933661000088 - ], - [ - 103.85661868600013, - 0.968410549000041 - ], - [ - 103.84644616000017, - 0.977484442000119 - ], - [ - 103.83969160200016, - 0.989935614000146 - ], - [ - 103.83887780000012, - 1.002997137000037 - ], - [ - 103.84473717500006, - 1.012681382000082 - ], - [ - 103.85661868600013, - 1.014390367000175 - ], - [ - 103.87378991000006, - 1.003607489000089 - ], - [ - 103.87370853000007, - 1.011908270000063 - ], - [ - 103.88005618600019, - 1.031480210000126 - ], - [ - 103.89283287900011, - 1.014349677000013 - ], - [ - 103.9090275400001, - 1.005926825000145 - ] - ] - ], - [ - [ - [ - 104.8396916020001, - 0.958807684000149 - ], - [ - 104.832774285, - 0.955145575000103 - ], - [ - 104.82829837300008, - 0.964992580000114 - ], - [ - 104.8263452480002, - 0.976629950000117 - ], - [ - 104.82593834700018, - 0.99298737200013 - ], - [ - 104.82178795700005, - 0.998724677000027 - ], - [ - 104.79118899800002, - 1.024074611000145 - ], - [ - 104.798594597, - 1.031480210000126 - ], - [ - 104.81104576900006, - 1.025620835000083 - ], - [ - 104.83008873800006, - 1.023382880000099 - ], - [ - 104.84351647200006, - 1.018215236000017 - ], - [ - 104.83904056100008, - 1.003607489000089 - ], - [ - 104.84555097700016, - 0.997788804000123 - ], - [ - 104.84994550900015, - 0.991197007000054 - ], - [ - 104.85230553500011, - 0.983710028000175 - ], - [ - 104.85279381600017, - 0.975490627000084 - ], - [ - 104.84961998800011, - 0.968898830000029 - ], - [ - 104.84538821700019, - 0.963324286000102 - ], - [ - 104.8396916020001, - 0.958807684000149 - ] - ] - ], - [ - [ - [ - 131.24415123800011, - 1.02973053600013 - ], - [ - 131.23633873800011, - 1.01935455900005 - ], - [ - 131.23707116000006, - 1.024969794000128 - ], - [ - 131.24488366000006, - 1.035345770000049 - ], - [ - 131.24415123800011, - 1.02973053600013 - ] - ] - ], - [ - [ - [ - 107.60157311300006, - 1.009833075000131 - ], - [ - 107.57545006600017, - 0.980169989000103 - ], - [ - 107.55958092500006, - 0.970160223000036 - ], - [ - 107.54712975400005, - 0.976263739000103 - ], - [ - 107.54761803500006, - 0.982123114000146 - ], - [ - 107.55339603000019, - 0.987453518000123 - ], - [ - 107.55909264400006, - 0.993963934000107 - ], - [ - 107.5594181650001, - 1.003607489000089 - ], - [ - 107.55404707100016, - 1.006903387000122 - ], - [ - 107.5452580090001, - 1.006252346000068 - ], - [ - 107.5359806650001, - 1.007879950000088 - ], - [ - 107.529551629, - 1.018052476000051 - ], - [ - 107.53126061300011, - 1.027899481000148 - ], - [ - 107.53907311300011, - 1.034328518000081 - ], - [ - 107.55014082100016, - 1.037502346000139 - ], - [ - 107.56202233200011, - 1.037176825000117 - ], - [ - 107.58594811300006, - 1.026068427000084 - ], - [ - 107.59888756600017, - 1.017157294000057 - ], - [ - 107.60157311300006, - 1.009833075000131 - ] - ] - ], - [ - [ - [ - 131.26539147200018, - 1.052720445000119 - ], - [ - 131.25489342500012, - 1.044256903000161 - ], - [ - 131.2535913420002, - 1.052639065000136 - ], - [ - 131.25562584700006, - 1.068793036000102 - ], - [ - 131.26351972700004, - 1.075913804000052 - ], - [ - 131.27116946700002, - 1.072007554000052 - ], - [ - 131.27019290500007, - 1.060980536000102 - ], - [ - 131.26539147200018, - 1.052720445000119 - ] - ] - ], - [ - [ - [ - 120.683360222, - 1.044582424000097 - ], - [ - 120.66716556100008, - 1.043117580000128 - ], - [ - 120.63209069100017, - 1.068508205000072 - ], - [ - 120.60759524800002, - 1.072455145000148 - ], - [ - 120.61752363400015, - 1.076808986000131 - ], - [ - 120.62826582100016, - 1.078843492000161 - ], - [ - 120.63917076900023, - 1.077582098000065 - ], - [ - 120.649180535, - 1.072455145000148 - ], - [ - 120.65992272200006, - 1.067613023000078 - ], - [ - 120.668711785, - 1.061021226000179 - ], - [ - 120.683360222, - 1.044582424000097 - ] - ] - ], - [ - [ - [ - 120.38624108200005, - 1.025946356000105 - ], - [ - 120.37794030000006, - 1.024074611000145 - ], - [ - 120.36866295700023, - 1.031724351000165 - ], - [ - 120.36768639400017, - 1.049221096000039 - ], - [ - 120.37159264400017, - 1.068019924000083 - ], - [ - 120.37761478000007, - 1.079901434000121 - ], - [ - 120.39242597700004, - 1.0860863300001 - ], - [ - 120.40235436300023, - 1.077215887000136 - ], - [ - 120.40650475400017, - 1.060980536000102 - ], - [ - 120.40398196700008, - 1.044867255000128 - ], - [ - 120.39966881600017, - 1.037502346000139 - ], - [ - 120.39372806100002, - 1.030747789000188 - ], - [ - 120.38624108200005, - 1.025946356000105 - ] - ] - ], - [ - [ - [ - 103.443125847, - 1.01276276200015 - ], - [ - 103.44483483200011, - 1.006170966000084 - ], - [ - 103.44483483200011, - 1.000311591000056 - ], - [ - 103.4422306650001, - 0.995266018000109 - ], - [ - 103.43702233200011, - 0.991400458000101 - ], - [ - 103.42359459700006, - 0.990179755000085 - ], - [ - 103.40756269600016, - 0.994940497000087 - ], - [ - 103.38038170700005, - 1.009833075000131 - ], - [ - 103.35767662900017, - 1.004461981000091 - ], - [ - 103.34083092500006, - 1.019517320000105 - ], - [ - 103.3147892590001, - 1.06159088700015 - ], - [ - 103.31560306100002, - 1.073187567000076 - ], - [ - 103.32349694100012, - 1.092759507000054 - ], - [ - 103.3338322270001, - 1.111395575000131 - ], - [ - 103.3421330090001, - 1.119696356000119 - ], - [ - 103.34791100400017, - 1.121771552000126 - ], - [ - 103.36646569100006, - 1.13117096600007 - ], - [ - 103.37671959700018, - 1.133286851000079 - ], - [ - 103.38982181100008, - 1.130275783000158 - ], - [ - 103.39136803500017, - 1.122463283000073 - ], - [ - 103.38819420700011, - 1.111721096000153 - ], - [ - 103.38721764400006, - 1.099798895000035 - ], - [ - 103.39307701900012, - 1.076076565000108 - ], - [ - 103.3977970710001, - 1.06415436399999 - ], - [ - 103.40398196700008, - 1.054836330000128 - ], - [ - 103.40967858200005, - 1.051174221000082 - ], - [ - 103.42269941500015, - 1.049709377000028 - ], - [ - 103.42839603000002, - 1.047186591000013 - ], - [ - 103.431407097, - 1.042710679000123 - ], - [ - 103.43165123800006, - 1.038153387000094 - ], - [ - 103.43116295700005, - 1.033392645 - ], - [ - 103.43189537900011, - 1.028387762000136 - ], - [ - 103.43425540500007, - 1.024237372000101 - ], - [ - 103.44060306100019, - 1.017157294000057 - ], - [ - 103.443125847, - 1.01276276200015 - ] - ] - ], - [ - [ - [ - 102.64527428500006, - 0.997219143000152 - ], - [ - 102.66374759200008, - 0.996079820000119 - ], - [ - 102.67807050900015, - 0.999416408000144 - ], - [ - 102.70533287900017, - 1.013902085000097 - ], - [ - 102.71876061300006, - 1.017279364000032 - ], - [ - 102.74301191500015, - 1.015936591000042 - ], - [ - 102.7638452480002, - 1.011175848000121 - ], - [ - 102.7825626960001, - 1.001776434000021 - ], - [ - 102.83253014400012, - 0.963771877000099 - ], - [ - 102.9090275400001, - 0.927720445000134 - ], - [ - 103.02173912900011, - 0.845282294000114 - ], - [ - 103.0364689460001, - 0.828192450000174 - ], - [ - 103.0403751960001, - 0.821275132 - ], - [ - 103.0486759770001, - 0.797023830000086 - ], - [ - 103.05176842500006, - 0.784654039000145 - ], - [ - 103.05445397200006, - 0.777736721000153 - ], - [ - 103.05762780000012, - 0.777044989000117 - ], - [ - 103.04908287900011, - 0.757798570000077 - ], - [ - 103.04371178500006, - 0.720689195000148 - ], - [ - 103.03370201900006, - 0.705023505 - ], - [ - 103.02784264400012, - 0.701239325000145 - ], - [ - 103.01734459700006, - 0.696112372000144 - ], - [ - 103.00733483200005, - 0.693833726000079 - ], - [ - 103.00294030000006, - 0.698472398000192 - ], - [ - 102.999766472, - 0.700751044000157 - ], - [ - 102.98243248800011, - 0.72235748899999 - ], - [ - 102.92994225400017, - 0.770005601000136 - ], - [ - 102.89470462300002, - 0.789984442000033 - ], - [ - 102.85222415500007, - 0.798163153000118 - ], - [ - 102.766856316, - 0.791327216000113 - ], - [ - 102.74512780000006, - 0.793768622000144 - ], - [ - 102.70215905000006, - 0.803900458000015 - ], - [ - 102.68148847700016, - 0.804917709999984 - ], - [ - 102.59766686300006, - 0.78506094000015 - ], - [ - 102.55787194100017, - 0.780259507000068 - ], - [ - 102.51636803500017, - 0.791327216000113 - ], - [ - 102.46729576900006, - 0.826971747000158 - ], - [ - 102.45801842500006, - 0.832220770000134 - ], - [ - 102.40650475400011, - 0.873236395000063 - ], - [ - 102.40943444100006, - 0.894720770000077 - ], - [ - 102.42457116000006, - 0.914496161000102 - ], - [ - 102.44507897200018, - 0.929022528000132 - ], - [ - 102.48943118600013, - 0.939764716000155 - ], - [ - 102.50066165500002, - 0.953273830000043 - ], - [ - 102.50171959700018, - 0.972886460000097 - ], - [ - 102.46989993600002, - 1.067368882000039 - ], - [ - 102.46762129000015, - 1.106431382000082 - ], - [ - 102.489024285, - 1.133286851000079 - ], - [ - 102.5275171230002, - 1.139837958000058 - ], - [ - 102.556407097, - 1.125677802000126 - ], - [ - 102.60792076900012, - 1.068915106000077 - ], - [ - 102.61573326900012, - 1.057684637000165 - ], - [ - 102.6173608730002, - 1.044256903000161 - ], - [ - 102.60889733200005, - 1.027777411000088 - ], - [ - 102.60547936300006, - 1.011175848000121 - ], - [ - 102.62175540500019, - 1.001613674000055 - ], - [ - 102.64527428500006, - 0.997219143000152 - ] - ] - ], - [ - [ - [ - 103.03711998800006, - 1.044582424000097 - ], - [ - 103.07764733200011, - 1.003404039000131 - ], - [ - 103.12647545700011, - 0.9278832050001 - ], - [ - 103.16325931100019, - 0.899603583000143 - ], - [ - 103.17457116000017, - 0.88214752800009 - ], - [ - 103.16749108200011, - 0.858954169000157 - ], - [ - 103.12712649800002, - 0.83441803600013 - ], - [ - 103.0862736340001, - 0.841009833000115 - ], - [ - 102.9515080090001, - 0.924627997000158 - ], - [ - 102.95118248800006, - 0.9278832050001 - ], - [ - 102.90674889400006, - 0.968817450000046 - ], - [ - 102.89332116000006, - 0.975327867000118 - ], - [ - 102.85889733200011, - 0.987697658000073 - ], - [ - 102.84229576900006, - 0.989935614000146 - ], - [ - 102.8243921230002, - 0.995428778000161 - ], - [ - 102.81153405000006, - 1.008042710000055 - ], - [ - 102.80103600400011, - 1.021958726000136 - ], - [ - 102.79070071700019, - 1.031480210000126 - ], - [ - 102.77361087300008, - 1.035467841000113 - ], - [ - 102.71192467500012, - 1.031480210000126 - ], - [ - 102.69263756600017, - 1.02582428600013 - ], - [ - 102.67058353000019, - 1.014553127000141 - ], - [ - 102.64763431100019, - 1.006293036000059 - ], - [ - 102.62623131600017, - 1.009833075000131 - ], - [ - 102.62476647200012, - 1.021958726000136 - ], - [ - 102.63721764400012, - 1.041001695000119 - ], - [ - 102.67058353000019, - 1.075588283000116 - ], - [ - 102.68523196700019, - 1.095404364000132 - ], - [ - 102.70191491000006, - 1.137762762000136 - ], - [ - 102.71558678500017, - 1.154445705000072 - ], - [ - 102.75538170700005, - 1.167914130000057 - ], - [ - 102.80176842500006, - 1.163275458000044 - ], - [ - 102.88624108200011, - 1.133286851000079 - ], - [ - 102.96713300900015, - 1.091538804000123 - ], - [ - 103.03711998800006, - 1.044582424000097 - ] - ] - ], - [ - [ - [ - 104.15235436300006, - 1.140041408000101 - ], - [ - 104.1517033210001, - 1.11945221600017 - ], - [ - 104.13111412900011, - 1.048773505000042 - ], - [ - 104.12322024800014, - 1.049627997000044 - ], - [ - 104.10596764400012, - 1.065008856000162 - ], - [ - 104.10417728000002, - 1.057766018000137 - ], - [ - 104.10417728000002, - 1.05166250200007 - ], - [ - 104.10670006600006, - 1.045477606000091 - ], - [ - 104.11280358200005, - 1.037746486000088 - ], - [ - 104.10450280000006, - 1.033270575000031 - ], - [ - 104.10059655000006, - 1.027044989000061 - ], - [ - 104.0978296230002, - 1.0191104190001 - ], - [ - 104.09229576900006, - 1.009833075000131 - ], - [ - 104.09156334700006, - 1.005560614000132 - ], - [ - 104.09327233200005, - 0.993638414000173 - ], - [ - 104.09229576900006, - 0.989935614000146 - ], - [ - 104.08790123800011, - 0.98895905200007 - ], - [ - 104.07642662900017, - 0.990464585000126 - ], - [ - 104.07178795700011, - 0.989935614000146 - ], - [ - 104.04916425900015, - 0.984198309000163 - ], - [ - 104.03174889400012, - 0.989447333000058 - ], - [ - 103.99610436300006, - 1.009833075000131 - ], - [ - 103.98796634200014, - 1.010484117000175 - ], - [ - 103.96664472700016, - 1.008124091000127 - ], - [ - 103.95582116000017, - 1.009833075000131 - ], - [ - 103.9505314460001, - 1.014105536000145 - ], - [ - 103.91822350400017, - 1.051336981000048 - ], - [ - 103.90674889400012, - 1.07168203300013 - ], - [ - 103.90259850400017, - 1.09052155200007 - ], - [ - 103.91407311300011, - 1.099798895000035 - ], - [ - 103.92383873800006, - 1.096136785999988 - ], - [ - 103.93816165500007, - 1.079575914000188 - ], - [ - 103.94898522200006, - 1.078599351000122 - ], - [ - 103.95622806100008, - 1.084865627000084 - ], - [ - 103.95533287900017, - 1.093573309000149 - ], - [ - 103.9513452480002, - 1.103583075000145 - ], - [ - 103.946543816, - 1.124701239000061 - ], - [ - 103.9432072270001, - 1.130926825000031 - ], - [ - 103.94450931100019, - 1.135239976000122 - ], - [ - 103.95582116000017, - 1.140773830000128 - ], - [ - 103.96705162900017, - 1.141669012000122 - ], - [ - 103.9876408210001, - 1.134222723000065 - ], - [ - 103.99610436300006, - 1.133286851000079 - ], - [ - 104.01107832100016, - 1.14472077000012 - ], - [ - 104.01921634200019, - 1.178859768000038 - ], - [ - 104.03093509200008, - 1.187892971000124 - ], - [ - 104.04135175900015, - 1.181382554000052 - ], - [ - 104.07081139400006, - 1.145941473000136 - ], - [ - 104.08545983200005, - 1.133286851000079 - ], - [ - 104.0916447270001, - 1.145493882000139 - ], - [ - 104.09156334700006, - 1.158433335000055 - ], - [ - 104.08659915500019, - 1.17096588700015 - ], - [ - 104.07862389400006, - 1.181708075000074 - ], - [ - 104.09058678500017, - 1.187811591000141 - ], - [ - 104.10320071700008, - 1.189520575000145 - ], - [ - 104.11573326900006, - 1.187241929000081 - ], - [ - 104.12769616000017, - 1.181301174000069 - ], - [ - 104.13819420700005, - 1.1720238300001 - ], - [ - 104.1427514980002, - 1.166489976000094 - ], - [ - 104.14633222700016, - 1.16046784100017 - ], - [ - 104.15235436300006, - 1.140041408000101 - ] - ] - ], - [ - [ - [ - 104.59253991, - 1.198797919000114 - ], - [ - 104.58692467500012, - 1.162054755000028 - ], - [ - 104.5882267590001, - 1.144598700000145 - ], - [ - 104.59937584700006, - 1.126450914000145 - ], - [ - 104.64714603000007, - 1.104966539000117 - ], - [ - 104.65455162900017, - 1.096380927000027 - ], - [ - 104.65642337300014, - 1.080389716000028 - ], - [ - 104.66749108200005, - 1.030585028000132 - ], - [ - 104.65162194100006, - 1.009019273000121 - ], - [ - 104.64714603000007, - 0.99689362200013 - ], - [ - 104.65398196700019, - 0.976874091000155 - ], - [ - 104.65479576900012, - 0.947699286000116 - ], - [ - 104.65772545700011, - 0.941473700000159 - ], - [ - 104.66163170700011, - 0.937241929000052 - ], - [ - 104.65870201900012, - 0.9278832050001 - ], - [ - 104.64991295700005, - 0.918443101000179 - ], - [ - 104.63697350400011, - 0.914211330000072 - ], - [ - 104.62354576900006, - 0.912176825000131 - ], - [ - 104.61638431100019, - 0.906195380000128 - ], - [ - 104.61353600400017, - 0.896429755000085 - ], - [ - 104.61304772200018, - 0.883124091000155 - ], - [ - 104.59986412900011, - 0.835028387000094 - ], - [ - 104.56706790500019, - 0.829535223000065 - ], - [ - 104.48340905000006, - 0.858954169000157 - ], - [ - 104.48926842500012, - 0.875148830000114 - ], - [ - 104.4837345710001, - 0.893296617000104 - ], - [ - 104.46949303500017, - 0.908107815000079 - ], - [ - 104.44922936300006, - 0.914211330000072 - ], - [ - 104.44922936300006, - 0.921616929000066 - ], - [ - 104.47339928500017, - 0.920599677000098 - ], - [ - 104.48462975400017, - 0.922186591000127 - ], - [ - 104.49024498800006, - 0.9278832050001 - ], - [ - 104.48658287900011, - 0.937079169000086 - ], - [ - 104.47486412900011, - 0.940090236000088 - ], - [ - 104.44922936300006, - 0.941473700000159 - ], - [ - 104.42896569100017, - 0.948919989000132 - ], - [ - 104.42107181100019, - 0.956610419000157 - ], - [ - 104.42123457100016, - 0.968817450000046 - ], - [ - 104.4275822270001, - 0.974798895000148 - ], - [ - 104.46273847700016, - 0.983099677000041 - ], - [ - 104.45801842500006, - 0.993719794000157 - ], - [ - 104.4573673840001, - 1.001939195000077 - ], - [ - 104.46273847700016, - 1.017279364000032 - ], - [ - 104.46827233200005, - 1.018052476000051 - ], - [ - 104.47966556100002, - 1.025336005000057 - ], - [ - 104.48519941500015, - 1.033677476000037 - ], - [ - 104.4729923840001, - 1.037746486000088 - ], - [ - 104.46778405000006, - 1.040920315000136 - ], - [ - 104.45777428500011, - 1.054999091000084 - ], - [ - 104.4524845710001, - 1.058172919000143 - ], - [ - 104.438731316, - 1.056870835000055 - ], - [ - 104.42994225400011, - 1.053615627000113 - ], - [ - 104.38624108200005, - 1.029852606000105 - ], - [ - 104.3714298840001, - 1.025620835000083 - ], - [ - 104.34945722700016, - 1.024074611000145 - ], - [ - 104.340586785, - 1.020900783000087 - ], - [ - 104.32715905000012, - 1.006781317000147 - ], - [ - 104.31544030000006, - 1.003607489000089 - ], - [ - 104.28150475400011, - 1.002142645000035 - ], - [ - 104.27100670700011, - 1.003607489000089 - ], - [ - 104.24561608200011, - 1.017279364000032 - ], - [ - 104.24138431100008, - 1.035549221000096 - ], - [ - 104.24244225400011, - 1.055894273000177 - ], - [ - 104.2327580090001, - 1.075588283000116 - ], - [ - 104.23194420700005, - 1.093329169000114 - ], - [ - 104.25635826900012, - 1.108872789000117 - ], - [ - 104.30518639400012, - 1.126450914000145 - ], - [ - 104.31657962300008, - 1.132879950000074 - ], - [ - 104.32227623800006, - 1.138657945000119 - ], - [ - 104.33253014400006, - 1.154445705000072 - ], - [ - 104.3367619150001, - 1.165025132000039 - ], - [ - 104.3372501960001, - 1.173732815000108 - ], - [ - 104.34131920700005, - 1.179592190000065 - ], - [ - 104.3562931650001, - 1.181708075000074 - ], - [ - 104.37842858200005, - 1.176499742000161 - ], - [ - 104.38933353000002, - 1.17865631699999 - ], - [ - 104.3938908210001, - 1.191595770000077 - ], - [ - 104.39966881600006, - 1.202622789000117 - ], - [ - 104.41260826900006, - 1.200628973000093 - ], - [ - 104.43555748800006, - 1.187892971000124 - ], - [ - 104.47608483200005, - 1.178290106000148 - ], - [ - 104.50814863400015, - 1.179510809000163 - ], - [ - 104.53809655000012, - 1.190252997000087 - ], - [ - 104.57203209700006, - 1.209051825000131 - ], - [ - 104.56804446700008, - 1.220160223000065 - ], - [ - 104.57569420700011, - 1.225409247000144 - ], - [ - 104.58692467500012, - 1.219916083000115 - ], - [ - 104.59253991, - 1.198797919000114 - ] - ] - ], - [ - [ - [ - 126.38542728000013, - 1.286281643000066 - ], - [ - 126.38086998800006, - 1.283392645000134 - ], - [ - 126.35906009200014, - 1.316107489000061 - ], - [ - 126.350840691, - 1.3185082050001 - ], - [ - 126.34717858200005, - 1.323309637000094 - ], - [ - 126.35238691500015, - 1.335882880000085 - ], - [ - 126.36166425900004, - 1.344712632000054 - ], - [ - 126.36963951900006, - 1.348822333000086 - ], - [ - 126.37769616, - 1.347479559000107 - ], - [ - 126.38493899800002, - 1.342189846000039 - ], - [ - 126.39486738400004, - 1.339341539000173 - ], - [ - 126.40162194100017, - 1.332017320000176 - ], - [ - 126.39039147200018, - 1.310248114000032 - ], - [ - 126.39079837300008, - 1.304022528000147 - ], - [ - 126.38542728000013, - 1.286281643000066 - ] - ] - ], - [ - [ - [ - 102.46485436300011, - 0.963446356000162 - ], - [ - 102.45687910200016, - 0.962347723000121 - ], - [ - 102.44703209700006, - 0.962958075000088 - ], - [ - 102.43751061300006, - 0.958889065000122 - ], - [ - 102.40748131600017, - 0.932847398000149 - ], - [ - 102.39966881600017, - 0.9278832050001 - ], - [ - 102.3693139980002, - 0.935207424000026 - ], - [ - 102.33375084700006, - 0.963690497000115 - ], - [ - 102.26710045700005, - 1.036851304000095 - ], - [ - 102.2513126960001, - 1.066799221000068 - ], - [ - 102.23926842500012, - 1.082098700000031 - ], - [ - 102.23292076900006, - 1.099514065000093 - ], - [ - 102.2342228520001, - 1.124212958000072 - ], - [ - 102.24268639400012, - 1.167425848000079 - ], - [ - 102.24512780000006, - 1.203924872000115 - ], - [ - 102.24187259200019, - 1.221869208000072 - ], - [ - 102.22291100400011, - 1.238023179000123 - ], - [ - 102.21257571700019, - 1.258002020000106 - ], - [ - 102.20411217500006, - 1.280829169000128 - ], - [ - 102.20101972700016, - 1.297756252000113 - ], - [ - 102.2034611340001, - 1.30654531499999 - ], - [ - 102.21265709700018, - 1.325425523000192 - ], - [ - 102.214610222, - 1.335638739000132 - ], - [ - 102.20850670700005, - 1.377183335000041 - ], - [ - 102.21062259200002, - 1.398260809000149 - ], - [ - 102.21745853000007, - 1.409165757000039 - ], - [ - 102.23121178500017, - 1.413234768000081 - ], - [ - 102.25294030000006, - 1.413804429000052 - ], - [ - 102.29086347700016, - 1.404527085000097 - ], - [ - 102.32211347700016, - 1.381496486000131 - ], - [ - 102.37574303500006, - 1.322251695000134 - ], - [ - 102.45142662900011, - 1.267279364000061 - ], - [ - 102.46705162900011, - 1.251206773000177 - ], - [ - 102.47339928500006, - 1.242010809000107 - ], - [ - 102.47950280000012, - 1.219142971000096 - ], - [ - 102.47608483200011, - 1.194525458000015 - ], - [ - 102.44743899800002, - 1.10049062700007 - ], - [ - 102.44556725400017, - 1.076157945000176 - ], - [ - 102.44743899800002, - 1.051336981000048 - ], - [ - 102.46517988400015, - 0.994818427000112 - ], - [ - 102.46802819100017, - 0.972560940000065 - ], - [ - 102.46485436300011, - 0.963446356000162 - ] - ] - ], - [ - [ - [ - 97.37452233200005, - 1.51854075700011 - ], - [ - 97.39161217500006, - 1.508937893000137 - ], - [ - 97.407481316, - 1.514064846000139 - ], - [ - 97.41675866000006, - 1.519232489000146 - ], - [ - 97.42432701900012, - 1.514878648000149 - ], - [ - 97.43799889400006, - 1.495266018000095 - ], - [ - 97.43897545700011, - 1.484605210000069 - ], - [ - 97.44166100400011, - 1.479681708000101 - ], - [ - 97.44727623800011, - 1.476874091000155 - ], - [ - 97.45997155000006, - 1.477972723000107 - ], - [ - 97.47038821700002, - 1.475653387000051 - ], - [ - 97.48170006600006, - 1.477443752000127 - ], - [ - 97.48633873800006, - 1.476548570000134 - ], - [ - 97.48780358200011, - 1.473089911000045 - ], - [ - 97.49146569100017, - 1.459784247000115 - ], - [ - 97.49317467500006, - 1.456040757 - ], - [ - 97.51685631600017, - 1.431789455000086 - ], - [ - 97.52418053500011, - 1.428127346000139 - ], - [ - 97.52808678500011, - 1.422919012000136 - ], - [ - 97.53353925900015, - 1.399847723000079 - ], - [ - 97.53988691500015, - 1.390570380000042 - ], - [ - 97.5921330090001, - 1.339911200000145 - ], - [ - 97.60474694100006, - 1.322333075000117 - ], - [ - 97.6165470710001, - 1.280910549000112 - ], - [ - 97.69361412900017, - 1.186021226000165 - ], - [ - 97.71265709700018, - 1.172674872000144 - ], - [ - 97.75733483200005, - 1.163885809000178 - ], - [ - 97.77654056100019, - 1.155096747000115 - ], - [ - 97.79224694100006, - 1.143988348000093 - ], - [ - 97.80225670700005, - 1.133286851000079 - ], - [ - 97.81902103000007, - 1.109930731000162 - ], - [ - 97.82642662900017, - 1.096258856000134 - ], - [ - 97.82943769600016, - 1.082098700000031 - ], - [ - 97.8362736340001, - 1.069973049000126 - ], - [ - 97.85279381600006, - 1.065008856000162 - ], - [ - 97.872813347, - 1.062486070000148 - ], - [ - 97.89039147200006, - 1.058172919000143 - ], - [ - 97.9044702480002, - 1.044012762000122 - ], - [ - 97.9222111340001, - 1.004339911000116 - ], - [ - 97.92847741000006, - 0.996079820000119 - ], - [ - 97.93921959700006, - 0.986070054000052 - ], - [ - 97.93441816500015, - 0.963609117000132 - ], - [ - 97.917735222, - 0.9278832050001 - ], - [ - 97.917735222, - 0.934637762000136 - ], - [ - 97.90137780000012, - 0.905951239000089 - ], - [ - 97.8982853520001, - 0.87531159100017 - ], - [ - 97.90406334700018, - 0.814886786000059 - ], - [ - 97.90186608200011, - 0.800726630000128 - ], - [ - 97.89258873800006, - 0.777044989000117 - ], - [ - 97.88453209700012, - 0.718207098000121 - ], - [ - 97.88298587300008, - 0.642971096000053 - ], - [ - 97.87427819100017, - 0.62201569200009 - ], - [ - 97.82715905000006, - 0.562689520000035 - ], - [ - 97.81934655000006, - 0.55853913 - ], - [ - 97.80925540500002, - 0.560288804 - ], - [ - 97.80030358200011, - 0.565497137000079 - ], - [ - 97.7742619150001, - 0.585191148000106 - ], - [ - 97.76417076900006, - 0.567572333000086 - ], - [ - 97.7522892590001, - 0.568345445000105 - ], - [ - 97.7264103520001, - 0.585191148000106 - ], - [ - 97.72527103000007, - 0.580755927000141 - ], - [ - 97.71534264400006, - 0.574448960000097 - ], - [ - 97.70411217500006, - 0.572739976000179 - ], - [ - 97.6961369150001, - 0.58637116100013 - ], - [ - 97.69044030000012, - 0.591620184000121 - ], - [ - 97.68384850400011, - 0.596136786000088 - ], - [ - 97.67872155000012, - 0.598863023000149 - ], - [ - 97.69092858200011, - 0.624212958 - ], - [ - 97.68384850400011, - 0.643052476000037 - ], - [ - 97.66895592500006, - 0.658758856000176 - ], - [ - 97.65821373800006, - 0.67462799700003 - ], - [ - 97.65748131600006, - 0.687241929000095 - ], - [ - 97.65919030000006, - 0.715399481000176 - ], - [ - 97.65455162900011, - 0.726060289000117 - ], - [ - 97.647715691, - 0.736314195000134 - ], - [ - 97.63306725400011, - 0.769476629999986 - ], - [ - 97.63038170700011, - 0.780747789000145 - ], - [ - 97.61378014400006, - 0.823553778000061 - ], - [ - 97.57439212300008, - 0.8609072940001 - ], - [ - 97.48633873800006, - 0.914211330000072 - ], - [ - 97.49187259200008, - 0.933010158000116 - ], - [ - 97.4793400400001, - 0.943426825000103 - ], - [ - 97.45736738400015, - 0.947984117000146 - ], - [ - 97.43506920700011, - 0.948919989000132 - ], - [ - 97.3953556650001, - 0.944891669000157 - ], - [ - 97.3888452480002, - 0.952093817000019 - ], - [ - 97.38998457100016, - 0.976263739000103 - ], - [ - 97.38770592500006, - 1.018784898000078 - ], - [ - 97.37159264400012, - 1.059759833000086 - ], - [ - 97.32178795700005, - 1.140773830000128 - ], - [ - 97.31226647200006, - 1.16693756700009 - ], - [ - 97.30827884200008, - 1.174872137000136 - ], - [ - 97.29883873800006, - 1.183254299000112 - ], - [ - 97.28785241000017, - 1.190822658000144 - ], - [ - 97.27857506600006, - 1.199693101000108 - ], - [ - 97.2713322270001, - 1.222235419000086 - ], - [ - 97.25684655000006, - 1.235012111000131 - ], - [ - 97.25359134200014, - 1.246893622000087 - ], - [ - 97.25171959700006, - 1.259222723000121 - ], - [ - 97.24724368600019, - 1.267035223000121 - ], - [ - 97.24057050900015, - 1.272406317000076 - ], - [ - 97.23308353000007, - 1.277289130000057 - ], - [ - 97.22291100400011, - 1.281887111000088 - ], - [ - 97.21265709700018, - 1.284328518000109 - ], - [ - 97.20215905000012, - 1.288316148000177 - ], - [ - 97.19157962300008, - 1.297756252000113 - ], - [ - 97.18580162900011, - 1.307766018 - ], - [ - 97.17595462300008, - 1.331854559000121 - ], - [ - 97.16822350400017, - 1.342840887000165 - ], - [ - 97.12842858200005, - 1.382635809000163 - ], - [ - 97.1072697270001, - 1.397772528000161 - ], - [ - 97.08228600400017, - 1.407619533 - ], - [ - 97.08228600400017, - 1.405340887000108 - ], - [ - 97.06861412900011, - 1.394598700000103 - ], - [ - 97.06364993600008, - 1.415228583000115 - ], - [ - 97.0804142590001, - 1.429144598000107 - ], - [ - 97.10694420700005, - 1.436021226000108 - ], - [ - 97.13062584700018, - 1.435532945000119 - ], - [ - 97.1394962900001, - 1.432196356000091 - ], - [ - 97.1507267590001, - 1.425930080000057 - ], - [ - 97.16065514400012, - 1.418280341000113 - ], - [ - 97.16480553500017, - 1.410711981000077 - ], - [ - 97.16968834700006, - 1.415961005000057 - ], - [ - 97.181407097, - 1.41644928600013 - ], - [ - 97.20582116000017, - 1.413804429000052 - ], - [ - 97.23585045700011, - 1.416693427000084 - ], - [ - 97.25782311300006, - 1.423651434000163 - ], - [ - 97.27735436300011, - 1.436224676999984 - ], - [ - 97.321055535, - 1.474066473000022 - ], - [ - 97.33073978000007, - 1.486558335000112 - ], - [ - 97.3348087900001, - 1.500148830000072 - ], - [ - 97.331797722, - 1.527818101000165 - ], - [ - 97.33545983200005, - 1.537665106000176 - ], - [ - 97.34978274800008, - 1.545396226000193 - ], - [ - 97.37452233200005, - 1.51854075700011 - ] - ] - ], - [ - [ - [ - 125.21599368600008, - 1.392726955000043 - ], - [ - 125.18531334700006, - 1.390692450000017 - ], - [ - 125.17156009200002, - 1.404486395000106 - ], - [ - 125.17465254000004, - 1.415472723000065 - ], - [ - 125.18295332099999, - 1.421332098000107 - ], - [ - 125.20492597700004, - 1.428127346000139 - ], - [ - 125.25001061300006, - 1.448635158000087 - ], - [ - 125.29509524800002, - 1.551662502000141 - ], - [ - 125.30128014400012, - 1.551662502000141 - ], - [ - 125.30128014400012, - 1.531195380000085 - ], - [ - 125.29639733200023, - 1.502752997000158 - ], - [ - 125.29509524800002, - 1.47284577 - ], - [ - 125.29175866, - 1.46527741100013 - ], - [ - 125.277110222, - 1.453070379999986 - ], - [ - 125.27393639400023, - 1.445217190000079 - ], - [ - 125.26710045700023, - 1.413804429000052 - ], - [ - 125.24838300900015, - 1.402980861000145 - ], - [ - 125.21599368600008, - 1.392726955000043 - ] - ] - ], - [ - [ - [ - 102.2376408210001, - 1.570257880000057 - ], - [ - 102.29786217500006, - 1.558498440000065 - ], - [ - 102.3282983730002, - 1.559271552000084 - ], - [ - 102.33814537900011, - 1.558498440000065 - ], - [ - 102.3489689460001, - 1.554632880000071 - ], - [ - 102.36915123800006, - 1.542303778000118 - ], - [ - 102.37916100400011, - 1.537990627000028 - ], - [ - 102.462657097, - 1.515448309000121 - ], - [ - 102.49048912900017, - 1.489691473 - ], - [ - 102.49586022200006, - 1.441799221000082 - ], - [ - 102.49586022200006, - 1.36359284100017 - ], - [ - 102.511485222, - 1.295314846000082 - ], - [ - 102.50953209700018, - 1.277289130000057 - ], - [ - 102.47877037900017, - 1.270738023000149 - ], - [ - 102.43474368600008, - 1.299139716000084 - ], - [ - 102.372325066, - 1.359849351000051 - ], - [ - 102.33025149800008, - 1.413275458000072 - ], - [ - 102.31462649800008, - 1.421332098000107 - ], - [ - 102.30469811300006, - 1.423529364000018 - ], - [ - 102.28516686300011, - 1.433335679000123 - ], - [ - 102.13453209700006, - 1.455715236000145 - ], - [ - 102.09555097700016, - 1.475246486000046 - ], - [ - 102.0569767590001, - 1.510687567000133 - ], - [ - 102.02654056100008, - 1.547674872000158 - ], - [ - 102.00440514400006, - 1.585679429 - ], - [ - 102.00782311300006, - 1.6153832050001 - ], - [ - 102.05372155000006, - 1.627346096000124 - ], - [ - 102.07243899800014, - 1.623236395000092 - ], - [ - 102.12012780000006, - 1.600734768 - ], - [ - 102.13624108200005, - 1.589544989000089 - ], - [ - 102.15235436300011, - 1.581122137000122 - ], - [ - 102.17505944100017, - 1.575751044000171 - ], - [ - 102.2376408210001, - 1.570257880000057 - ] - ] - ], - [ - [ - [ - 98.50416100400011, - 1.664943752000127 - ], - [ - 98.52100670700011, - 1.655585028000104 - ], - [ - 98.53109785200016, - 1.661444403000132 - ], - [ - 98.54053795700011, - 1.673407294000171 - ], - [ - 98.55518639400012, - 1.682033596 - ], - [ - 98.57097415500007, - 1.673081773000149 - ], - [ - 98.5906681650001, - 1.651922919000057 - ], - [ - 98.59913170700005, - 1.631984768000152 - ], - [ - 98.58106530000012, - 1.626776434000163 - ], - [ - 98.5599064460001, - 1.623602606000105 - ], - [ - 98.52881920700011, - 1.623236395000092 - ], - [ - 98.49756920700005, - 1.627264716000141 - ], - [ - 98.46485436300011, - 1.644191799000126 - ], - [ - 98.45183353000013, - 1.646226304000066 - ], - [ - 98.43995201900006, - 1.649847723000121 - ], - [ - 98.43165123800006, - 1.661525783000116 - ], - [ - 98.43018639400012, - 1.67645905200007 - ], - [ - 98.43482506600006, - 1.691961981000176 - ], - [ - 98.44564863400015, - 1.704331773000121 - ], - [ - 98.462657097, - 1.709295966000155 - ], - [ - 98.47706139400006, - 1.703599351000094 - ], - [ - 98.4881291020001, - 1.690497137000122 - ], - [ - 98.50416100400011, - 1.664943752000127 - ] - ] - ], - [ - [ - [ - 125.06169681100008, - 1.674546617000104 - ], - [ - 125.08171634200002, - 1.674383856000148 - ], - [ - 125.14763431100008, - 1.682033596 - ], - [ - 125.17530358200005, - 1.678168036000073 - ], - [ - 125.17994225400011, - 1.66742584800015 - ], - [ - 125.16529381600017, - 1.627346096000124 - ], - [ - 125.16781660199999, - 1.584784247000172 - ], - [ - 125.18783613400015, - 1.56053294500019 - ], - [ - 125.21517988400015, - 1.543931382000139 - ], - [ - 125.23975670700023, - 1.523667710000041 - ], - [ - 125.24919681100008, - 1.484686591000141 - ], - [ - 125.22022545700005, - 1.459051825000088 - ], - [ - 125.17701256600017, - 1.440171617000061 - ], - [ - 125.14429772200006, - 1.421332098000107 - ], - [ - 125.11540774800002, - 1.385199286000073 - ], - [ - 125.09620201900006, - 1.349514065000122 - ], - [ - 125.03370201900023, - 1.175441799000112 - ], - [ - 124.98658287900005, - 1.092962958000101 - ], - [ - 124.95427493600013, - 1.05353424700013 - ], - [ - 124.92115319100017, - 1.020656643000137 - ], - [ - 124.916270379, - 1.013006903000104 - ], - [ - 124.90593509200019, - 0.988104559000078 - ], - [ - 124.90398196700008, - 0.979681708000115 - ], - [ - 124.89869225400017, - 0.973049221000153 - ], - [ - 124.86304772200006, - 0.955145575000103 - ], - [ - 124.83082116000017, - 0.946437893000109 - ], - [ - 124.822032097, - 0.941473700000159 - ], - [ - 124.81446373800006, - 0.931708075000117 - ], - [ - 124.79900149800008, - 0.905747789000131 - ], - [ - 124.79102623800011, - 0.90058014500012 - ], - [ - 124.76644941499998, - 0.895005601000108 - ], - [ - 124.74634850400005, - 0.881252346000096 - ], - [ - 124.71216881600006, - 0.845282294000114 - ], - [ - 124.67872155000006, - 0.820379950000174 - ], - [ - 124.66382897200006, - 0.805609442000019 - ], - [ - 124.65430748800023, - 0.778021552000084 - ], - [ - 124.63982181100019, - 0.758449611000032 - ], - [ - 124.63648522200018, - 0.746649481000148 - ], - [ - 124.63672936300011, - 0.73175690300009 - ], - [ - 124.63607832100016, - 0.725083726000051 - ], - [ - 124.62403405000023, - 0.708156643000066 - ], - [ - 124.58790123800011, - 0.676988023000078 - ], - [ - 124.57935631600017, - 0.658189195000034 - ], - [ - 124.57325280000012, - 0.649115302000112 - ], - [ - 124.56934655000012, - 0.638861395000092 - ], - [ - 124.57211347700016, - 0.629584052000141 - ], - [ - 124.57935631600017, - 0.621039130000113 - ], - [ - 124.58220462300014, - 0.613755601000108 - ], - [ - 124.58253014400023, - 0.595445054000052 - ], - [ - 124.577891472, - 0.591620184000121 - ], - [ - 124.55632571700019, - 0.59296295800003 - ], - [ - 124.54835045700017, - 0.592027085000126 - ], - [ - 124.54411868600002, - 0.587713934000121 - ], - [ - 124.50342858200017, - 0.534002997000158 - ], - [ - 124.49976647200012, - 0.518540757000139 - ], - [ - 124.51417076900006, - 0.510077216000013 - ], - [ - 124.51417076900006, - 0.503322658000158 - ], - [ - 124.49480228000007, - 0.49628327 - ], - [ - 124.48292076900012, - 0.482896226000094 - ], - [ - 124.46583092500023, - 0.448675848000022 - ], - [ - 124.43897545700005, - 0.456447658000101 - ], - [ - 124.41456139400012, - 0.448146877000042 - ], - [ - 124.39258873800011, - 0.435003973000079 - ], - [ - 124.37330162900017, - 0.428168036000145 - ], - [ - 124.34929446700002, - 0.42279694200009 - ], - [ - 124.32178795700011, - 0.398871161000045 - ], - [ - 124.19971764400023, - 0.374090887000165 - ], - [ - 124.1505639980002, - 0.369859117000146 - ], - [ - 124.10938561300023, - 0.387193101000136 - ], - [ - 124.09734134200002, - 0.379624742000175 - ], - [ - 124.0685327480002, - 0.351874091000113 - ], - [ - 124.04135175899998, - 0.359198309000107 - ], - [ - 124.03386478000002, - 0.359320380000085 - ], - [ - 124.02393639400012, - 0.354437567000119 - ], - [ - 124.00611412900005, - 0.341457424000112 - ], - [ - 123.99626712300014, - 0.338812567000133 - ], - [ - 123.93140709700006, - 0.336249091000127 - ], - [ - 123.91089928500017, - 0.33201732000019 - ], - [ - 123.8693139980002, - 0.318304755000085 - ], - [ - 123.85889733200011, - 0.31704336100016 - ], - [ - 123.82496178500017, - 0.318304755000085 - ], - [ - 123.80730228000007, - 0.310858466000099 - ], - [ - 123.79053795700023, - 0.301255601000037 - ], - [ - 123.781993035, - 0.298570054000137 - ], - [ - 123.77051842500018, - 0.302069403000047 - ], - [ - 123.75806725400005, - 0.30752187700007 - ], - [ - 123.74577884200019, - 0.310858466000099 - ], - [ - 123.72461998800011, - 0.308823960000069 - ], - [ - 123.68970787900017, - 0.294501044000086 - ], - [ - 123.65650475400017, - 0.288275458000129 - ], - [ - 123.64698326900023, - 0.281642971000153 - ], - [ - 123.63249759200019, - 0.266506252000156 - ], - [ - 123.62598717500012, - 0.266587632000139 - ], - [ - 123.616465691, - 0.272040106000091 - ], - [ - 123.58423912900017, - 0.297593492000161 - ], - [ - 123.57105553500006, - 0.303615627000084 - ], - [ - 123.46631920700005, - 0.312323309000149 - ], - [ - 123.4446720710001, - 0.310858466000099 - ], - [ - 123.40723717500023, - 0.300441799000026 - ], - [ - 123.39014733200011, - 0.29783763200011 - ], - [ - 123.29200280000012, - 0.308335679000081 - ], - [ - 123.25912519600004, - 0.320868231000091 - ], - [ - 123.24610436300023, - 0.322088934000107 - ], - [ - 123.23878014400023, - 0.324530341000127 - ], - [ - 123.23503665500019, - 0.328924872000115 - ], - [ - 123.22706139400023, - 0.342678127000127 - ], - [ - 123.22193444100006, - 0.345648505000142 - ], - [ - 123.21558678500011, - 0.352769273000106 - ], - [ - 123.19092858200011, - 0.390326239000103 - ], - [ - 123.18669681100019, - 0.39386627800009 - ], - [ - 123.16773522200018, - 0.393052476000165 - ], - [ - 123.16358483200023, - 0.396795966000028 - ], - [ - 123.16179446700002, - 0.401353257000068 - ], - [ - 123.13257897200012, - 0.44757721600007 - ], - [ - 123.08936608200011, - 0.494289455000143 - ], - [ - 123.07422936300011, - 0.516302802000055 - ], - [ - 123.06739342500006, - 0.516302802000055 - ], - [ - 123.0540470710001, - 0.50096263200011 - ], - [ - 123.03248131600017, - 0.491359768000123 - ], - [ - 122.97787519600004, - 0.48281484600011 - ], - [ - 122.83073978000007, - 0.4923363300001 - ], - [ - 122.73829186300023, - 0.481675523000078 - ], - [ - 122.69410241000017, - 0.48281484600011 - ], - [ - 122.68230228000019, - 0.488592841000155 - ], - [ - 122.66293378999998, - 0.515692450000103 - ], - [ - 122.64966881600017, - 0.52383047100011 - ], - [ - 122.655528191, - 0.492865302 - ], - [ - 122.65316816500015, - 0.480414130000071 - ], - [ - 122.63941491000006, - 0.475327867000132 - ], - [ - 122.62224368600019, - 0.476548570000148 - ], - [ - 122.60808353000019, - 0.480861721000068 - ], - [ - 122.59685306100019, - 0.489447333000072 - ], - [ - 122.58301842500006, - 0.494330145000134 - ], - [ - 122.56592858200023, - 0.496527411000045 - ], - [ - 122.32439212300002, - 0.497056382000025 - ], - [ - 122.31251061300011, - 0.494859117000033 - ], - [ - 122.29314212300008, - 0.485052802000084 - ], - [ - 122.283457879, - 0.48281484600011 - ], - [ - 122.20720462300008, - 0.483832098000079 - ], - [ - 122.19711347699999, - 0.48281484600011 - ], - [ - 122.18832441500004, - 0.479681708000044 - ], - [ - 122.17286217500012, - 0.470933335000055 - ], - [ - 122.16635175900004, - 0.469183661000059 - ], - [ - 122.14454186300017, - 0.471258856000176 - ], - [ - 122.10425866000017, - 0.480698960000012 - ], - [ - 122.03777103000007, - 0.482123114000075 - ], - [ - 122.01970462300002, - 0.477118231000119 - ], - [ - 122.00416100400005, - 0.454901434000163 - ], - [ - 121.98511803500006, - 0.448431708000072 - ], - [ - 121.89291425899998, - 0.435451565000065 - ], - [ - 121.84083092500023, - 0.434393622000115 - ], - [ - 121.80046634200019, - 0.426459052000141 - ], - [ - 121.78630618600008, - 0.428168036000145 - ], - [ - 121.77947024800002, - 0.4331729190001 - ], - [ - 121.7325952480002, - 0.499945380000142 - ], - [ - 121.71550540500007, - 0.51508209800005 - ], - [ - 121.69011478000002, - 0.52383047100011 - ], - [ - 121.67644290500019, - 0.523260809000135 - ], - [ - 121.64503014400023, - 0.517157294000157 - ], - [ - 121.63599694100006, - 0.516302802000055 - ], - [ - 121.62378991000017, - 0.522528387000108 - ], - [ - 121.61736087300008, - 0.531317450000088 - ], - [ - 121.61166425899998, - 0.541408596000139 - ], - [ - 121.60189863400015, - 0.551743882000054 - ], - [ - 121.59669030000023, - 0.539007880000099 - ], - [ - 121.58773847700004, - 0.532863674000126 - ], - [ - 121.57447350400017, - 0.530747789000117 - ], - [ - 121.55665123800011, - 0.530585028000061 - ], - [ - 121.54460696700019, - 0.533677476000136 - ], - [ - 121.535899285, - 0.538397528000132 - ], - [ - 121.52833092500018, - 0.537420966000155 - ], - [ - 121.51872806100019, - 0.52383047100011 - ], - [ - 121.51490319100017, - 0.510402736000117 - ], - [ - 121.51270592500006, - 0.497056382000025 - ], - [ - 121.50782311300011, - 0.486802476000179 - ], - [ - 121.49512780000023, - 0.48281484600011 - ], - [ - 121.47852623800011, - 0.482082424000083 - ], - [ - 121.46534264400023, - 0.479641018000052 - ], - [ - 121.45411217500023, - 0.475327867000132 - ], - [ - 121.44361412900017, - 0.469183661000059 - ], - [ - 121.42676842500018, - 0.482367255000113 - ], - [ - 121.41334069100017, - 0.483099677000141 - ], - [ - 121.39698326900017, - 0.478461005000028 - ], - [ - 121.36133873800011, - 0.473211981000119 - ], - [ - 121.34205162900017, - 0.463853257000011 - ], - [ - 121.33033287900017, - 0.461737372000172 - ], - [ - 121.31967207100016, - 0.464748440000093 - ], - [ - 121.29639733200023, - 0.478583075000174 - ], - [ - 121.28589928500017, - 0.48281484600011 - ], - [ - 121.26059004000004, - 0.482489325000088 - ], - [ - 121.220469597, - 0.465969143000109 - ], - [ - 121.20020592500012, - 0.461737372000172 - ], - [ - 121.17969811300023, - 0.461004950000145 - ], - [ - 121.163828972, - 0.457464911000073 - ], - [ - 121.14991295700023, - 0.449286200000074 - ], - [ - 121.13510175900015, - 0.434393622000115 - ], - [ - 121.12501061300011, - 0.417629299000097 - ], - [ - 121.11915123800017, - 0.411444403000118 - ], - [ - 121.10792076900023, - 0.407131252000113 - ], - [ - 121.09913170700011, - 0.407375393000066 - ], - [ - 121.06316165500013, - 0.413967190000051 - ], - [ - 121.04737389400006, - 0.418931382000096 - ], - [ - 121.01978600400005, - 0.442043361000131 - ], - [ - 121.00489342500012, - 0.448675848000022 - ], - [ - 120.98698978000007, - 0.44700755400001 - ], - [ - 120.95533287900017, - 0.431870835000012 - ], - [ - 120.89242597700004, - 0.423325914000159 - ], - [ - 120.87647545700011, - 0.424505927000098 - ], - [ - 120.86068769600016, - 0.434393622000115 - ], - [ - 120.85670006600012, - 0.440863348000107 - ], - [ - 120.85181725400005, - 0.45575592700007 - ], - [ - 120.84717858200011, - 0.461737372000172 - ], - [ - 120.83961022200006, - 0.46409739800005 - ], - [ - 120.80933678500006, - 0.469183661000059 - ], - [ - 120.80543053500017, - 0.472357489000117 - ], - [ - 120.80258222700004, - 0.479396877000013 - ], - [ - 120.79786217500012, - 0.486476955000157 - ], - [ - 120.78882897200012, - 0.489650783000116 - ], - [ - 120.77719160199999, - 0.488104559000178 - ], - [ - 120.76002037900017, - 0.482611395000063 - ], - [ - 120.75082441499998, - 0.48281484600011 - ], - [ - 120.73015384200008, - 0.493475653000132 - ], - [ - 120.69857832099999, - 0.524155992000132 - ], - [ - 120.67953535199999, - 0.530585028000061 - ], - [ - 120.50269616, - 0.528876044000057 - ], - [ - 120.48609459700006, - 0.524237372000115 - ], - [ - 120.40886478000002, - 0.48574453300013 - ], - [ - 120.39161217500012, - 0.48281484600011 - ], - [ - 120.375254754, - 0.477687893 - ], - [ - 120.36182701900012, - 0.465643622000087 - ], - [ - 120.35075931100019, - 0.451971747000144 - ], - [ - 120.34009850400005, - 0.441880601000165 - ], - [ - 120.31470787900005, - 0.423163153000104 - ], - [ - 120.27295983200011, - 0.378119208000129 - ], - [ - 120.21452884200019, - 0.291937567000076 - ], - [ - 120.15821373800023, - 0.227769273000121 - ], - [ - 120.13331139400012, - 0.191229559000092 - ], - [ - 120.12842858200023, - 0.181097723000121 - ], - [ - 120.12134850400017, - 0.145168361000145 - ], - [ - 120.11752363400015, - 0.136786200000174 - ], - [ - 120.10385175900004, - 0.117254950000103 - ], - [ - 120.09848066500015, - 0.09699127800009 - ], - [ - 120.09424889400023, - 0.051418361000131 - ], - [ - 120.08423912900017, - 0.006252346000011 - ], - [ - 120.07545006600012, - -0.016412041999871 - ], - [ - 120.06283613400004, - -0.034519138999869 - ], - [ - 120.02849368600008, - -0.061822197999859 - ], - [ - 120.02295983200023, - -0.070977471999925 - ], - [ - 120.02230878999998, - -0.081719658999859 - ], - [ - 120.02475019600004, - -0.106784763999855 - ], - [ - 120.01889082099999, - -0.15252044099995 - ], - [ - 120.01197350400017, - -0.175225518999909 - ], - [ - 120.00147545700011, - -0.192152601999894 - ], - [ - 119.99561608200005, - -0.209242445999934 - ], - [ - 119.99659264400023, - -0.234307549999926 - ], - [ - 120.01856530000023, - -0.363457940999936 - ], - [ - 120.02491295700011, - -0.384047132999967 - ], - [ - 120.05298912900011, - -0.419366143999909 - ], - [ - 120.05941816500004, - -0.44198984199987 - ], - [ - 120.05746504000015, - -0.452406507999868 - ], - [ - 120.048106316, - -0.472751559999864 - ], - [ - 120.04574629000015, - -0.483005466999884 - ], - [ - 120.04786217500006, - -0.49374765399989 - ], - [ - 120.05730228000019, - -0.517185153999876 - ], - [ - 120.07309004000015, - -0.613946221999882 - ], - [ - 120.08920332100004, - -0.65732187299993 - ], - [ - 120.243907097, - -0.88762786299985 - ], - [ - 120.25562584700012, - -0.899346612999921 - ], - [ - 120.30274498800011, - -0.932305596999896 - ], - [ - 120.32553144600004, - -0.938653252999842 - ], - [ - 120.34791100400005, - -0.927504164999917 - ], - [ - 120.36890709700018, - -0.911065362999821 - ], - [ - 120.38786868600019, - -0.901299737999963 - ], - [ - 120.41244550900004, - -0.904961846999839 - ], - [ - 120.42579186300011, - -0.920017184999935 - ], - [ - 120.43490644600004, - -0.94036223799985 - ], - [ - 120.44678795700017, - -0.960056247999887 - ], - [ - 120.45508873800023, - -0.965997002999899 - ], - [ - 120.46517988400004, - -0.96900807099999 - ], - [ - 120.48780358200005, - -0.970310153999989 - ], - [ - 120.50033613400015, - -0.975274346999868 - ], - [ - 120.50814863400015, - -0.987074476999837 - ], - [ - 120.51807701900017, - -1.011163018999852 - ], - [ - 120.58236738399998, - -1.105238539999888 - ], - [ - 120.58676191500015, - -1.116631768999852 - ], - [ - 120.58790123800011, - -1.128594658999873 - ], - [ - 120.58375084700006, - -1.138116143999881 - ], - [ - 120.57699629000004, - -1.146742445999962 - ], - [ - 120.57545006600017, - -1.154392184999907 - ], - [ - 120.57536868600019, - -1.163344007999925 - ], - [ - 120.57349694100006, - -1.176364841999913 - ], - [ - 120.56690514400017, - -1.201429945999919 - ], - [ - 120.56544030000012, - -1.215508721999868 - ], - [ - 120.57243899800008, - -1.227715752999927 - ], - [ - 120.619395379, - -1.280450127999842 - ], - [ - 120.63086998800017, - -1.300469658999901 - ], - [ - 120.63917076900023, - -1.341241143999952 - ], - [ - 120.64893639400006, - -1.364353122999916 - ], - [ - 120.66187584700018, - -1.384860934999878 - ], - [ - 120.67595462300014, - -1.394707940999893 - ], - [ - 120.73731530000012, - -1.367445570999905 - ], - [ - 120.73731530000012, - -1.360609632999967 - ], - [ - 120.80388431100013, - -1.342868747999972 - ], - [ - 120.83008873800023, - -1.340101820999919 - ], - [ - 120.83277428500006, - -1.344821872999844 - ], - [ - 120.82667076900023, - -1.377699476999837 - ], - [ - 120.83204186300011, - -1.384454033999873 - ], - [ - 120.84441165500002, - -1.389580987999963 - ], - [ - 120.86768639400023, - -1.394707940999893 - ], - [ - 120.889903191, - -1.395277601999865 - ], - [ - 120.957774285, - -1.386895440999893 - ], - [ - 120.97657311300023, - -1.382094007999825 - ], - [ - 120.98780358200017, - -1.381117445999934 - ], - [ - 120.99830162900005, - -1.385918877999828 - ], - [ - 121.02247155000023, - -1.408379815999837 - ], - [ - 121.03272545700017, - -1.415785414999917 - ], - [ - 121.07325280000006, - -1.421319268999923 - ], - [ - 121.10547936300011, - -1.405857028999904 - ], - [ - 121.13054446700014, - -1.37981536299985 - ], - [ - 121.16700280000006, - -1.322930596999896 - ], - [ - 121.17400149800008, - -1.305433851999851 - ], - [ - 121.17847741000006, - -1.268161716999884 - ], - [ - 121.18970787900005, - -1.22136809699991 - ], - [ - 121.19711347700004, - -1.202894789999888 - ], - [ - 121.20655358200023, - -1.191338799999855 - ], - [ - 121.22282962300008, - -1.175388278999847 - ], - [ - 121.24097741000017, - -1.161228122999916 - ], - [ - 121.25562584700018, - -1.155205987999821 - ], - [ - 121.26677493600019, - -1.148614190999851 - ], - [ - 121.27686608200017, - -1.132907809999963 - ], - [ - 121.29216556100013, - -1.100518487999878 - ], - [ - 121.31836998800023, - -1.067152601999808 - ], - [ - 121.37452233200017, - -1.020684502999856 - ], - [ - 121.42994225400005, - -0.93377044099995 - ], - [ - 121.45248457100004, - -0.905694268999866 - ], - [ - 121.50066165500007, - -0.859307549999897 - ], - [ - 121.51596113400004, - -0.850274346999882 - ], - [ - 121.53614342500023, - -0.846774997999901 - ], - [ - 121.57781009200019, - -0.846774997999901 - ], - [ - 121.58521569100012, - -0.84270598799985 - ], - [ - 121.58594811300023, - -0.832940362999892 - ], - [ - 121.58513431100013, - -0.82170989399998 - ], - [ - 121.58765709700006, - -0.812595309999907 - ], - [ - 121.59489993600008, - -0.808282158999987 - ], - [ - 121.62012780000012, - -0.800388278999932 - ], - [ - 121.62916100400005, - -0.798923434999878 - ], - [ - 121.64063561300006, - -0.800957940999893 - ], - [ - 121.648692254, - -0.805596612999835 - ], - [ - 121.65479576900012, - -0.810316664999931 - ], - [ - 121.65967858200005, - -0.812595309999907 - ], - [ - 121.66065514400023, - -0.873223565999879 - ], - [ - 121.66285241000006, - -0.88762786299985 - ], - [ - 121.69011478000002, - -0.908786716999856 - ], - [ - 121.69996178500006, - -0.923435153999861 - ], - [ - 121.70720462300008, - -0.931735934999935 - ], - [ - 121.71420332100016, - -0.935479424999954 - ], - [ - 121.79997806100019, - -0.935479424999954 - ], - [ - 121.84538821700019, - -0.94101327899989 - ], - [ - 121.88697350400017, - -0.951348565999979 - ], - [ - 121.92603600400005, - -0.955336195999877 - ], - [ - 121.96371504000004, - -0.942966403999932 - ], - [ - 121.99952233200011, - -0.922051690999879 - ], - [ - 122.01856530000012, - -0.916761976999894 - ], - [ - 122.043223504, - -0.914971612999906 - ], - [ - 122.06641686300023, - -0.919528903999947 - ], - [ - 122.08570397200018, - -0.926446221999868 - ], - [ - 122.10531660200004, - -0.926202080999914 - ], - [ - 122.12891686300006, - -0.908786716999856 - ], - [ - 122.14136803500011, - -0.886814059999921 - ], - [ - 122.15284264400023, - -0.853204033999901 - ], - [ - 122.159434441, - -0.820000908999887 - ], - [ - 122.15626061300023, - -0.798923434999878 - ], - [ - 122.193614129, - -0.768975518999895 - ], - [ - 122.20769290500007, - -0.764743747999887 - ], - [ - 122.41016686300011, - -0.757500908999944 - ], - [ - 122.45101972700004, - -0.750583591999856 - ], - [ - 122.48747806100019, - -0.749688408999873 - ], - [ - 122.55713951900006, - -0.768161716999884 - ], - [ - 122.594981316, - -0.764743747999887 - ], - [ - 122.60059655000012, - -0.761407158999859 - ], - [ - 122.60572350400005, - -0.756524346999967 - ], - [ - 122.61247806100008, - -0.752211195999877 - ], - [ - 122.62232506600017, - -0.750583591999856 - ], - [ - 122.63575280000006, - -0.753838799999897 - ], - [ - 122.6564233730002, - -0.767754815999879 - ], - [ - 122.68336022200018, - -0.775567315999879 - ], - [ - 122.69890384200008, - -0.784926039999903 - ], - [ - 122.71648196700019, - -0.792413018999881 - ], - [ - 122.73902428500017, - -0.791436455999985 - ], - [ - 122.7874455090001, - -0.77369557099999 - ], - [ - 122.91244550900015, - -0.762872002999913 - ], - [ - 122.92904707100004, - -0.758884372999844 - ], - [ - 122.94450931100002, - -0.750583591999856 - ], - [ - 122.95972741, - -0.737074476999879 - ], - [ - 122.96021569100017, - -0.730564059999892 - ], - [ - 122.89730879000015, - -0.716403903999876 - ], - [ - 122.89405358200011, - -0.712579033999859 - ], - [ - 122.88624108200011, - -0.699395440999908 - ], - [ - 122.88298587300008, - -0.695896091999913 - ], - [ - 122.86784915500007, - -0.692803643999838 - ], - [ - 122.78012129000015, - -0.686618747999859 - ], - [ - 122.76644941500004, - -0.683038018999895 - ], - [ - 122.75269616, - -0.67603932099999 - ], - [ - 122.74170983200017, - -0.668064059999864 - ], - [ - 122.73324629000004, - -0.657972914999974 - ], - [ - 122.734629754, - -0.648370049999912 - ], - [ - 122.75269616, - -0.641289971999939 - ], - [ - 122.76563561300023, - -0.649834893999881 - ], - [ - 122.77930748800017, - -0.646254164999903 - ], - [ - 122.80738366000017, - -0.627618096999825 - ], - [ - 122.81275475400005, - -0.622247002999856 - ], - [ - 122.81739342500023, - -0.615492445999919 - ], - [ - 122.82300866000006, - -0.612237237999878 - ], - [ - 122.83887780000006, - -0.620538018999852 - ], - [ - 122.84644616000006, - -0.619235934999864 - ], - [ - 122.85254967500012, - -0.615329684999864 - ], - [ - 122.85499108200023, - -0.610528252999956 - ], - [ - 122.94304446700008, - -0.605075778999932 - ], - [ - 122.96436608200023, - -0.599704684999878 - ], - [ - 122.97608483200023, - -0.607191664999931 - ], - [ - 122.9943139980002, - -0.608005466999941 - ], - [ - 123.01295006600017, - -0.604424737999878 - ], - [ - 123.02637780000006, - -0.599704684999878 - ], - [ - 123.03825931100002, - -0.589613539999903 - ], - [ - 123.05005944100012, - -0.566989841999856 - ], - [ - 123.06055748800006, - -0.558689059999864 - ], - [ - 123.07585696700002, - -0.556410414999888 - ], - [ - 123.23951256600006, - -0.570489190999837 - ], - [ - 123.27369225400005, - -0.583265882999882 - ], - [ - 123.34180748800006, - -0.62021249799993 - ], - [ - 123.40349368600019, - -0.642673434999921 - ], - [ - 123.41732832100004, - -0.654880466999899 - ], - [ - 123.40593509200002, - -0.668389580999886 - ], - [ - 123.40381920700023, - -0.67253997199991 - ], - [ - 123.40593509200002, - -0.677911065999879 - ], - [ - 123.41529381600017, - -0.686944268999881 - ], - [ - 123.41732832100004, - -0.692803643999838 - ], - [ - 123.41944420700011, - -0.702732028999932 - ], - [ - 123.42530358200017, - -0.708428643999824 - ], - [ - 123.43409264400023, - -0.710625908999987 - ], - [ - 123.4446720710001, - -0.709567966999856 - ], - [ - 123.43848717500012, - -0.730401299999841 - ], - [ - 123.45435631600006, - -0.758233330999971 - ], - [ - 123.44044030000023, - -0.792901299999869 - ], - [ - 123.44483483200023, - -0.833103122999859 - ], - [ - 123.43783613400015, - -0.853610934999907 - ], - [ - 123.409922722, - -0.880303643999838 - ], - [ - 123.40015709700018, - -0.894789320999891 - ], - [ - 123.38965905000012, - -0.98365650799991 - ], - [ - 123.38331139400006, - -1.003676039999888 - ], - [ - 123.35238691500004, - -1.039727471999853 - ], - [ - 123.31120853000007, - -1.051446221999839 - ], - [ - 123.26978600400005, - -1.044610283999916 - ], - [ - 123.23878014400023, - -1.024834893999895 - ], - [ - 123.21094811300006, - -0.983330987999977 - ], - [ - 123.20101972700016, - -0.976983330999872 - ], - [ - 123.19629967500023, - -0.970391533999972 - ], - [ - 123.14991295700011, - -0.935479424999954 - ], - [ - 123.1477970710001, - -0.922946872999873 - ], - [ - 123.15552819100017, - -0.898125908999916 - ], - [ - 123.15674889400012, - -0.88762786299985 - ], - [ - 123.15088951900017, - -0.872979424999841 - ], - [ - 123.14087975400017, - -0.862237237999821 - ], - [ - 123.11890709700018, - -0.842950127999885 - ], - [ - 123.09620201900012, - -0.835056247999901 - ], - [ - 123.060801629, - -0.880547783999887 - ], - [ - 123.04004967500012, - -0.880791924999826 - ], - [ - 123.00945071700019, - -0.893731377999842 - ], - [ - 122.91700280000012, - -0.89959075299987 - ], - [ - 122.87614993600008, - -0.908786716999856 - ], - [ - 122.83871504000004, - -0.899183851999865 - ], - [ - 122.81169681100008, - -0.924086195999905 - ], - [ - 122.76970462300008, - -1.019789320999863 - ], - [ - 122.76075280000023, - -1.03435637799997 - ], - [ - 122.73560631600017, - -1.062676690999922 - ], - [ - 122.73047936300017, - -1.070000908999845 - ], - [ - 122.72706139400023, - -1.078545830999857 - ], - [ - 122.72527103000007, - -1.087660414999945 - ], - [ - 122.72478274800008, - -1.097100518999952 - ], - [ - 122.72095787900017, - -1.109063408999901 - ], - [ - 122.71208743600013, - -1.114353122999958 - ], - [ - 122.70069420700023, - -1.116875908999972 - ], - [ - 122.69068444100017, - -1.121026299999841 - ], - [ - 122.66163170700011, - -1.142836195999877 - ], - [ - 122.6482853520001, - -1.159437757999839 - ], - [ - 122.63843834700006, - -1.20614999799993 - ], - [ - 122.62647545700023, - -1.218438408999887 - ], - [ - 122.588145379, - -1.237074476999879 - ], - [ - 122.57211347700004, - -1.253187757999854 - ], - [ - 122.52955162900017, - -1.316013278999904 - ], - [ - 122.51197350400005, - -1.326592705999943 - ], - [ - 122.50269616000017, - -1.333754164999903 - ], - [ - 122.49878991000017, - -1.343194268999824 - ], - [ - 122.49610436300011, - -1.352959893999852 - ], - [ - 122.48292076900023, - -1.375095309999921 - ], - [ - 122.478282097, - -1.381117445999934 - ], - [ - 122.40601647200006, - -1.446221612999878 - ], - [ - 122.38209069100017, - -1.478692315999865 - ], - [ - 122.36882571700008, - -1.492771091999899 - ], - [ - 122.30632571700014, - -1.524346612999892 - ], - [ - 122.23316491000006, - -1.57431406 - ], - [ - 122.20053144599999, - -1.604180596999825 - ], - [ - 122.18392988400015, - -1.614190362999892 - ], - [ - 122.17188561300023, - -1.609795830999914 - ], - [ - 122.15984134200014, - -1.600192966999927 - ], - [ - 122.14323978000007, - -1.594008070999877 - ], - [ - 122.12403405000012, - -1.597588799999841 - ], - [ - 122.08350670700005, - -1.61679452899989 - ], - [ - 122.06373131600006, - -1.621270440999865 - ], - [ - 122.05404707099999, - -1.619805596999981 - ], - [ - 122.03646894600016, - -1.613946221999853 - ], - [ - 122.02588951900012, - -1.614434502999842 - ], - [ - 122.01856530000012, - -1.618096612999977 - ], - [ - 122.01392662900017, - -1.623630466999913 - ], - [ - 122.01026451900023, - -1.629652601999823 - ], - [ - 122.00538170700005, - -1.634942315999979 - ], - [ - 121.97364342500012, - -1.655368747999873 - ], - [ - 121.95476321700008, - -1.663832289999903 - ], - [ - 121.94320722700016, - -1.662286065999865 - ], - [ - 121.91928144599999, - -1.673028252999885 - ], - [ - 121.90137780000023, - -1.675469658999916 - ], - [ - 121.86133873800011, - -1.66969166499986 - ], - [ - 121.85613040500019, - -1.688083591999899 - ], - [ - 121.84766686300017, - -1.690199476999823 - ], - [ - 121.83122806100008, - -1.701918226999808 - ], - [ - 121.82016035200004, - -1.707614841999884 - ], - [ - 121.81039472699999, - -1.710137627999899 - ], - [ - 121.798594597, - -1.71795012799997 - ], - [ - 121.79004967500012, - -1.73642343499999 - ], - [ - 121.78003991, - -1.772149346999853 - ], - [ - 121.75513756600017, - -1.833754164999888 - ], - [ - 121.739024285, - -1.8617489559999 - ], - [ - 121.71802819100017, - -1.888278903999876 - ], - [ - 121.69214928500006, - -1.908135674999869 - ], - [ - 121.66114342500012, - -1.920668226999879 - ], - [ - 121.62769616000017, - -1.927341403999918 - ], - [ - 121.56251061300023, - -1.930596612999878 - ], - [ - 121.55298912900017, - -1.929131768999824 - ], - [ - 121.54004967500023, - -1.923435153999932 - ], - [ - 121.53451582100004, - -1.916599216999913 - ], - [ - 121.53052819100006, - -1.908379815999908 - ], - [ - 121.51156660200004, - -1.883558851999865 - ], - [ - 121.50473066500004, - -1.876722914999931 - ], - [ - 121.49512780000023, - -1.873955987999878 - ], - [ - 121.49146569100012, - -1.871677341999913 - ], - [ - 121.45671634200002, - -1.86093515399989 - ], - [ - 121.44507897200006, - -1.841566664999874 - ], - [ - 121.44516035200004, - -1.825616143999866 - ], - [ - 121.44092858200011, - -1.813571872999944 - ], - [ - 121.416270379, - -1.805759372999873 - ], - [ - 121.37134850400011, - -1.805759372999873 - ], - [ - 121.36459394600016, - -1.802341403999861 - ], - [ - 121.35450280000006, - -1.785577080999843 - ], - [ - 121.34742272200006, - -1.778985283999859 - ], - [ - 121.31185957100016, - -1.782891533999944 - ], - [ - 121.29607181100013, - -1.816664321000019 - ], - [ - 121.30420983200023, - -1.846937757999925 - ], - [ - 121.340586785, - -1.839776299999897 - ], - [ - 121.34571373800023, - -1.855726820999905 - ], - [ - 121.34009850400005, - -1.875664971999882 - ], - [ - 121.33139082100004, - -1.897556248 - ], - [ - 121.32699629000015, - -1.919040622999859 - ], - [ - 121.32911217500018, - -1.927911065999979 - ], - [ - 121.33838951900012, - -1.937595309999864 - ], - [ - 121.340586785, - -1.946547132999967 - ], - [ - 121.340586785, - -1.991306247999916 - ], - [ - 121.351328972, - -1.984144789999888 - ], - [ - 121.36085045700023, - -1.975844007999896 - ], - [ - 121.36866295700011, - -1.966566664999945 - ], - [ - 121.37476647200012, - -1.957126559999935 - ], - [ - 121.37956790500019, - -1.942966403999904 - ], - [ - 121.38249759200019, - -1.928887627999956 - ], - [ - 121.38843834700006, - -1.917168877999885 - ], - [ - 121.40202884200019, - -1.909356377999885 - ], - [ - 121.41456139400012, - -1.927341403999918 - ], - [ - 121.43628991000017, - -1.980157158999987 - ], - [ - 121.46664472700004, - -2.000909112999906 - ], - [ - 121.47787519600004, - -2.020277601999823 - ], - [ - 121.49146569100012, - -2.035332940999837 - ], - [ - 121.51189212300008, - -2.03232187299993 - ], - [ - 121.53532962300002, - -2.058770440999822 - ], - [ - 121.55502363399998, - -2.133965752999913 - ], - [ - 121.57455488400015, - -2.1625302059999 - ], - [ - 121.61768639400006, - -2.177992445999919 - ], - [ - 121.659922722, - -2.176690362999835 - ], - [ - 121.70085696700002, - -2.180352471999882 - ], - [ - 121.739024285, - -2.211032809999878 - ], - [ - 121.76693769600016, - -2.241631768999895 - ], - [ - 121.82292728000019, - -2.287286065999837 - ], - [ - 121.84766686300017, - -2.320896091999856 - ], - [ - 121.86475670700011, - -2.358493747999859 - ], - [ - 121.87208092500012, - -2.380303643999895 - ], - [ - 121.87501061300023, - -2.398695570999934 - ], - [ - 121.88257897200018, - -2.413344007999854 - ], - [ - 121.92969811300006, - -2.462985934999864 - ], - [ - 121.96550540500019, - -2.518243096999882 - ], - [ - 121.97787519600004, - -2.553969007999825 - ], - [ - 122.00928795700017, - -2.593519789999945 - ], - [ - 122.01905358200011, - -2.615004164999888 - ], - [ - 122.01921634200008, - -2.635430596999868 - ], - [ - 122.01335696700014, - -2.680922132999839 - ], - [ - 122.01563561300011, - -2.693536065999822 - ], - [ - 122.05990644600016, - -2.744805596999853 - ], - [ - 122.08383222699999, - -2.763929945999919 - ], - [ - 122.09896894599999, - -2.770277601999851 - ], - [ - 122.13705488399998, - -2.775485934999935 - ], - [ - 122.14576256600017, - -2.778741143999895 - ], - [ - 122.14942467500012, - -2.782647393999895 - ], - [ - 122.1526798840001, - -2.794122002999842 - ], - [ - 122.16049238400015, - -2.798760674999869 - ], - [ - 122.16968834700006, - -2.801364841999856 - ], - [ - 122.17725670700011, - -2.806817315999979 - ], - [ - 122.18165123800006, - -2.822930596999953 - ], - [ - 122.185313347, - -2.845798434999878 - ], - [ - 122.19263756600006, - -2.86630624799993 - ], - [ - 122.20769290500007, - -2.875176690999879 - ], - [ - 122.245371941, - -2.875258070999863 - ], - [ - 122.26612389400012, - -2.879164320999948 - ], - [ - 122.28711998800017, - -2.888767184999921 - ], - [ - 122.31251061300011, - -2.926853122999916 - ], - [ - 122.29444420700005, - -2.964532158999901 - ], - [ - 122.27084394600004, - -3.002129815999979 - ], - [ - 122.27963300899998, - -3.039646091999913 - ], - [ - 122.286875847, - -3.044691664999945 - ], - [ - 122.313731316, - -3.060153903999876 - ], - [ - 122.38591556100019, - -3.132012627999927 - ], - [ - 122.39437910200004, - -3.133477471999981 - ], - [ - 122.40699303500006, - -3.127618096999853 - ], - [ - 122.4200952480002, - -3.119561455999829 - ], - [ - 122.43043053500011, - -3.114678643999937 - ], - [ - 122.433848504, - -3.12859465899983 - ], - [ - 122.43873131600017, - -3.140069268999881 - ], - [ - 122.44613691500015, - -3.149346612999835 - ], - [ - 122.45728600400017, - -3.156345309999907 - ], - [ - 122.46753991, - -3.148207289999974 - ], - [ - 122.47291100400017, - -3.151136976999823 - ], - [ - 122.47217858200023, - -3.161797783999845 - ], - [ - 122.46469160200016, - -3.176853122999859 - ], - [ - 122.45915774800008, - -3.1801083309999 - ], - [ - 122.44263756600017, - -3.18523528399983 - ], - [ - 122.43669681100008, - -3.190362237999835 - ], - [ - 122.43539472700016, - -3.19638437299993 - ], - [ - 122.43718509200002, - -3.211195570999905 - ], - [ - 122.43669681100008, - -3.217705987999906 - ], - [ - 122.43360436300017, - -3.234551690999908 - ], - [ - 122.43295332100004, - -3.243096612999921 - ], - [ - 122.42920983200005, - -3.245863539999974 - ], - [ - 122.41627037900017, - -3.245700778999918 - ], - [ - 122.41879316499998, - -3.243747653999876 - ], - [ - 122.41342207100004, - -3.238946221999896 - ], - [ - 122.40259850400005, - -3.232028903999975 - ], - [ - 122.39535566500004, - -3.230238539999988 - ], - [ - 122.38982181100019, - -3.231703382999953 - ], - [ - 122.38575280000023, - -3.234958591999913 - ], - [ - 122.38266035200016, - -3.238213799999869 - ], - [ - 122.35792076900006, - -3.217543226999851 - ], - [ - 122.33936608200005, - -3.237562757999825 - ], - [ - 122.32129967500023, - -3.257094007999896 - ], - [ - 122.29566491000017, - -3.312920830999957 - ], - [ - 122.30355879000015, - -3.341241143999909 - ], - [ - 122.31690514400006, - -3.344821872999972 - ], - [ - 122.35938561300023, - -3.363457940999879 - ], - [ - 122.37256920700011, - -3.372247002999842 - ], - [ - 122.380625847, - -3.391534112999963 - ], - [ - 122.38363691500004, - -3.41863372199991 - ], - [ - 122.37842858200023, - -3.438734632999854 - ], - [ - 122.36158287900005, - -3.437432549999855 - ], - [ - 122.36890709700006, - -3.425713799999954 - ], - [ - 122.36198978000002, - -3.413344007999839 - ], - [ - 122.34620201900012, - -3.404473565999879 - ], - [ - 122.32748457100004, - -3.403252862999864 - ], - [ - 122.33204186300006, - -3.393487237999835 - ], - [ - 122.33497155000006, - -3.389743747999887 - ], - [ - 122.32520592500023, - -3.375258070999934 - ], - [ - 122.31104576900023, - -3.368584893999895 - ], - [ - 122.2950952480002, - -3.364027601999851 - ], - [ - 122.27963300899998, - -3.355564059999907 - ], - [ - 122.27686608200023, - -3.366306247999916 - ], - [ - 122.27247155000023, - -3.37623463299991 - ], - [ - 122.26482181100002, - -3.381117445999891 - ], - [ - 122.25171959700006, - -3.376071872999944 - ], - [ - 122.25440514400023, - -3.395114841999856 - ], - [ - 122.26124108200023, - -3.40992604 - ], - [ - 122.27125084700006, - -3.422295830999857 - ], - [ - 122.283457879, - -3.434014580999857 - ], - [ - 122.29216556100019, - -3.450860283999859 - ], - [ - 122.29053795700005, - -3.471368096999896 - ], - [ - 122.28272545700005, - -3.492771091999856 - ], - [ - 122.26661217500012, - -3.522881768999966 - ], - [ - 122.26246178500017, - -3.528985283999873 - ], - [ - 122.25660241000006, - -3.533461195999834 - ], - [ - 122.24561608200005, - -3.53980885199995 - ], - [ - 122.23438561300006, - -3.544203382999854 - ], - [ - 122.21070397200006, - -3.550551039999874 - ], - [ - 122.20053144599999, - -3.556573174999969 - ], - [ - 122.19792728000019, - -3.571709893999966 - ], - [ - 122.2054142590001, - -3.593845309999864 - ], - [ - 122.22510826900012, - -3.629164320999891 - ], - [ - 122.23560631600017, - -3.643161716999856 - ], - [ - 122.25049889400023, - -3.656182549999841 - ], - [ - 122.26880944100012, - -3.665785414999903 - ], - [ - 122.29029381600006, - -3.669610283999916 - ], - [ - 122.30543053500006, - -3.674981377999885 - ], - [ - 122.31519616000017, - -3.688164971999839 - ], - [ - 122.32357832100004, - -3.704278252999984 - ], - [ - 122.33497155000006, - -3.71803150799991 - ], - [ - 122.35523522200012, - -3.727797132999868 - ], - [ - 122.37647545700011, - -3.729180596999839 - ], - [ - 122.41968834700018, - -3.724786065999865 - ], - [ - 122.44141686300023, - -3.731052341999899 - ], - [ - 122.45337975400017, - -3.746270440999879 - ], - [ - 122.47095787900005, - -3.786309502999828 - ], - [ - 122.52955162900017, - -3.865411065999822 - ], - [ - 122.54867597700004, - -3.878676039999931 - ], - [ - 122.56869550900004, - -3.882907809999949 - ], - [ - 122.6368921230002, - -3.883477471999839 - ], - [ - 122.64730879000004, - -3.884942315999893 - ], - [ - 122.6564233730002, - -3.889336846999882 - ], - [ - 122.66334069100012, - -3.897149346999953 - ], - [ - 122.66895592500012, - -3.908623955999914 - ], - [ - 122.66724694100017, - -3.91887786299985 - ], - [ - 122.64616946700008, - -3.925469658999916 - ], - [ - 122.63819420700011, - -3.930352471999967 - ], - [ - 122.63184655000006, - -3.936211846999839 - ], - [ - 122.62435957100004, - -3.952406507999882 - ], - [ - 122.61329186300006, - -3.956475518999838 - ], - [ - 122.588145379, - -3.95761484199987 - ], - [ - 122.5657658210001, - -3.963962497999987 - ], - [ - 122.55128014400023, - -3.970798434999921 - ], - [ - 122.55250084700006, - -3.976332289999931 - ], - [ - 122.60075931100019, - -3.980157158999944 - ], - [ - 122.62281334700018, - -3.985039971999839 - ], - [ - 122.64210045700011, - -3.993747653999904 - ], - [ - 122.6564233730002, - -4.006605726999837 - ], - [ - 122.66382897200018, - -4.023125908999916 - ], - [ - 122.66553795700011, - -4.042168877999899 - ], - [ - 122.66325931100013, - -4.084567966999899 - ], - [ - 122.66651451900017, - -4.10247161299985 - ], - [ - 122.67505944100017, - -4.122735283999859 - ], - [ - 122.68816165500007, - -4.138360283999845 - ], - [ - 122.70427493600002, - -4.142510674999969 - ], - [ - 122.707774285, - -4.139092705999872 - ], - [ - 122.71021569100006, - -4.132094007999896 - ], - [ - 122.71143639400017, - -4.123467705999886 - ], - [ - 122.71111087300002, - -4.115329684999878 - ], - [ - 122.73902428500017, - -4.129327080999843 - ], - [ - 122.77816816500004, - -4.136976820999863 - ], - [ - 122.81641686300006, - -4.137302341999884 - ], - [ - 122.84205162900005, - -4.128838799999855 - ], - [ - 122.78931725400005, - -4.073988539999931 - ], - [ - 122.775157097, - -4.048272393999895 - ], - [ - 122.80738366000017, - -4.040704033999845 - ], - [ - 122.84498131600017, - -4.057712497999901 - ], - [ - 122.872813347, - -4.09319426899998 - ], - [ - 122.891856316, - -4.136488539999874 - ], - [ - 122.90707441499998, - -4.19597747199991 - ], - [ - 122.90894616000017, - -4.216729424999912 - ], - [ - 122.90723717500023, - -4.235528252999856 - ], - [ - 122.8924259770001, - -4.2660458309999 - ], - [ - 122.89389082100016, - -4.286065362999949 - ], - [ - 122.90357506600012, - -4.328220309999907 - ], - [ - 122.90528405000012, - -4.370212497999972 - ], - [ - 122.90015709700018, - -4.388767184999978 - ], - [ - 122.88640384200008, - -4.396416924999826 - ], - [ - 122.86687259200019, - -4.400323174999912 - ], - [ - 122.85914147200018, - -4.410332940999908 - ], - [ - 122.85401451900006, - -4.423923434999864 - ], - [ - 122.84205162900005, - -4.438083591999884 - ], - [ - 122.82740319100006, - -4.419610283999944 - ], - [ - 122.75879967500012, - -4.36907317499994 - ], - [ - 122.722911004, - -4.332452080999829 - ], - [ - 122.69971764400006, - -4.318291924999897 - ], - [ - 122.670176629, - -4.314548434999878 - ], - [ - 122.68083743600008, - -4.334161065999922 - ], - [ - 122.72169030000012, - -4.372491143999866 - ], - [ - 122.72779381600017, - -4.381117445999863 - ], - [ - 122.73812910199999, - -4.40056731599995 - ], - [ - 122.74512780000018, - -4.410088799999869 - ], - [ - 122.74935957099999, - -4.410902601999879 - ], - [ - 122.76221764400012, - -4.409112237999892 - ], - [ - 122.76628665500007, - -4.410088799999869 - ], - [ - 122.77027428500006, - -4.416761976999908 - ], - [ - 122.76872806100019, - -4.420586846999839 - ], - [ - 122.76587975400017, - -4.424086195999834 - ], - [ - 122.76628665500007, - -4.430433851999851 - ], - [ - 122.77100670700005, - -4.442559502999856 - ], - [ - 122.77295983200023, - -4.450127862999977 - ], - [ - 122.77312259200019, - -4.468438408999944 - ], - [ - 122.76880944100017, - -4.478448174999841 - ], - [ - 122.75814863400015, - -4.484795830999957 - ], - [ - 122.74577884200014, - -4.486504815999879 - ], - [ - 122.73560631600017, - -4.482354424999926 - ], - [ - 122.71111087300002, - -4.451755467 - ], - [ - 122.69996178500006, - -4.451836846999981 - ], - [ - 122.69727623800023, - -4.457940362999892 - ], - [ - 122.69988040500007, - -4.466078382999896 - ], - [ - 122.70427493600002, - -4.472100518999909 - ], - [ - 122.69117272200006, - -4.48381926899998 - ], - [ - 122.68230228000019, - -4.480401299999883 - ], - [ - 122.670176629, - -4.458428643999881 - ], - [ - 122.67009524800002, - -4.432224216999927 - ], - [ - 122.64047285199999, - -4.408461195999848 - ], - [ - 122.59913170700017, - -4.396742445999848 - ], - [ - 122.56373131600006, - -4.406914971999896 - ], - [ - 122.53142337300014, - -4.427911065999837 - ], - [ - 122.49756920700017, - -4.43523528399993 - ], - [ - 122.46363366, - -4.430840752999856 - ], - [ - 122.43043053500011, - -4.416924737999963 - ], - [ - 122.39193769600004, - -4.438083591999884 - ], - [ - 122.35035241000006, - -4.45289478999986 - ], - [ - 122.30600019599999, - -4.461683851999823 - ], - [ - 122.24040774800008, - -4.46591562299993 - ], - [ - 122.23324629000004, - -4.468031507999939 - ], - [ - 122.22510826900012, - -4.472100518999909 - ], - [ - 122.20899498800023, - -4.484551690999837 - ], - [ - 122.19939212300008, - -4.490166924999841 - ], - [ - 122.17652428500006, - -4.49578215899983 - ], - [ - 122.15894616000006, - -4.509942315999851 - ], - [ - 122.15284264400023, - -4.513116143999909 - ], - [ - 122.11622155000012, - -4.517510674999983 - ], - [ - 122.1077580090001, - -4.519952080999843 - ], - [ - 122.08716881600006, - -4.543226820999848 - ], - [ - 122.065684441, - -4.58228932099982 - ], - [ - 122.04835045700011, - -4.625909112999906 - ], - [ - 122.03956139400023, - -4.663344007999939 - ], - [ - 122.04297936300017, - -4.707777601999865 - ], - [ - 122.05933678500017, - -4.742445570999934 - ], - [ - 122.08277428500006, - -4.770196221999825 - ], - [ - 122.1077580090001, - -4.793633721999981 - ], - [ - 122.11158287900017, - -4.795830987999892 - ], - [ - 122.12891686300006, - -4.800469658999916 - ], - [ - 122.12891686300006, - -4.807875257999896 - ], - [ - 122.110606316, - -4.813246351999865 - ], - [ - 122.09099368600008, - -4.836683851999837 - ], - [ - 122.07740319100012, - -4.842054945999806 - ], - [ - 122.05518639400023, - -4.84433359199987 - ], - [ - 122.01124108200011, - -4.853692315999893 - ], - [ - 121.99170983200023, - -4.855726820999919 - ], - [ - 121.88746178500006, - -4.846368096999896 - ], - [ - 121.86963951900006, - -4.840915622999944 - ], - [ - 121.84083092500023, - -4.821547132999839 - ], - [ - 121.82325280000012, - -4.813083591999899 - ], - [ - 121.80876712300008, - -4.814060153999876 - ], - [ - 121.79224694100017, - -4.818780205999886 - ], - [ - 121.76954186300023, - -4.821547132999839 - ], - [ - 121.7508244150001, - -4.816013278999918 - ], - [ - 121.742442254, - -4.816094658999901 - ], - [ - 121.739024285, - -4.824639580999914 - ], - [ - 121.73487389400017, - -4.828220309999978 - ], - [ - 121.72535241000017, - -4.832289320999863 - ], - [ - 121.71387780000012, - -4.835219007999882 - ], - [ - 121.70435631600006, - -4.835219007999882 - ], - [ - 121.68555748800006, - -4.822442315999922 - ], - [ - 121.65723717500023, - -4.787204684999892 - ], - [ - 121.63917076900012, - -4.779961846999868 - ], - [ - 121.62549889400006, - -4.77678801899998 - ], - [ - 121.5665796230002, - -4.752618096999896 - ], - [ - 121.55420983200005, - -4.743747653999932 - ], - [ - 121.50342858200023, - -4.674899997999873 - ], - [ - 121.498301629, - -4.663344007999939 - ], - [ - 121.494395379, - -4.660902601999908 - ], - [ - 121.49122155000023, - -4.661309502999913 - ], - [ - 121.48804772200018, - -4.661065362999963 - ], - [ - 121.48462975400017, - -4.656426690999851 - ], - [ - 121.47771243600008, - -4.622979424999897 - ], - [ - 121.48047936300023, - -4.580824476999936 - ], - [ - 121.498301629, - -4.500095309999921 - ], - [ - 121.52051842500006, - -4.439629815999837 - ], - [ - 121.52930748800023, - -4.397556247999859 - ], - [ - 121.53296959700018, - -4.356215101999837 - ], - [ - 121.52930748800023, - -4.277520440999851 - ], - [ - 121.53353925900015, - -4.247735283999845 - ], - [ - 121.53321373800023, - -4.238051039999959 - ], - [ - 121.53630618600013, - -4.230564059999907 - ], - [ - 121.54672285199999, - -4.225192966999856 - ], - [ - 121.55958092500023, - -4.225192966999856 - ], - [ - 121.56316165500019, - -4.232517184999864 - ], - [ - 121.56023196700008, - -4.243096612999906 - ], - [ - 121.55298912900017, - -4.252373955999857 - ], - [ - 121.58497155000023, - -4.236748955999872 - ], - [ - 121.61719811300011, - -4.166924737999835 - ], - [ - 121.62769616000017, - -4.087090752999913 - ], - [ - 121.59449303500006, - -4.040704033999845 - ], - [ - 121.55518639400023, - -4.021416924999912 - ], - [ - 121.43002363400004, - -3.999200127999856 - ], - [ - 121.35425866000006, - -3.968438408999873 - ], - [ - 121.35108483200005, - -3.958265882999825 - ], - [ - 121.33692467500023, - -3.943536065999922 - ], - [ - 121.33375084700018, - -3.934340101999865 - ], - [ - 121.33139082100004, - -3.923028252999885 - ], - [ - 121.32569420700017, - -3.9125302059999 - ], - [ - 121.31267337300008, - -3.897393487999821 - ], - [ - 121.29615319100012, - -3.886814059999864 - ], - [ - 121.284434441, - -3.889906507999854 - ], - [ - 121.27263431100002, - -3.89820729 - ], - [ - 121.25562584700018, - -3.90300872199991 - ], - [ - 121.24610436300006, - -3.894219658999845 - ], - [ - 121.25131269600016, - -3.874118747999901 - ], - [ - 121.26099694100006, - -3.851250908999972 - ], - [ - 121.26490319100006, - -3.834649346999839 - ], - [ - 121.25513756600017, - -3.81568775799991 - ], - [ - 121.24024498800023, - -3.807875257999839 - ], - [ - 121.20020592500012, - -3.807305596999868 - ], - [ - 121.1761173840001, - -3.804457289999917 - ], - [ - 121.16032962300002, - -3.796156507999839 - ], - [ - 121.10515384200019, - -3.730238539999888 - ], - [ - 120.893809441, - -3.539157809999907 - ], - [ - 120.87452233200005, - -3.498955987999821 - ], - [ - 120.86768639400023, - -3.469496351999837 - ], - [ - 120.86768639400023, - -3.457940362999821 - ], - [ - 120.87029056100008, - -3.445733330999843 - ], - [ - 120.87940514400023, - -3.423516533999873 - ], - [ - 120.88135826900006, - -3.413262627999856 - ], - [ - 120.88941491000006, - -3.388767184999921 - ], - [ - 120.90853925899998, - -3.367608330999914 - ], - [ - 120.931407097, - -3.347914320999877 - ], - [ - 120.95020592500023, - -3.327569268999966 - ], - [ - 120.96802819100006, - -3.28573984199987 - ], - [ - 120.97901451900006, - -3.267022393999895 - ], - [ - 120.99488366, - -3.259372653999861 - ], - [ - 121.00554446700008, - -3.257256768999852 - ], - [ - 121.01531009200019, - -3.251641533999859 - ], - [ - 121.02247155000023, - -3.243829033999859 - ], - [ - 121.02523847699999, - -3.235039971999896 - ], - [ - 121.02979576900023, - -3.226820570999891 - ], - [ - 121.04037519599999, - -3.220961195999948 - ], - [ - 121.05193118600013, - -3.216403903999989 - ], - [ - 121.059336785, - -3.211521091999927 - ], - [ - 121.06674238399998, - -3.193780205999843 - ], - [ - 121.07341556100002, - -3.139418226999837 - ], - [ - 121.07300866000006, - -3.114678643999937 - ], - [ - 121.06836998800011, - -3.09042734199987 - ], - [ - 121.0633244150001, - -3.07870859199987 - ], - [ - 121.05632571700019, - -3.073663018999852 - ], - [ - 121.04810631600012, - -3.066176039999959 - ], - [ - 121.0529077480002, - -3.049493096999925 - ], - [ - 121.06690514400023, - -3.022149346999868 - ], - [ - 121.06853274800008, - -3.007989190999851 - ], - [ - 121.07683353000007, - -2.989434502999842 - ], - [ - 121.08041425900004, - -2.977634372999873 - ], - [ - 121.07943769600016, - -2.936700127999927 - ], - [ - 121.08383222700004, - -2.926364841999927 - ], - [ - 121.08725019600004, - -2.904554945999962 - ], - [ - 121.08171634200014, - -2.872328382999925 - ], - [ - 121.07081139400023, - -2.851006768999866 - ], - [ - 121.059336785, - -2.862074476999823 - ], - [ - 121.05323326900012, - -2.862074476999823 - ], - [ - 121.04810631600012, - -2.851250908999916 - ], - [ - 121.04102623800023, - -2.824395440999837 - ], - [ - 121.03272545700017, - -2.814222914999888 - ], - [ - 121.02442467500006, - -2.822686455999914 - ], - [ - 121.01677493600008, - -2.842868747999859 - ], - [ - 121.01172936300011, - -2.848402601999879 - ], - [ - 121.00171959700006, - -2.848077080999857 - ], - [ - 120.99301191500015, - -2.841729424999826 - ], - [ - 120.98682701900006, - -2.832614841999927 - ], - [ - 120.98438561300023, - -2.82390715899993 - ], - [ - 120.99073326900006, - -2.811618747999887 - ], - [ - 121.00489342500012, - -2.808363540000016 - ], - [ - 121.01889082100016, - -2.801853122999844 - ], - [ - 121.02523847699999, - -2.778903903999861 - ], - [ - 121.04167728000019, - -2.78386809699991 - ], - [ - 121.05250084700018, - -2.777601820999863 - ], - [ - 121.06690514400023, - -2.752211195999934 - ], - [ - 121.07064863399998, - -2.755303643999909 - ], - [ - 121.07374108200005, - -2.756605726999908 - ], - [ - 121.07683353000007, - -2.757419528999918 - ], - [ - 121.08041425900004, - -2.759047132999939 - ], - [ - 121.0481876960001, - -2.698988539999945 - ], - [ - 121.03589928500006, - -2.690118096999896 - ], - [ - 121.03646894599999, - -2.68645598799985 - ], - [ - 121.02930748800023, - -2.678399346999825 - ], - [ - 121.01539147200018, - -2.665948174999897 - ], - [ - 121.00586998800006, - -2.660821221999967 - ], - [ - 120.88502037900005, - -2.642347914999945 - ], - [ - 120.87240644600016, - -2.644138278999932 - ], - [ - 120.86255944100006, - -2.646661065999865 - ], - [ - 120.85377037900017, - -2.646172783999958 - ], - [ - 120.84376061300011, - -2.638604424999826 - ], - [ - 120.83277428500006, - -2.627862237999821 - ], - [ - 120.82349694100017, - -2.621514580999886 - ], - [ - 120.81324303500006, - -2.617933851999823 - ], - [ - 120.79932701900006, - -2.615004164999888 - ], - [ - 120.77605228000007, - -2.614922783999987 - ], - [ - 120.76099694100006, - -2.622002862999864 - ], - [ - 120.74870853000019, - -2.630629164999874 - ], - [ - 120.73389733200011, - -2.634942315999879 - ], - [ - 120.71257571700008, - -2.636895440999822 - ], - [ - 120.69629967500012, - -2.64218515399989 - ], - [ - 120.64210045700017, - -2.670342705999886 - ], - [ - 120.626719597, - -2.674737237999949 - ], - [ - 120.60450280000023, - -2.676446221999953 - ], - [ - 120.58448326900012, - -2.682061455999872 - ], - [ - 120.57471764400023, - -2.695977471999853 - ], - [ - 120.56869550900015, - -2.713799737999835 - ], - [ - 120.55982506600012, - -2.73113372199991 - ], - [ - 120.54297936300011, - -2.747247002999885 - ], - [ - 120.292246941, - -2.903008721999925 - ], - [ - 120.25294030000012, - -2.936455987999977 - ], - [ - 120.23161868600008, - -2.95037200299987 - ], - [ - 120.2034611340001, - -2.957696221999882 - ], - [ - 120.20899498800011, - -2.97039153399993 - ], - [ - 120.22641035200016, - -2.98805103999986 - ], - [ - 120.23023522200018, - -3.001722914999974 - ], - [ - 120.23121178500006, - -3.014336846999868 - ], - [ - 120.23438561300011, - -3.026543877999856 - ], - [ - 120.240000847, - -3.035902601999965 - ], - [ - 120.247813347, - -3.039646091999913 - ], - [ - 120.26140384200008, - -3.050388278999918 - ], - [ - 120.27540123800011, - -3.102715752999828 - ], - [ - 120.285411004, - -3.122165622999916 - ], - [ - 120.27865644600016, - -3.125258070999905 - ], - [ - 120.27426191499998, - -3.129489841999913 - ], - [ - 120.26433353000019, - -3.142022393999824 - ], - [ - 120.28532962300014, - -3.162530205999872 - ], - [ - 120.30681399800008, - -3.173516533999845 - ], - [ - 120.35377037900017, - -3.190362237999835 - ], - [ - 120.383067254, - -3.209079684999907 - ], - [ - 120.38786868600019, - -3.21461354 - ], - [ - 120.38941491000006, - -3.22332122199991 - ], - [ - 120.39389082099999, - -3.237237237999892 - ], - [ - 120.40040123800011, - -3.250909112999835 - ], - [ - 120.40821373800006, - -3.259372653999861 - ], - [ - 120.42579186300011, - -3.256117445999919 - ], - [ - 120.42156009200019, - -3.267510674999883 - ], - [ - 120.40919030000023, - -3.28411223799985 - ], - [ - 120.40211022200012, - -3.296807549999983 - ], - [ - 120.40398196700008, - -3.307224216999884 - ], - [ - 120.40699303500017, - -3.318454684999892 - ], - [ - 120.40853925900004, - -3.32903411299985 - ], - [ - 120.40284264400023, - -3.345635674999983 - ], - [ - 120.39527428500017, - -3.382256768999838 - ], - [ - 120.397715691, - -3.392185153999918 - ], - [ - 120.40626061300023, - -3.412367445999863 - ], - [ - 120.40821373800006, - -3.423760674999912 - ], - [ - 120.40772545700011, - -3.433363539999903 - ], - [ - 120.40316816500015, - -3.449639580999843 - ], - [ - 120.39893639400023, - -3.500909112999864 - ], - [ - 120.40015709700006, - -3.517836195999848 - ], - [ - 120.41781660200016, - -3.563571872999873 - ], - [ - 120.42188561300011, - -3.5824520809999 - ], - [ - 120.42204837300008, - -3.666436455999857 - ], - [ - 120.42505944100017, - -3.673028252999842 - ], - [ - 120.4436955090001, - -3.690687757999854 - ], - [ - 120.446543816, - -3.728692315999851 - ], - [ - 120.43002363400015, - -3.766778252999927 - ], - [ - 120.38786868600019, - -3.827894789999888 - ], - [ - 120.37142988399998, - -3.860446872999859 - ], - [ - 120.35971113400004, - -3.894219658999845 - ], - [ - 120.35352623800023, - -3.930840752999956 - ], - [ - 120.35189863400004, - -4.100274346999868 - ], - [ - 120.35564212300008, - -4.116469007999825 - ], - [ - 120.37720787900017, - -4.152764580999914 - ], - [ - 120.38135826900012, - -4.167250257999868 - ], - [ - 120.38160241000006, - -4.207696221999981 - ], - [ - 120.38054446700019, - -4.217950127999828 - ], - [ - 120.375254754, - -4.237725518999937 - ], - [ - 120.37419681100008, - -4.249281507999882 - ], - [ - 120.37582441499998, - -4.263278903999932 - ], - [ - 120.38786868600019, - -4.294040622999916 - ], - [ - 120.38624108200005, - -4.32927825299987 - ], - [ - 120.36231530000012, - -4.38697682099982 - ], - [ - 120.36736087300002, - -4.424411716999856 - ], - [ - 120.39177493600019, - -4.45289478999986 - ], - [ - 120.40259850400017, - -4.472100518999909 - ], - [ - 120.39869225400011, - -4.489190362999864 - ], - [ - 120.39275149800008, - -4.5062802059999 - ], - [ - 120.39307701900006, - -4.531670830999914 - ], - [ - 120.39714603000007, - -4.557224216999913 - ], - [ - 120.40211022200012, - -4.57447682099982 - ], - [ - 120.4142358730002, - -4.592868747999859 - ], - [ - 120.44410241000017, - -4.626641533999845 - ], - [ - 120.44996178500006, - -4.646579684999921 - ], - [ - 120.44662519599999, - -4.6566708309999 - ], - [ - 120.43848717500006, - -4.665134372999844 - ], - [ - 120.41920006600006, - -4.680759373 - ], - [ - 120.41586347700004, - -4.688897393999838 - ], - [ - 120.39616946700008, - -4.787204684999892 - ], - [ - 120.39527428500017, - -4.810967705999971 - ], - [ - 120.38656660199999, - -4.829278252999856 - ], - [ - 120.36638431100008, - -4.835625908999887 - ], - [ - 120.34343509200008, - -4.837497653999847 - ], - [ - 120.326426629, - -4.842054945999806 - ], - [ - 120.30941816500015, - -4.871270440999922 - ], - [ - 120.30665123800011, - -4.992852471999896 - ], - [ - 120.28402754000004, - -5.11158619599982 - ], - [ - 120.27564537900017, - -5.133884372999859 - ], - [ - 120.26433353000019, - -5.149997653999918 - ], - [ - 120.30665123800011, - -5.211358330999829 - ], - [ - 120.31495201900006, - -5.228936455999857 - ], - [ - 120.32829837300008, - -5.268731377999856 - ], - [ - 120.33692467500006, - -5.28378671699987 - ], - [ - 120.38111412900017, - -5.337334893999881 - ], - [ - 120.38786868600019, - -5.352227471999839 - ], - [ - 120.38892662900005, - -5.371677341999927 - ], - [ - 120.43295332100016, - -5.527601820999848 - ], - [ - 120.43628991000017, - -5.565199476999851 - ], - [ - 120.44060306100019, - -5.573988539999903 - ], - [ - 120.45932050900015, - -5.601983330999829 - ], - [ - 120.46363366000017, - -5.620212497999901 - ], - [ - 120.45834394599999, - -5.626071872999859 - ], - [ - 120.43051191500004, - -5.613946221999868 - ], - [ - 120.41635175900004, - -5.616794528999904 - ], - [ - 120.37964928500011, - -5.576348565999865 - ], - [ - 120.37419681100008, - -5.565199476999851 - ], - [ - 120.37126712300002, - -5.553887627999856 - ], - [ - 120.35499108200011, - -5.52239348799985 - ], - [ - 120.34750410200004, - -5.513604424999883 - ], - [ - 120.32325280000023, - -5.509535414999917 - ], - [ - 120.29786217500012, - -5.518975518999838 - ], - [ - 120.27344811300006, - -5.532403252999842 - ], - [ - 120.25196373800023, - -5.540948174999855 - ], - [ - 120.20671634200014, - -5.547784112999878 - ], - [ - 120.19922936300023, - -5.550551039999931 - ], - [ - 120.17554772200006, - -5.56894296699987 - ], - [ - 120.15691165500007, - -5.576836846999853 - ], - [ - 120.11866295700011, - -5.587985934999864 - ], - [ - 120.10043379000004, - -5.595635674999897 - ], - [ - 120.094004754, - -5.590752862999835 - ], - [ - 120.08790123800011, - -5.589288018999866 - ], - [ - 120.07309004000015, - -5.588799737999878 - ], - [ - 120.01026451900006, - -5.57781340899983 - ], - [ - 119.99805748800011, - -5.571954033999873 - ], - [ - 119.98658287900017, - -5.564222914999874 - ], - [ - 119.96070397200006, - -5.56259530999985 - ], - [ - 119.93262780000023, - -5.564711195999863 - ], - [ - 119.91488691500015, - -5.56894296699987 - ], - [ - 119.89918053500017, - -5.579359632999868 - ], - [ - 119.857188347, - -5.620212497999901 - ], - [ - 119.85124759200008, - -5.63054778399983 - ], - [ - 119.84815514400012, - -5.652032158999845 - ], - [ - 119.84351647200018, - -5.661065362999864 - ], - [ - 119.823496941, - -5.67937590899983 - ], - [ - 119.80567467500012, - -5.692478122999887 - ], - [ - 119.77222741000017, - -5.70126718499985 - ], - [ - 119.72364342500012, - -5.703789971999868 - ], - [ - 119.67693118600002, - -5.697035414999931 - ], - [ - 119.64795983200023, - -5.678806247999859 - ], - [ - 119.64405358200023, - -5.660088799999883 - ], - [ - 119.64242597699999, - -5.636976820999834 - ], - [ - 119.63404381600006, - -5.617445570999848 - ], - [ - 119.60971113399998, - -5.609144789999874 - ], - [ - 119.59034264400017, - -5.620538018999838 - ], - [ - 119.57984459700018, - -5.642266533999901 - ], - [ - 119.56999759200008, - -5.655938408999845 - ], - [ - 119.55241946700002, - -5.643324476999865 - ], - [ - 119.54712975400017, - -5.631768487999835 - ], - [ - 119.54761803500006, - -5.608168226999808 - ], - [ - 119.54566491, - -5.595635674999897 - ], - [ - 119.53834069100012, - -5.585219007999811 - ], - [ - 119.52898196700008, - -5.57968515399989 - ], - [ - 119.52116946700008, - -5.572523695999848 - ], - [ - 119.51758873800011, - -5.558038018999895 - ], - [ - 119.50277754000004, - -5.555840752999899 - ], - [ - 119.47413170700017, - -5.560804945999863 - ], - [ - 119.455332879, - -5.573825778999847 - ], - [ - 119.46989993600002, - -5.595635674999897 - ], - [ - 119.44825280000023, - -5.594984632999854 - ], - [ - 119.43327884200019, - -5.587823174999897 - ], - [ - 119.42481530000018, - -5.573337497999859 - ], - [ - 119.42212975400011, - -5.551202080999886 - ], - [ - 119.4259546230002, - -5.541761976999865 - ], - [ - 119.43327884200019, - -5.532159112999892 - ], - [ - 119.43751061300023, - -5.521742445999806 - ], - [ - 119.43238366, - -5.510349216999842 - ], - [ - 119.42481530000018, - -5.501234632999854 - ], - [ - 119.41472415500019, - -5.482354424999826 - ], - [ - 119.380137566, - -5.4340145809999 - ], - [ - 119.36036217500006, - -5.396416924999897 - ], - [ - 119.35279381600006, - -5.355645440999837 - ], - [ - 119.36060631600006, - -5.307549737999864 - ], - [ - 119.36963951900023, - -5.276788018999881 - ], - [ - 119.37525475400005, - -5.211521091999884 - ], - [ - 119.37989342500018, - -5.191664320999891 - ], - [ - 119.39470462300002, - -5.156833591999856 - ], - [ - 119.40365644600016, - -5.124118747999916 - ], - [ - 119.40845787900005, - -5.115817966999842 - ], - [ - 119.41700280000006, - -5.109470309999907 - ], - [ - 119.43734785200016, - -5.09880950299987 - ], - [ - 119.44597415500007, - -5.092461846999853 - ], - [ - 119.45997155000023, - -5.073500257999839 - ], - [ - 119.46566816500004, - -5.055596612999878 - ], - [ - 119.46989993600002, - -5.020196221999868 - ], - [ - 119.48324629000015, - -4.986260674999826 - ], - [ - 119.51978600400011, - -4.916680596999825 - ], - [ - 119.52515709700006, - -4.883070570999806 - ], - [ - 119.49122155000012, - -4.754082940999851 - ], - [ - 119.49708092500023, - -4.717950127999913 - ], - [ - 119.50212649800008, - -4.713555596999839 - ], - [ - 119.51905358200017, - -4.703545830999857 - ], - [ - 119.52515709700006, - -4.698011976999837 - ], - [ - 119.53882897200018, - -4.666680596999882 - ], - [ - 119.54184003999998, - -4.65292734199987 - ], - [ - 119.58497155000012, - -4.579196872999916 - ], - [ - 119.59107506600017, - -4.564141533999901 - ], - [ - 119.60621178500017, - -4.420342705999971 - ], - [ - 119.62330162900005, - -4.352227471999939 - ], - [ - 119.62680097700004, - -4.314548434999878 - ], - [ - 119.62582441500015, - -4.304457289999988 - ], - [ - 119.62159264400023, - -4.286879164999959 - ], - [ - 119.62061608200017, - -4.276625257999854 - ], - [ - 119.6175236340001, - -4.265069268999824 - ], - [ - 119.60336347700016, - -4.25164153399983 - ], - [ - 119.60010826900012, - -4.242445570999863 - ], - [ - 119.60450280000006, - -4.222914320999962 - ], - [ - 119.62330162900005, - -4.183770440999837 - ], - [ - 119.62680097700004, - -4.16301848799985 - ], - [ - 119.61841881600017, - -4.121026299999855 - ], - [ - 119.61353600400011, - -4.11296965899983 - ], - [ - 119.608653191, - -4.107679945999934 - ], - [ - 119.60629316500015, - -4.104668877999842 - ], - [ - 119.60816491000006, - -4.09319426899998 - ], - [ - 119.61719811300023, - -4.076755466999984 - ], - [ - 119.62061608200017, - -4.0668270809999 - ], - [ - 119.62110436300023, - -4.057061455999857 - ], - [ - 119.61841881600017, - -4.038506768999852 - ], - [ - 119.62061608200017, - -4.02646249799993 - ], - [ - 119.64307701900023, - -3.992771091999927 - ], - [ - 119.64698326900023, - -3.977959893999952 - ], - [ - 119.63062584700006, - -3.971856377999885 - ], - [ - 119.60710696700008, - -3.975844007999854 - ], - [ - 119.60043379000004, - -3.986993096999882 - ], - [ - 119.59961998800011, - -4.004164320999806 - ], - [ - 119.59343509200002, - -4.02646249799993 - ], - [ - 119.58773847700016, - -4.008884372999901 - ], - [ - 119.58521569100006, - -3.970310153999932 - ], - [ - 119.56609134200008, - -3.939873955999886 - ], - [ - 119.5198673840001, - -3.826348565999851 - ], - [ - 119.49740644600016, - -3.793877862999864 - ], - [ - 119.4856876960001, - -3.754082940999879 - ], - [ - 119.45671634200019, - -3.71453215899983 - ], - [ - 119.45427493600008, - -3.700127862999949 - ], - [ - 119.46989993600002, - -3.669610283999916 - ], - [ - 119.48365319100006, - -3.614922783999887 - ], - [ - 119.49398847700016, - -3.597588799999897 - ], - [ - 119.50896243600019, - -3.57773202899989 - ], - [ - 119.51400800900004, - -3.563083591999884 - ], - [ - 119.511973504, - -3.547621351999865 - ], - [ - 119.49756920700023, - -3.49529387799987 - ], - [ - 119.49398847700016, - -3.488376559999864 - ], - [ - 119.48585045700023, - -3.483493747999901 - ], - [ - 119.46566816500004, - -3.477227471999853 - ], - [ - 119.45679772200018, - -3.470961195999891 - ], - [ - 119.43238366, - -3.475030205999943 - ], - [ - 119.40300540500013, - -3.461521091999884 - ], - [ - 119.3728947270001, - -3.442559502999956 - ], - [ - 119.34693444100017, - -3.43059661299985 - ], - [ - 119.31177819100006, - -3.426364842 - ], - [ - 119.297618035, - -3.427911065999865 - ], - [ - 119.29167728000019, - -3.434014580999857 - ], - [ - 119.28394616000017, - -3.445896091999899 - ], - [ - 119.24537194100012, - -3.476169528999975 - ], - [ - 119.22966556100002, - -3.485284112999878 - ], - [ - 119.20899498800011, - -3.489841403999918 - ], - [ - 119.192149285, - -3.486911716999899 - ], - [ - 119.17595462300008, - -3.481377862999892 - ], - [ - 119.157969597, - -3.478448174999869 - ], - [ - 119.14087975400017, - -3.482110283999916 - ], - [ - 119.11768639400023, - -3.499688408999859 - ], - [ - 119.09937584700018, - -3.505059502999899 - ], - [ - 119.02702884200002, - -3.509698174999841 - ], - [ - 118.99870853000019, - -3.524997653999975 - ], - [ - 119.00440514400017, - -3.559747002999856 - ], - [ - 118.99236087300002, - -3.556735934999935 - ], - [ - 118.97917728000019, - -3.542168877999828 - ], - [ - 118.97022545700005, - -3.53980885199995 - ], - [ - 118.96192467500006, - -3.546075127999913 - ], - [ - 118.94947350400017, - -3.569024346999896 - ], - [ - 118.93881269600004, - -3.57398853999986 - ], - [ - 118.92676842500012, - -3.566094658999887 - ], - [ - 118.91684004000004, - -3.546807549999855 - ], - [ - 118.880137566, - -3.443129165000016 - ], - [ - 118.85889733200023, - -3.411309502999984 - ], - [ - 118.84896894600004, - -3.390557549999897 - ], - [ - 118.84229576900006, - -3.368340752999856 - ], - [ - 118.83985436300023, - -3.348077080999843 - ], - [ - 118.84376061300023, - -3.32903411299985 - ], - [ - 118.85043378999998, - -3.312432549999969 - ], - [ - 118.85254967500012, - -3.295586846999967 - ], - [ - 118.83448326900006, - -3.259942315999922 - ], - [ - 118.82341556100008, - -3.193291924999855 - ], - [ - 118.81714928500011, - -3.171807549999841 - ], - [ - 118.81185957100004, - -3.162530205999872 - ], - [ - 118.80347741000017, - -3.156508070999877 - ], - [ - 118.79200280000012, - -3.151543877999828 - ], - [ - 118.78199303500006, - -3.144301039999888 - ], - [ - 118.77784264400012, - -3.132012627999927 - ], - [ - 118.775645379, - -3.122165622999916 - ], - [ - 118.76636803500006, - -3.102634372999844 - ], - [ - 118.76417076900023, - -3.090915622999859 - ], - [ - 118.76775149800002, - -3.084161065999822 - ], - [ - 118.78492272200006, - -3.06454843499985 - ], - [ - 118.79135175900015, - -3.060153903999876 - ], - [ - 118.79916425900015, - -3.061781507999896 - ], - [ - 118.82252037900005, - -3.071465752999856 - ], - [ - 118.8361108730002, - -3.073663018999852 - ], - [ - 118.84839928500017, - -3.06780364399998 - ], - [ - 118.85328209700006, - -3.053399346999839 - ], - [ - 118.85694420700011, - -2.972832940999879 - ], - [ - 118.86402428500006, - -2.94296640399989 - ], - [ - 118.88249759200008, - -2.923760674999841 - ], - [ - 118.88575280000012, - -2.909926039999931 - ], - [ - 118.88770592500018, - -2.882500908999887 - ], - [ - 118.88550866000017, - -2.869561455999872 - ], - [ - 118.880625847, - -2.861016533999859 - ], - [ - 118.87240644600004, - -2.854668877999913 - ], - [ - 118.86036217500012, - -2.848402601999879 - ], - [ - 118.83432050900004, - -2.84099700299997 - ], - [ - 118.81299889400023, - -2.844170830999857 - ], - [ - 118.77165774800014, - -2.862074476999823 - ], - [ - 118.77100670700005, - -2.839288018999966 - ], - [ - 118.76010175899998, - -2.796807549999912 - ], - [ - 118.75733483200023, - -2.775811455999957 - ], - [ - 118.76042728000002, - -2.765394789999888 - ], - [ - 118.77458743600008, - -2.745293877999842 - ], - [ - 118.77784264400012, - -2.734795830999872 - ], - [ - 118.77784264400012, - -2.690118096999896 - ], - [ - 118.782481316, - -2.672946872999873 - ], - [ - 118.79232832100004, - -2.64999765399989 - ], - [ - 118.80616295700023, - -2.629815362999864 - ], - [ - 118.82276451900012, - -2.621270440999837 - ], - [ - 118.84148196700008, - -2.627699476999936 - ], - [ - 118.85547936300023, - -2.641534112999935 - ], - [ - 118.87110436300011, - -2.65390390399989 - ], - [ - 118.89454186300006, - -2.656019789999888 - ], - [ - 118.91439863399998, - -2.648370049999869 - ], - [ - 118.95850670700005, - -2.618747653999918 - ], - [ - 118.981700066, - -2.59742603999986 - ], - [ - 119.00440514400017, - -2.585137627999899 - ], - [ - 119.01490319100006, - -2.577243747999916 - ], - [ - 119.02100670700011, - -2.567478122999887 - ], - [ - 119.0315861340001, - -2.532484632999967 - ], - [ - 119.04737389400012, - -2.512872002999913 - ], - [ - 119.06478925899998, - -2.503024997999901 - ], - [ - 119.08350670700017, - -2.495049737999935 - ], - [ - 119.13575280000018, - -2.454278252999885 - ], - [ - 119.14144941500015, - -2.441989841999927 - ], - [ - 119.13754316500015, - -2.379571221999868 - ], - [ - 119.13038170700011, - -2.354750257999825 - ], - [ - 119.12720787900005, - -2.255303643999838 - ], - [ - 119.13119550900004, - -2.244398695999948 - ], - [ - 119.13843834700006, - -2.231052341999842 - ], - [ - 119.14185631600006, - -2.216729424999855 - ], - [ - 119.13404381600006, - -2.2035458309999 - ], - [ - 119.17123457100016, - -2.149509372999916 - ], - [ - 119.18555748800023, - -2.120863539999931 - ], - [ - 119.21607506600017, - -2.009942315999822 - ], - [ - 119.23462975400017, - -1.982191664999931 - ], - [ - 119.26441491000017, - -1.963311455999985 - ], - [ - 119.28736412900017, - -1.958428643999923 - ], - [ - 119.30404707100004, - -1.961521092 - ], - [ - 119.31902103000007, - -1.967054945999934 - ], - [ - 119.33643639400012, - -1.970147393999824 - ], - [ - 119.34701582100016, - -1.9594052059999 - ], - [ - 119.35401451900023, - -1.934747002999913 - ], - [ - 119.36744225400005, - -1.847263278999947 - ], - [ - 119.36703535200004, - -1.832940362999878 - ], - [ - 119.36524498800023, - -1.827732028999876 - ], - [ - 119.36011803500006, - -1.824476820999934 - ], - [ - 119.35010826900023, - -1.81617603999986 - ], - [ - 119.33570397200018, - -1.798109632999925 - ], - [ - 119.32878665500019, - -1.7811825499999 - ], - [ - 119.30844160199999, - -1.694919528999918 - ], - [ - 119.30543053500011, - -1.65203215899993 - ], - [ - 119.30982506600017, - -1.630140882999811 - ], - [ - 119.32886803500017, - -1.593194268999866 - ], - [ - 119.33326256600006, - -1.573500257999825 - ], - [ - 119.30909264400023, - -1.504571221999953 - ], - [ - 119.30241946700019, - -1.493747653999876 - ], - [ - 119.29688561300006, - -1.411390882999839 - ], - [ - 119.29476972700016, - -1.405368747999916 - ], - [ - 119.29444420700023, - -1.399183851999865 - ], - [ - 119.29859459700018, - -1.38787200299987 - ], - [ - 119.3055119150001, - -1.380547783999873 - ], - [ - 119.32846113400015, - -1.360609632999967 - ], - [ - 119.33326256600006, - -1.350192966999899 - ], - [ - 119.33073978000002, - -1.330254815999908 - ], - [ - 119.31283613399998, - -1.284844658999916 - ], - [ - 119.31364993600019, - -1.245782158999944 - ], - [ - 119.32837975400017, - -1.214450778999989 - ], - [ - 119.35043378999998, - -1.189141533999873 - ], - [ - 119.37370853000019, - -1.168877862999864 - ], - [ - 119.38135826900012, - -1.158623955999829 - ], - [ - 119.38941491000017, - -1.145196221999925 - ], - [ - 119.399180535, - -1.133477471999853 - ], - [ - 119.41187584700006, - -1.12851327899989 - ], - [ - 119.42920983200023, - -1.124281507999882 - ], - [ - 119.443614129, - -1.113051039999959 - ], - [ - 119.45313561300011, - -1.096449476999908 - ], - [ - 119.45997155000023, - -1.057712497999887 - ], - [ - 119.47413170700017, - -1.020928643999895 - ], - [ - 119.48243248800023, - -0.963474216999884 - ], - [ - 119.48975670700023, - -0.945977471999839 - ], - [ - 119.5008244150001, - -0.932305596999896 - ], - [ - 119.50855553500017, - -0.918715101999936 - ], - [ - 119.51807701900006, - -0.876722914999874 - ], - [ - 119.52515709700006, - -0.86044687299993 - ], - [ - 119.53736412900005, - -0.850030205999843 - ], - [ - 119.56625410200004, - -0.83367278399983 - ], - [ - 119.57357832100004, - -0.829522393999895 - ], - [ - 119.58716881600012, - -0.819431247999916 - ], - [ - 119.59913170700023, - -0.79550546699987 - ], - [ - 119.60328209700018, - -0.791436455999985 - ], - [ - 119.63445071700008, - -0.778415622999916 - ], - [ - 119.68213951900012, - -0.736911716999913 - ], - [ - 119.65821373800023, - -0.71209075299987 - ], - [ - 119.65479576900023, - -0.70614999799993 - ], - [ - 119.65943444100017, - -0.69622161299985 - ], - [ - 119.67017662900017, - -0.689222914999945 - ], - [ - 119.69263756600017, - -0.678806247999873 - ], - [ - 119.70386803500017, - -0.666761976999865 - ], - [ - 119.72461998800006, - -0.639255466999913 - ], - [ - 119.73365319100012, - -0.633884372999873 - ], - [ - 119.73519941500004, - -0.6410458309999 - ], - [ - 119.75049889400012, - -0.678806247999873 - ], - [ - 119.755625847, - -0.703789971999882 - ], - [ - 119.79200280000006, - -0.778415622999916 - ], - [ - 119.80982506600017, - -0.833916924999869 - ], - [ - 119.82488040500019, - -0.858656507999854 - ], - [ - 119.8465275400001, - -0.874607028999861 - ], - [ - 119.86231530000012, - -0.834161065999908 - ], - [ - 119.86589603000019, - -0.813571872999887 - ], - [ - 119.86719811300011, - -0.78834400799991 - ], - [ - 119.86500084700012, - -0.782891533999887 - ], - [ - 119.85613040500007, - -0.769138278999861 - ], - [ - 119.85401451900023, - -0.761000257999854 - ], - [ - 119.85523522200006, - -0.727146091999884 - ], - [ - 119.85401451900023, - -0.716403903999876 - ], - [ - 119.84693444100017, - -0.701267184999878 - ], - [ - 119.82406660200016, - -0.675062757999925 - ], - [ - 119.81934655000018, - -0.665459893999866 - ], - [ - 119.81576582099999, - -0.653415622999844 - ], - [ - 119.79200280000006, - -0.607110283999859 - ], - [ - 119.78248131600012, - -0.569105726999865 - ], - [ - 119.77833092500023, - -0.535088799999841 - ], - [ - 119.77540123800023, - -0.522637627999913 - ], - [ - 119.76156660200004, - -0.490655205999914 - ], - [ - 119.75782311300011, - -0.469903252999913 - ], - [ - 119.78109785200004, - -0.239353122999873 - ], - [ - 119.79053795700023, - -0.208754164999945 - ], - [ - 119.80225670700011, - -0.195570570999905 - ], - [ - 119.808360222, - -0.182793877999856 - ], - [ - 119.80640709700006, - -0.153985283999916 - ], - [ - 119.79997806100008, - -0.123793226999823 - ], - [ - 119.79200280000006, - -0.106784763999855 - ], - [ - 119.76254316500004, - -0.119480075999903 - ], - [ - 119.73047936300023, - -0.121351820999962 - ], - [ - 119.69996178500011, - -0.114108981999863 - ], - [ - 119.67530358200011, - -0.09937916499986 - ], - [ - 119.65756269599999, - -0.080132744999915 - ], - [ - 119.63868248800006, - -0.050876559999892 - ], - [ - 119.62769616, - -0.018365166999914 - ], - [ - 119.63445071700008, - 0.010484117000118 - ], - [ - 119.650645379, - 0.001613674000069 - ], - [ - 119.65943444100017, - -0.001519463999912 - ], - [ - 119.66846764400006, - -0.003838799999869 - ], - [ - 119.66797936300011, - 0.00702545800003 - ], - [ - 119.66895592500018, - 0.016262111000074 - ], - [ - 119.67139733200011, - 0.023993231000176 - ], - [ - 119.67530358200011, - 0.030340887000122 - ], - [ - 119.69809004000004, - 0.016913153000118 - ], - [ - 119.71583092500012, - 0.001532294000086 - ], - [ - 119.74415123800006, - -0.031101169999872 - ], - [ - 119.76587975400005, - -0.063246351999837 - ], - [ - 119.77833092500023, - -0.076348565999893 - ], - [ - 119.79883873800011, - -0.085707289999917 - ], - [ - 119.81641686300023, - -0.090020440999837 - ], - [ - 119.82593834700006, - -0.089939059999935 - ], - [ - 119.83269290500007, - -0.084405205999829 - ], - [ - 119.84717858200023, - -0.06157805799991 - ], - [ - 119.85678144599999, - -0.041029554999952 - ], - [ - 119.87794030000012, - 0.045477606000119 - ], - [ - 119.88819420700023, - 0.071275132000139 - ], - [ - 119.86980228000019, - 0.10565827 - ], - [ - 119.79395592500023, - 0.196600653000132 - ], - [ - 119.78785241000006, - 0.208400783000116 - ], - [ - 119.78565514400017, - 0.221096096000082 - ], - [ - 119.78516686300006, - 0.239488023000121 - ], - [ - 119.79444420700023, - 0.250189520000134 - ], - [ - 119.85401451900023, - 0.269924221000082 - ], - [ - 119.86947675900015, - 0.287176825000088 - ], - [ - 119.86768639400006, - 0.302069403000047 - ], - [ - 119.85914147200006, - 0.318915106000048 - ], - [ - 119.85401451900023, - 0.34223053600013 - ], - [ - 119.85873457100016, - 0.364243882000139 - ], - [ - 119.883555535, - 0.400051174000069 - ], - [ - 119.89503014400023, - 0.420721747000172 - ], - [ - 119.89730879000004, - 0.431138414000074 - ], - [ - 119.89844811300017, - 0.45160553600013 - ], - [ - 119.90186608200005, - 0.461737372000172 - ], - [ - 119.91179446700008, - 0.473700262000108 - ], - [ - 119.92383873800006, - 0.480861721000068 - ], - [ - 119.93620853000002, - 0.486395575000174 - ], - [ - 119.94654381600006, - 0.493353582999987 - ], - [ - 119.96461022200006, - 0.501125393000066 - ], - [ - 120.01246178500017, - 0.504787502000113 - ], - [ - 120.03223717500012, - 0.516302802000055 - ], - [ - 120.045176629, - 0.549994208000058 - ], - [ - 120.04037519600004, - 0.588120835000126 - ], - [ - 120.02963300899998, - 0.628119208000086 - ], - [ - 120.02475019600004, - 0.667181708000129 - ], - [ - 120.0275171230002, - 0.688910223000107 - ], - [ - 120.03419030000023, - 0.713812567000147 - ], - [ - 120.04574629000015, - 0.734361070000176 - ], - [ - 120.06283613400004, - 0.742865302000126 - ], - [ - 120.07227623800023, - 0.74404531500015 - ], - [ - 120.097422722, - 0.750311591000099 - ], - [ - 120.11052493600008, - 0.751410223000136 - ], - [ - 120.12086022200018, - 0.754339910999988 - ], - [ - 120.18653405000006, - 0.784002997000101 - ], - [ - 120.20728600400017, - 0.797593492000146 - ], - [ - 120.22706139400012, - 0.814886786000059 - ], - [ - 120.23552493600008, - 0.831529039000102 - ], - [ - 120.24708092500006, - 0.933294989000146 - ], - [ - 120.25652103000019, - 0.968898830000029 - ], - [ - 120.27849368600019, - 0.994208075000145 - ], - [ - 120.31959069100012, - 0.996079820000119 - ], - [ - 120.34164472699999, - 0.982855536 - ], - [ - 120.34669030000012, - 0.963080145000063 - ], - [ - 120.34009850400005, - 0.917914130000028 - ], - [ - 120.34034264400012, - 0.872381903000061 - ], - [ - 120.34644616000017, - 0.855617580000043 - ], - [ - 120.36182701900012, - 0.866400458000129 - ], - [ - 120.36736087300002, - 0.866400458000129 - ], - [ - 120.375254754, - 0.848700262000122 - ], - [ - 120.38705488399998, - 0.833929755000142 - ], - [ - 120.40284264400023, - 0.82172272299999 - ], - [ - 120.42204837300008, - 0.811753648000177 - ], - [ - 120.45337975400005, - 0.805080471000039 - ], - [ - 120.46957441499998, - 0.796820380000128 - ], - [ - 120.476817254, - 0.800970770000077 - ], - [ - 120.48267662900005, - 0.80805084800005 - ], - [ - 120.48780358200005, - 0.811753648000177 - ], - [ - 120.51148522200018, - 0.810614325000145 - ], - [ - 120.52759850400017, - 0.806057033000016 - ], - [ - 120.54102623800023, - 0.796576239000089 - ], - [ - 120.55640709700018, - 0.780747789000145 - ], - [ - 120.56812584700018, - 0.782131252000127 - ], - [ - 120.58472741000006, - 0.79755280200007 - ], - [ - 120.61443118600008, - 0.832220770000134 - ], - [ - 120.60222415500019, - 0.855698960000026 - ], - [ - 120.61784915500007, - 0.898586330000086 - ], - [ - 120.6622827480002, - 0.968817450000046 - ], - [ - 120.683360222, - 0.991929429000081 - ], - [ - 120.69019616000006, - 0.996079820000119 - ], - [ - 120.69955488400015, - 0.992377020000077 - ], - [ - 120.71094811300023, - 0.983465887000136 - ], - [ - 120.72266686300011, - 0.976752020000092 - ], - [ - 120.73389733200011, - 0.979681708000115 - ], - [ - 120.74000084700012, - 0.989162502000127 - ], - [ - 120.74756920700023, - 1.010565497000158 - ], - [ - 120.75424238400004, - 1.020656643000137 - ], - [ - 120.76303144600016, - 1.026027736000088 - ], - [ - 120.78370201900006, - 1.031968492000033 - ], - [ - 120.79249108200017, - 1.037746486000088 - ], - [ - 120.80176842500012, - 1.052639065000136 - ], - [ - 120.80323326900006, - 1.068426825000088 - ], - [ - 120.79867597700004, - 1.130845445000048 - ], - [ - 120.79948978000002, - 1.142075914000131 - ], - [ - 120.80250084700006, - 1.146958726000193 - ], - [ - 120.80250084700006, - 1.152044989000132 - ], - [ - 120.80909264400012, - 1.162787177000055 - ], - [ - 120.81690514400012, - 1.172674872000144 - ], - [ - 120.81983483200023, - 1.174872137000136 - ], - [ - 120.825938347, - 1.196682033000016 - ], - [ - 120.82764733200011, - 1.214016018000095 - ], - [ - 120.82667076900023, - 1.253729559000092 - ], - [ - 120.81967207100016, - 1.290920315 - ], - [ - 120.82081139400012, - 1.31000397299999 - ], - [ - 120.83350670700005, - 1.32566966400006 - ], - [ - 120.84302819100006, - 1.328314520000049 - ], - [ - 120.86459394600016, - 1.32514069199999 - ], - [ - 120.87452233200005, - 1.32566966400006 - ], - [ - 120.88445071700008, - 1.330633856000105 - ], - [ - 120.90919030000023, - 1.353664455000072 - ], - [ - 120.90609785200016, - 1.324286200000159 - ], - [ - 120.90853925899998, - 1.311428127000056 - ], - [ - 120.91920006600006, - 1.315171617000175 - ], - [ - 120.93848717500018, - 1.337225653000161 - ], - [ - 120.94947350400005, - 1.34381745000006 - ], - [ - 120.96729576900012, - 1.346177476000108 - ], - [ - 121.06120853000007, - 1.327093817000033 - ], - [ - 121.08041425900004, - 1.331935940000093 - ], - [ - 121.13379967500018, - 1.314601955000114 - ], - [ - 121.15870201900012, - 1.302801825000131 - ], - [ - 121.18279056100002, - 1.271429755000099 - ], - [ - 121.26490319100006, - 1.229559637000179 - ], - [ - 121.317637566, - 1.253851630000071 - ], - [ - 121.337168816, - 1.256822007000082 - ], - [ - 121.38168378999998, - 1.256659247000115 - ], - [ - 121.39909915500007, - 1.262396552000098 - ], - [ - 121.42253665500007, - 1.277289130000057 - ], - [ - 121.44166100400005, - 1.294582424000055 - ], - [ - 121.45142662900017, - 1.297552802000055 - ], - [ - 121.464121941, - 1.291571356000134 - ], - [ - 121.46949303500017, - 1.282863674000154 - ], - [ - 121.47201582099999, - 1.269924221000139 - ], - [ - 121.47152754000004, - 1.256577867000132 - ], - [ - 121.46753991000006, - 1.246893622000087 - ], - [ - 121.45948326900012, - 1.24266185100015 - ], - [ - 121.43506920700023, - 1.235296942000062 - ], - [ - 121.43002363400004, - 1.232977606000105 - ], - [ - 121.43140709700018, - 1.226019598000107 - ], - [ - 121.4396264980002, - 1.212103583000044 - ], - [ - 121.44361412900017, - 1.202215887000122 - ], - [ - 121.44507897200006, - 1.193345445000162 - ], - [ - 121.44459069100006, - 1.186835028000175 - ], - [ - 121.445567254, - 1.17918528900006 - ], - [ - 121.45045006600017, - 1.167425848000079 - ], - [ - 121.46843509200002, - 1.146307684000149 - ], - [ - 121.47095787900005, - 1.137030341000099 - ], - [ - 121.48072350400017, - 1.120917059000135 - ], - [ - 121.528575066, - 1.083238023000064 - ], - [ - 121.54672285199999, - 1.072455145000148 - ], - [ - 121.58676191500015, - 1.061753648000121 - ], - [ - 121.63086998800023, - 1.061957098000079 - ], - [ - 121.92611738400004, - 1.098700262000165 - ], - [ - 121.94320722700016, - 1.091131903000118 - ], - [ - 121.95582116000006, - 1.045558986000074 - ], - [ - 121.97022545700011, - 1.029486395000092 - ], - [ - 121.99024498800006, - 1.021918036000145 - ], - [ - 122.01221764400006, - 1.024074611000145 - ], - [ - 122.02719160200004, - 1.034002997000059 - ], - [ - 122.04883873800011, - 1.059759833000086 - ], - [ - 122.06373131600006, - 1.065008856000162 - ], - [ - 122.08773847699999, - 1.06159088700015 - ], - [ - 122.14942467500012, - 1.037746486000088 - ], - [ - 122.17790774800002, - 1.035630601000079 - ], - [ - 122.19092858200023, - 1.031480210000126 - ], - [ - 122.19735761800021, - 1.027655341000113 - ], - [ - 122.22282962300002, - 1.012355861000145 - ], - [ - 122.23536217500023, - 1.009833075000131 - ], - [ - 122.245371941, - 1.010931708000086 - ], - [ - 122.26465905000023, - 1.016058661000017 - ], - [ - 122.27621503999998, - 1.017279364000032 - ], - [ - 122.28142337300008, - 1.016058661000017 - ], - [ - 122.29070071700002, - 1.010931708000086 - ], - [ - 122.29672285200004, - 1.009833075000131 - ], - [ - 122.29981530000012, - 1.011786200000088 - ], - [ - 122.30827884200008, - 1.021185614000117 - ], - [ - 122.313731316, - 1.024074611000145 - ], - [ - 122.32829837300002, - 1.024359442000076 - ], - [ - 122.37598717500012, - 1.009833075000131 - ], - [ - 122.39551842500006, - 1.010972398000163 - ], - [ - 122.44174238399998, - 1.021673895000106 - ], - [ - 122.45411217500012, - 1.020656643000137 - ], - [ - 122.48560631600006, - 0.995998440000136 - ], - [ - 122.524180535, - 0.979966539000145 - ], - [ - 122.56519616, - 0.971380927000141 - ], - [ - 122.62378991000006, - 0.966376044000015 - ], - [ - 122.64527428500017, - 0.959173895000063 - ], - [ - 122.66285241, - 0.947414455000086 - ], - [ - 122.670176629, - 0.931301174000112 - ], - [ - 122.67937259200019, - 0.918850002000013 - ], - [ - 122.700450066, - 0.908189195000162 - ], - [ - 122.73902428500017, - 0.893744208000101 - ], - [ - 122.74691816500015, - 0.886664130000057 - ], - [ - 122.75114993600008, - 0.880072333000072 - ], - [ - 122.75684655000023, - 0.875148830000114 - ], - [ - 122.76970462300008, - 0.873236395000063 - ], - [ - 122.77881920700005, - 0.870062567 - ], - [ - 122.78101647200018, - 0.855902411000073 - ], - [ - 122.8060001960001, - 0.84784577000012 - ], - [ - 122.83073978000007, - 0.824937242000132 - ], - [ - 122.84888756600006, - 0.818019924000126 - ], - [ - 122.88990319100017, - 0.848211981000134 - ], - [ - 122.906993035, - 0.852728583000015 - ], - [ - 122.91846764400023, - 0.85956452000012 - ], - [ - 122.93824303500017, - 0.907416083000143 - ], - [ - 122.94304446700008, - 0.912502346000068 - ], - [ - 122.95386803500017, - 0.9214541690001 - ], - [ - 122.95818118600008, - 0.9278832050001 - ], - [ - 122.95818118600008, - 0.945746161000073 - ], - [ - 122.96078535200016, - 0.957261460000112 - ], - [ - 122.96802819100017, - 0.962591864000075 - ], - [ - 122.99089603000019, - 0.961859442000133 - ], - [ - 123.00505618600013, - 0.959458726000193 - ], - [ - 123.07129967500006, - 0.93475983300003 - ], - [ - 123.09571373800023, - 0.928900458000072 - ], - [ - 123.0972599620001, - 0.929144598000107 - ], - [ - 123.11207116000006, - 0.931301174000112 - ], - [ - 123.13445071700008, - 0.938910223000065 - ], - [ - 123.17562910200004, - 0.922552802000141 - ], - [ - 123.19092858200011, - 0.9278832050001 - ], - [ - 123.18669681100019, - 0.938177802000126 - ], - [ - 123.18238366000017, - 0.960109768000137 - ], - [ - 123.18669681100019, - 0.973618882000125 - ], - [ - 123.20785566499998, - 0.958889065000122 - ], - [ - 123.22575931100002, - 0.949530341000013 - ], - [ - 123.25489342500012, - 0.960679429000109 - ], - [ - 123.27344811300011, - 0.948919989000132 - ], - [ - 123.27833092500006, - 0.93878815300009 - ], - [ - 123.27906334700012, - 0.929836330000143 - ], - [ - 123.28207441500004, - 0.921779690000122 - ], - [ - 123.29395592500023, - 0.914211330000072 - ], - [ - 123.30396569100006, - 0.912298895000106 - ], - [ - 123.331309441, - 0.912827867000175 - ], - [ - 123.34180748800006, - 0.914211330000072 - ], - [ - 123.35206139400012, - 0.918158270000148 - ], - [ - 123.35962975400017, - 0.923407294000143 - ], - [ - 123.36866295700005, - 0.927435614000103 - ], - [ - 123.38331139400006, - 0.9278832050001 - ], - [ - 123.39112389400006, - 0.923814195000148 - ], - [ - 123.39714603000019, - 0.917873440000037 - ], - [ - 123.40495853000007, - 0.915350653000104 - ], - [ - 123.41732832100004, - 0.921616929000066 - ], - [ - 123.44507897200018, - 0.90298086100016 - ], - [ - 123.51978600400011, - 0.886623440000065 - ], - [ - 123.55054772200018, - 0.869818427000055 - ], - [ - 123.56299889400012, - 0.866929429000109 - ], - [ - 123.59669030000012, - 0.881822007000068 - ], - [ - 123.61231530000006, - 0.88621653900006 - ], - [ - 123.63200931100002, - 0.881659247000101 - ], - [ - 123.67212975400005, - 0.859930731000134 - ], - [ - 123.69117272200006, - 0.852728583000015 - ], - [ - 123.83179772200018, - 0.832220770000134 - ], - [ - 123.90040123800011, - 0.839667059000035 - ], - [ - 123.909922722, - 0.837876695000048 - ], - [ - 123.92920983200023, - 0.831529039000102 - ], - [ - 123.93751061300023, - 0.832220770000134 - ], - [ - 123.94792728000013, - 0.838934637000179 - ], - [ - 123.951426629, - 0.846136786000116 - ], - [ - 123.9480900400001, - 0.853013414000046 - ], - [ - 123.93751061300023, - 0.858954169000157 - ], - [ - 123.95240319100017, - 0.867987372000158 - ], - [ - 123.99170983200005, - 0.880682684000121 - ], - [ - 124.00806725400011, - 0.898179429000081 - ], - [ - 124.12029056100002, - 0.939113674000112 - ], - [ - 124.15300540500007, - 0.945949611000117 - ], - [ - 124.16667728000019, - 0.956935940000079 - ], - [ - 124.19076582100004, - 0.983099677000041 - ], - [ - 124.22364342500012, - 0.998724677000027 - ], - [ - 124.29037519600016, - 1.017320054000024 - ], - [ - 124.31495201900006, - 1.037746486000088 - ], - [ - 124.32976321700008, - 1.070542710000097 - ], - [ - 124.34652754000015, - 1.139634507000096 - ], - [ - 124.36280358200011, - 1.167425848000079 - ], - [ - 124.37403405000012, - 1.177069403000132 - ], - [ - 124.38941491000006, - 1.186102606000148 - ], - [ - 124.40772545700011, - 1.192775783000101 - ], - [ - 124.42790774800002, - 1.195379950000017 - ], - [ - 124.49431399800008, - 1.19220612200013 - ], - [ - 124.51417076900006, - 1.195379950000017 - ], - [ - 124.52344811300023, - 1.201239325000145 - ], - [ - 124.529551629, - 1.208685614000117 - ], - [ - 124.53663170700005, - 1.21466705900005 - ], - [ - 124.54835045700017, - 1.215806382000082 - ], - [ - 124.55600019599999, - 1.210598049 - ], - [ - 124.5607202480002, - 1.201076565000079 - ], - [ - 124.56690514400017, - 1.192043361000074 - ], - [ - 124.57911217500023, - 1.187892971000124 - ], - [ - 124.59376061300023, - 1.195868231000176 - ], - [ - 124.60678144600004, - 1.214789130000113 - ], - [ - 124.61500084700006, - 1.237534898000135 - ], - [ - 124.61597741, - 1.256822007000082 - ], - [ - 124.60645592500012, - 1.27334219000015 - ], - [ - 124.59083092500023, - 1.278794664000102 - ], - [ - 124.55144290500007, - 1.277289130000057 - ], - [ - 124.53443444100017, - 1.288641669000114 - ], - [ - 124.532969597, - 1.314520575000131 - ], - [ - 124.53980553500006, - 1.34243398600016 - ], - [ - 124.54835045700017, - 1.359849351000051 - ], - [ - 124.60181725400017, - 1.400132554000109 - ], - [ - 124.60971113400015, - 1.410711981000077 - ], - [ - 124.62037194100017, - 1.417141018000081 - ], - [ - 124.6917423840001, - 1.401434637000108 - ], - [ - 124.71729576900017, - 1.405829169000015 - ], - [ - 124.73243248800017, - 1.415676174000112 - ], - [ - 124.75660241000017, - 1.445217190000079 - ], - [ - 124.77418053500011, - 1.455226955000157 - ], - [ - 124.81576582100016, - 1.460598049000126 - ], - [ - 124.83570397200006, - 1.469142971000139 - ], - [ - 124.85043379000015, - 1.489691473 - ], - [ - 124.84392337300008, - 1.508530992000132 - ], - [ - 124.829844597, - 1.527533270000134 - ], - [ - 124.822032097, - 1.548529364000075 - ], - [ - 124.825938347, - 1.572902736000046 - ], - [ - 124.83692467500006, - 1.588853257000054 - ], - [ - 124.93653405000012, - 1.665594794000171 - ], - [ - 124.94556725400005, - 1.678290106000134 - ], - [ - 124.94988040500002, - 1.682603257000139 - ], - [ - 124.96859785199999, - 1.673814195000176 - ], - [ - 124.972911004, - 1.678290106000134 - ], - [ - 124.97095787900017, - 1.713202216000155 - ], - [ - 124.972911004, - 1.722967841000099 - ], - [ - 124.98389733200005, - 1.731594143000024 - ], - [ - 125.00473066500015, - 1.741034247000115 - ], - [ - 125.025157097, - 1.744126695000105 - ], - [ - 125.03443444100017, - 1.733465887000165 - ], - [ - 125.03492272200006, - 1.69204336100016 - ], - [ - 125.04273522200006, - 1.680568752000113 - ], - [ - 125.06169681100008, - 1.674546617000104 - ] - ] - ], - [ - [ - [ - 125.14942467500023, - 1.742173570000148 - ], - [ - 125.14470462300008, - 1.741848049000126 - ], - [ - 125.13721764400006, - 1.747951565000037 - ], - [ - 125.13209069100017, - 1.758368231000105 - ], - [ - 125.12973066500004, - 1.772406317000062 - ], - [ - 125.12387129000015, - 1.789048570000105 - ], - [ - 125.12232506600006, - 1.807033596000139 - ], - [ - 125.12598717500006, - 1.815415757000025 - ], - [ - 125.12940514400012, - 1.828436591000013 - ], - [ - 125.13526451900023, - 1.830959377000028 - ], - [ - 125.14454186300011, - 1.822333075000103 - ], - [ - 125.15398196700019, - 1.810736395000092 - ], - [ - 125.16570071700019, - 1.802232164000159 - ], - [ - 125.17221113399998, - 1.799221096000068 - ], - [ - 125.17660566500015, - 1.792792059000135 - ], - [ - 125.17701256600017, - 1.778753973000093 - ], - [ - 125.15406334700018, - 1.756496486000145 - ], - [ - 125.15202884200008, - 1.747707424 - ], - [ - 125.14942467500023, - 1.742173570000148 - ] - ] - ], - [ - [ - [ - 97.14291425900015, - 2.092271226000051 - ], - [ - 97.14844811300006, - 2.074164130000042 - ], - [ - 97.15113366000006, - 2.05809153900006 - ], - [ - 97.14478600400011, - 2.051947333000072 - ], - [ - 97.12305748800011, - 2.039292710000097 - ], - [ - 97.12012780000012, - 2.034857489000117 - ], - [ - 97.12427819100006, - 2.021673895000077 - ], - [ - 97.11500084700018, - 2.014715887000094 - ], - [ - 97.10230553500006, - 2.016058661000073 - ], - [ - 97.06902103000002, - 2.087144273000121 - ], - [ - 97.07545006600006, - 2.086004950000088 - ], - [ - 97.0872501960001, - 2.096869208000072 - ], - [ - 97.09253991000017, - 2.105536200000159 - ], - [ - 97.10035241000017, - 2.111273505000142 - ], - [ - 97.12012780000012, - 2.113348700000159 - ], - [ - 97.13379967500006, - 2.10716380400001 - ], - [ - 97.14291425900015, - 2.092271226000051 - ] - ] - ], - [ - [ - [ - 101.72120201900012, - 2.05809153900006 - ], - [ - 101.7579858730002, - 2.011297919000086 - ], - [ - 101.77027428500006, - 1.985052802000055 - ], - [ - 101.77556399800014, - 1.947984117000132 - ], - [ - 101.76775149800002, - 1.925604559000107 - ], - [ - 101.73585045700011, - 1.887681382000082 - ], - [ - 101.72877037900017, - 1.863226630000057 - ], - [ - 101.73243248800011, - 1.817938544000128 - ], - [ - 101.72917728000007, - 1.799058335000012 - ], - [ - 101.71509850400011, - 1.778225002000113 - ], - [ - 101.66627037900011, - 1.744940497000115 - ], - [ - 101.65984134200019, - 1.733465887000165 - ], - [ - 101.64942467500012, - 1.722235419000171 - ], - [ - 101.62525475400011, - 1.714422919000171 - ], - [ - 101.5975041020001, - 1.710028387000094 - ], - [ - 101.57732181100019, - 1.709295966000155 - ], - [ - 101.5306095710001, - 1.71816640800003 - ], - [ - 101.49073326900006, - 1.736761786000116 - ], - [ - 101.46013431100002, - 1.765529690000065 - ], - [ - 101.44068444100006, - 1.804877020000148 - ], - [ - 101.43034915500013, - 1.850287177000141 - ], - [ - 101.4222111340001, - 1.872992255000085 - ], - [ - 101.39714603000019, - 1.909369207999987 - ], - [ - 101.39380944100017, - 1.930609442000062 - ], - [ - 101.40577233200011, - 2.013861395000092 - ], - [ - 101.41814212300002, - 2.044419664000117 - ], - [ - 101.44092858200005, - 2.064927476000165 - ], - [ - 101.478282097, - 2.072414455000128 - ], - [ - 101.49577884200008, - 2.06883372600015 - ], - [ - 101.531016472, - 2.056463934000121 - ], - [ - 101.55054772200012, - 2.05809153900006 - ], - [ - 101.56641686300011, - 2.067938544000157 - ], - [ - 101.61508222700016, - 2.117092190000093 - ], - [ - 101.64926191500015, - 2.128485419000157 - ], - [ - 101.68165123800006, - 2.108954169000086 - ], - [ - 101.70720462300002, - 2.078802802000055 - ], - [ - 101.72120201900012, - 2.05809153900006 - ] - ] - ], - [ - [ - [ - 96.64356530000006, - 2.074448959999984 - ], - [ - 96.62289472700016, - 2.070624091000141 - ], - [ - 96.60962975400011, - 2.080145575000145 - ], - [ - 96.60987389400006, - 2.106512762000136 - ], - [ - 96.61329186300011, - 2.119126695000119 - ], - [ - 96.61833743600002, - 2.126857815000136 - ], - [ - 96.62769616000017, - 2.129461981000134 - ], - [ - 96.64405358200005, - 2.127020575000103 - ], - [ - 96.65796959700006, - 2.121812242000189 - ], - [ - 96.66822350400017, - 2.113430080000143 - ], - [ - 96.67172285200016, - 2.101996161000088 - ], - [ - 96.66537519600016, - 2.087876695000148 - ], - [ - 96.64356530000006, - 2.074448959999984 - ] - ] - ], - [ - [ - [ - 125.408457879, - 2.122259833000015 - ], - [ - 125.40626061300011, - 2.107326565000065 - ], - [ - 125.40316816500004, - 2.102769273000106 - ], - [ - 125.3977970710001, - 2.104193427 - ], - [ - 125.39332116, - 2.104396877000127 - ], - [ - 125.39087975400017, - 2.101752020000134 - ], - [ - 125.37549889400023, - 2.092108466000084 - ], - [ - 125.37012780000006, - 2.091701565000079 - ], - [ - 125.36215254000004, - 2.086371161000102 - ], - [ - 125.35613040500002, - 2.077215887000037 - ], - [ - 125.34913170700023, - 2.071234442000105 - ], - [ - 125.34050540500002, - 2.073309637000122 - ], - [ - 125.33423912900017, - 2.081854559000149 - ], - [ - 125.33521569100017, - 2.092433986000017 - ], - [ - 125.340586785, - 2.100775458000072 - ], - [ - 125.34457441499998, - 2.102240302000126 - ], - [ - 125.35035241000017, - 2.109035549000069 - ], - [ - 125.35718834700018, - 2.109849351000079 - ], - [ - 125.35718834700018, - 2.113918361000131 - ], - [ - 125.35377037900017, - 2.116685289000173 - ], - [ - 125.35124759200008, - 2.122259833000015 - ], - [ - 125.35425866000006, - 2.129868882000139 - ], - [ - 125.35987389400023, - 2.127630927000055 - ], - [ - 125.36451256600017, - 2.123602606000176 - ], - [ - 125.36793053500017, - 2.125637111000032 - ], - [ - 125.37208092500023, - 2.124416408000016 - ], - [ - 125.37794030000006, - 2.120591539000173 - ], - [ - 125.38624108200023, - 2.118312893000109 - ], - [ - 125.39340253999998, - 2.118231512000122 - ], - [ - 125.40495853000002, - 2.130275783000144 - ], - [ - 125.408457879, - 2.122259833000015 - ] - ] - ], - [ - [ - [ - 128.05665123800023, - 2.192450262000065 - ], - [ - 128.0568139980002, - 2.169907945000162 - ], - [ - 128.05014082100016, - 2.14752838700015 - ], - [ - 128.02906334700006, - 2.109686591000113 - ], - [ - 128.01612389400023, - 2.093003648000078 - ], - [ - 128.00464928500017, - 2.086004950000088 - ], - [ - 127.99952233200005, - 2.081691799000083 - ], - [ - 127.99447675900015, - 2.072088934000107 - ], - [ - 127.98764082100004, - 2.062445380000142 - ], - [ - 127.96461022200006, - 2.053615627000084 - ], - [ - 127.95850670700005, - 2.04242584799999 - ], - [ - 127.95411217500006, - 2.017157294000114 - ], - [ - 127.94336998800006, - 1.980780341000141 - ], - [ - 127.93458092500012, - 1.963202216000113 - ], - [ - 127.92302493600019, - 1.955715236000131 - ], - [ - 127.90495853000007, - 1.953436591000155 - ], - [ - 127.88900800900015, - 1.947333075000088 - ], - [ - 127.87566165500007, - 1.938788153000147 - ], - [ - 127.86475670700005, - 1.929022528000033 - ], - [ - 127.85661868600008, - 1.912502346000053 - ], - [ - 127.84929446700002, - 1.883530992000146 - ], - [ - 127.84644616, - 1.851467190000065 - ], - [ - 127.85173587300008, - 1.825384833000101 - ], - [ - 127.87566165500007, - 1.807928778000132 - ], - [ - 127.94068444100017, - 1.800034898000078 - ], - [ - 127.95411217500006, - 1.788153387000122 - ], - [ - 127.96355228000019, - 1.773586330000086 - ], - [ - 128.00538170700023, - 1.739406643000095 - ], - [ - 128.014903191, - 1.719224351000079 - ], - [ - 128.00586998800011, - 1.645493882000125 - ], - [ - 128.00228925900015, - 1.633734442000147 - ], - [ - 127.99561608200005, - 1.627346096000124 - ], - [ - 128.00147545700023, - 1.613836981000148 - ], - [ - 128.00855553500017, - 1.60639069200009 - ], - [ - 128.0157983730002, - 1.600775458 - ], - [ - 128.02222741000006, - 1.592596747000172 - ], - [ - 128.02719160200016, - 1.58055247600015 - ], - [ - 128.0353296230002, - 1.537990627000028 - ], - [ - 128.03223717500012, - 1.516994533000073 - ], - [ - 128.0159611340001, - 1.46417877800009 - ], - [ - 128.014903191, - 1.435532945000119 - ], - [ - 128.01636803500017, - 1.404038804000109 - ], - [ - 128.014903191, - 1.394598700000103 - ], - [ - 128.01059004000004, - 1.389349677000027 - ], - [ - 128.004161004, - 1.385402736000117 - ], - [ - 127.99822024800008, - 1.380072333000058 - ], - [ - 127.99561608200005, - 1.370754299000112 - ], - [ - 127.99984785199999, - 1.352280992000175 - ], - [ - 128.01539147200012, - 1.317287502000084 - ], - [ - 128.014903191, - 1.305243231000162 - ], - [ - 128.00611412900005, - 1.299872137000122 - ], - [ - 127.98292076900012, - 1.3003604190001 - ], - [ - 127.973887566, - 1.297756252000113 - ], - [ - 127.96949303500006, - 1.290432033000101 - ], - [ - 127.95850670700005, - 1.26459381700009 - ], - [ - 127.95069420700005, - 1.253729559000092 - ], - [ - 127.93140709700006, - 1.233791408000116 - ], - [ - 127.91911868600019, - 1.216050523000121 - ], - [ - 127.89942467500023, - 1.174872137000136 - ], - [ - 127.895274285, - 1.162990627000013 - ], - [ - 127.89429772200006, - 1.156642971000068 - ], - [ - 127.89063561300006, - 1.152411200000145 - ], - [ - 127.87826582100004, - 1.146958726000193 - ], - [ - 127.86744225400005, - 1.145697333000015 - ], - [ - 127.84359785200016, - 1.147772528000033 - ], - [ - 127.83399498800006, - 1.143866278000118 - ], - [ - 127.75489342500006, - 1.078599351000122 - ], - [ - 127.67107181100019, - 1.031805731000148 - ], - [ - 127.63754316500015, - 1.000718492000061 - ], - [ - 127.62452233200017, - 0.955145575000103 - ], - [ - 127.62761478000007, - 0.937404690000108 - ], - [ - 127.63550866, - 0.918931382 - ], - [ - 127.64535566500015, - 0.902411200000017 - ], - [ - 127.6551212900001, - 0.890041408000073 - ], - [ - 127.6700952480002, - 0.878973700000117 - ], - [ - 127.70541425900015, - 0.863714911000059 - ], - [ - 127.72071373800011, - 0.852728583000015 - ], - [ - 127.72543379000004, - 0.845404364000089 - ], - [ - 127.73511803500017, - 0.825913804000109 - ], - [ - 127.74187259200019, - 0.818019924000126 - ], - [ - 127.75033613400015, - 0.814764716000084 - ], - [ - 127.75912519600004, - 0.815659898000163 - ], - [ - 127.76856530000012, - 0.815375067000133 - ], - [ - 127.79566491000006, - 0.799058335000112 - ], - [ - 127.81560306100002, - 0.799058335000112 - ], - [ - 127.83545983200023, - 0.804632880000042 - ], - [ - 127.85173587300008, - 0.811753648000177 - ], - [ - 127.87240644599999, - 0.823960679000066 - ], - [ - 127.90658613399998, - 0.852484442000147 - ], - [ - 127.92302493600019, - 0.869818427000055 - ], - [ - 127.92758222700004, - 0.885158596000011 - ], - [ - 127.9329533210001, - 0.973211981000119 - ], - [ - 127.93230228000002, - 0.989935614000146 - ], - [ - 127.93637128999998, - 1.007310289000117 - ], - [ - 127.99390709700018, - 1.082993882000025 - ], - [ - 128.014903191, - 1.099798895000035 - ], - [ - 128.03549238400015, - 1.112127997000158 - ], - [ - 128.05494225400005, - 1.120428778000147 - ], - [ - 128.07569420700023, - 1.125067450000159 - ], - [ - 128.14478600400017, - 1.124660549000069 - ], - [ - 128.16065514400006, - 1.132147528000047 - ], - [ - 128.17945397200006, - 1.154445705000072 - ], - [ - 128.19239342500023, - 1.177435614000146 - ], - [ - 128.1960555350001, - 1.196437893000066 - ], - [ - 128.19060306100008, - 1.214056708000086 - ], - [ - 128.17628014400006, - 1.232977606000105 - ], - [ - 128.15650475400005, - 1.241766669000157 - ], - [ - 128.1136173840001, - 1.231838283000073 - ], - [ - 128.097422722, - 1.236314195000119 - ], - [ - 128.09205162900017, - 1.257269598000079 - ], - [ - 128.10710696700008, - 1.276434637000136 - ], - [ - 128.14210045700005, - 1.301459052000055 - ], - [ - 128.154551629, - 1.319281317000119 - ], - [ - 128.1744897800002, - 1.356634833 - ], - [ - 128.18677819100006, - 1.374172268000038 - ], - [ - 128.2046004570001, - 1.389960028000161 - ], - [ - 128.24708092500006, - 1.416489976000122 - ], - [ - 128.26531009200008, - 1.431830145000077 - ], - [ - 128.2823999360002, - 1.442613023000092 - ], - [ - 128.32618248800006, - 1.456610419000057 - ], - [ - 128.34449303500006, - 1.469142971000139 - ], - [ - 128.3502710300002, - 1.477932033000116 - ], - [ - 128.3576766290001, - 1.495062567000147 - ], - [ - 128.3649194670002, - 1.503241278000147 - ], - [ - 128.3727319670002, - 1.507473049000083 - ], - [ - 128.39356530000006, - 1.515041408000116 - ], - [ - 128.41716556100002, - 1.530585028000118 - ], - [ - 128.43726647200018, - 1.539292710000026 - ], - [ - 128.45972741000017, - 1.544989325000088 - ], - [ - 128.4816186860002, - 1.545396226000193 - ], - [ - 128.48894290500013, - 1.542181708000143 - ], - [ - 128.4933374360002, - 1.536932684000149 - ], - [ - 128.49854576900012, - 1.532294012000122 - ], - [ - 128.50904381600017, - 1.531195380000085 - ], - [ - 128.51929772200018, - 1.535589910999988 - ], - [ - 128.52735436300023, - 1.544256903000161 - ], - [ - 128.53931725400017, - 1.561916408000073 - ], - [ - 128.55372155000012, - 1.568426825000159 - ], - [ - 128.60466556100002, - 1.576890367000104 - ], - [ - 128.64722741000017, - 1.579006252000113 - ], - [ - 128.71949303500017, - 1.57062409100007 - ], - [ - 128.72478274800002, - 1.565985419000128 - ], - [ - 128.72730553500006, - 1.558579820000148 - ], - [ - 128.72803795700005, - 1.548529364000075 - ], - [ - 128.72478274800002, - 1.541978257000096 - ], - [ - 128.7006942070001, - 1.523667710000041 - ], - [ - 128.68751061300017, - 1.503241278000147 - ], - [ - 128.68392988399998, - 1.483343817000062 - ], - [ - 128.68637129000004, - 1.445217190000079 - ], - [ - 128.6891382170002, - 1.436753648000135 - ], - [ - 128.6954858730002, - 1.429754950000159 - ], - [ - 128.71461022200018, - 1.414618231000162 - ], - [ - 128.72681725400017, - 1.408758856000034 - ], - [ - 128.74097741000017, - 1.404852606000119 - ], - [ - 128.74333743600002, - 1.398382880000113 - ], - [ - 128.7417098320001, - 1.387152411000116 - ], - [ - 128.74577884200008, - 1.369452216000113 - ], - [ - 128.7483016290001, - 1.344061591000099 - ], - [ - 128.74659264400006, - 1.321275132000068 - ], - [ - 128.73829186300011, - 1.311468817000048 - ], - [ - 128.72120201900017, - 1.304185289000117 - ], - [ - 128.71583092500012, - 1.286525783000101 - ], - [ - 128.71436608200023, - 1.243150132000139 - ], - [ - 128.702403191, - 1.193752346 - ], - [ - 128.7006942070001, - 1.171128648000106 - ], - [ - 128.7085067070001, - 1.103461005000071 - ], - [ - 128.70687910200016, - 1.085516669000128 - ], - [ - 128.70362389400023, - 1.075018622000144 - ], - [ - 128.70118248800011, - 1.070868231000119 - ], - [ - 128.68637129000004, - 1.065008856000162 - ], - [ - 128.67628014400023, - 1.063706773000163 - ], - [ - 128.66260826900012, - 1.063788153000147 - ], - [ - 128.6506453790001, - 1.061957098000079 - ], - [ - 128.64551842500006, - 1.054754950000145 - ], - [ - 128.56332441499998, - 1.0073916690001 - ], - [ - 128.54883873800023, - 0.996039130000128 - ], - [ - 128.54249108200023, - 0.986517645000049 - ], - [ - 128.53321373800006, - 0.979437567000076 - ], - [ - 128.4747827480002, - 0.962591864000075 - ], - [ - 128.45289147200006, - 0.941229559000121 - ], - [ - 128.43978925899998, - 0.9317894550001 - ], - [ - 128.4233504570001, - 0.9278832050001 - ], - [ - 128.40398196700008, - 0.925482489000061 - ], - [ - 128.31544030000018, - 0.901556708000015 - ], - [ - 128.30046634200002, - 0.893744208000101 - ], - [ - 128.29200280000006, - 0.87986888200011 - ], - [ - 128.289317254, - 0.855861721000082 - ], - [ - 128.29639733200005, - 0.835760809000121 - ], - [ - 128.29835045700023, - 0.823431708000086 - ], - [ - 128.29297936300017, - 0.818019924000126 - ], - [ - 128.28060957100004, - 0.820461330000157 - ], - [ - 128.25945071700014, - 0.830633856000105 - ], - [ - 128.24878991000017, - 0.832220770000134 - ], - [ - 128.23178144600004, - 0.826076565000065 - ], - [ - 128.22095787900005, - 0.812689520000063 - ], - [ - 128.21509850400017, - 0.794623114000146 - ], - [ - 128.21355228000007, - 0.773911851000051 - ], - [ - 128.21949303500017, - 0.758368231000048 - ], - [ - 128.23422285200016, - 0.742621161000088 - ], - [ - 128.26872806100008, - 0.715562242000132 - ], - [ - 128.29517662900017, - 0.684637762000094 - ], - [ - 128.31348717500012, - 0.668158270000106 - ], - [ - 128.3434350920002, - 0.657782294000029 - ], - [ - 128.36459394599999, - 0.643622137000179 - ], - [ - 128.37517337300002, - 0.640448309000121 - ], - [ - 128.40886478000007, - 0.64154694199999 - ], - [ - 128.4362899100001, - 0.638861395000092 - ], - [ - 128.44288170700005, - 0.636419989000061 - ], - [ - 128.45053144599999, - 0.629584052000141 - ], - [ - 128.46664472700016, - 0.611517645000035 - ], - [ - 128.47657311300006, - 0.602728583000058 - ], - [ - 128.48503665500013, - 0.598863023000149 - ], - [ - 128.5201929050002, - 0.594427802000084 - ], - [ - 128.53931725400017, - 0.589097398000106 - ], - [ - 128.57056725400005, - 0.570257880000071 - ], - [ - 128.58545983200005, - 0.568508205000072 - ], - [ - 128.60035241000006, - 0.570868231000119 - ], - [ - 128.61817467500012, - 0.571600653000147 - ], - [ - 128.62956790500007, - 0.567450262000122 - ], - [ - 128.64144941500004, - 0.560980536000031 - ], - [ - 128.65406334700012, - 0.558050848000093 - ], - [ - 128.6666772800002, - 0.564764716000141 - ], - [ - 128.6808374360002, - 0.554510809000107 - ], - [ - 128.6843367850001, - 0.541693427 - ], - [ - 128.68018639400023, - 0.510077216000013 - ], - [ - 128.67774498800011, - 0.504828192000105 - ], - [ - 128.67359459700018, - 0.499579169000128 - ], - [ - 128.67172285200004, - 0.493719794000171 - ], - [ - 128.68165123800011, - 0.47931549700003 - ], - [ - 128.68458092500023, - 0.470689195000105 - ], - [ - 128.68604576900012, - 0.461371160999988 - ], - [ - 128.68539472700016, - 0.382025458000044 - ], - [ - 128.69011478000007, - 0.346991278000132 - ], - [ - 128.70386803500017, - 0.33201732000019 - ], - [ - 128.76221764400006, - 0.321437893000152 - ], - [ - 128.77051842500023, - 0.315904039000046 - ], - [ - 128.82422936300011, - 0.310858466000099 - ], - [ - 128.85043379000015, - 0.289862372000158 - ], - [ - 128.8797306650001, - 0.255845445000134 - ], - [ - 128.90015709700006, - 0.221991278000075 - ], - [ - 128.8995874360002, - 0.207790432000152 - ], - [ - 128.86117597700016, - 0.243557033000073 - ], - [ - 128.84791100400005, - 0.250067450000159 - ], - [ - 128.83415774800014, - 0.251532294000043 - ], - [ - 128.7003686860002, - 0.290961005000099 - ], - [ - 128.68018639400023, - 0.283514716000042 - ], - [ - 128.65674889400006, - 0.2970238300001 - ], - [ - 128.62867272200018, - 0.30805084800015 - ], - [ - 128.5979110040001, - 0.315619208000015 - ], - [ - 128.56666100400005, - 0.318304755000085 - ], - [ - 128.53760826900023, - 0.326849677000098 - ], - [ - 128.51343834700006, - 0.346828518 - ], - [ - 128.4747827480002, - 0.387193101000136 - ], - [ - 128.46111087300008, - 0.394842841000155 - ], - [ - 128.44955488400004, - 0.396795966000028 - ], - [ - 128.41960696700008, - 0.393459377000084 - ], - [ - 128.40284264400023, - 0.393500067000076 - ], - [ - 128.37671959700018, - 0.398871161000045 - ], - [ - 128.3615014980002, - 0.400213934000035 - ], - [ - 128.2946069670002, - 0.388983466000113 - ], - [ - 128.26221764400006, - 0.391343492000161 - ], - [ - 128.23462975400017, - 0.413967190000051 - ], - [ - 128.210215691, - 0.406805731000091 - ], - [ - 128.18799889400023, - 0.420843817000147 - ], - [ - 128.16846764400006, - 0.441880601000165 - ], - [ - 128.1520288420002, - 0.455511786000116 - ], - [ - 128.07032311300011, - 0.463364976000193 - ], - [ - 128.05591881600006, - 0.461737372000172 - ], - [ - 128.03158613400015, - 0.47134023600016 - ], - [ - 127.9786889980002, - 0.472560940000079 - ], - [ - 127.96021569100017, - 0.48281484600011 - ], - [ - 127.94109134200019, - 0.465806382000054 - ], - [ - 127.92335045700011, - 0.453436591000099 - ], - [ - 127.91049238399998, - 0.437689520000148 - ], - [ - 127.89649498800011, - 0.355658270000134 - ], - [ - 127.88282311300006, - 0.335923570000105 - ], - [ - 127.87826582100004, - 0.324530341000127 - ], - [ - 127.88086998800023, - 0.301743882000025 - ], - [ - 127.90609785199999, - 0.275376695000105 - ], - [ - 127.91236412900005, - 0.253485419000086 - ], - [ - 127.92123457099999, - 0.14557526200015 - ], - [ - 127.91920006600017, - 0.131333726000136 - ], - [ - 127.91146894600016, - 0.118882554000123 - ], - [ - 127.89576256600017, - 0.102362372000144 - ], - [ - 127.88786868600013, - 0.087469794000015 - ], - [ - 127.88461347700016, - 0.067043361000117 - ], - [ - 127.88575280000012, - 0.023504950000017 - ], - [ - 127.89242597700016, - -0.01718515399989 - ], - [ - 127.90381920700023, - -0.04949309699991 - ], - [ - 127.93344160200016, - -0.106784763999855 - ], - [ - 127.95460045700005, - -0.163506768999824 - ], - [ - 127.97315514400006, - -0.196872653999904 - ], - [ - 127.97657311300011, - -0.243340752999856 - ], - [ - 127.98072350400005, - -0.263848565999893 - ], - [ - 127.99170983200011, - -0.281426690999922 - ], - [ - 128.01734459700006, - -0.312595309999921 - ], - [ - 128.02222741000006, - -0.329034112999906 - ], - [ - 128.02418053500017, - -0.349786065999822 - ], - [ - 128.03549238400015, - -0.395928643999923 - ], - [ - 128.04273522200018, - -0.415297132999939 - ], - [ - 128.08448326900012, - -0.480889580999957 - ], - [ - 128.09636478000007, - -0.517266533999859 - ], - [ - 128.12574303500017, - -0.543633721999939 - ], - [ - 128.138926629, - -0.558689059999864 - ], - [ - 128.22779381600006, - -0.709567966999856 - ], - [ - 128.281993035, - -0.766208591999842 - ], - [ - 128.337657097, - -0.812595309999907 - ], - [ - 128.34742272200018, - -0.823418877999984 - ], - [ - 128.36890709700018, - -0.852715752999913 - ], - [ - 128.38542728000007, - -0.867120049999883 - ], - [ - 128.42042076900006, - -0.883070570999891 - ], - [ - 128.435394727, - -0.893324476999837 - ], - [ - 128.44068444100017, - -0.908786716999856 - ], - [ - 128.4332788420002, - -0.908786716999856 - ], - [ - 128.40601647200012, - -0.892266533999873 - ], - [ - 128.37086022200006, - -0.884860934999878 - ], - [ - 128.28402754000004, - -0.878187757999839 - ], - [ - 128.26636803500006, - -0.873711846999868 - ], - [ - 128.25098717500006, - -0.866794528999861 - ], - [ - 128.23804772200018, - -0.857028904 - ], - [ - 128.22885175900004, - -0.839939059999963 - ], - [ - 128.23511803500006, - -0.829034112999906 - ], - [ - 128.2487085300002, - -0.826104424999883 - ], - [ - 128.26189212300008, - -0.833103122999859 - ], - [ - 128.26872806100008, - -0.833103122999859 - ], - [ - 128.24952233200023, - -0.796482028999932 - ], - [ - 128.20394941500015, - -0.769463799999883 - ], - [ - 128.04883873800017, - -0.712823174999897 - ], - [ - 128.03223717500012, - -0.699314059999921 - ], - [ - 128.0206811860002, - -0.682061455999914 - ], - [ - 127.96851647200006, - -0.559502862999963 - ], - [ - 127.91236412900005, - -0.476739190999922 - ], - [ - 127.88559004000015, - -0.406019789999903 - ], - [ - 127.86882571700014, - -0.389336846999868 - ], - [ - 127.85132897200018, - -0.365492445999962 - ], - [ - 127.84083092500012, - -0.360039971999839 - ], - [ - 127.8322046230002, - -0.357517184999921 - ], - [ - 127.77759850400005, - -0.328057549999841 - ], - [ - 127.74146569100012, - -0.303399346999853 - ], - [ - 127.72413170700011, - -0.298597914999945 - ], - [ - 127.70834394600016, - -0.287041924999841 - ], - [ - 127.6888126960001, - -0.260186455999857 - ], - [ - 127.67237389400006, - -0.230157158999901 - ], - [ - 127.66602623800023, - -0.209242445999934 - ], - [ - 127.66724694100017, - -0.185804945999948 - ], - [ - 127.68262780000012, - -0.144952080999914 - ], - [ - 127.68653405000012, - -0.123874606999976 - ], - [ - 127.68539472700016, - -0.008314710999926 - ], - [ - 127.68653405000012, - 0.003078518000123 - ], - [ - 127.68946373800023, - 0.014837958000101 - ], - [ - 127.69825280000012, - 0.037787177000013 - ], - [ - 127.70020592500023, - 0.047674872000101 - ], - [ - 127.69752037900017, - 0.07078685100015 - ], - [ - 127.68458092500023, - 0.099351304000052 - ], - [ - 127.67969811300011, - 0.119086005 - ], - [ - 127.68067467500018, - 0.162258205000086 - ], - [ - 127.71371504000004, - 0.277329820000148 - ], - [ - 127.71680748800011, - 0.296454169000128 - ], - [ - 127.71558678500017, - 0.312567450000103 - ], - [ - 127.70915774800008, - 0.327215887000108 - ], - [ - 127.69678795700023, - 0.34223053600013 - ], - [ - 127.68588300900015, - 0.346625067000119 - ], - [ - 127.66423587300008, - 0.339789130000099 - ], - [ - 127.6551212900001, - 0.34223053600013 - ], - [ - 127.61085045700023, - 0.379787502000141 - ], - [ - 127.60865319100006, - 0.382879950000046 - ], - [ - 127.60580488399998, - 0.390448309000178 - ], - [ - 127.60401451900012, - 0.393459377000084 - ], - [ - 127.58350670700023, - 0.407131252000113 - ], - [ - 127.5765080090001, - 0.415513414000088 - ], - [ - 127.57227623800023, - 0.422349351000193 - ], - [ - 127.57032311300011, - 0.431138414000074 - ], - [ - 127.568614129, - 0.462836005000042 - ], - [ - 127.56104576900023, - 0.50942617400014 - ], - [ - 127.55616295700005, - 0.52383047100011 - ], - [ - 127.55054772200018, - 0.529364325000046 - ], - [ - 127.54249108200023, - 0.534654039000102 - ], - [ - 127.534434441, - 0.541652736000088 - ], - [ - 127.52833092500012, - 0.551743882000054 - ], - [ - 127.52686608200017, - 0.560614325000017 - ], - [ - 127.52947024800008, - 0.605902411000116 - ], - [ - 127.54249108200023, - 0.667181708000129 - ], - [ - 127.54737389400012, - 0.715399481000176 - ], - [ - 127.55543053500006, - 0.739894924000026 - ], - [ - 127.5880639980002, - 0.761175848000093 - ], - [ - 127.60466556100008, - 0.786037502000127 - ], - [ - 127.61833743600019, - 0.813462632000082 - ], - [ - 127.62452233200017, - 0.832220770000134 - ], - [ - 127.61158287900017, - 0.857733466000141 - ], - [ - 127.57748457100016, - 0.869289455000157 - ], - [ - 127.53760826900006, - 0.875718492000175 - ], - [ - 127.50782311300006, - 0.88621653900006 - ], - [ - 127.49463951900012, - 0.905015367000104 - ], - [ - 127.49854576900012, - 0.92279694200009 - ], - [ - 127.50879967500023, - 0.940375067000119 - ], - [ - 127.51465905000006, - 0.958889065000122 - ], - [ - 127.5125431650001, - 0.968898830000029 - ], - [ - 127.50359134200008, - 0.987209377000084 - ], - [ - 127.50163821700019, - 0.99298737200013 - ], - [ - 127.49935957100004, - 0.996486721000124 - ], - [ - 127.49000084700018, - 0.995998440000136 - ], - [ - 127.48780358200011, - 0.999904690000051 - ], - [ - 127.48853600400005, - 1.018255927000098 - ], - [ - 127.48780358200011, - 1.024074611000145 - ], - [ - 127.489024285, - 1.03457265800003 - ], - [ - 127.49268639400006, - 1.044867255000128 - ], - [ - 127.49195397200006, - 1.054917710000112 - ], - [ - 127.48047936300011, - 1.065008856000162 - ], - [ - 127.47144616000017, - 1.065578518000052 - ], - [ - 127.46290123800017, - 1.060614325000088 - ], - [ - 127.455332879, - 1.054388739000132 - ], - [ - 127.44947350400017, - 1.051336981000048 - ], - [ - 127.43213951900006, - 1.04682038 - ], - [ - 127.41627037900017, - 1.040350653000175 - ], - [ - 127.40414472700016, - 1.042792059000107 - ], - [ - 127.39861087300002, - 1.065008856000162 - ], - [ - 127.3997501960001, - 1.078762111000088 - ], - [ - 127.4044702480002, - 1.087388414000188 - ], - [ - 127.4109806650001, - 1.095160223000093 - ], - [ - 127.41846764400023, - 1.105943101000193 - ], - [ - 127.42546634200002, - 1.120428778000147 - ], - [ - 127.42741946700008, - 1.128485419000171 - ], - [ - 127.42579186300023, - 1.150702216000141 - ], - [ - 127.42066491000006, - 1.163804429000024 - ], - [ - 127.41000410199999, - 1.175523179000095 - ], - [ - 127.40023847700016, - 1.189439195000162 - ], - [ - 127.39861087300002, - 1.209051825000131 - ], - [ - 127.40593509200008, - 1.22988515800003 - ], - [ - 127.43482506600017, - 1.277411200000031 - ], - [ - 127.46338951900023, - 1.314113674000126 - ], - [ - 127.48780358200011, - 1.380316473000107 - ], - [ - 127.52637780000006, - 1.438544012000122 - ], - [ - 127.54078209700006, - 1.475653387000051 - ], - [ - 127.53199303500017, - 1.506903387000023 - ], - [ - 127.51937910199999, - 1.531927802000112 - ], - [ - 127.52515709700006, - 1.556626695000105 - ], - [ - 127.55616295700005, - 1.600043036000145 - ], - [ - 127.54672285200016, - 1.615423895000092 - ], - [ - 127.54371178500017, - 1.622992255000142 - ], - [ - 127.54249108200023, - 1.630438544000114 - ], - [ - 127.54639733200023, - 1.642889716000127 - ], - [ - 127.55518639400012, - 1.648423570000148 - ], - [ - 127.56430097699999, - 1.651027736000145 - ], - [ - 127.56983483200011, - 1.65468984600011 - ], - [ - 127.57309004000015, - 1.664007880000142 - ], - [ - 127.57488040500007, - 1.675279039000131 - ], - [ - 127.571543816, - 1.68480052300005 - ], - [ - 127.55933678500006, - 1.688869533000101 - ], - [ - 127.55567467500012, - 1.692531643000137 - ], - [ - 127.55958092500006, - 1.700832424000041 - ], - [ - 127.56983483200011, - 1.715521552000041 - ], - [ - 127.58090254000015, - 1.75177643400005 - ], - [ - 127.62973066500015, - 1.835394598000093 - ], - [ - 127.65463300899998, - 1.865668036000088 - ], - [ - 127.67741946700014, - 1.907456773000106 - ], - [ - 127.68995201900012, - 1.925279039000173 - ], - [ - 127.74659264400012, - 1.973130601000108 - ], - [ - 127.76970462300008, - 2.008693752 - ], - [ - 127.861094597, - 2.104437567000119 - ], - [ - 127.89258873800023, - 2.129055080000128 - ], - [ - 127.89942467500023, - 2.137884833 - ], - [ - 127.90430748800011, - 2.153998114000146 - ], - [ - 127.917246941, - 2.172105209999984 - ], - [ - 127.93482506600006, - 2.187648830000157 - ], - [ - 127.95411217500006, - 2.195868231000162 - ], - [ - 127.97315514400006, - 2.193101304000109 - ], - [ - 127.98812910200004, - 2.184312242000132 - ], - [ - 128.00391686300017, - 2.18060944200009 - ], - [ - 128.04737389400012, - 2.203843492000033 - ], - [ - 128.05665123800023, - 2.192450262000065 - ] - ] - ], - [ - [ - [ - 97.19157962300008, - 2.208929755000142 - ], - [ - 97.20801842500006, - 2.207586981000063 - ], - [ - 97.22071373800011, - 2.214300848000093 - ], - [ - 97.23292076900012, - 2.223822333000101 - ], - [ - 97.24675540500019, - 2.230658270000106 - ], - [ - 97.26465905000006, - 2.232245184000135 - ], - [ - 97.28126061300011, - 2.229071356000176 - ], - [ - 97.28923587300008, - 2.221177476000193 - ], - [ - 97.28150475400017, - 2.208929755000142 - ], - [ - 97.30583743600002, - 2.185370184000092 - ], - [ - 97.31983483200011, - 2.178656317000147 - ], - [ - 97.32374108200005, - 2.16958242400014 - ], - [ - 97.32862389400006, - 2.14752838700015 - ], - [ - 97.3362736340001, - 2.126654364000089 - ], - [ - 97.34107506600017, - 2.105698960000126 - ], - [ - 97.343028191, - 2.083319403000104 - ], - [ - 97.34229576900006, - 2.05809153900006 - ], - [ - 97.33952884200002, - 2.049465236000145 - ], - [ - 97.33521569100006, - 2.042181708000044 - ], - [ - 97.32935631600017, - 2.036322333000086 - ], - [ - 97.32178795700005, - 2.03143952000012 - ], - [ - 97.32032311300006, - 2.049994208000115 - ], - [ - 97.32178795700005, - 2.05809153900006 - ], - [ - 97.30616295700005, - 2.057196356000148 - ], - [ - 97.29615319100017, - 2.069525458000101 - ], - [ - 97.28785241000017, - 2.087469794000143 - ], - [ - 97.27808678500006, - 2.103094794000128 - ], - [ - 97.23389733200005, - 2.147162177000126 - ], - [ - 97.22681725400011, - 2.158026434000035 - ], - [ - 97.2073673840001, - 2.175523179000081 - ], - [ - 97.102793816, - 2.212713934000163 - ], - [ - 97.10938561300011, - 2.220160223000136 - ], - [ - 97.12517337300002, - 2.225490627000113 - ], - [ - 97.16700280000006, - 2.233099677000141 - ], - [ - 97.17172285200016, - 2.233099677000141 - ], - [ - 97.17847741, - 2.230658270000106 - ], - [ - 97.18279056100019, - 2.226060289000173 - ], - [ - 97.19157962300008, - 2.208929755000142 - ] - ] - ], - [ - [ - [ - 127.75993899800014, - 2.269924221000039 - ], - [ - 127.785899285, - 2.264227606000134 - ], - [ - 127.80144290500013, - 2.265041408000144 - ], - [ - 127.81055748800011, - 2.26386139500012 - ], - [ - 127.81511478000007, - 2.25527578300003 - ], - [ - 127.816172722, - 2.233791408000087 - ], - [ - 127.80518639400023, - 2.21234772300015 - ], - [ - 127.78126061300011, - 2.208929755000142 - ], - [ - 127.75766035200016, - 2.22138092700007 - ], - [ - 127.74822024800002, - 2.247381903000132 - ], - [ - 127.751719597, - 2.265855210000069 - ], - [ - 127.75993899800014, - 2.269924221000039 - ] - ] - ], - [ - [ - [ - 118.58985436300011, - 2.305568752000084 - ], - [ - 118.62256920700023, - 2.286118882 - ], - [ - 118.63379967500012, - 2.271673895000035 - ], - [ - 118.63266035199999, - 2.260687567000062 - ], - [ - 118.617442254, - 2.268540757000139 - ], - [ - 118.58594811300011, - 2.291489976000136 - ], - [ - 118.57488040500007, - 2.294175523000106 - ], - [ - 118.57488040500007, - 2.292425848000121 - ], - [ - 118.580332879, - 2.286851304000024 - ], - [ - 118.58594811300011, - 2.277818101000193 - ], - [ - 118.59961998800023, - 2.244330145000148 - ], - [ - 118.62387129000004, - 2.213080145000077 - ], - [ - 118.63949629000004, - 2.198635158000116 - ], - [ - 118.65430748800006, - 2.189683335000012 - ], - [ - 118.65430748800006, - 2.182277736000103 - ], - [ - 118.632090691, - 2.187241928999981 - ], - [ - 118.610118035, - 2.202297268 - ], - [ - 118.59115644599999, - 2.221014716000056 - ], - [ - 118.57846113400004, - 2.236883856000162 - ], - [ - 118.56836998800006, - 2.255601304000052 - ], - [ - 118.55689537900005, - 2.28595612200003 - ], - [ - 118.55640709700006, - 2.312201239000132 - ], - [ - 118.57846113400004, - 2.318793036000031 - ], - [ - 118.58985436300011, - 2.305568752000084 - ] - ] - ], - [ - [ - [ - 125.45264733200011, - 2.333075262000108 - ], - [ - 125.423106316, - 2.317124742000189 - ], - [ - 125.39234459700006, - 2.325669664000117 - ], - [ - 125.37094160199999, - 2.348130601000122 - ], - [ - 125.36947675900004, - 2.374090887000122 - ], - [ - 125.38062584700006, - 2.385728257000039 - ], - [ - 125.39682050900004, - 2.391424872000101 - ], - [ - 125.41504967500006, - 2.391831773000106 - ], - [ - 125.43213951900023, - 2.387681382000082 - ], - [ - 125.45069420700023, - 2.377915757000125 - ], - [ - 125.45622806100008, - 2.367743231000176 - ], - [ - 125.45264733200011, - 2.333075262000108 - ] - ] - ], - [ - [ - [ - 128.16993248800023, - 2.297430731000148 - ], - [ - 128.15463300899998, - 2.286363023000035 - ], - [ - 128.14112389400012, - 2.296372789000102 - ], - [ - 128.13070722700004, - 2.316473700000145 - ], - [ - 128.12525475400017, - 2.335638739000032 - ], - [ - 128.12525475400017, - 2.347479559000163 - ], - [ - 128.12867272200018, - 2.35830312700007 - ], - [ - 128.13477623800006, - 2.368312893000066 - ], - [ - 128.14210045700005, - 2.377834377000141 - ], - [ - 128.14975019600004, - 2.39061107000019 - ], - [ - 128.154144727, - 2.400580145 - ], - [ - 128.16016686300011, - 2.404852606000105 - ], - [ - 128.17318769599999, - 2.40070221600007 - ], - [ - 128.19361412900017, - 2.367254950000017 - ], - [ - 128.1922306650001, - 2.354641018000123 - ], - [ - 128.16993248800023, - 2.297430731000148 - ] - ] - ], - [ - [ - [ - 109.05347741000006, - 2.537909247000101 - ], - [ - 109.09685306100019, - 2.537176825000174 - ], - [ - 109.10865319100017, - 2.531683661000059 - ], - [ - 109.11394290500007, - 2.523179429000109 - ], - [ - 109.11085045700005, - 2.516058661000073 - ], - [ - 109.0950626960001, - 2.504380601000165 - ], - [ - 109.07846113400015, - 2.496039130000014 - ], - [ - 109.05225670700011, - 2.487616278000147 - ], - [ - 109.02670332100016, - 2.485825914000159 - ], - [ - 109.01246178500006, - 2.49754466400006 - ], - [ - 109.01482181100019, - 2.511053778000118 - ], - [ - 109.02247155000012, - 2.52000560100015 - ], - [ - 109.0232853520001, - 2.527818101000136 - ], - [ - 109.005625847, - 2.537909247000101 - ], - [ - 109.0008244150001, - 2.537420966000113 - ], - [ - 108.99073326900006, - 2.529730536000017 - ], - [ - 108.98560631600006, - 2.527736721000153 - ], - [ - 108.9798283210001, - 2.529120184000135 - ], - [ - 108.97437584700006, - 2.532904364000075 - ], - [ - 108.97006269600016, - 2.53815338700015 - ], - [ - 108.9681095710001, - 2.543646552 - ], - [ - 108.971934441, - 2.555121161000116 - ], - [ - 108.9827580090001, - 2.560614325000145 - ], - [ - 108.99642988400015, - 2.561753648000177 - ], - [ - 109.00831139400012, - 2.560126044000157 - ], - [ - 109.01978600400005, - 2.555121161000116 - ], - [ - 109.04200280000012, - 2.541978257000068 - ], - [ - 109.05347741000006, - 2.537909247000101 - ] - ] - ], - [ - [ - [ - 128.59603925900004, - 2.608587958000143 - ], - [ - 128.62012780000023, - 2.560451565 - ], - [ - 128.63038170700005, - 2.544623114000146 - ], - [ - 128.64210045700005, - 2.537909247000101 - ], - [ - 128.68637129000004, - 2.4839541690001 - ], - [ - 128.69450931100002, - 2.43886953300013 - ], - [ - 128.68165123800011, - 2.399074611000131 - ], - [ - 128.66081790500002, - 2.362290757000054 - ], - [ - 128.64551842500006, - 2.326239325000088 - ], - [ - 128.64210045700005, - 2.26117584800015 - ], - [ - 128.58521569100006, - 2.154852606000148 - ], - [ - 128.57300866000017, - 2.120591539000173 - ], - [ - 128.56666100400005, - 2.109930731000063 - ], - [ - 128.50953209700006, - 2.062445380000142 - ], - [ - 128.49024498800011, - 2.054266669000128 - ], - [ - 128.34498131600006, - 2.039943752000141 - ], - [ - 128.33082116, - 2.034857489000117 - ], - [ - 128.3170679050002, - 2.01972077000012 - ], - [ - 128.28956139400023, - 2.001410223000065 - ], - [ - 128.2690535820001, - 1.995347398000078 - ], - [ - 128.2755639980002, - 2.017157294000114 - ], - [ - 128.28858483200005, - 2.039618231000119 - ], - [ - 128.28370201900012, - 2.057603256999982 - ], - [ - 128.25196373800023, - 2.089422919000015 - ], - [ - 128.24610436300011, - 2.106146552000041 - ], - [ - 128.24878991000017, - 2.175441799000097 - ], - [ - 128.24146569100017, - 2.222479559000021 - ], - [ - 128.23210696700008, - 2.246812242000161 - ], - [ - 128.21713300900004, - 2.257391669000128 - ], - [ - 128.19711347700016, - 2.266180731000091 - ], - [ - 128.20777428500017, - 2.286525783 - ], - [ - 128.24878991000017, - 2.326239325000088 - ], - [ - 128.27662194100006, - 2.368719794000071 - ], - [ - 128.32113691500015, - 2.45864492400014 - ], - [ - 128.3580835300002, - 2.49754466400006 - ], - [ - 128.40072675900004, - 2.51837799700013 - ], - [ - 128.4194442070001, - 2.532619533000044 - ], - [ - 128.43002363400015, - 2.567572333000143 - ], - [ - 128.43767337300008, - 2.575669664000159 - ], - [ - 128.45736738400004, - 2.590073960000126 - ], - [ - 128.46656334700018, - 2.594305731000148 - ], - [ - 128.4747827480002, - 2.590765692000076 - ], - [ - 128.48845462300014, - 2.57953522299999 - ], - [ - 128.51514733200023, - 2.573391018000095 - ], - [ - 128.52515709700006, - 2.58242422100011 - ], - [ - 128.53142337300008, - 2.601141669000171 - ], - [ - 128.54590905000023, - 2.623846747000115 - ], - [ - 128.56641686300006, - 2.633612372000158 - ], - [ - 128.58326256600017, - 2.625189520000106 - ], - [ - 128.59603925900004, - 2.608587958000143 - ] - ] - ], - [ - [ - [ - 125.42107181100019, - 2.633937893000081 - ], - [ - 125.41114342500006, - 2.627264716000042 - ], - [ - 125.39258873800006, - 2.628892320000062 - ], - [ - 125.38257897200012, - 2.641831773000149 - ], - [ - 125.37826582099999, - 2.66034577 - ], - [ - 125.37761478000007, - 2.678778387000023 - ], - [ - 125.374278191, - 2.69310130400001 - ], - [ - 125.35971113399998, - 2.723089911000145 - ], - [ - 125.35645592500023, - 2.740545966000028 - ], - [ - 125.36011803500011, - 2.753322658000144 - ], - [ - 125.37891686300023, - 2.790961005000057 - ], - [ - 125.38721764400023, - 2.802394924000097 - ], - [ - 125.40162194100017, - 2.810207424000097 - ], - [ - 125.41700280000023, - 2.810248114000089 - ], - [ - 125.4314884770001, - 2.804103908000101 - ], - [ - 125.44361412900017, - 2.793036200000074 - ], - [ - 125.45101972700016, - 2.778387762000065 - ], - [ - 125.45045006600017, - 2.764837958000086 - ], - [ - 125.44304446700019, - 2.752590236000117 - ], - [ - 125.41602623800017, - 2.73078034100017 - ], - [ - 125.40967858200023, - 2.724514065000037 - ], - [ - 125.40495853000002, - 2.716701565000122 - ], - [ - 125.40186608200023, - 2.699937242000104 - ], - [ - 125.40658613400015, - 2.686346747000144 - ], - [ - 125.41846764400012, - 2.66889069200009 - ], - [ - 125.42188561300011, - 2.657212632000096 - ], - [ - 125.42367597699999, - 2.64472077 - ], - [ - 125.42107181100019, - 2.633937893000081 - ] - ] - ], - [ - [ - [ - 106.2415470710001, - 2.738023179000095 - ], - [ - 106.23780358200005, - 2.732855536000088 - ], - [ - 106.23243248800011, - 2.741766669000043 - ], - [ - 106.21949303500011, - 2.758368231000176 - ], - [ - 106.21265709700018, - 2.78148021000014 - ], - [ - 106.20435631600012, - 2.796128648000149 - ], - [ - 106.19898522200006, - 2.809515692000062 - ], - [ - 106.20329837300002, - 2.819077867000132 - ], - [ - 106.21631920700005, - 2.822455145000148 - ], - [ - 106.22624759200002, - 2.817043361000103 - ], - [ - 106.23316491000006, - 2.806301174000012 - ], - [ - 106.23780358200005, - 2.793768622000101 - ], - [ - 106.24317467500012, - 2.760484117000104 - ], - [ - 106.24341881600006, - 2.74542877800009 - ], - [ - 106.2415470710001, - 2.738023179000095 - ] - ] - ], - [ - [ - [ - 95.911875847, - 2.906236070000077 - ], - [ - 95.91041100400017, - 2.873683986000017 - ], - [ - 95.8907983730002, - 2.889105536000045 - ], - [ - 95.8829858730002, - 2.883937893000123 - ], - [ - 95.88306725400011, - 2.846380927000112 - ], - [ - 95.91724694100017, - 2.860663153000118 - ], - [ - 95.92774498800006, - 2.844549872000144 - ], - [ - 95.96452884200002, - 2.827948309000092 - ], - [ - 95.98170006600017, - 2.790350653000175 - ], - [ - 96.00326582100016, - 2.777004299000083 - ], - [ - 96.02833092500006, - 2.768459377000141 - ], - [ - 96.09050540500019, - 2.757798570000034 - ], - [ - 96.1067814460001, - 2.749660549000097 - ], - [ - 96.1263126960001, - 2.73371002800009 - ], - [ - 96.13086998800006, - 2.715277411000059 - ], - [ - 96.10181725400017, - 2.675441799 - ], - [ - 96.10279381600006, - 2.654608466000099 - ], - [ - 96.11866295700005, - 2.666001695000162 - ], - [ - 96.1297306650001, - 2.664780992000146 - ], - [ - 96.13843834700018, - 2.65839264500012 - ], - [ - 96.14714603000007, - 2.654608466000099 - ], - [ - 96.15626061300006, - 2.648423570000134 - ], - [ - 96.16187584700018, - 2.64777252800009 - ], - [ - 96.16423587300014, - 2.654608466000099 - ], - [ - 96.16089928500011, - 2.661200262000165 - ], - [ - 96.14698326900012, - 2.670721747000158 - ], - [ - 96.14372806100008, - 2.678778387000023 - ], - [ - 96.15796959700018, - 2.680405992000132 - ], - [ - 96.24610436300006, - 2.600002346000139 - ], - [ - 96.25782311300006, - 2.591864325000117 - ], - [ - 96.29070071700008, - 2.575181382000082 - ], - [ - 96.30420983200005, - 2.572088934000092 - ], - [ - 96.32129967500006, - 2.566148179000081 - ], - [ - 96.33594811300006, - 2.552150783000116 - ], - [ - 96.359141472, - 2.521429755000113 - ], - [ - 96.36394290500019, - 2.508490302000112 - ], - [ - 96.36784915500019, - 2.489691473000065 - ], - [ - 96.37525475400017, - 2.473863023000121 - ], - [ - 96.39014733200005, - 2.469671942000105 - ], - [ - 96.39527428500006, - 2.477362372000115 - ], - [ - 96.39698326900006, - 2.493109442000076 - ], - [ - 96.39649498800006, - 2.524847723000121 - ], - [ - 96.41065514400012, - 2.508937893000109 - ], - [ - 96.41724694100017, - 2.506333726000108 - ], - [ - 96.42432701900012, - 2.51056549700013 - ], - [ - 96.44410241000006, - 2.4903832050001 - ], - [ - 96.4650171230002, - 2.43781159100017 - ], - [ - 96.47950280000006, - 2.414984442000147 - ], - [ - 96.47510826900006, - 2.397853908000116 - ], - [ - 96.48121178500017, - 2.378851630000113 - ], - [ - 96.48121178500017, - 2.363999742000146 - ], - [ - 96.45850670700011, - 2.359808661000116 - ], - [ - 96.46583092500012, - 2.359808661000116 - ], - [ - 96.43067467500006, - 2.348781643 - ], - [ - 96.42090905000012, - 2.343003648000106 - ], - [ - 96.411387566, - 2.343817450000117 - ], - [ - 96.36963951900006, - 2.367254950000017 - ], - [ - 96.35108483200005, - 2.355047919000128 - ], - [ - 96.33497155000012, - 2.355454820000134 - ], - [ - 96.32081139400006, - 2.363470770000077 - ], - [ - 96.30762780000006, - 2.374090887000122 - ], - [ - 96.31283613400015, - 2.378648179000066 - ], - [ - 96.3226017590001, - 2.389797268000081 - ], - [ - 96.32813561300011, - 2.394517320000176 - ], - [ - 96.30616295700005, - 2.405096747000144 - ], - [ - 96.28516686300006, - 2.436428127000099 - ], - [ - 96.23991946700019, - 2.44867584800015 - ], - [ - 96.06568444100006, - 2.579413153000019 - ], - [ - 96.04265384200008, - 2.592027085000083 - ], - [ - 96.02027428500006, - 2.600002346000139 - ], - [ - 96.01099694100017, - 2.600897528000132 - ], - [ - 95.98609459700006, - 2.600002346000139 - ], - [ - 95.9806421230002, - 2.602687893000109 - ], - [ - 95.971934441, - 2.612209377000028 - ], - [ - 95.96509850400011, - 2.614243882000054 - ], - [ - 95.9612736340001, - 2.607123114000089 - ], - [ - 95.95801842500006, - 2.602240302000112 - ], - [ - 95.95508873800011, - 2.600002346000139 - ], - [ - 95.94752037900017, - 2.598049221000096 - ], - [ - 95.93995201900012, - 2.59516022300015 - ], - [ - 95.93140709700012, - 2.595607815000065 - ], - [ - 95.9114689460001, - 2.610296942000147 - ], - [ - 95.89210045700011, - 2.615627346000124 - ], - [ - 95.88306725400011, - 2.620428778000104 - ], - [ - 95.878184441, - 2.628566799000041 - ], - [ - 95.8777775400001, - 2.637111721000139 - ], - [ - 95.874766472, - 2.645819403000047 - ], - [ - 95.86255944100006, - 2.654608466000099 - ], - [ - 95.79053795700011, - 2.654608466000099 - ], - [ - 95.7853296230002, - 2.660589911000031 - ], - [ - 95.7874455090001, - 2.674058335000097 - ], - [ - 95.79428144600016, - 2.696234442000076 - ], - [ - 95.7889103520001, - 2.70400625200007 - ], - [ - 95.75896243600019, - 2.724107164000031 - ], - [ - 95.7615666020001, - 2.739935614000146 - ], - [ - 95.74878991000017, - 2.749904690000136 - ], - [ - 95.7351994150001, - 2.757879950000017 - ], - [ - 95.7356876960001, - 2.767889716000084 - ], - [ - 95.7400822270001, - 2.778062242000132 - ], - [ - 95.7278751960001, - 2.779242255000057 - ], - [ - 95.71021569100017, - 2.777492580000072 - ], - [ - 95.69800866, - 2.778753973000079 - ], - [ - 95.69263756600006, - 2.792059637000179 - ], - [ - 95.69263756600006, - 2.812811591000084 - ], - [ - 95.69955488400015, - 2.831773179000095 - ], - [ - 95.71485436300011, - 2.84015534100007 - ], - [ - 95.76872806100008, - 2.840806382000025 - ], - [ - 95.78003991000006, - 2.846380927000112 - ], - [ - 95.78150475400011, - 2.855047919000029 - ], - [ - 95.776621941, - 2.86098867400014 - ], - [ - 95.7698673840001, - 2.864894924000126 - ], - [ - 95.76636803500011, - 2.867499091000127 - ], - [ - 95.76677493600019, - 2.878119208000072 - ], - [ - 95.77182050900015, - 2.895453192000062 - ], - [ - 95.773203972, - 2.905015367000061 - ], - [ - 95.78467858200005, - 2.924953518000137 - ], - [ - 95.78687584700006, - 2.932684637000136 - ], - [ - 95.79151451900006, - 2.942531643000066 - ], - [ - 95.80152428500017, - 2.937567450000031 - ], - [ - 95.81104576900006, - 2.927435614000061 - ], - [ - 95.81413821700002, - 2.922105210000012 - ], - [ - 95.88404381600017, - 2.919012762000108 - ], - [ - 95.911875847, - 2.906236070000077 - ] - ] - ], - [ - [ - [ - 108.8458764980002, - 2.850653387000122 - ], - [ - 108.84245853000019, - 2.846380927000112 - ], - [ - 108.82960045700005, - 2.847601630000128 - ], - [ - 108.818125847, - 2.855902411000031 - ], - [ - 108.80014082100016, - 2.873683986000017 - ], - [ - 108.78296959700006, - 2.882269598000107 - ], - [ - 108.77588951900006, - 2.888006903000175 - ], - [ - 108.77515709700006, - 2.895086981000148 - ], - [ - 108.77588951900006, - 2.89594147300015 - ], - [ - 108.79688561300011, - 2.90766022300005 - ], - [ - 108.8143009770001, - 2.921454169000057 - ], - [ - 108.82927493600002, - 2.936265367000033 - ], - [ - 108.8362736340001, - 2.947577216000099 - ], - [ - 108.84083092500006, - 2.960109768000095 - ], - [ - 108.84245853000019, - 2.973618882000082 - ], - [ - 108.855723504, - 3.003363348 - ], - [ - 108.88135826900006, - 3.002997137000165 - ], - [ - 108.89861087300008, - 2.98285553600013 - ], - [ - 108.88624108200005, - 2.953111070000034 - ], - [ - 108.88412519600016, - 2.941636460000083 - ], - [ - 108.89226321700008, - 2.903876044000029 - ], - [ - 108.88965905000006, - 2.888006903000175 - ], - [ - 108.88355553500017, - 2.883978583000115 - ], - [ - 108.86280358200005, - 2.877142645000106 - ], - [ - 108.85547936300006, - 2.873683986000017 - ], - [ - 108.85173587300002, - 2.867661851000179 - ], - [ - 108.8458764980002, - 2.850653387000122 - ] - ] - ], - [ - [ - [ - 107.76823978000019, - 2.979071356000105 - ], - [ - 107.75611412900017, - 2.978461005000057 - ], - [ - 107.74512780000012, - 2.983547268 - ], - [ - 107.751231316, - 3.012030341000084 - ], - [ - 107.77295983200011, - 3.025295315000108 - ], - [ - 107.7962345710001, - 3.025539455000157 - ], - [ - 107.80713951900006, - 3.014878648000121 - ], - [ - 107.81324303500017, - 2.99494049700013 - ], - [ - 107.81120853000002, - 2.986802476000037 - ], - [ - 107.76823978000019, - 2.979071356000105 - ] - ] - ], - [ - [ - [ - 105.7781681650001, - 2.97760651200015 - ], - [ - 105.78492272200018, - 2.977362372000101 - ], - [ - 105.790293816, - 2.981594143000123 - ], - [ - 105.79224694100017, - 2.988267320000091 - ], - [ - 105.79460696700014, - 2.994533596000124 - ], - [ - 105.802012566, - 2.997259833000101 - ], - [ - 105.81348717500006, - 2.996039130000085 - ], - [ - 105.84400475400011, - 2.988470770000049 - ], - [ - 105.85328209700006, - 2.983547268 - ], - [ - 105.846934441, - 2.969916083000044 - ], - [ - 105.839610222, - 2.969916083000044 - ], - [ - 105.839610222, - 2.977362372000101 - ], - [ - 105.83334394600016, - 2.977362372000101 - ], - [ - 105.8118595710001, - 2.90448639499999 - ], - [ - 105.802012566, - 2.898179429000123 - ], - [ - 105.78891035200016, - 2.907171942000062 - ], - [ - 105.78142337300008, - 2.90497467700007 - ], - [ - 105.77556399800002, - 2.898504950000145 - ], - [ - 105.72974694100006, - 2.881170966000155 - ], - [ - 105.73406009200002, - 2.873277085000012 - ], - [ - 105.73894290500019, - 2.869289455000114 - ], - [ - 105.745371941, - 2.867743231000162 - ], - [ - 105.75416100400017, - 2.867499091000127 - ], - [ - 105.76221764400012, - 2.86420319200009 - ], - [ - 105.76514733200005, - 2.856919664000088 - ], - [ - 105.76441491, - 2.849676825000145 - ], - [ - 105.76099694100012, - 2.846380927000112 - ], - [ - 105.7488712900001, - 2.844549872000144 - ], - [ - 105.73658287900005, - 2.841253973000022 - ], - [ - 105.72445722700016, - 2.839667059000163 - ], - [ - 105.71265709700018, - 2.843166408000073 - ], - [ - 105.70484459700018, - 2.850978908000144 - ], - [ - 105.69947350400005, - 2.861639716000084 - ], - [ - 105.69646243600002, - 2.873480536000059 - ], - [ - 105.69556725400005, - 2.884588934000163 - ], - [ - 105.6976017590001, - 2.896470445000119 - ], - [ - 105.7068791020001, - 2.920803127000013 - ], - [ - 105.711680535, - 2.943670966000099 - ], - [ - 105.72217858200011, - 2.969224351000179 - ], - [ - 105.7234806650001, - 2.977362372000101 - ], - [ - 105.71534264400006, - 2.988999742000118 - ], - [ - 105.69117272200006, - 3.002346096000039 - ], - [ - 105.681895379, - 3.011460679000109 - ], - [ - 105.69190514400012, - 3.020493882000039 - ], - [ - 105.69556725400005, - 3.034165756999982 - ], - [ - 105.69410241000017, - 3.048570054000123 - ], - [ - 105.68873131600006, - 3.059963283000087 - ], - [ - 105.70289147200006, - 3.06610748899999 - ], - [ - 105.71029707100016, - 3.04848867400014 - ], - [ - 105.71290123800006, - 3.045640367000104 - ], - [ - 105.7151798840001, - 3.043890692000105 - ], - [ - 105.73218834700018, - 3.03538646 - ], - [ - 105.73707116000006, - 3.031968492000161 - ], - [ - 105.73943118600019, - 3.015122789000159 - ], - [ - 105.73682701900012, - 2.999579169000157 - ], - [ - 105.738536004, - 2.988104559000035 - ], - [ - 105.75416100400017, - 2.983547268 - ], - [ - 105.76238040500019, - 2.98232656500015 - ], - [ - 105.7781681650001, - 2.97760651200015 - ] - ] - ], - [ - [ - [ - 106.23853600400017, - 3.226507880000142 - ], - [ - 106.2591251960001, - 3.214748440000079 - ], - [ - 106.27735436300011, - 3.196234442000147 - ], - [ - 106.28516686300011, - 3.179103908000116 - ], - [ - 106.28516686300011, - 3.08722565300009 - ], - [ - 106.279063347, - 3.08722565300009 - ], - [ - 106.25782311300011, - 3.113918361000103 - ], - [ - 106.24187259200019, - 3.107855536000102 - ], - [ - 106.23389733200005, - 3.11522044500019 - ], - [ - 106.22608483200005, - 3.125555731000105 - ], - [ - 106.21070397200006, - 3.128159898000106 - ], - [ - 106.215098504, - 3.134833075000074 - ], - [ - 106.21607506600017, - 3.140814520000077 - ], - [ - 106.21599368600019, - 3.147162177000027 - ], - [ - 106.21697024800008, - 3.154933986000117 - ], - [ - 106.20582116000017, - 3.20571523600016 - ], - [ - 106.207774285, - 3.225327867000118 - ], - [ - 106.22380618600019, - 3.223781643000081 - ], - [ - 106.23853600400017, - 3.226507880000142 - ] - ] - ], - [ - [ - [ - 117.53028405000012, - 3.305650132000125 - ], - [ - 117.52751712300002, - 3.290838934000149 - ], - [ - 117.52149498800023, - 3.288072007000096 - ], - [ - 117.51335696700002, - 3.290838934000149 - ], - [ - 117.50359134200019, - 3.292669989000132 - ], - [ - 117.47217858200017, - 3.293605861000117 - ], - [ - 117.46192467500012, - 3.292669989000132 - ], - [ - 117.453379754, - 3.28925202000012 - ], - [ - 117.44027754000004, - 3.280015367000075 - ], - [ - 117.43392988400004, - 3.278998114000018 - ], - [ - 117.41700280000012, - 3.28872304900014 - ], - [ - 117.41391035200004, - 3.304836330000114 - ], - [ - 117.42090905000012, - 3.322414455000143 - ], - [ - 117.43336022200006, - 3.336411851000108 - ], - [ - 117.44988040500013, - 3.34393952 - ], - [ - 117.46843509200014, - 3.345282294000071 - ], - [ - 117.48707116, - 3.34145742400014 - ], - [ - 117.50359134200019, - 3.333644924000154 - ], - [ - 117.52084394599999, - 3.324530341000155 - ], - [ - 117.52784264400006, - 3.317368882000125 - ], - [ - 117.53028405000012, - 3.305650132000125 - ] - ] - ], - [ - [ - [ - 106.29200280000012, - 3.316555080000114 - ], - [ - 106.29395592500006, - 3.281073309000035 - ], - [ - 106.29200280000012, - 3.271551825000117 - ], - [ - 106.28565514400006, - 3.263861395000021 - ], - [ - 106.2815861340001, - 3.267523505000057 - ], - [ - 106.2796330090001, - 3.277655341000028 - ], - [ - 106.279063347, - 3.288967190000093 - ], - [ - 106.27670332100016, - 3.292385158000101 - ], - [ - 106.271739129, - 3.293524481000134 - ], - [ - 106.26685631600006, - 3.292385158000101 - ], - [ - 106.26465905000006, - 3.288967190000093 - ], - [ - 106.26547285200016, - 3.281805731000063 - ], - [ - 106.275157097, - 3.254217841000127 - ], - [ - 106.28028405000012, - 3.247503973 - ], - [ - 106.28288821700014, - 3.240871486000117 - ], - [ - 106.279063347, - 3.230617580000015 - ], - [ - 106.23047936300006, - 3.257961330000072 - ], - [ - 106.23536217500012, - 3.262640692 - ], - [ - 106.23682701900006, - 3.268540757000125 - ], - [ - 106.23682701900006, - 3.285223700000159 - ], - [ - 106.24675540500019, - 3.306341864000075 - ], - [ - 106.24976647200018, - 3.326646226000165 - ], - [ - 106.25489342500012, - 3.345160223 - ], - [ - 106.2708439460001, - 3.360988674000041 - ], - [ - 106.29200280000012, - 3.368150132000068 - ], - [ - 106.29737389400006, - 3.358303127000141 - ], - [ - 106.29200280000012, - 3.316555080000114 - ] - ] - ], - [ - [ - [ - 117.659922722, - 3.255275783000087 - ], - [ - 117.64844811300017, - 3.246039130000042 - ], - [ - 117.63795006600017, - 3.248724677000112 - ], - [ - 117.63331139400017, - 3.268215236000103 - ], - [ - 117.62484785200004, - 3.283270575000117 - ], - [ - 117.57178795700011, - 3.313137111000017 - ], - [ - 117.55640709700006, - 3.331854559000078 - ], - [ - 117.54363040500002, - 3.354803778000147 - ], - [ - 117.53467858200011, - 3.379380601000079 - ], - [ - 117.53126061300006, - 3.403143622000158 - ], - [ - 117.54151451900012, - 3.428452867000118 - ], - [ - 117.56666100400011, - 3.438421942000105 - ], - [ - 117.62525475400005, - 3.437689520000077 - ], - [ - 117.64047285199999, - 3.436509507000054 - ], - [ - 117.65699303500017, - 3.433539130000128 - ], - [ - 117.67156009200019, - 3.426988023000064 - ], - [ - 117.68165123800006, - 3.415513414000102 - ], - [ - 117.68392988400015, - 3.399603583000086 - ], - [ - 117.68197675900004, - 3.37750885600002 - ], - [ - 117.67725670700011, - 3.356431382000082 - ], - [ - 117.66537519600016, - 3.329291083000072 - ], - [ - 117.66732832099999, - 3.271551825000117 - ], - [ - 117.659922722, - 3.255275783000087 - ] - ] - ], - [ - [ - [ - 117.89600670700005, - 3.468410549000069 - ], - [ - 117.89128665500007, - 3.455633856000119 - ], - [ - 117.87745201900017, - 3.459947007000039 - ], - [ - 117.82618248800023, - 3.494086005000128 - ], - [ - 117.81885826900012, - 3.511623440000065 - ], - [ - 117.78549238400015, - 3.538478908000144 - ], - [ - 117.77759850400017, - 3.55841705900005 - ], - [ - 117.78492272200018, - 3.581976630000085 - ], - [ - 117.80372155000012, - 3.591050523000092 - ], - [ - 117.82699629000015, - 3.58808014499999 - ], - [ - 117.847911004, - 3.575425523000106 - ], - [ - 117.86304772200012, - 3.559027411000102 - ], - [ - 117.87663821700008, - 3.539780992000061 - ], - [ - 117.88721764400012, - 3.518947658000073 - ], - [ - 117.89389082100016, - 3.497503973000136 - ], - [ - 117.89551842500006, - 3.486273505000128 - ], - [ - 117.89600670700005, - 3.468410549000069 - ] - ] - ], - [ - [ - [ - 117.50619550899998, - 3.502142645000063 - ], - [ - 117.51392662900011, - 3.495306708000143 - ], - [ - 117.51710045700017, - 3.486273505000128 - ], - [ - 117.51726321700014, - 3.477036851000079 - ], - [ - 117.49675540500007, - 3.455552476000136 - ], - [ - 117.45582116000006, - 3.46426015800013 - ], - [ - 117.37305748800011, - 3.497503973000136 - ], - [ - 117.28760826900006, - 3.497503973000136 - ], - [ - 117.27076256600017, - 3.500189520000106 - ], - [ - 117.25489342500023, - 3.507066148000035 - ], - [ - 117.24089603000019, - 3.516180731000105 - ], - [ - 117.22974694100006, - 3.525376695000091 - ], - [ - 117.22201582100016, - 3.535549221000124 - ], - [ - 117.21778405000012, - 3.547837632000082 - ], - [ - 117.21802819100017, - 3.560288804000109 - ], - [ - 117.22413170700017, - 3.570990302000041 - ], - [ - 117.23292076900012, - 3.578680731000148 - ], - [ - 117.24447675900015, - 3.586493231000134 - ], - [ - 117.25709069100006, - 3.592027085000069 - ], - [ - 117.26840254000004, - 3.592922268000152 - ], - [ - 117.27857506600006, - 3.58852773600016 - ], - [ - 117.29712975400017, - 3.575873114000103 - ], - [ - 117.30795332100016, - 3.573187567000033 - ], - [ - 117.39372806100019, - 3.566392320000176 - ], - [ - 117.40821373800017, - 3.55609772299999 - ], - [ - 117.43531334700018, - 3.524603583000072 - ], - [ - 117.45167076900012, - 3.517971096000096 - ], - [ - 117.46176191500015, - 3.515936591000155 - ], - [ - 117.48210696700008, - 3.506984768000052 - ], - [ - 117.50619550899998, - 3.502142645000063 - ] - ] - ], - [ - [ - [ - 125.62728925900015, - 3.518215236000131 - ], - [ - 125.63892662900017, - 3.514349677000126 - ], - [ - 125.64437910200004, - 3.514878648000106 - ], - [ - 125.64698326900012, - 3.492010809000021 - ], - [ - 125.65251712300002, - 3.469631252000084 - ], - [ - 125.65552819100006, - 3.461737372000115 - ], - [ - 125.66342207100004, - 3.44611237200013 - ], - [ - 125.66578209700006, - 3.438788153000118 - ], - [ - 125.66456139400023, - 3.430894273000149 - ], - [ - 125.65951582100004, - 3.424790756999982 - ], - [ - 125.62435957100016, - 3.397650458000143 - ], - [ - 125.61719811300011, - 3.395086981000048 - ], - [ - 125.60271243600008, - 3.39809804900014 - ], - [ - 125.59913170700011, - 3.405503648000121 - ], - [ - 125.59839928500006, - 3.415472723000121 - ], - [ - 125.59302819100012, - 3.42609284100007 - ], - [ - 125.57203209700006, - 3.438137111000074 - ], - [ - 125.52418053500006, - 3.450588283000087 - ], - [ - 125.50733483200023, - 3.463324286000145 - ], - [ - 125.50505618600008, - 3.480780341000099 - ], - [ - 125.513926629, - 3.529120184000121 - ], - [ - 125.51758873800023, - 3.539048570000034 - ], - [ - 125.520762566, - 3.544012762000079 - ], - [ - 125.52100670700005, - 3.576971747000144 - ], - [ - 125.517344597, - 3.582342841000099 - ], - [ - 125.49366295700011, - 3.594387111000117 - ], - [ - 125.442149285, - 3.637762762000165 - ], - [ - 125.43051191500004, - 3.651353257000125 - ], - [ - 125.42115319100017, - 3.668036200000159 - ], - [ - 125.41651451900023, - 3.68756745000006 - ], - [ - 125.41846764400012, - 3.709784247000101 - ], - [ - 125.44206790500002, - 3.736558335000026 - ], - [ - 125.47779381600017, - 3.730780341000141 - ], - [ - 125.51295006600006, - 3.707912502000141 - ], - [ - 125.53451582100004, - 3.683050848000093 - ], - [ - 125.56999759200002, - 3.628119208000101 - ], - [ - 125.57545006600017, - 3.610785223000121 - ], - [ - 125.5745548840001, - 3.604396877000013 - ], - [ - 125.57300866000006, - 3.598456122000158 - ], - [ - 125.57260175900004, - 3.59125397300005 - ], - [ - 125.57545006600017, - 3.580633856000091 - ], - [ - 125.57976321700008, - 3.575873114000103 - ], - [ - 125.59652753999998, - 3.560980536000145 - ], - [ - 125.60352623800006, - 3.552720445000148 - ], - [ - 125.61378014400012, - 3.525376695000091 - ], - [ - 125.61654707100016, - 3.523016669000043 - ], - [ - 125.62728925900015, - 3.518215236000131 - ] - ] - ], - [ - [ - [ - 126.83791507200007, - 3.743390532000177 - ], - [ - 126.81153026000007, - 3.731861627000086 - ], - [ - 126.76538184400007, - 3.772892250000083 - ], - [ - 126.73901235499997, - 3.823800694000084 - ], - [ - 126.74399309000009, - 3.853385379000116 - ], - [ - 126.7802656060002, - 3.843554032000142 - ], - [ - 126.81158808600006, - 3.823865680000139 - ], - [ - 126.8330052150001, - 3.795958589000094 - ], - [ - 126.84288583400004, - 3.779539954000157 - ], - [ - 126.85605696000007, - 3.758195233000052 - ], - [ - 126.83791507200007, - 3.743390532000177 - ] - ] - ], - [ - [ - [ - 117.76677493600008, - 3.87400950700011 - ], - [ - 117.78760826900023, - 3.866685289000188 - ], - [ - 117.80738366000017, - 3.856146552000141 - ], - [ - 117.82911217500023, - 3.841253973000093 - ], - [ - 117.84424889400023, - 3.827541408000158 - ], - [ - 117.85287519600016, - 3.81240469000015 - ], - [ - 117.84620201900012, - 3.799139716000127 - ], - [ - 117.83155358200011, - 3.798081773000163 - ], - [ - 117.81226647200006, - 3.804673570000148 - ], - [ - 117.78402753999998, - 3.819647528000175 - ], - [ - 117.76954186300023, - 3.831244208000101 - ], - [ - 117.74463951900012, - 3.857896226000136 - ], - [ - 117.72950280000012, - 3.868068752000084 - ], - [ - 117.73617597700016, - 3.867987372000101 - ], - [ - 117.75521894600016, - 3.873358466000155 - ], - [ - 117.76295006600017, - 3.874497789000188 - ], - [ - 117.76677493600008, - 3.87400950700011 - ] - ] - ], - [ - [ - [ - 126.69608857300003, - 3.812256189000124 - ], - [ - 126.6779236450001, - 3.812235590000114 - ], - [ - 126.6696860340002, - 3.854956748000106 - ], - [ - 126.6614310780001, - 3.8976769020001 - ], - [ - 126.66639148400012, - 3.930547457000131 - ], - [ - 126.6482145470001, - 3.951896161000121 - ], - [ - 126.62672243600005, - 3.965031270000154 - ], - [ - 126.620095856, - 3.991323517000168 - ], - [ - 126.61346434300006, - 4.025835761000138 - ], - [ - 126.61510771900024, - 4.043914712000131 - ], - [ - 126.6432221160002, - 4.027484228000105 - ], - [ - 126.65654675900012, - 3.981478084000102 - ], - [ - 126.70107204300004, - 3.933851241000099 - ], - [ - 126.71262861800002, - 3.920714118000177 - ], - [ - 126.7142758470001, - 3.901001649000122 - ], - [ - 126.70105399100018, - 3.879630668000146 - ], - [ - 126.68785141700008, - 3.853330733000121 - ], - [ - 126.69608857300003, - 3.812256189000124 - ] - ] - ], - [ - [ - [ - 117.70557701900023, - 3.987494208000143 - ], - [ - 117.66529381600017, - 3.98305898600016 - ], - [ - 117.62029056100008, - 4.015326239000103 - ], - [ - 117.59449303500006, - 4.063869533000158 - ], - [ - 117.61280358200011, - 4.108221747000101 - ], - [ - 117.64633222700016, - 4.140814520000148 - ], - [ - 117.66114342500012, - 4.149237372000115 - ], - [ - 117.67359459700006, - 4.14061107000019 - ], - [ - 117.69874108200023, - 4.111314195000176 - ], - [ - 117.74122155000006, - 4.08828359600011 - ], - [ - 117.75001061300017, - 4.080308335000069 - ], - [ - 117.753184441, - 4.05182526200015 - ], - [ - 117.74105879000004, - 4.025620835000112 - ], - [ - 117.70557701900023, - 3.987494208000143 - ] - ] - ], - [ - [ - [ - 117.70360790399397, - 4.163414541993006 - ], - [ - 117.73807146200014, - 4.157241908000088 - ], - [ - 117.78357224700008, - 4.157241908000088 - ], - [ - 117.85255730900022, - 4.157241908000088 - ], - [ - 117.90703902788991, - 4.15668301495252 - ], - [ - 117.91211998800023, - 4.14492422100011 - ], - [ - 117.91822350400005, - 4.100043036000102 - ], - [ - 117.93482506600017, - 4.059881903000175 - ], - [ - 117.90137780000012, - 4.036688544000157 - ], - [ - 117.88705488400015, - 4.03192780200007 - ], - [ - 117.87256920700011, - 4.031561591000141 - ], - [ - 117.83855228000007, - 4.040187893000137 - ], - [ - 117.81910241000017, - 4.068670966000155 - ], - [ - 117.76270592500012, - 4.100734768000137 - ], - [ - 117.73943118600019, - 4.132310289000131 - ], - [ - 117.70360790399397, - 4.163414541993006 - ] - ] - ], - [ - [ - [ - 108.30681399800002, - 4.086493231000134 - ], - [ - 108.36540774800008, - 4.015448309000163 - ], - [ - 108.39136803500017, - 3.997015692000133 - ], - [ - 108.39616946700008, - 3.990912177000141 - ], - [ - 108.39820397200018, - 3.976467190000093 - ], - [ - 108.39771569100012, - 3.949367580000157 - ], - [ - 108.40357506600006, - 3.936346747000172 - ], - [ - 108.39283287900005, - 3.924383856000148 - ], - [ - 108.3782658210001, - 3.915757554000137 - ], - [ - 108.36597741000006, - 3.905462958000129 - ], - [ - 108.36207116000006, - 3.888576565000136 - ], - [ - 108.37208092500012, - 3.893540757000082 - ], - [ - 108.38013756600017, - 3.891180731000134 - ], - [ - 108.39616946700008, - 3.874823309000121 - ], - [ - 108.40650475400017, - 3.884588934000149 - ], - [ - 108.40626061300011, - 3.874335028000132 - ], - [ - 108.38933353000007, - 3.822170315000108 - ], - [ - 108.38257897200012, - 3.809881903000147 - ], - [ - 108.341075066, - 3.756293036000145 - ], - [ - 108.333262566, - 3.74042389500012 - ], - [ - 108.32789147200006, - 3.724066473000107 - ], - [ - 108.32398522200018, - 3.692694403000161 - ], - [ - 108.31763756600006, - 3.68378327000012 - ], - [ - 108.30005944100012, - 3.676255601000165 - ], - [ - 108.28516686300006, - 3.674465236000088 - ], - [ - 108.25359134200008, - 3.676988023000192 - ], - [ - 108.23853600400005, - 3.676255601000165 - ], - [ - 108.22364342500006, - 3.670396226000037 - ], - [ - 108.19499759200019, - 3.652289130000028 - ], - [ - 108.18384850400011, - 3.648342190000122 - ], - [ - 108.17448978000007, - 3.651922919000015 - ], - [ - 108.14226321700014, - 3.676255601000165 - ], - [ - 108.1048283210001, - 3.690578518000152 - ], - [ - 108.09449303500017, - 3.696193752000141 - ], - [ - 108.11817467500012, - 3.725775458000101 - ], - [ - 108.12183678500006, - 3.734605209999984 - ], - [ - 108.12501061300011, - 3.747870184000092 - ], - [ - 108.13233483200011, - 3.752183335000012 - ], - [ - 108.1404728520001, - 3.751776434000178 - ], - [ - 108.14600670700005, - 3.750718492000047 - ], - [ - 108.1648869150001, - 3.757269598000121 - ], - [ - 108.17139733200005, - 3.771470445000134 - ], - [ - 108.175547722, - 3.785834052000112 - ], - [ - 108.18702233200005, - 3.792303778000118 - ], - [ - 108.2024845710001, - 3.792466539000173 - ], - [ - 108.21363366, - 3.791164455000072 - ], - [ - 108.224375847, - 3.785345770000035 - ], - [ - 108.23853600400005, - 3.772406317000119 - ], - [ - 108.26685631600017, - 3.738755601000108 - ], - [ - 108.28003991000006, - 3.731512762000165 - ], - [ - 108.277598504, - 3.745062567000133 - ], - [ - 108.26238040500002, - 3.792303778000118 - ], - [ - 108.25733483200011, - 3.795355536000102 - ], - [ - 108.24887129000015, - 3.809312242000175 - ], - [ - 108.24537194100006, - 3.81346263200011 - ], - [ - 108.23682701900006, - 3.815008856000148 - ], - [ - 108.20753014400012, - 3.81346263200011 - ], - [ - 108.18034915500019, - 3.81683991100013 - ], - [ - 108.1033634770001, - 3.845892645000106 - ], - [ - 108.07154381600017, - 3.852240302000141 - ], - [ - 108.0623478520001, - 3.855943101000179 - ], - [ - 108.05298912900017, - 3.864650783000158 - ], - [ - 108.0447697270001, - 3.877020575000103 - ], - [ - 108.03003991000017, - 3.908880927000126 - ], - [ - 108.02808678500006, - 3.917222398000192 - ], - [ - 108.02613366000011, - 3.932928778000161 - ], - [ - 108.02344811300011, - 3.941717841000127 - ], - [ - 108.01685631600006, - 3.946763414000159 - ], - [ - 108.00993899800002, - 3.951076565000079 - ], - [ - 108.00513756600006, - 3.957464911000088 - ], - [ - 108.00391686300006, - 3.964341539000188 - ], - [ - 108.00513756600006, - 3.987494208000143 - ], - [ - 108.00212649800008, - 3.9976260440001 - ], - [ - 107.9954533210001, - 4.002264716000127 - ], - [ - 107.98853600400011, - 4.005601304000052 - ], - [ - 107.984629754, - 4.012030341000155 - ], - [ - 107.98780358200005, - 4.020697333000058 - ], - [ - 107.99724368600019, - 4.034247137000122 - ], - [ - 108.02247155000006, - 4.063544012000136 - ], - [ - 108.03223717500006, - 4.069973049000154 - ], - [ - 108.04151451900006, - 4.070949611000131 - ], - [ - 108.05054772200006, - 4.070786851000165 - ], - [ - 108.06031334700018, - 4.074123440000093 - ], - [ - 108.066661004, - 4.080145575000103 - ], - [ - 108.08033287900005, - 4.097235419000143 - ], - [ - 108.08423912900005, - 4.100775458000129 - ], - [ - 108.09449303500017, - 4.10537344000015 - ], - [ - 108.17025800900015, - 4.179429429000123 - ], - [ - 108.18197675900015, - 4.204535223000107 - ], - [ - 108.19556725400017, - 4.22036367400014 - ], - [ - 108.21159915500007, - 4.235419012000165 - ], - [ - 108.224864129, - 4.244818427000098 - ], - [ - 108.24244225400005, - 4.230698960000069 - ], - [ - 108.25025475400005, - 4.211249091000155 - ], - [ - 108.25220787900017, - 4.15916575700011 - ], - [ - 108.25733483200011, - 4.130560614000132 - ], - [ - 108.27076256600017, - 4.112982489000103 - ], - [ - 108.30681399800002, - 4.086493231000134 - ] - ] - ], - [ - [ - [ - 116.57689416600013, - 4.332010600000089 - ], - [ - 116.59022668500015, - 4.331132101000136 - ], - [ - 116.61554813699999, - 4.344077047000155 - ], - [ - 116.64179976500023, - 4.333870952000098 - ], - [ - 116.6611267500002, - 4.334387716000123 - ], - [ - 116.68004032400015, - 4.339917094000128 - ], - [ - 116.71166630000013, - 4.366788838000133 - ], - [ - 116.72944299300016, - 4.364463399000101 - ], - [ - 116.76613326100014, - 4.338573507000163 - ], - [ - 116.80447717300015, - 4.330072733000151 - ], - [ - 116.8830253510001, - 4.344903870000095 - ], - [ - 116.9242631430001, - 4.344955547000097 - ], - [ - 116.98059045400007, - 4.329555970000115 - ], - [ - 117.16466190600008, - 4.333147481000182 - ], - [ - 117.17437707500002, - 4.338418477000118 - ], - [ - 117.1903967690001, - 4.353017069000188 - ], - [ - 117.20269576100023, - 4.356065979000121 - ], - [ - 117.21716516200016, - 4.353430481000188 - ], - [ - 117.22481327300014, - 4.346583354000146 - ], - [ - 117.23060103400022, - 4.337178243000096 - ], - [ - 117.23866255800013, - 4.326868795000095 - ], - [ - 117.27555953000015, - 4.300978903000143 - ], - [ - 117.35658817600003, - 4.259508566000179 - ], - [ - 117.41291548700016, - 4.20008066800014 - ], - [ - 117.43647994000017, - 4.185611267000112 - ], - [ - 117.46417850800017, - 4.177911479000116 - ], - [ - 117.49838830600018, - 4.172614644000163 - ], - [ - 117.51461470500018, - 4.171942851000097 - ], - [ - 117.54220992000009, - 4.173829040000101 - ], - [ - 117.55833296800009, - 4.167653707000127 - ], - [ - 117.56714928500017, - 4.159654039000188 - ], - [ - 117.56706790500019, - 4.159613348000107 - ], - [ - 117.55551191500015, - 4.151841539000102 - ], - [ - 117.52833092500023, - 4.127508856000134 - ], - [ - 117.51856530000012, - 4.122259833000143 - ], - [ - 117.50782311300011, - 4.123480536000073 - ], - [ - 117.37305748800011, - 4.169745184000163 - ], - [ - 117.37387129000004, - 4.165269273000192 - ], - [ - 117.37712649800008, - 4.154364325000117 - ], - [ - 117.37924238400015, - 4.149237372000115 - ], - [ - 117.3868921230002, - 4.142482815000079 - ], - [ - 117.39616946700002, - 4.139634507000125 - ], - [ - 117.40398196700002, - 4.135484117000189 - ], - [ - 117.40739993600008, - 4.124986070000119 - ], - [ - 117.40308678500006, - 4.120347398000192 - ], - [ - 117.39633222699999, - 4.109686591000155 - ], - [ - 117.39584394600004, - 4.098944403000147 - ], - [ - 117.41041100400005, - 4.093939520000106 - ], - [ - 117.43132571700019, - 4.092596747000115 - ], - [ - 117.45069420700023, - 4.088120835000055 - ], - [ - 117.46648196700008, - 4.079901434000149 - ], - [ - 117.47559655000018, - 4.067328192000076 - ], - [ - 117.46827233200017, - 4.052923895000106 - ], - [ - 117.46827233200017, - 4.043524481000162 - ], - [ - 117.47901451900006, - 4.039374091000127 - ], - [ - 117.48894290500007, - 4.04295482000019 - ], - [ - 117.49968509200019, - 4.049790757000125 - ], - [ - 117.51042728000019, - 4.053941148000163 - ], - [ - 117.52027428500006, - 4.049302476000136 - ], - [ - 117.61378014400006, - 3.957098700000174 - ], - [ - 117.62794030000012, - 3.947088934000178 - ], - [ - 117.66146894600016, - 3.940171617000189 - ], - [ - 117.67847741, - 3.932440497000172 - ], - [ - 117.68930097699999, - 3.921454169000128 - ], - [ - 117.68848717500012, - 3.909002997000101 - ], - [ - 117.67269941500015, - 3.897772528000104 - ], - [ - 117.65088951900012, - 3.895209052000098 - ], - [ - 117.62810306100008, - 3.90037669500019 - ], - [ - 117.59066816500004, - 3.926092841000141 - ], - [ - 117.57007897200012, - 3.933172919000114 - ], - [ - 117.52344811300011, - 3.936346747000172 - ], - [ - 117.52344811300011, - 3.929510809000149 - ], - [ - 117.55209394600016, - 3.927150783000101 - ], - [ - 117.57943769600004, - 3.914536851000122 - ], - [ - 117.603770379, - 3.89671458500014 - ], - [ - 117.62330162900017, - 3.878607489000132 - ], - [ - 117.63672936300006, - 3.872870184000163 - ], - [ - 117.65235436300017, - 3.875148830000143 - ], - [ - 117.66822350400017, - 3.880031643000109 - ], - [ - 117.68165123800006, - 3.882269598000093 - ], - [ - 117.689707879, - 3.878810940000093 - ], - [ - 117.71908613400004, - 3.860581773000106 - ], - [ - 117.72510826900012, - 3.850897528000147 - ], - [ - 117.77719160200016, - 3.799139716000127 - ], - [ - 117.78199303500006, - 3.787339585000069 - ], - [ - 117.78288821700008, - 3.779038804000081 - ], - [ - 117.7767033210001, - 3.774115302000112 - ], - [ - 117.76050866000006, - 3.772406317000119 - ], - [ - 117.70215905000023, - 3.778713283000144 - ], - [ - 117.71485436300011, - 3.76357656500015 - ], - [ - 117.73422285200004, - 3.752142645000021 - ], - [ - 117.77719160200016, - 3.73773834800005 - ], - [ - 117.81788170700023, - 3.730047919000114 - ], - [ - 117.82927493600013, - 3.721584377000084 - ], - [ - 117.82618248800023, - 3.703599351000051 - ], - [ - 117.81723066499998, - 3.694810289000159 - ], - [ - 117.78793378999998, - 3.678656317000105 - ], - [ - 117.77719160200016, - 3.668850002 - ], - [ - 117.76107832099999, - 3.643744208000086 - ], - [ - 117.74854576900012, - 3.636948959999984 - ], - [ - 117.65064537900005, - 3.627875067000062 - ], - [ - 117.62867272200006, - 3.632066148000177 - ], - [ - 117.58765709700006, - 3.650864976000136 - ], - [ - 117.56836998800011, - 3.655096747000073 - ], - [ - 117.546641472, - 3.664007880000099 - ], - [ - 117.53370201900012, - 3.684759833000015 - ], - [ - 117.52426191499998, - 3.708889065000108 - ], - [ - 117.50855553500006, - 3.735907294000071 - ], - [ - 117.50538170700005, - 3.746771552000141 - ], - [ - 117.50359134200019, - 3.768744208000072 - ], - [ - 117.49919681100019, - 3.775580145000077 - ], - [ - 117.48894290500007, - 3.782171942000147 - ], - [ - 117.46876061300023, - 3.792303778000118 - ], - [ - 117.47999108200023, - 3.771185614000103 - ], - [ - 117.48243248800006, - 3.764960028000132 - ], - [ - 117.49195397200018, - 3.707098700000131 - ], - [ - 117.49976647200018, - 3.692694403000161 - ], - [ - 117.51335696700002, - 3.674872137000094 - ], - [ - 117.52344811300011, - 3.650213934000092 - ], - [ - 117.52426191499998, - 3.62543366100013 - ], - [ - 117.50977623800023, - 3.607367255000113 - ], - [ - 117.494395379, - 3.60834381700009 - ], - [ - 117.45101972700016, - 3.629299221000124 - ], - [ - 117.430918816, - 3.634670315 - ], - [ - 117.30225670700005, - 3.633246161000116 - ], - [ - 117.21949303500006, - 3.647365627000141 - ], - [ - 117.09050540500019, - 3.645819403000104 - ], - [ - 117.05567467500023, - 3.631903387000122 - ], - [ - 117.03052819100017, - 3.594387111000117 - ], - [ - 117.05396569100006, - 3.608303127000099 - ], - [ - 117.08318118600008, - 3.616644598000065 - ], - [ - 117.11426842500006, - 3.62059153900006 - ], - [ - 117.16928144600016, - 3.621039130000057 - ], - [ - 117.19922936300011, - 3.616278387000136 - ], - [ - 117.216563347, - 3.603013414000031 - ], - [ - 117.205332879, - 3.576971747000144 - ], - [ - 117.19996178500006, - 3.554999091000042 - ], - [ - 117.21029707100016, - 3.528876044000171 - ], - [ - 117.22754967500018, - 3.505194403000147 - ], - [ - 117.24284915500002, - 3.490668036000031 - ], - [ - 117.25310306100008, - 3.486070054000081 - ], - [ - 117.29070071700008, - 3.477036851000079 - ], - [ - 117.30453535200016, - 3.469387111000131 - ], - [ - 117.31202233200011, - 3.461127020000063 - ], - [ - 117.325450066, - 3.43602122600015 - ], - [ - 117.34498131600017, - 3.446519273000135 - ], - [ - 117.37435957099999, - 3.448635158000144 - ], - [ - 117.40495853000013, - 3.444484768000109 - ], - [ - 117.42774498800023, - 3.43602122600015 - ], - [ - 117.4357202480002, - 3.434312242000146 - ], - [ - 117.442149285, - 3.435695705000128 - ], - [ - 117.44654381600017, - 3.434759833000058 - ], - [ - 117.44825280000006, - 3.42609284100007 - ], - [ - 117.44825280000006, - 3.398504950000145 - ], - [ - 117.44654381600017, - 3.385199286000116 - ], - [ - 117.44190514400017, - 3.373032945000134 - ], - [ - 117.43441816499998, - 3.364325262000065 - ], - [ - 117.42432701900023, - 3.360988674000041 - ], - [ - 117.41439863400004, - 3.356187242000132 - ], - [ - 117.40552819100017, - 3.345607815000093 - ], - [ - 117.39372806100019, - 3.326239325000159 - ], - [ - 117.3868921230002, - 3.319891669000128 - ], - [ - 117.37777753999998, - 3.313137111000017 - ], - [ - 117.36963951900006, - 3.305243231000119 - ], - [ - 117.36638431100002, - 3.295803127000028 - ], - [ - 117.36312910199999, - 3.254868882000082 - ], - [ - 117.35954837300014, - 3.244289455000128 - ], - [ - 117.34473717500023, - 3.230454820000048 - ], - [ - 117.33366946700019, - 3.232123114000061 - ], - [ - 117.31177819100017, - 3.251695054000123 - ], - [ - 117.28158613400015, - 3.263251044000057 - ], - [ - 117.2737736340001, - 3.264797268000095 - ], - [ - 117.26465905000006, - 3.261786200000174 - ], - [ - 117.26441491000006, - 3.254339911000102 - ], - [ - 117.26783287900005, - 3.244533596 - ], - [ - 117.27003014400023, - 3.234320380000142 - ], - [ - 117.28150475400017, - 3.22308991100013 - ], - [ - 117.35271243600019, - 3.182806708000072 - ], - [ - 117.37029056100002, - 3.177191473000065 - ], - [ - 117.38990319100012, - 3.175197658000116 - ], - [ - 117.430918816, - 3.175360419000086 - ], - [ - 117.4539494150001, - 3.171210028000147 - ], - [ - 117.45777428500017, - 3.160345770000063 - ], - [ - 117.45411217500023, - 3.145168361000074 - ], - [ - 117.45508873800011, - 3.128159898000106 - ], - [ - 117.48170006600006, - 3.101263739000046 - ], - [ - 117.52003014400006, - 3.098456122000172 - ], - [ - 117.56373131600017, - 3.101874091000099 - ], - [ - 117.60580488400004, - 3.09341054900014 - ], - [ - 117.61719811300011, - 3.085882880000099 - ], - [ - 117.62086022200006, - 3.079494533000073 - ], - [ - 117.6232202480002, - 3.072455145000106 - ], - [ - 117.63013756600012, - 3.062974351000179 - ], - [ - 117.63428795700023, - 3.052394924000055 - ], - [ - 117.62940514400006, - 3.042385158000158 - ], - [ - 117.61963951900023, - 3.03489817900001 - ], - [ - 117.60922285200004, - 3.031968492000161 - ], - [ - 117.60084069100017, - 3.024969794000086 - ], - [ - 117.57504316500015, - 2.992865302000112 - ], - [ - 117.56495201900006, - 2.983547268 - ], - [ - 117.58033287900005, - 2.978989976000122 - ], - [ - 117.60157311300011, - 2.980658270000134 - ], - [ - 117.62240644599999, - 2.986476955000015 - ], - [ - 117.63672936300006, - 2.994126695000119 - ], - [ - 117.65560957099999, - 2.997381903000161 - ], - [ - 117.67546634200019, - 2.98578522300015 - ], - [ - 117.68799889400012, - 2.970648505000071 - ], - [ - 117.68506920700011, - 2.963080145000106 - ], - [ - 117.66732832099999, - 2.959540106000134 - ], - [ - 117.63054446700019, - 2.942328192000119 - ], - [ - 117.61280358200011, - 2.936428127 - ], - [ - 117.54379316499998, - 2.928941148000106 - ], - [ - 117.54379316499998, - 2.922105210000012 - ], - [ - 117.56739342500012, - 2.922552802000098 - ], - [ - 117.64014733200005, - 2.908514716000141 - ], - [ - 117.73633873800011, - 2.901597398000135 - ], - [ - 117.72510826900012, - 2.886542059000121 - ], - [ - 117.70427493600002, - 2.878973700000174 - ], - [ - 117.68132571700008, - 2.873277085000012 - ], - [ - 117.66431725400011, - 2.864081122000115 - ], - [ - 117.6271264980002, - 2.836981512000094 - ], - [ - 117.61963951900023, - 2.825506903000061 - ], - [ - 117.63331139400017, - 2.812241929000123 - ], - [ - 117.67351321700008, - 2.799261786000116 - ], - [ - 117.71436608200011, - 2.794094143000123 - ], - [ - 117.75220787900005, - 2.784613348000107 - ], - [ - 117.78402753999998, - 2.758246161000031 - ], - [ - 117.79200280000023, - 2.742336330000015 - ], - [ - 117.79623457100016, - 2.723211981000119 - ], - [ - 117.80079186300011, - 2.657171942000105 - ], - [ - 117.80738366000017, - 2.638006903000132 - ], - [ - 117.81625410200004, - 2.621527411000059 - ], - [ - 117.82618248800023, - 2.607407945000119 - ], - [ - 117.86703535200016, - 2.572699286000059 - ], - [ - 117.88168378999998, - 2.551418361000088 - ], - [ - 117.97901451900017, - 2.466538804000038 - ], - [ - 117.98780358200023, - 2.456366278000175 - ], - [ - 117.99968509200008, - 2.434271552000098 - ], - [ - 118.00684655000012, - 2.425523179000109 - ], - [ - 118.02409915500002, - 2.382025458 - ], - [ - 118.03711998800011, - 2.363959051999984 - ], - [ - 118.04468834700006, - 2.381537177000013 - ], - [ - 118.06348717500012, - 2.366929429 - ], - [ - 118.08220462300008, - 2.3374697940001 - ], - [ - 118.0958764980002, - 2.304144598000022 - ], - [ - 118.099375847, - 2.277818101000193 - ], - [ - 118.09148196700002, - 2.262030341000141 - ], - [ - 118.05779056100002, - 2.219956773000177 - ], - [ - 118.04468834700006, - 2.208929755000142 - ], - [ - 117.97559655000023, - 2.192084052000141 - ], - [ - 117.95541425900004, - 2.182277736000103 - ], - [ - 117.94125410199999, - 2.163153387000136 - ], - [ - 117.93921959700018, - 2.143377997000115 - ], - [ - 117.93523196700019, - 2.124172268000066 - ], - [ - 117.91504967500018, - 2.106512762000136 - ], - [ - 117.91472415500002, - 2.093491929000066 - ], - [ - 117.88282311300011, - 2.095445054000109 - ], - [ - 117.82618248800023, - 2.106512762000136 - ], - [ - 117.84424889400023, - 2.08820221600017 - ], - [ - 117.88209069100017, - 2.068060614000132 - ], - [ - 117.90040123800023, - 2.049994208000115 - ], - [ - 117.85987389400023, - 2.038275458000129 - ], - [ - 117.82545006600012, - 2.036281643000095 - ], - [ - 117.79151451900023, - 2.038275458000129 - ], - [ - 117.75464928500017, - 2.046332098000079 - ], - [ - 117.74073326900012, - 2.044989325000088 - ], - [ - 117.75001061300017, - 2.03143952000012 - ], - [ - 117.76465905000018, - 2.024969794000029 - ], - [ - 117.8029077480002, - 2.021307684000149 - ], - [ - 117.81885826900012, - 2.017157294000114 - ], - [ - 117.83179772200006, - 2.005682684000163 - ], - [ - 117.844004754, - 1.991441148000163 - ], - [ - 117.8556421230002, - 1.983384507000139 - ], - [ - 117.86719811300023, - 1.990464585000097 - ], - [ - 117.87338300900004, - 1.990464585000097 - ], - [ - 117.87476647200018, - 1.947495835000055 - ], - [ - 117.87224368600008, - 1.924709377000113 - ], - [ - 117.86353600400017, - 1.914740302000126 - ], - [ - 117.85670006600017, - 1.909369207999987 - ], - [ - 117.85726972700004, - 1.897650458000086 - ], - [ - 117.862559441, - 1.885931708000086 - ], - [ - 117.870371941, - 1.880601304000038 - ], - [ - 117.88103274800002, - 1.882066148000092 - ], - [ - 117.88396243600008, - 1.884100653000118 - ], - [ - 117.88599694100017, - 1.882554429000081 - ], - [ - 117.89389082100016, - 1.873765367000104 - ], - [ - 117.90333092500006, - 1.857407945000176 - ], - [ - 117.91187584700012, - 1.836859442000147 - ], - [ - 117.92408287900017, - 1.819159247000144 - ], - [ - 117.94483483200005, - 1.811712957999987 - ], - [ - 117.96534264400012, - 1.808417059000121 - ], - [ - 117.98096764400012, - 1.800767320000105 - ], - [ - 117.99488366000017, - 1.791693427000098 - ], - [ - 118.01059004000015, - 1.784369208000101 - ], - [ - 118.03484134200002, - 1.784898179000081 - ], - [ - 118.046153191, - 1.783107815000093 - ], - [ - 118.0509546230002, - 1.774481512000179 - ], - [ - 118.04932701900006, - 1.762030341000155 - ], - [ - 118.047129754, - 1.752264716000127 - ], - [ - 118.04786217500012, - 1.74355703300013 - ], - [ - 118.05469811300023, - 1.733465887000165 - ], - [ - 118.12671959700018, - 1.65468984600011 - ], - [ - 118.185313347, - 1.631781317000105 - ], - [ - 118.27125084700006, - 1.562730210000083 - ], - [ - 118.31128991000017, - 1.541978257000096 - ], - [ - 118.35279381600006, - 1.533596096000124 - ], - [ - 118.36980228000002, - 1.522772528000047 - ], - [ - 118.39421634200008, - 1.49701569200009 - ], - [ - 118.41684004000004, - 1.491848049000097 - ], - [ - 118.42505944100006, - 1.485744533000101 - ], - [ - 118.41846764400017, - 1.47284577 - ], - [ - 118.40365644599999, - 1.461737372000158 - ], - [ - 118.399668816, - 1.454413153000147 - ], - [ - 118.40479576900012, - 1.445217190000079 - ], - [ - 118.41472415500002, - 1.440863348 - ], - [ - 118.43824303500017, - 1.440578518000066 - ], - [ - 118.44890384200014, - 1.435532945000119 - ], - [ - 118.45101972700004, - 1.428452867000161 - ], - [ - 118.45394941500015, - 1.403225002000099 - ], - [ - 118.456309441, - 1.394598700000103 - ], - [ - 118.46314537900005, - 1.394598700000103 - ], - [ - 118.47624759200019, - 1.402044989000075 - ], - [ - 118.49219811300011, - 1.395697333000143 - ], - [ - 118.52393639400023, - 1.374172268000038 - ], - [ - 118.53598066500015, - 1.370672919000128 - ], - [ - 118.58228600400005, - 1.3673363300001 - ], - [ - 118.61329186300006, - 1.351223049000126 - ], - [ - 118.67514082100016, - 1.280422268000123 - ], - [ - 118.71290123800011, - 1.26430898600006 - ], - [ - 118.72925866000006, - 1.253851630000071 - ], - [ - 118.75416100400017, - 1.229559637000179 - ], - [ - 118.77637780000023, - 1.201971747000172 - ], - [ - 118.78467858200011, - 1.181708075000074 - ], - [ - 118.78052819100017, - 1.177313544000171 - ], - [ - 118.77361087300008, - 1.175726630000142 - ], - [ - 118.76710045700005, - 1.172674872000144 - ], - [ - 118.76417076900023, - 1.164007880000071 - ], - [ - 118.79786217500023, - 1.149969794000114 - ], - [ - 118.80892988399998, - 1.139715887000179 - ], - [ - 118.82618248800011, - 1.119696356000119 - ], - [ - 118.85694420700011, - 1.058172919000143 - ], - [ - 118.87086022200018, - 1.056301174000083 - ], - [ - 118.87818444100017, - 1.055975653000161 - ], - [ - 118.88770592500018, - 1.058172919000143 - ], - [ - 118.89437910200004, - 1.06281159100017 - ], - [ - 118.906504754, - 1.075384833000072 - ], - [ - 118.91553795700023, - 1.078599351000122 - ], - [ - 118.9339298840001, - 1.076076565000108 - ], - [ - 118.98519941500004, - 1.05756256700009 - ], - [ - 119.00098717500023, - 1.047919012000122 - ], - [ - 119.00554446700019, - 1.037583726000122 - ], - [ - 119.00318444100006, - 1.026312567000119 - ], - [ - 118.99903405000012, - 1.014634507000125 - ], - [ - 118.99756920700023, - 1.003607489000089 - ], - [ - 119.00066165500002, - 0.999090887000122 - ], - [ - 119.00635826900012, - 0.994859117000104 - ], - [ - 119.01124108200005, - 0.988226630000142 - ], - [ - 119.01172936300006, - 0.976263739000103 - ], - [ - 119.00294030000012, - 0.9624697940001 - ], - [ - 118.97055097699999, - 0.935736395 - ], - [ - 118.95655358200023, - 0.912665106000119 - ], - [ - 118.93995201900006, - 0.902085679 - ], - [ - 118.865000847, - 0.86884186399999 - ], - [ - 118.85132897200018, - 0.856919664000131 - ], - [ - 118.84099368600008, - 0.829901434000178 - ], - [ - 118.828379754, - 0.818101304000109 - ], - [ - 118.812754754, - 0.809149481000091 - ], - [ - 118.79818769599999, - 0.804917709999984 - ], - [ - 118.78630618600002, - 0.804592190000051 - ], - [ - 118.77426191500004, - 0.805731512000165 - ], - [ - 118.76319420700005, - 0.809027411000116 - ], - [ - 118.74170983200017, - 0.822170315000079 - ], - [ - 118.71753991000006, - 0.828273830000157 - ], - [ - 118.70582116000017, - 0.835923570000176 - ], - [ - 118.68604576900023, - 0.846136786000116 - ], - [ - 118.66277103000002, - 0.84638092700007 - ], - [ - 118.63941491000006, - 0.840521552000126 - ], - [ - 118.58318118600002, - 0.813666083000129 - ], - [ - 118.57545006600006, - 0.808335679000081 - ], - [ - 118.56527753999998, - 0.804022528000161 - ], - [ - 118.55469811300023, - 0.807928778000075 - ], - [ - 118.54395592500012, - 0.814520575000131 - ], - [ - 118.53419030000006, - 0.818019924000126 - ], - [ - 118.51417076900012, - 0.822007554000024 - ], - [ - 118.47348066500004, - 0.838283596000053 - ], - [ - 118.42839603000007, - 0.839992580000057 - ], - [ - 118.418711785, - 0.837225653000175 - ], - [ - 118.41098066499998, - 0.821844794000057 - ], - [ - 118.40235436300011, - 0.813950914000159 - ], - [ - 118.39193769599999, - 0.807603257000054 - ], - [ - 118.38396243600008, - 0.804917709999984 - ], - [ - 118.36719811300023, - 0.810370184000107 - ], - [ - 118.35645592500012, - 0.823228257000039 - ], - [ - 118.34685306100002, - 0.839016018000081 - ], - [ - 118.33277428500011, - 0.852728583000015 - ], - [ - 118.31690514400017, - 0.858832098000093 - ], - [ - 118.18783613400004, - 0.875230210000097 - ], - [ - 118.12907962300002, - 0.893011786000073 - ], - [ - 118.09669030000012, - 0.908636786000059 - ], - [ - 118.06918378999998, - 0.928778387000094 - ], - [ - 118.04468834700006, - 0.955145575000103 - ], - [ - 118.02849368600019, - 0.984523830000015 - ], - [ - 118.00554446700014, - 1.051011460000026 - ], - [ - 117.98951256600006, - 1.078599351000122 - ], - [ - 117.97584069100012, - 1.088120835000126 - ], - [ - 117.93677819100006, - 1.108140367000175 - ], - [ - 117.92872155000012, - 1.116603908000044 - ], - [ - 117.9240014980002, - 1.124986070000176 - ], - [ - 117.91334069100006, - 1.124945380000099 - ], - [ - 117.90162194100017, - 1.119859117000175 - ], - [ - 117.89389082100016, - 1.113470770000148 - ], - [ - 117.89096113400015, - 1.104193427000098 - ], - [ - 117.892832879, - 1.094875393000152 - ], - [ - 117.90137780000012, - 1.078599351000122 - ], - [ - 117.93360436300006, - 1.038763739000146 - ], - [ - 117.93799889400023, - 1.031480210000126 - ], - [ - 117.97527103000002, - 0.983099677000041 - ], - [ - 117.97974694100017, - 0.96621328300013 - ], - [ - 117.98462975400017, - 0.926214911000088 - ], - [ - 117.99293053500006, - 0.91079336100016 - ], - [ - 117.99586022200006, - 0.906724351000108 - ], - [ - 118.00318444100017, - 0.893744208000101 - ], - [ - 118.00562584700012, - 0.891913153000132 - ], - [ - 118.01417076900012, - 0.888128973000022 - ], - [ - 118.016856316, - 0.88621653900006 - ], - [ - 118.0247501960001, - 0.872788804000066 - ], - [ - 118.03044681100008, - 0.858954169000157 - ], - [ - 118.03402754000004, - 0.843329169000171 - ], - [ - 118.03630618600019, - 0.820705471000025 - ], - [ - 118.03296959700018, - 0.800238348000136 - ], - [ - 118.02051842500023, - 0.791327216000113 - ], - [ - 118.00521894599999, - 0.788763739000018 - ], - [ - 117.993907097, - 0.788478908000158 - ], - [ - 117.982676629, - 0.791327216000113 - ], - [ - 117.97331790500019, - 0.79848867400014 - ], - [ - 117.96241295700011, - 0.817084052000141 - ], - [ - 117.95541425900004, - 0.825425523000121 - ], - [ - 117.94743899800008, - 0.831122137000094 - ], - [ - 117.93816165500013, - 0.835638739000146 - ], - [ - 117.92725670700023, - 0.838690497000059 - ], - [ - 117.91407311300011, - 0.839667059000035 - ], - [ - 117.90251712300008, - 0.837469794000043 - ], - [ - 117.89478600400005, - 0.832586981000148 - ], - [ - 117.88933353000013, - 0.827704169000086 - ], - [ - 117.88428795700005, - 0.825425523000121 - ], - [ - 117.85035241000006, - 0.824286200000088 - ], - [ - 117.82935631600012, - 0.820257880000028 - ], - [ - 117.81128991000017, - 0.811753648000177 - ], - [ - 117.78834069100017, - 0.79230377800009 - ], - [ - 117.74317467500023, - 0.74054596600007 - ], - [ - 117.72950280000012, - 0.715562242000132 - ], - [ - 117.72486412900017, - 0.652655341000099 - ], - [ - 117.71908613400004, - 0.636786200000159 - ], - [ - 117.69581139400012, - 0.617092190000122 - ], - [ - 117.68848717500012, - 0.606350002000113 - ], - [ - 117.68441816500004, - 0.596380927000126 - ], - [ - 117.6790470710001, - 0.574693101000136 - ], - [ - 117.67481530000023, - 0.564764716000141 - ], - [ - 117.62037194100006, - 0.502020575000159 - ], - [ - 117.61280358200011, - 0.479071356000162 - ], - [ - 117.61548912900011, - 0.469183661000059 - ], - [ - 117.626231316, - 0.444037177 - ], - [ - 117.6271264980002, - 0.434393622000115 - ], - [ - 117.6193139980002, - 0.423895575000131 - ], - [ - 117.607676629, - 0.417181708000101 - ], - [ - 117.59538821700002, - 0.41229889500012 - ], - [ - 117.58545983200023, - 0.407131252000113 - ], - [ - 117.56950931100002, - 0.389064846000096 - ], - [ - 117.55372155000006, - 0.349514065000065 - ], - [ - 117.51726321700014, - 0.290961005000099 - ], - [ - 117.51441491000017, - 0.28034088700015 - ], - [ - 117.51596113400004, - 0.275295315000122 - ], - [ - 117.51954186300011, - 0.271063544000114 - ], - [ - 117.52344811300011, - 0.263088283000144 - ], - [ - 117.52654056100008, - 0.24217357000019 - ], - [ - 117.52312259200008, - 0.225775458000086 - ], - [ - 117.51392662900011, - 0.211859442000105 - ], - [ - 117.49097741, - 0.189886786000102 - ], - [ - 117.48365319100012, - 0.178859768000137 - ], - [ - 117.48015384200019, - 0.166489976000108 - ], - [ - 117.48243248800006, - 0.15379466400006 - ], - [ - 117.48829186300023, - 0.151109117000161 - ], - [ - 117.49822024800002, - 0.15082428600013 - ], - [ - 117.50912519599999, - 0.148586330000143 - ], - [ - 117.51726321700014, - 0.1402041690001 - ], - [ - 117.50684655000023, - 0.133042710000055 - ], - [ - 117.48365319100012, - 0.124823309000064 - ], - [ - 117.47559655000018, - 0.119086005 - ], - [ - 117.46998131600017, - 0.108791408000073 - ], - [ - 117.47055097700004, - 0.102199611000088 - ], - [ - 117.47364342500012, - 0.095526434000135 - ], - [ - 117.47559655000018, - 0.085598049000126 - ], - [ - 117.47486412900005, - 0.074774481000048 - ], - [ - 117.47364342500012, - 0.069240627000113 - ], - [ - 117.47339928500017, - 0.064886786000116 - ], - [ - 117.47559655000018, - 0.057603257000025 - ], - [ - 117.48243248800006, - 0.054592190000022 - ], - [ - 117.49219811300011, - 0.054632880000014 - ], - [ - 117.49708092500006, - 0.051011460000126 - ], - [ - 117.48910566500004, - 0.037176825000131 - ], - [ - 117.50001061300011, - 0.033026434000092 - ], - [ - 117.509043816, - 0.026027736000032 - ], - [ - 117.516856316, - 0.015936591000141 - ], - [ - 117.52344811300011, - 0.003078518000123 - ], - [ - 117.52906334700018, - -0.019463799999855 - ], - [ - 117.53028405000012, - -0.032321872999887 - ], - [ - 117.52686608200011, - -0.037896416999885 - ], - [ - 117.52523847700016, - -0.042046808 - ], - [ - 117.51286868600002, - -0.059136651999879 - ], - [ - 117.50733483200011, - -0.069634697999945 - ], - [ - 117.49488366, - -0.080336195999877 - ], - [ - 117.48910566500004, - -0.085707289999917 - ], - [ - 117.48487389400012, - -0.092217705999829 - ], - [ - 117.46949303500017, - -0.128838799999855 - ], - [ - 117.46534264400023, - -0.144463799999841 - ], - [ - 117.46192467500012, - -0.185723565999965 - ], - [ - 117.45639082100004, - -0.205498955999985 - ], - [ - 117.43506920700023, - -0.239678643999895 - ], - [ - 117.43392988400004, - -0.263848565999893 - ], - [ - 117.44206790500002, - -0.28191497199991 - ], - [ - 117.45777428500017, - -0.308200778999932 - ], - [ - 117.47461998800011, - -0.330254815999922 - ], - [ - 117.48585045700011, - -0.335870049999841 - ], - [ - 117.49537194100017, - -0.333754165 - ], - [ - 117.49708092500006, - -0.350274346999981 - ], - [ - 117.49398847699999, - -0.372653903999918 - ], - [ - 117.48910566500004, - -0.38738372199991 - ], - [ - 117.46753991000006, - -0.411553643999909 - ], - [ - 117.45753014400023, - -0.427015882999839 - ], - [ - 117.45850670700011, - -0.438897393999895 - ], - [ - 117.46648196700008, - -0.457289320999934 - ], - [ - 117.46241295700011, - -0.47991301899998 - ], - [ - 117.45215905000006, - -0.501722914999945 - ], - [ - 117.44141686300006, - -0.517754815999851 - ], - [ - 117.44141686300006, - -0.525160414999917 - ], - [ - 117.47494550900004, - -0.509047132999854 - ], - [ - 117.595957879, - -0.422621351999865 - ], - [ - 117.6155705090001, - -0.415215752999956 - ], - [ - 117.63013756600012, - -0.418715101999865 - ], - [ - 117.63884524800008, - -0.436455987999864 - ], - [ - 117.63160241000017, - -0.447523695999976 - ], - [ - 117.6193139980002, - -0.456231377999885 - ], - [ - 117.61280358200011, - -0.46689218499999 - ], - [ - 117.60547936300011, - -0.476169528999861 - ], - [ - 117.5704858730002, - -0.48503997199991 - ], - [ - 117.55811608200005, - -0.490411065999865 - ], - [ - 117.55453535199999, - -0.502699476999837 - ], - [ - 117.58952884200019, - -0.511000257999896 - ], - [ - 117.59896894600004, - -0.521416924999897 - ], - [ - 117.59750410200016, - -0.559502862999963 - ], - [ - 117.59351647200018, - -0.574639580999872 - ], - [ - 117.58073978000002, - -0.592950127999927 - ], - [ - 117.57846113400015, - -0.596937757999825 - ], - [ - 117.57390384200019, - -0.599053643999838 - ], - [ - 117.54297936300006, - -0.600681247999859 - ], - [ - 117.53614342500023, - -0.602959893999824 - ], - [ - 117.53028405000012, - -0.607110283999859 - ], - [ - 117.53028405000012, - -0.613946221999882 - ], - [ - 117.547129754, - -0.619724216999842 - ], - [ - 117.56519616000006, - -0.622816664999917 - ], - [ - 117.57593834700006, - -0.629978122999873 - ], - [ - 117.57178795700011, - -0.648125908999873 - ], - [ - 117.55990644600016, - -0.658298434999907 - ], - [ - 117.54615319100006, - -0.665622653999918 - ], - [ - 117.53988691499998, - -0.674493096999953 - ], - [ - 117.55128014400023, - -0.68962981599995 - ], - [ - 117.539317254, - -0.694512627999842 - ], - [ - 117.52751712300002, - -0.69394296699987 - ], - [ - 117.49976647200018, - -0.68962981599995 - ], - [ - 117.48585045700011, - -0.692803643999838 - ], - [ - 117.48292076900006, - -0.699639580999857 - ], - [ - 117.48853600400017, - -0.706475518999952 - ], - [ - 117.49976647200018, - -0.709567966999856 - ], - [ - 117.52068118600002, - -0.712823174999897 - ], - [ - 117.57504316500015, - -0.727308851999851 - ], - [ - 117.60238691500004, - -0.730645440999879 - ], - [ - 117.61361738400004, - -0.734063408999887 - ], - [ - 117.62208092500018, - -0.743096612999892 - ], - [ - 117.62680097700016, - -0.755954684999907 - ], - [ - 117.6271264980002, - -0.770928643999937 - ], - [ - 117.62273196700019, - -0.781508070999905 - ], - [ - 117.61500084700012, - -0.786065362999935 - ], - [ - 117.58570397200018, - -0.792413018999881 - ], - [ - 117.57154381600006, - -0.79078541499986 - ], - [ - 117.56495201900006, - -0.791436455999985 - ], - [ - 117.55795332099999, - -0.795668226999837 - ], - [ - 117.54460696700019, - -0.808851820999877 - ], - [ - 117.53760826900012, - -0.812595309999907 - ], - [ - 117.48910566500004, - -0.798923434999878 - ], - [ - 117.49350019600004, - -0.827813408999887 - ], - [ - 117.45818118600019, - -0.820489190999965 - ], - [ - 117.44825280000006, - -0.842950127999885 - ], - [ - 117.45191491000006, - -0.866469007999839 - ], - [ - 117.44654381600017, - -0.877048434999892 - ], - [ - 117.42774498800023, - -0.880791924999826 - ], - [ - 117.41285241000017, - -0.874932549999883 - ], - [ - 117.39087975400017, - -0.848565362999878 - ], - [ - 117.37924238400015, - -0.839288018999838 - ], - [ - 117.37468509200014, - -0.855889580999971 - ], - [ - 117.36378014400023, - -0.878513278999861 - ], - [ - 117.35035241000006, - -0.8969052059999 - ], - [ - 117.33904056100008, - -0.901299737999963 - ], - [ - 117.332774285, - -0.891778252999885 - ], - [ - 117.33082116000017, - -0.877699476999851 - ], - [ - 117.33220462300002, - -0.850192966999899 - ], - [ - 117.32789147200006, - -0.84148528399983 - ], - [ - 117.30111738400015, - -0.816013278999918 - ], - [ - 117.28150475400017, - -0.809177341999899 - ], - [ - 117.26742597700004, - -0.828301690999879 - ], - [ - 117.25928795700023, - -0.858330987999835 - ], - [ - 117.25652103000007, - -0.884209893999923 - ], - [ - 117.25033613399998, - -0.90927499799993 - ], - [ - 117.235118035, - -0.92449309699991 - ], - [ - 117.19507897200018, - -0.949151299999897 - ], - [ - 117.16391035199999, - -0.981703382999868 - ], - [ - 117.06519616000006, - -1.121840101999851 - ], - [ - 117.03923587300002, - -1.137790622999859 - ], - [ - 117.03288821700014, - -1.159356377999856 - ], - [ - 117.0296330090001, - -1.184177341999913 - ], - [ - 117.02369225400005, - -1.202894789999888 - ], - [ - 117.00782311300011, - -1.216403903999861 - ], - [ - 116.98340905000018, - -1.22966887799997 - ], - [ - 116.95769290500002, - -1.239922783999916 - ], - [ - 116.85181725400005, - -1.264418226999851 - ], - [ - 116.829844597, - -1.265801690999837 - ], - [ - 116.81983483200023, - -1.26140715899993 - ], - [ - 116.81739342500006, - -1.247491143999866 - ], - [ - 116.81763756600006, - -1.220391533999845 - ], - [ - 116.829356316, - -1.204034112999821 - ], - [ - 116.83073978000019, - -1.195000908999901 - ], - [ - 116.81763756600006, - -1.189385674999912 - ], - [ - 116.81137128999998, - -1.192640882999854 - ], - [ - 116.80518639400012, - -1.201348565999851 - ], - [ - 116.79712975400017, - -1.217217705999872 - ], - [ - 116.79322350400017, - -1.203301690999893 - ], - [ - 116.79249108200023, - -1.171156507999839 - ], - [ - 116.78744550900004, - -1.158868096999868 - ], - [ - 116.74634850400005, - -1.110528252999856 - ], - [ - 116.74333743600002, - -1.085381768999881 - ], - [ - 116.75684655000012, - -1.023695570999948 - ], - [ - 116.74317467500018, - -1.024834893999895 - ], - [ - 116.72885175899998, - -1.044040622999844 - ], - [ - 116.72038821700002, - -1.07097747199991 - ], - [ - 116.71534264400012, - -1.12476978999986 - ], - [ - 116.71949303500006, - -1.13632577899989 - ], - [ - 116.74935957100004, - -1.168877862999864 - ], - [ - 116.75709069100006, - -1.18222421699987 - ], - [ - 116.75757897200006, - -1.188409112999835 - ], - [ - 116.75391686300006, - -1.193454684999864 - ], - [ - 116.74935957100004, - -1.202894789999888 - ], - [ - 116.73796634200008, - -1.215020440999879 - ], - [ - 116.73609459700012, - -1.220961195999905 - ], - [ - 116.77735436300023, - -1.23398202899989 - ], - [ - 116.77906334700006, - -1.236423434999921 - ], - [ - 116.78321373800011, - -1.237562757999868 - ], - [ - 116.78777103000007, - -1.239434502999828 - ], - [ - 116.79086347700004, - -1.243910414999974 - ], - [ - 116.79086347700004, - -1.249118747999887 - ], - [ - 116.7889103520001, - -1.254489841999842 - ], - [ - 116.77906334700006, - -1.273858330999857 - ], - [ - 116.76661217500023, - -1.287692966999856 - ], - [ - 116.76303144600016, - -1.298516533999859 - ], - [ - 116.76742597700016, - -1.344333591999856 - ], - [ - 116.76238040500002, - -1.365329684999892 - ], - [ - 116.73975670700017, - -1.37428150799991 - ], - [ - 116.71900475400017, - -1.377211196000019 - ], - [ - 116.60971113400015, - -1.420586846999896 - ], - [ - 116.56763756600017, - -1.446547132999896 - ], - [ - 116.53923587300008, - -1.481215101999879 - ], - [ - 116.53711998800023, - -1.525648695999891 - ], - [ - 116.54460696700014, - -1.540459893999866 - ], - [ - 116.55355879000015, - -1.551364841999927 - ], - [ - 116.56120853000007, - -1.563734632999882 - ], - [ - 116.56446373800011, - -1.583428643999909 - ], - [ - 116.55746504000015, - -1.606215101999851 - ], - [ - 116.54021243600002, - -1.62273528399983 - ], - [ - 116.517832879, - -1.634372653999918 - ], - [ - 116.42994225400005, - -1.659356377999856 - ], - [ - 116.3907983730002, - -1.684502862999835 - ], - [ - 116.34571373800023, - -1.695977471999868 - ], - [ - 116.32488040500007, - -1.703871351999851 - ], - [ - 116.27198326900012, - -1.749281507999925 - ], - [ - 116.26335696700019, - -1.761895440999908 - ], - [ - 116.23194420700005, - -1.777113539999888 - ], - [ - 116.22242272200018, - -1.789646091999899 - ], - [ - 116.24293053500006, - -1.805759372999873 - ], - [ - 116.26099694100006, - -1.808526299999826 - ], - [ - 116.28589928500017, - -1.807061455999872 - ], - [ - 116.30787194100012, - -1.800876559999978 - ], - [ - 116.31739342500012, - -1.789239190999893 - ], - [ - 116.32105553500006, - -1.782810153999961 - ], - [ - 116.33008873800017, - -1.778090101999865 - ], - [ - 116.35141035200004, - -1.772149346999853 - ], - [ - 116.35743248800023, - -1.772230726999837 - ], - [ - 116.36670983200011, - -1.778090101999865 - ], - [ - 116.37256920700023, - -1.778985283999859 - ], - [ - 116.37281334700018, - -1.776950778999932 - ], - [ - 116.379161004, - -1.76734791499986 - ], - [ - 116.37956790500019, - -1.765313408999916 - ], - [ - 116.40259850400017, - -1.763929945999934 - ], - [ - 116.42481530000023, - -1.766371351999965 - ], - [ - 116.44166100400005, - -1.776055596999839 - ], - [ - 116.44825280000012, - -1.796075127999899 - ], - [ - 116.43287194100017, - -1.821872653999932 - ], - [ - 116.41358483200023, - -1.847263278999947 - ], - [ - 116.45183353000019, - -1.88396575299987 - ], - [ - 116.46656334700018, - -1.907484632999825 - ], - [ - 116.450450066, - -1.957452080999857 - ], - [ - 116.46314537900017, - -2.0199520809999 - ], - [ - 116.45785566499998, - -2.04241301899998 - ], - [ - 116.43848717500006, - -2.066989841999913 - ], - [ - 116.42693118600008, - -2.076348565999851 - ], - [ - 116.35889733200011, - -2.093682549999841 - ], - [ - 116.33668053500006, - -2.108168226999965 - ], - [ - 116.31218509200019, - -2.129001559999864 - ], - [ - 116.29200280000006, - -2.15097421699987 - ], - [ - 116.28321373800011, - -2.169366143999909 - ], - [ - 116.2893986340001, - -2.169366143999909 - ], - [ - 116.337168816, - -2.146091403999904 - ], - [ - 116.370860222, - -2.137872002999899 - ], - [ - 116.38624108200005, - -2.152276299999869 - ], - [ - 116.39283287900005, - -2.191094658999972 - ], - [ - 116.41065514400012, - -2.203789971999939 - ], - [ - 116.43702233200011, - -2.198337497999916 - ], - [ - 116.50066165500019, - -2.169691664999931 - ], - [ - 116.517832879, - -2.1664364559999 - ], - [ - 116.53093509200008, - -2.169366143999909 - ], - [ - 116.53158613400004, - -2.177829684999864 - ], - [ - 116.53541100400005, - -2.195245049999841 - ], - [ - 116.54273522200006, - -2.209242445999891 - ], - [ - 116.55445397200006, - -2.207207940999865 - ], - [ - 116.56625410199999, - -2.197686455999872 - ], - [ - 116.58326256600017, - -2.187676690999965 - ], - [ - 116.59864342500012, - -2.183851820999863 - ], - [ - 116.60547936300023, - -2.193617445999905 - ], - [ - 116.60328209700006, - -2.224216404 - ], - [ - 116.57292728000007, - -2.36280689899985 - ], - [ - 116.54004967500006, - -2.512872002999913 - ], - [ - 116.51791425899998, - -2.553887627999842 - ], - [ - 116.48243248800011, - -2.560316664999931 - ], - [ - 116.47315514400023, - -2.547458592 - ], - [ - 116.46810957100004, - -2.526462497999873 - ], - [ - 116.46094811300006, - -2.507012627999885 - ], - [ - 116.44459069100017, - -2.498304945999976 - ], - [ - 116.41895592500012, - -2.4965145809999 - ], - [ - 116.40674889400012, - -2.498304945999976 - ], - [ - 116.401621941, - -2.500746351999837 - ], - [ - 116.39185631600017, - -2.509209893999866 - ], - [ - 116.38624108200005, - -2.511976820999919 - ], - [ - 116.37973066500015, - -2.511895440999936 - ], - [ - 116.37427819100006, - -2.509372653999932 - ], - [ - 116.36963951900012, - -2.506442966999913 - ], - [ - 116.36573326900012, - -2.505140882999825 - ], - [ - 116.33326256600006, - -2.511163018999909 - ], - [ - 116.32105553500006, - -2.511976820999919 - ], - [ - 116.31006920700011, - -2.516289971999839 - ], - [ - 116.30420983200023, - -2.525648695999863 - ], - [ - 116.30307050900004, - -2.535088799999883 - ], - [ - 116.30713951900006, - -2.539320570999905 - ], - [ - 116.32374108200023, - -2.547539971999981 - ], - [ - 116.32081139400012, - -2.566989841999899 - ], - [ - 116.29688561300023, - -2.608168226999865 - ], - [ - 116.31055748800006, - -2.615004164999888 - ], - [ - 116.34156334700012, - -2.566582940999893 - ], - [ - 116.36622155000012, - -2.556735934999878 - ], - [ - 116.38200931100008, - -2.557712497999844 - ], - [ - 116.39307701900006, - -2.573988539999874 - ], - [ - 116.39039147200012, - -2.589043877999899 - ], - [ - 116.37061608200005, - -2.63290780999985 - ], - [ - 116.36573326900012, - -2.652601820999891 - ], - [ - 116.36996504000004, - -2.82390715899993 - ], - [ - 116.36475670700023, - -2.861423434999864 - ], - [ - 116.35141035200004, - -2.896172783999916 - ], - [ - 116.334239129, - -2.925551039999917 - ], - [ - 116.28760826900012, - -2.987074476999965 - ], - [ - 116.26335696700019, - -3.005466404 - ], - [ - 116.24382571700014, - -3.009047132999896 - ], - [ - 116.228770379, - -3.001641533999901 - ], - [ - 116.21900475400017, - -2.985039971999939 - ], - [ - 116.21461022200018, - -2.93865325299997 - ], - [ - 116.21241295700011, - -2.93035247199991 - ], - [ - 116.20818118600008, - -2.922946873 - ], - [ - 116.19996178500017, - -2.915215752999913 - ], - [ - 116.18360436300017, - -2.90935637799987 - ], - [ - 116.17408287900017, - -2.903008721999925 - ], - [ - 116.16570071700019, - -2.889092705999943 - ], - [ - 116.15919030000012, - -2.867445570999863 - ], - [ - 116.15503991000017, - -2.843926690999908 - ], - [ - 116.153575066, - -2.82390715899993 - ], - [ - 116.15064537900017, - -2.816338799999897 - ], - [ - 116.14454186300011, - -2.816827080999886 - ], - [ - 116.13770592500006, - -2.823418877999941 - ], - [ - 116.13306725400017, - -2.834161065999865 - ], - [ - 116.13396243600008, - -2.840020440999822 - ], - [ - 116.13965905000023, - -2.857842705999971 - ], - [ - 116.13982181100019, - -2.868910414999917 - ], - [ - 116.130625847, - -2.889906507999953 - ], - [ - 116.11744225400017, - -2.909763278999876 - ], - [ - 116.11133873800006, - -2.930271091999927 - ], - [ - 116.12281334700006, - -2.95387135199995 - ], - [ - 116.126719597, - -2.966078382999839 - ], - [ - 116.11963951900017, - -2.976495049999841 - ], - [ - 116.10987389400012, - -2.986586195999976 - ], - [ - 116.10572350400017, - -2.997979424999855 - ], - [ - 116.11019941500015, - -3.006280205999843 - ], - [ - 116.11833743600008, - -3.005303643999866 - ], - [ - 116.13306725400017, - -2.997979424999855 - ], - [ - 116.16138756600012, - -3.003513278999961 - ], - [ - 116.16749108200011, - -3.014825127999856 - ], - [ - 116.16732832100004, - -3.030694268999881 - ], - [ - 116.17750084700018, - -3.04989999799993 - ], - [ - 116.19206790500019, - -3.063571872999873 - ], - [ - 116.25489342500023, - -3.108656507999854 - ], - [ - 116.26726321700019, - -3.124200127999856 - ], - [ - 116.26490319100006, - -3.136895440999908 - ], - [ - 116.21924889400012, - -3.146661065999936 - ], - [ - 116.18018639400023, - -3.161309502999856 - ], - [ - 116.16724694100006, - -3.156345309999907 - ], - [ - 116.16334069100006, - -3.172946872999873 - ], - [ - 116.18327884200002, - -3.208265882999896 - ], - [ - 116.1876733730002, - -3.232028903999975 - ], - [ - 116.18132571700019, - -3.255954684999864 - ], - [ - 116.16846764400017, - -3.265801690999879 - ], - [ - 116.149668816, - -3.270684502999856 - ], - [ - 116.12623131600006, - -3.279880467 - ], - [ - 116.12769616000011, - -3.264825127999984 - ], - [ - 116.13428795700005, - -3.254327080999843 - ], - [ - 116.14356530000012, - -3.251560153999876 - ], - [ - 116.153575066, - -3.259372653999861 - ], - [ - 116.16065514400006, - -3.25302499799993 - ], - [ - 116.16724694100006, - -3.245700778999918 - ], - [ - 116.172129754, - -3.226169528999847 - ], - [ - 116.15601647200006, - -3.225681247999859 - ], - [ - 116.12281334700006, - -3.238213799999869 - ], - [ - 116.11052493600008, - -3.246189059999907 - ], - [ - 116.10027103000007, - -3.264906507999967 - ], - [ - 116.08521569100006, - -3.307061455999829 - ], - [ - 116.02344811300023, - -3.411797783999972 - ], - [ - 116.00953209700006, - -3.451104424999897 - ], - [ - 115.99976647200012, - -3.540134372999972 - ], - [ - 115.98951256600017, - -3.582696221999839 - ], - [ - 115.96794681100008, - -3.608819268999895 - ], - [ - 115.94890384200008, - -3.61419036299985 - ], - [ - 115.882578972, - -3.614922783999887 - ], - [ - 115.85816491000017, - -3.620212497999944 - ], - [ - 115.83619225400017, - -3.633233330999843 - ], - [ - 115.796641472, - -3.669610283999916 - ], - [ - 115.75879967500018, - -3.696954033999901 - ], - [ - 115.58334394600016, - -3.780531507999854 - ], - [ - 115.31364993600019, - -3.883070570999834 - ], - [ - 115.060313347, - -3.985772393999866 - ], - [ - 114.87598717500006, - -4.070977471999839 - ], - [ - 114.71290123800011, - -4.170830987999921 - ], - [ - 114.66431725400017, - -4.184177341999842 - ], - [ - 114.624766472, - -4.170505466999899 - ], - [ - 114.60661868600019, - -4.132256768999866 - ], - [ - 114.61060631600017, - -4.088799737999906 - ], - [ - 114.63160241000006, - -4.01287200299997 - ], - [ - 114.61133873800011, - -3.926364841999899 - ], - [ - 114.60425866000017, - -3.855157158999887 - ], - [ - 114.61109459700018, - -3.683851820999919 - ], - [ - 114.59644616000017, - -3.637872002999956 - ], - [ - 114.53687584700006, - -3.563409112999906 - ], - [ - 114.52230879000004, - -3.519301039999903 - ], - [ - 114.52393639400023, - -3.475844007999953 - ], - [ - 114.55030358200023, - -3.348077080999843 - ], - [ - 114.52906334700006, - -3.357354424999883 - ], - [ - 114.51172936300006, - -3.367608330999914 - ], - [ - 114.50001061300006, - -3.382745049999912 - ], - [ - 114.48829186300011, - -3.488376559999864 - ], - [ - 114.47681725400005, - -3.500664971999825 - ], - [ - 114.45150800900004, - -3.498711846999882 - ], - [ - 114.41244550900015, - -3.485284112999878 - ], - [ - 114.36793053500006, - -3.458591403999947 - ], - [ - 114.28882897200006, - -3.424493096999939 - ], - [ - 114.27222741000011, - -3.413262627999856 - ], - [ - 114.26351972700004, - -3.397556247999887 - ], - [ - 114.26514733200023, - -3.378350518999838 - ], - [ - 114.27540123800017, - -3.362399998 - ], - [ - 114.29297936300011, - -3.355564059999907 - ], - [ - 114.30193118600002, - -3.345798434999949 - ], - [ - 114.32374108200005, - -3.279880467 - ], - [ - 114.350840691, - -3.248955987999878 - ], - [ - 114.35962975400017, - -3.23447031 - ], - [ - 114.36475670700011, - -3.211521091999927 - ], - [ - 114.32406660199999, - -3.247979424999983 - ], - [ - 114.28956139400006, - -3.306410414999874 - ], - [ - 114.24805748800011, - -3.360284112999821 - ], - [ - 114.18653405000023, - -3.382256768999838 - ], - [ - 114.15316816500015, - -3.378350518999838 - ], - [ - 114.1258244150001, - -3.367852471999868 - ], - [ - 114.10824629000015, - -3.347344658999987 - ], - [ - 114.10401451900023, - -3.313897393999852 - ], - [ - 114.12256920700023, - -3.216078382999967 - ], - [ - 114.11768639400017, - -3.190362237999835 - ], - [ - 114.11231530000012, - -3.198907158999944 - ], - [ - 114.10889733200011, - -3.208428643999852 - ], - [ - 114.09929446700014, - -3.253350518999866 - ], - [ - 114.09717858200011, - -3.276055596999896 - ], - [ - 114.09400475400005, - -3.281182549999826 - ], - [ - 114.080332879, - -3.291273695999877 - ], - [ - 114.04200280000006, - -3.355564059999907 - ], - [ - 113.98064212300008, - -3.385023695999891 - ], - [ - 113.94800866000006, - -3.394789321 - ], - [ - 113.88550866000011, - -3.43059661299985 - ], - [ - 113.81470787900017, - -3.455254815999922 - ], - [ - 113.71314537900017, - -3.472588799999912 - ], - [ - 113.63249759200008, - -3.456801039999959 - ], - [ - 113.62476647200006, - -3.382256768999838 - ], - [ - 113.6375431650001, - -3.341729424999897 - ], - [ - 113.64380944100006, - -3.298435154 - ], - [ - 113.64210045700023, - -3.255954684999864 - ], - [ - 113.62037194100006, - -3.185316664999903 - ], - [ - 113.6115014980002, - -3.174248955999872 - ], - [ - 113.59351647200018, - -3.17001718499985 - ], - [ - 113.50806725400005, - -3.17001718499985 - ], - [ - 113.48617597700004, - -3.17473723799985 - ], - [ - 113.46631920700011, - -3.184258721999853 - ], - [ - 113.45215905000006, - -3.199395440999851 - ], - [ - 113.44662519600016, - -3.221123955999914 - ], - [ - 113.43970787900017, - -3.238457940999908 - ], - [ - 113.42302493600002, - -3.247247002999956 - ], - [ - 113.36573326900006, - -3.252862237999878 - ], - [ - 113.35279381600017, - -3.249281507999811 - ], - [ - 113.34587649800008, - -3.237888278999932 - ], - [ - 113.34359785199999, - -3.21461354 - ], - [ - 113.33961022200006, - -3.200290622999844 - ], - [ - 113.32935631600012, - -3.18279387799997 - ], - [ - 113.31592858200011, - -3.168064059999978 - ], - [ - 113.30274498800017, - -3.162530205999872 - ], - [ - 113.34522545700023, - -3.246514580999929 - ], - [ - 113.35108483200005, - -3.27239348799985 - ], - [ - 113.29932701900023, - -3.21461354 - ], - [ - 113.28500410200016, - -3.20419687299993 - ], - [ - 113.25464928500017, - -3.186944268999838 - ], - [ - 113.24122155000012, - -3.176853122999859 - ], - [ - 113.23047936300006, - -3.164320570999948 - ], - [ - 113.22169030000012, - -3.149997653999961 - ], - [ - 113.21558678500006, - -3.134209893999838 - ], - [ - 113.20997155000023, - -3.103773695999877 - ], - [ - 113.20167076900023, - -3.093031507999868 - ], - [ - 113.18262780000023, - -3.07708098799985 - ], - [ - 113.15919030000006, - -3.064629815999922 - ], - [ - 113.12826582100004, - -3.054945570999877 - ], - [ - 113.10132897200018, - -3.042575778999932 - ], - [ - 113.03516686300006, - -2.922946873 - ], - [ - 113.03711998800023, - -2.993096612999892 - ], - [ - 113.03150475400005, - -3.00888437299993 - ], - [ - 113.0252384770001, - -3.017347914999959 - ], - [ - 113.017344597, - -3.036797783999958 - ], - [ - 113.00782311300011, - -3.046482028999932 - ], - [ - 113.00342858200023, - -3.047458591999899 - ], - [ - 112.99195397200018, - -3.045668226999823 - ], - [ - 112.98731530000023, - -3.046482028999932 - ], - [ - 112.98316491, - -3.049737237999963 - ], - [ - 112.97632897200012, - -3.057549737999878 - ], - [ - 112.96338951900012, - -3.069024346999825 - ], - [ - 112.94906660200004, - -3.086032809999963 - ], - [ - 112.94109134200008, - -3.106377862999878 - ], - [ - 112.949473504, - -3.125176690999822 - ], - [ - 112.96192467500023, - -3.138360283999873 - ], - [ - 112.96843509200002, - -3.143975518999866 - ], - [ - 112.97982832099999, - -3.149509372999972 - ], - [ - 112.99048912900005, - -3.151788018999866 - ], - [ - 113.01140384200019, - -3.153252862999835 - ], - [ - 113.02149498800023, - -3.156345309999907 - ], - [ - 113.02149498800023, - -3.162530205999872 - ], - [ - 112.66976972700016, - -3.388604424999855 - ], - [ - 112.63803144599999, - -3.416761976999851 - ], - [ - 112.61801191500004, - -3.423760674999912 - ], - [ - 112.58155358200017, - -3.415948174999841 - ], - [ - 112.57593834700006, - -3.420098565999865 - ], - [ - 112.57309004000004, - -3.430352471999896 - ], - [ - 112.56576582100004, - -3.437920830999843 - ], - [ - 112.55591881600017, - -3.442640882999939 - ], - [ - 112.5450952480002, - -3.444268487999878 - ], - [ - 112.52466881600006, - -3.437758070999877 - ], - [ - 112.3904728520001, - -3.339939059999921 - ], - [ - 112.34896894599999, - -3.32284921699987 - ], - [ - 112.30274498800006, - -3.313897393999852 - ], - [ - 112.20289147200018, - -3.329522393999838 - ], - [ - 112.11687259200019, - -3.382256768999838 - ], - [ - 111.97315514400006, - -3.525567315999865 - ], - [ - 111.9310001960001, - -3.559014580999829 - ], - [ - 111.90528405000006, - -3.572035414999988 - ], - [ - 111.88721764400006, - -3.570245049999912 - ], - [ - 111.86947675900015, - -3.560153903999861 - ], - [ - 111.82203209700006, - -3.545098565999851 - ], - [ - 111.8087671230002, - -3.532972914999945 - ], - [ - 111.80836022200018, - -3.51181405999985 - ], - [ - 111.82976321700002, - -3.468194268999838 - ], - [ - 111.83529707100016, - -3.447686455999886 - ], - [ - 111.84294681100019, - -3.384454033999916 - ], - [ - 111.84278405000012, - -3.361748955999957 - ], - [ - 111.81495201900006, - -3.190362237999835 - ], - [ - 111.81755618600008, - -3.144463799999855 - ], - [ - 111.83253014400012, - -3.06161874799993 - ], - [ - 111.82243899800002, - -3.018487237999821 - ], - [ - 111.76026451900012, - -2.907647393999866 - ], - [ - 111.75407962300008, - -2.868910414999917 - ], - [ - 111.75407962300008, - -2.82390715899993 - ], - [ - 111.75098717500006, - -2.82040780999985 - ], - [ - 111.74382571700002, - -2.81747812299993 - ], - [ - 111.73682701900006, - -2.812676690999851 - ], - [ - 111.73357181100019, - -2.803399346999882 - ], - [ - 111.73747806100019, - -2.783379815999822 - ], - [ - 111.75277754000015, - -2.756280205999886 - ], - [ - 111.75407962300008, - -2.738539320999891 - ], - [ - 111.73943118600008, - -2.74618906 - ], - [ - 111.72348066500015, - -2.759047132999939 - ], - [ - 111.71078535200016, - -2.774590752999941 - ], - [ - 111.70573978000007, - -2.789727471999939 - ], - [ - 111.71265709700006, - -2.835056247999859 - ], - [ - 111.71314537900005, - -2.848402601999879 - ], - [ - 111.70801842500012, - -2.859633070999877 - ], - [ - 111.69874108200005, - -2.868096612999906 - ], - [ - 111.68978925900015, - -2.874200127999984 - ], - [ - 111.68580162900017, - -2.878838799999841 - ], - [ - 111.68311608200005, - -2.882989190999865 - ], - [ - 111.67750084700018, - -2.88795338299991 - ], - [ - 111.67253665500002, - -2.894626559999878 - ], - [ - 111.67156009200008, - -2.903008721999925 - ], - [ - 111.67546634200008, - -2.911065362999878 - ], - [ - 111.68091881600017, - -2.914483330999886 - ], - [ - 111.68677819100006, - -2.916924737999906 - ], - [ - 111.695567254, - -2.926202080999872 - ], - [ - 111.70004316500015, - -2.928155205999914 - ], - [ - 111.70394941500015, - -2.931817315999865 - ], - [ - 111.70573978000007, - -2.94003671699987 - ], - [ - 111.7034611340001, - -2.943617445999934 - ], - [ - 111.6941837900001, - -2.943047783999873 - ], - [ - 111.69206790500019, - -2.94687265399989 - ], - [ - 111.64893639400012, - -2.962009372999887 - ], - [ - 111.58432050900015, - -3.00888437299993 - ], - [ - 111.56983483200011, - -3.01572030999985 - ], - [ - 111.55176842500006, - -3.018487237999821 - ], - [ - 111.53435306100019, - -3.012139580999886 - ], - [ - 111.5257267590001, - -2.996840101999823 - ], - [ - 111.52084394600016, - -2.978936455999872 - ], - [ - 111.51441491000006, - -2.963799737999864 - ], - [ - 111.48568769600016, - -2.94150156 - ], - [ - 111.447520379, - -2.929782809999935 - ], - [ - 111.36304772200006, - -2.922946873 - ], - [ - 111.32422936300006, - -2.925957940999837 - ], - [ - 111.29615319100006, - -2.936455987999977 - ], - [ - 111.060801629, - -3.061130466999842 - ], - [ - 110.98617597700016, - -3.087497653999847 - ], - [ - 110.94239342500012, - -3.091485283999916 - ], - [ - 110.906504754, - -3.08326588299991 - ], - [ - 110.82374108200005, - -3.037204684999963 - ], - [ - 110.80665123800011, - -3.032972914999945 - ], - [ - 110.77027428500006, - -3.032159112999935 - ], - [ - 110.75424238400015, - -3.026055596999868 - ], - [ - 110.75554446700002, - -3.011814059999864 - ], - [ - 110.76498457100016, - -2.995782158999873 - ], - [ - 110.77409915500007, - -2.984307549999912 - ], - [ - 110.80437259200002, - -2.959079684999864 - ], - [ - 110.83790123800006, - -2.945000908999916 - ], - [ - 110.87208092500006, - -2.935235283999873 - ], - [ - 110.95606530000006, - -2.900079033999916 - ], - [ - 110.96583092500006, - -2.899590752999828 - ], - [ - 110.95606530000006, - -2.879001559999892 - ], - [ - 110.93409264400012, - -2.883884372999859 - ], - [ - 110.89698326900012, - -2.909844658999859 - ], - [ - 110.87940514400006, - -2.918145440999922 - ], - [ - 110.83008873800011, - -2.933770440999908 - ], - [ - 110.81153405000006, - -2.936618747999944 - ], - [ - 110.79395592500006, - -2.943536065999865 - ], - [ - 110.77686608200011, - -2.959730726999823 - ], - [ - 110.69792728000019, - -3.062676690999879 - ], - [ - 110.6624455090001, - -3.080743096999896 - ], - [ - 110.63062584700006, - -3.053317966999856 - ], - [ - 110.628184441, - -3.042657158999916 - ], - [ - 110.63314863400015, - -3.039483330999857 - ], - [ - 110.64014733200005, - -3.037204684999963 - ], - [ - 110.64356530000006, - -3.028985283999887 - ], - [ - 110.64258873800006, - -3.018731377999941 - ], - [ - 110.63672936300006, - -2.994886976999879 - ], - [ - 110.63502037900005, - -2.974216403999861 - ], - [ - 110.63038170700011, - -2.951348565999936 - ], - [ - 110.616953972, - -2.909844658999859 - ], - [ - 110.58855228000019, - -2.876560153999861 - ], - [ - 110.54948978000002, - -2.867608330999829 - ], - [ - 110.508067254, - -2.874607028999989 - ], - [ - 110.40406334700018, - -2.92050546699997 - ], - [ - 110.30103600400005, - -2.997979424999855 - ], - [ - 110.26319420700011, - -3.002862237999835 - ], - [ - 110.24024498800011, - -2.973077080999829 - ], - [ - 110.22364342500006, - -2.93035247199991 - ], - [ - 110.20484459700018, - -2.896172783999916 - ], - [ - 110.22169030000006, - -2.876071872999873 - ], - [ - 110.237559441, - -2.846937757999825 - ], - [ - 110.24708092500012, - -2.815118096999882 - ], - [ - 110.24586022200018, - -2.786309502999842 - ], - [ - 110.22754967500012, - -2.741957289999988 - ], - [ - 110.22315514400006, - -2.701918226999879 - ], - [ - 110.21387780000012, - -2.669040622999887 - ], - [ - 110.211680535, - -2.652601820999891 - ], - [ - 110.20378665500002, - -2.640069268999881 - ], - [ - 110.16749108200005, - -2.632419528999861 - ], - [ - 110.15699303500017, - -2.621270440999837 - ], - [ - 110.16041100400017, - -2.612399997999972 - ], - [ - 110.17969811300011, - -2.590020440999865 - ], - [ - 110.18433678500006, - -2.577243747999916 - ], - [ - 110.19922936300011, - -2.55234140399989 - ], - [ - 110.23194420700011, - -2.556735934999878 - ], - [ - 110.26490319100017, - -2.556573174999912 - ], - [ - 110.28052819100017, - -2.518243096999882 - ], - [ - 110.24683678500017, - -2.539808851999894 - ], - [ - 110.22103925900015, - -2.532810153999989 - ], - [ - 110.20118248800006, - -2.5082333309999 - ], - [ - 110.15992272200018, - -2.436455987999906 - ], - [ - 110.15699303500017, - -2.419528904 - ], - [ - 110.15479576900006, - -2.376234632999854 - ], - [ - 110.14087975400011, - -2.289727471999868 - ], - [ - 110.13209069100006, - -2.268161716999941 - ], - [ - 110.11947675900015, - -2.25872161299985 - ], - [ - 110.10466556100008, - -2.252048434999878 - ], - [ - 110.09717858200011, - -2.235772393999937 - ], - [ - 110.094981316, - -2.215508721999839 - ], - [ - 110.0955509770001, - -2.197360934999935 - ], - [ - 110.1053166020001, - -2.154392184999878 - ], - [ - 110.11988366000006, - -2.112074476999879 - ], - [ - 110.129161004, - -2.069512627999828 - ], - [ - 110.12354576900012, - -2.025485934999907 - ], - [ - 110.09546959700012, - -1.960137627999927 - ], - [ - 110.09253991000017, - -1.949639580999872 - ], - [ - 110.0750431650001, - -1.922458591999856 - ], - [ - 110.06576582100016, - -1.91757577899989 - ], - [ - 110.03419030000006, - -1.909356377999885 - ], - [ - 109.98755944100017, - -1.884698174999897 - ], - [ - 109.96859785200016, - -1.881442966999856 - ], - [ - 109.95362389400012, - -1.874281507999811 - ], - [ - 109.90381920700005, - -1.826104424999855 - ], - [ - 109.90894616000017, - -1.823337497999901 - ], - [ - 109.91895592500006, - -1.815850518999838 - ], - [ - 109.92432701900012, - -1.813164971999939 - ], - [ - 109.91627037900017, - -1.807793877999899 - ], - [ - 109.91081790500002, - -1.799899998 - ], - [ - 109.90870201900012, - -1.790134372999887 - ], - [ - 109.91065514400006, - -1.778985283999859 - ], - [ - 109.92164147200006, - -1.76962656 - ], - [ - 109.96802819100017, - -1.743422132999896 - ], - [ - 109.982676629, - -1.737969658999859 - ], - [ - 109.99390709700012, - -1.730238539999931 - ], - [ - 110.004649285, - -1.712172132999825 - ], - [ - 110.03394616000006, - -1.646172783999901 - ], - [ - 110.03858483200005, - -1.627618096999896 - ], - [ - 110.04175866000006, - -1.559828382999882 - ], - [ - 110.06853274800002, - -1.432549737999835 - ], - [ - 110.07105553500006, - -1.389906507999896 - ], - [ - 110.0613712900001, - -1.346368096999882 - ], - [ - 110.04411868600019, - -1.304782809999907 - ], - [ - 110.02955162900017, - -1.285902601999879 - ], - [ - 110.01002037900017, - -1.278008721999981 - ], - [ - 109.98829186300011, - -1.27499765399989 - ], - [ - 109.9642033210001, - -1.26572030999985 - ], - [ - 109.948496941, - -1.250746351999823 - ], - [ - 109.9515080090001, - -1.230889580999985 - ], - [ - 109.92986087300014, - -1.22323984199987 - ], - [ - 109.92204837300002, - -1.201592705999886 - ], - [ - 109.92367597700016, - -1.174004815999865 - ], - [ - 109.9368595710001, - -1.127618096999896 - ], - [ - 109.93458092500012, - -1.112562757999882 - ], - [ - 109.9226994150001, - -1.103610934999864 - ], - [ - 109.90015709700012, - -1.100518487999878 - ], - [ - 109.89405358200011, - -1.098565362999835 - ], - [ - 109.86963951900006, - -1.086195570999891 - ], - [ - 109.85906009200019, - -1.085056247999859 - ], - [ - 109.83545983200005, - -1.086195570999891 - ], - [ - 109.82300866000006, - -1.075290622999916 - ], - [ - 109.8099064460001, - -1.045179945999877 - ], - [ - 109.78565514400012, - -1.032972914999988 - ], - [ - 109.77515709700006, - -1.018731377999984 - ], - [ - 109.75977623800011, - -0.9906552059999 - ], - [ - 109.74048912900005, - -0.967543226999936 - ], - [ - 109.734141472, - -0.954034112999878 - ], - [ - 109.73178144600016, - -0.932305596999896 - ], - [ - 109.73487389400006, - -0.917657158999887 - ], - [ - 109.74219811300006, - -0.908135674999897 - ], - [ - 109.75131269600016, - -0.89959075299987 - ], - [ - 109.75977623800011, - -0.88762786299985 - ], - [ - 109.76514733200005, - -0.874281507999839 - ], - [ - 109.7635197270001, - -0.87086354 - ], - [ - 109.73487389400006, - -0.879001559999935 - ], - [ - 109.72437584700018, - -0.888767184999963 - ], - [ - 109.719493035, - -0.904066665000016 - ], - [ - 109.7181095710001, - -0.925876559999892 - ], - [ - 109.71412194100006, - -0.947360934999921 - ], - [ - 109.70386803500006, - -0.960625908999859 - ], - [ - 109.67725670700011, - -0.983819268999966 - ], - [ - 109.64795983200005, - -0.967461846999953 - ], - [ - 109.62989342500006, - -0.95191822699995 - ], - [ - 109.6232202480002, - -0.951592705999929 - ], - [ - 109.61622155000012, - -0.954685154 - ], - [ - 109.60523522200006, - -0.956638278999876 - ], - [ - 109.59864342500006, - -0.947849216999899 - ], - [ - 109.58171634200019, - -0.894463799999869 - ], - [ - 109.55982506600017, - -0.877373955999914 - ], - [ - 109.52564537900017, - -0.862399997999887 - ], - [ - 109.48878014400012, - -0.851657809999864 - ], - [ - 109.43824303500011, - -0.845635674999869 - ], - [ - 109.42798912900017, - -0.846612237999835 - ], - [ - 109.42066491000017, - -0.850192966999899 - ], - [ - 109.41382897200006, - -0.860121351999823 - ], - [ - 109.41586347700016, - -0.866957289999917 - ], - [ - 109.42107181100008, - -0.873793226999851 - ], - [ - 109.42408287900017, - -0.884209893999923 - ], - [ - 109.41895592500006, - -0.903578382999939 - ], - [ - 109.40650475400005, - -0.911390882999854 - ], - [ - 109.39079837300008, - -0.911879164999931 - ], - [ - 109.37623131600006, - -0.908786716999856 - ], - [ - 109.33521569100006, - -0.889092705999985 - ], - [ - 109.32837975400005, - -0.884209893999923 - ], - [ - 109.32048587300008, - -0.883396091999913 - ], - [ - 109.28386478000002, - -0.863213799999897 - ], - [ - 109.27320397200018, - -0.853610934999907 - ], - [ - 109.24529056100008, - -0.695896091999913 - ], - [ - 109.25098717500012, - -0.677666924999841 - ], - [ - 109.26254316500015, - -0.667413018999909 - ], - [ - 109.27857506600006, - -0.66904062299993 - ], - [ - 109.29737389400012, - -0.685642184999892 - ], - [ - 109.3138126960001, - -0.69500090899983 - ], - [ - 109.38306725400017, - -0.695896091999913 - ], - [ - 109.39820397200018, - -0.703057549999855 - ], - [ - 109.42920983200011, - -0.725762627999984 - ], - [ - 109.45582116000006, - -0.732110283999845 - ], - [ - 109.46192467500012, - -0.734795830999914 - ], - [ - 109.46859785200016, - -0.737074476999879 - ], - [ - 109.47868899800002, - -0.736911716999913 - ], - [ - 109.501719597, - -0.731052341999884 - ], - [ - 109.5096134770001, - -0.725030205999957 - ], - [ - 109.50652103000019, - -0.716403903999876 - ], - [ - 109.49732506600006, - -0.713636976999823 - ], - [ - 109.4715275400001, - -0.716566664999931 - ], - [ - 109.46159915500019, - -0.712985934999864 - ], - [ - 109.44361412900017, - -0.687432549999869 - ], - [ - 109.43458092500006, - -0.678806247999873 - ], - [ - 109.41293379000015, - -0.663995049999897 - ], - [ - 109.38990319100017, - -0.654880466999899 - ], - [ - 109.37916100400017, - -0.652927341999856 - ], - [ - 109.362559441, - -0.65195077899989 - ], - [ - 109.35515384200002, - -0.648125908999873 - ], - [ - 109.35515384200002, - -0.641289971999939 - ], - [ - 109.35962975400011, - -0.639743747999901 - ], - [ - 109.36882571700008, - -0.633884372999873 - ], - [ - 109.36475670700011, - -0.630140882999839 - ], - [ - 109.35962975400011, - -0.623630466999927 - ], - [ - 109.35515384200002, - -0.62021249799993 - ], - [ - 109.35515384200002, - -0.613946221999882 - ], - [ - 109.37322024800002, - -0.614190362999835 - ], - [ - 109.40626061300011, - -0.62021249799993 - ], - [ - 109.42408287900017, - -0.62021249799993 - ], - [ - 109.42408287900017, - -0.613946221999882 - ], - [ - 109.400645379, - -0.59734465899983 - ], - [ - 109.37452233200005, - -0.587334893999838 - ], - [ - 109.344004754, - -0.583754164999874 - ], - [ - 109.27759850400017, - -0.586195570999905 - ], - [ - 109.26238040500019, - -0.592461846999939 - ], - [ - 109.25660241000006, - -0.58847421699987 - ], - [ - 109.2503361340001, - -0.582289320999905 - ], - [ - 109.23536217500006, - -0.576348565999965 - ], - [ - 109.23113040500002, - -0.570000908999859 - ], - [ - 109.22803795700005, - -0.563083591999856 - ], - [ - 109.2247827480002, - -0.558689059999864 - ], - [ - 109.21509850400005, - -0.553399346999896 - ], - [ - 109.2117619150001, - -0.552178643999881 - ], - [ - 109.20777428500006, - -0.552422783999916 - ], - [ - 109.197520379, - -0.551853122999859 - ], - [ - 109.18734785200016, - -0.552992445999891 - ], - [ - 109.17969811300006, - -0.556084893999866 - ], - [ - 109.17139733200005, - -0.556329033999916 - ], - [ - 109.159922722, - -0.548760674999869 - ], - [ - 109.13941491000006, - -0.528578382999925 - ], - [ - 109.13013756600012, - -0.51572031 - ], - [ - 109.12330162900017, - -0.49968840899983 - ], - [ - 109.10279381600006, - -0.409926039999888 - ], - [ - 109.10059655000006, - -0.369724216999899 - ], - [ - 109.10254967500006, - -0.361097914999888 - ], - [ - 109.11247806100019, - -0.3597958309999 - ], - [ - 109.13599694100006, - -0.360039971999839 - ], - [ - 109.10320071700002, - -0.314141533999859 - ], - [ - 109.09083092500012, - -0.287204684999978 - ], - [ - 109.10132897200018, - -0.263848565999893 - ], - [ - 109.10132897200018, - -0.257582289999945 - ], - [ - 109.08936608200005, - -0.253024997999987 - ], - [ - 109.07642662900005, - -0.250583591999956 - ], - [ - 109.06739342500012, - -0.255140882999825 - ], - [ - 109.06706790500019, - -0.271254164999888 - ], - [ - 109.05030358200005, - -0.261895440999851 - ], - [ - 109.0462345710001, - -0.24586353999986 - ], - [ - 109.05095462300014, - -0.229099216999842 - ], - [ - 109.06031334700006, - -0.216729424999897 - ], - [ - 109.07032311300006, - -0.211846612999835 - ], - [ - 109.0861108730002, - -0.207452080999857 - ], - [ - 109.11866295700005, - -0.203057549999954 - ], - [ - 109.14665774800008, - -0.205254815999865 - ], - [ - 109.17603600400017, - -0.212009372999901 - ], - [ - 109.20167076900006, - -0.22275156 - ], - [ - 109.21851647200006, - -0.237237237999864 - ], - [ - 109.2247827480002, - -0.237237237999864 - ], - [ - 109.21876061300011, - -0.221612237999878 - ], - [ - 109.19857832100016, - -0.200860283999873 - ], - [ - 109.19060306100019, - -0.188734632999967 - ], - [ - 109.18848717500012, - -0.177341403999918 - ], - [ - 109.19060306100019, - -0.13730234199997 - ], - [ - 109.18685957100016, - -0.082207940999837 - ], - [ - 109.17969811300006, - -0.055474541999914 - ], - [ - 109.16041100400011, - -0.023695570999962 - ], - [ - 109.15739993600019, - -0.009291273999821 - ], - [ - 109.156504754, - 0.020086981000091 - ], - [ - 109.16098066500015, - 0.033921617000175 - ], - [ - 109.17212975400017, - 0.034165757000125 - ], - [ - 109.197520379, - 0.023504950000017 - ], - [ - 109.30046634200019, - 0.010484117000118 - ], - [ - 109.28052819100012, - 0.027492580000086 - ], - [ - 109.23666425900015, - 0.057277736 - ], - [ - 109.17693118600008, - 0.107611395000049 - ], - [ - 109.16675866000006, - 0.112290757000054 - ], - [ - 109.10230553500006, - 0.243109442000076 - ], - [ - 109.046641472, - 0.287054755000113 - ], - [ - 109.03321373800006, - 0.293361721000139 - ], - [ - 109.01612389400006, - 0.296820380000142 - ], - [ - 108.95313561300006, - 0.301743882000025 - ], - [ - 108.92872155000012, - 0.315090236000117 - ], - [ - 108.92090905000012, - 0.340277411000088 - ], - [ - 108.93116295700005, - 0.379787502000141 - ], - [ - 108.94239342500006, - 0.408270575000145 - ], - [ - 108.94434655000012, - 0.42251211100016 - ], - [ - 108.94483483200011, - 0.445298570000176 - ], - [ - 108.93848717500006, - 0.465155341000099 - ], - [ - 108.91309655000012, - 0.504339911000116 - ], - [ - 108.91000410200016, - 0.530585028000061 - ], - [ - 108.91431725400005, - 0.541408596000139 - ], - [ - 108.92823326900012, - 0.563666083000101 - ], - [ - 108.93116295700005, - 0.575018622000158 - ], - [ - 108.93116295700005, - 0.616197007000139 - ], - [ - 108.92725670700005, - 0.640773830000143 - ], - [ - 108.91724694100017, - 0.661078192000062 - ], - [ - 108.87598717500012, - 0.714667059000149 - ], - [ - 108.87745201900006, - 0.723822333000044 - ], - [ - 108.88502037900005, - 0.733221747000144 - ], - [ - 108.88965905000006, - 0.753729559000107 - ], - [ - 108.88257897200018, - 0.777533270000106 - ], - [ - 108.85596764400006, - 0.811590887000122 - ], - [ - 108.85547936300006, - 0.832220770000134 - ], - [ - 108.8626408210001, - 0.841742255000142 - ], - [ - 108.87696373800011, - 0.85553620000006 - ], - [ - 108.89332116, - 0.867905992000175 - ], - [ - 108.90658613400015, - 0.873236395000063 - ], - [ - 108.92603600400005, - 0.875962632000125 - ], - [ - 108.94141686300006, - 0.884019273000149 - ], - [ - 108.9539494150001, - 0.896877346000082 - ], - [ - 108.96534264400006, - 0.914211330000072 - ], - [ - 108.98080488400015, - 0.956040757000096 - ], - [ - 108.98031660200016, - 0.995550848000136 - ], - [ - 108.927012566, - 1.140448309000107 - ], - [ - 108.92432701900012, - 1.164007880000071 - ], - [ - 108.93262780000012, - 1.178045966000028 - ], - [ - 108.95232181100008, - 1.184068101000122 - ], - [ - 108.99268639400012, - 1.187892971000124 - ], - [ - 109.03272545700005, - 1.199042059000064 - ], - [ - 109.10816491000017, - 1.228705145 - ], - [ - 109.14283287900017, - 1.250637111000117 - ], - [ - 109.15845787900005, - 1.264634507000082 - ], - [ - 109.2156681650001, - 1.335435289000173 - ], - [ - 109.22803795700005, - 1.358628648000035 - ], - [ - 109.24341881600017, - 1.37986888200011 - ], - [ - 109.26636803500017, - 1.394598700000103 - ], - [ - 109.26636803500017, - 1.401434637000108 - ], - [ - 109.24048912900017, - 1.40420156499999 - ], - [ - 109.227305535, - 1.38886139500012 - ], - [ - 109.21729576900012, - 1.369452216000113 - ], - [ - 109.20118248800006, - 1.359849351000051 - ], - [ - 109.18824303500006, - 1.3491885440001 - ], - [ - 109.16504967500012, - 1.302232164000159 - ], - [ - 109.15308678500017, - 1.291571356000134 - ], - [ - 109.1492619150001, - 1.286200262000179 - ], - [ - 109.14470462300002, - 1.274155992000161 - ], - [ - 109.13738040500002, - 1.262274481000034 - ], - [ - 109.125743035, - 1.256822007000082 - ], - [ - 109.11402428500006, - 1.254461981000119 - ], - [ - 109.10450280000012, - 1.24884674700013 - ], - [ - 109.0882267590001, - 1.236314195000119 - ], - [ - 109.06617272200012, - 1.229559637000179 - ], - [ - 109.01221764400012, - 1.224310614000103 - ], - [ - 108.98585045700011, - 1.215806382000082 - ], - [ - 108.99040774800002, - 1.247463283000059 - ], - [ - 109.00603274800014, - 1.274155992000161 - ], - [ - 109.04037519600016, - 1.318915106000105 - ], - [ - 109.05437259200002, - 1.352240302000098 - ], - [ - 109.06080162900005, - 1.383856512000179 - ], - [ - 109.06080162900005, - 1.499009507000125 - ], - [ - 109.07300866000006, - 1.533921617000146 - ], - [ - 109.095957879, - 1.560614325000174 - ], - [ - 109.25269616000006, - 1.668361721000053 - ], - [ - 109.27222741, - 1.693793036000059 - ], - [ - 109.30339603000019, - 1.752630927000141 - ], - [ - 109.321055535, - 1.778225002000113 - ], - [ - 109.33912194100006, - 1.797756252000013 - ], - [ - 109.34205162900017, - 1.801825262000065 - ], - [ - 109.3431095710001, - 1.804388739000061 - ], - [ - 109.34546959700018, - 1.806463934000178 - ], - [ - 109.34782962300014, - 1.809556382000068 - ], - [ - 109.34888756600017, - 1.815415757000025 - ], - [ - 109.34669030000006, - 1.81879303600013 - ], - [ - 109.34180748800011, - 1.819973049000154 - ], - [ - 109.33692467500006, - 1.81879303600013 - ], - [ - 109.33464603000007, - 1.815415757000025 - ], - [ - 109.28679446700008, - 1.778225002000113 - ], - [ - 109.28923587300008, - 1.795965887000108 - ], - [ - 109.29997806100019, - 1.806952216000155 - ], - [ - 109.31446373800006, - 1.817206122000101 - ], - [ - 109.32837975400005, - 1.832831122000087 - ], - [ - 109.33513431100008, - 1.850165106000077 - ], - [ - 109.33643639400006, - 1.867905992000161 - ], - [ - 109.33464603000007, - 1.901109117000175 - ], - [ - 109.34099368600019, - 1.935532945000105 - ], - [ - 109.35889733200005, - 1.948309637000065 - ], - [ - 109.42408287900017, - 1.955715236000131 - ], - [ - 109.56120853000007, - 1.990464585000097 - ], - [ - 109.57886803500006, - 1.997626044000143 - ], - [ - 109.59278405000012, - 2.007513739000146 - ], - [ - 109.60466556100019, - 2.020941473000136 - ], - [ - 109.63502037900017, - 2.074042059000149 - ], - [ - 109.64527428500017, - 2.083238023000121 - ], - [ - 109.62662072800018, - 2.029696350000123 - ], - [ - 109.60026574700012, - 1.983135885000166 - ], - [ - 109.58507287600017, - 1.96091501900014 - ], - [ - 109.57442753100011, - 1.94859019000009 - ], - [ - 109.53794397000016, - 1.917713522000099 - ], - [ - 109.52936568200008, - 1.905156149 - ], - [ - 109.52843550600019, - 1.889989116000066 - ], - [ - 109.5347400320002, - 1.853893127000148 - ], - [ - 109.53432662000009, - 1.846451721000051 - ], - [ - 109.5347400320002, - 1.838984477000025 - ], - [ - 109.5398043220001, - 1.826556295000046 - ], - [ - 109.54662561000012, - 1.814334818000106 - ], - [ - 109.55561731000009, - 1.802165019000199 - ], - [ - 109.56698612500006, - 1.792553203000182 - ], - [ - 109.58011193900015, - 1.78797983800014 - ], - [ - 109.62403690700009, - 1.787773132000012 - ], - [ - 109.64181359900007, - 1.781003520000155 - ], - [ - 109.64718794800015, - 1.761883240000159 - ], - [ - 109.64057336400006, - 1.683025004000129 - ], - [ - 109.64171024600009, - 1.63716217100017 - ], - [ - 109.64698124200018, - 1.617628479000075 - ], - [ - 109.65803999900012, - 1.597190450000198 - ], - [ - 109.6772636320002, - 1.572850850000094 - ], - [ - 109.76635380100007, - 1.496473084000058 - ], - [ - 109.77317509000008, - 1.485853577000071 - ], - [ - 109.77555220500014, - 1.457948303000165 - ], - [ - 109.78154667200008, - 1.456294658000132 - ], - [ - 109.80056359900013, - 1.46675913500016 - ], - [ - 109.8077982990001, - 1.45996368400013 - ], - [ - 109.82547164000019, - 1.417563171000111 - ], - [ - 109.84283492000012, - 1.403274638000127 - ], - [ - 109.86288537700008, - 1.401465963000135 - ], - [ - 109.88272912600016, - 1.403843079000168 - ], - [ - 109.90205611200011, - 1.403791402000152 - ], - [ - 109.92024621600015, - 1.394773865000118 - ], - [ - 109.93254520700012, - 1.378521627000097 - ], - [ - 109.9517688390001, - 1.3196621700001 - ], - [ - 109.9637577720001, - 1.298578186000086 - ], - [ - 109.97626346900009, - 1.287726136000131 - ], - [ - 110.01212691200013, - 1.270517883000153 - ], - [ - 110.03073042800006, - 1.253568014000138 - ], - [ - 110.05181441200008, - 1.215482483000187 - ], - [ - 110.07455204300018, - 1.198635966000126 - ], - [ - 110.09346561700013, - 1.19160797100011 - ], - [ - 110.15217004500008, - 1.183856507000201 - ], - [ - 110.17036014900012, - 1.174451396000151 - ], - [ - 110.18513960800013, - 1.154194234000059 - ], - [ - 110.2067403570002, - 1.1117162070002 - ], - [ - 110.25655643700011, - 1.039059144000163 - ], - [ - 110.2617240800001, - 1.014719544000144 - ], - [ - 110.26348107900012, - 0.99430735300011 - ], - [ - 110.27278283800015, - 0.991051737000035 - ], - [ - 110.2863220630002, - 0.995340881000175 - ], - [ - 110.30079146400007, - 0.997717997000123 - ], - [ - 110.35164107300008, - 0.986504211000181 - ], - [ - 110.36414676900009, - 0.98138824500009 - ], - [ - 110.38068322800015, - 0.966608785000176 - ], - [ - 110.42264449100006, - 0.909454651000061 - ], - [ - 110.4602649330001, - 0.879740703 - ], - [ - 110.50636031100012, - 0.857313131000168 - ], - [ - 110.55390262900013, - 0.851370341000077 - ], - [ - 110.59607059800007, - 0.871110738000127 - ], - [ - 110.60599247300016, - 0.883306376000135 - ], - [ - 110.60960982300006, - 0.890851136000094 - ], - [ - 110.6134338790001, - 0.89395172100005 - ], - [ - 110.62480269400007, - 0.89312489800011 - ], - [ - 110.63214074800007, - 0.888629049000187 - ], - [ - 110.63885868300011, - 0.880774231000146 - ], - [ - 110.64774703000009, - 0.873901266000175 - ], - [ - 110.66128625500019, - 0.87214426700011 - ], - [ - 110.67441206900017, - 0.877001851000045 - ], - [ - 110.6930155850001, - 0.894675192000136 - ], - [ - 110.70417769400015, - 0.901393127000148 - ], - [ - 110.70944869000019, - 0.901393127000148 - ], - [ - 110.72071415200006, - 0.897362366000067 - ], - [ - 110.72484826700006, - 0.897259013000138 - ], - [ - 110.7447953700001, - 0.905062154000149 - ], - [ - 110.74572554600016, - 0.908007711000067 - ], - [ - 110.7583345950001, - 0.91451894100004 - ], - [ - 110.7611251230002, - 0.912865296000163 - ], - [ - 110.7712537030001, - 0.904390361000083 - ], - [ - 110.77673140500016, - 0.903253479000156 - ], - [ - 110.78396610600012, - 0.908162740000193 - ], - [ - 110.78623986800002, - 0.91627594000002 - ], - [ - 110.78706669100009, - 0.93415598600015 - ], - [ - 110.79698856600007, - 0.949658915000072 - ], - [ - 110.8526957610002, - 0.997201233000098 - ], - [ - 110.88039432900021, - 1.010533753000118 - ], - [ - 110.91057336500015, - 1.015701396000111 - ], - [ - 110.9734119070001, - 1.017716776000157 - ], - [ - 111.19758427000014, - 1.075232646000188 - ], - [ - 111.21753137200014, - 1.07326894200007 - ], - [ - 111.35178674300019, - 1.013892721000119 - ], - [ - 111.37411096200017, - 1.007536519000098 - ], - [ - 111.3955050050001, - 1.006296285000161 - ], - [ - 111.41503869700009, - 1.010223694000132 - ], - [ - 111.45451949100013, - 1.022626038000098 - ], - [ - 111.47208947800019, - 1.022212627000087 - ], - [ - 111.48242476400011, - 1.012859192000136 - ], - [ - 111.48800581900011, - 0.997924703000095 - ], - [ - 111.49203658100012, - 0.980871480000147 - ], - [ - 111.50319869000006, - 0.958443909000152 - ], - [ - 111.51539432800016, - 0.964490051000098 - ], - [ - 111.53885542900011, - 0.997717997000123 - ], - [ - 111.62267460100011, - 1.030274150000167 - ], - [ - 111.63735070800007, - 1.032237854000115 - ], - [ - 111.65523075400009, - 1.030790914000121 - ], - [ - 111.68210249800003, - 1.023452861000038 - ], - [ - 111.7341923430001, - 1.001438700000136 - ], - [ - 111.76282108600017, - 0.993015442000143 - ], - [ - 111.82307580600016, - 1.008466695000152 - ], - [ - 111.9100989180001, - 1.114041646000132 - ], - [ - 111.97335087100006, - 1.134040426000169 - ], - [ - 112.05406945800021, - 1.133627014000069 - ], - [ - 112.07949426300004, - 1.137244365000143 - ], - [ - 112.0929301350001, - 1.143135478000133 - ], - [ - 112.10006148300013, - 1.154917705000145 - ], - [ - 112.15266809100004, - 1.306277975000157 - ], - [ - 112.18398400900006, - 1.369039001000118 - ], - [ - 112.18739465300015, - 1.37965850800019 - ], - [ - 112.18801477100013, - 1.3914148960001 - ], - [ - 112.18181359900021, - 1.400019022000052 - ], - [ - 112.15907596900016, - 1.40079416900015 - ], - [ - 112.1541150310002, - 1.409527486000115 - ], - [ - 112.16155643700014, - 1.434538880000034 - ], - [ - 112.18005660000009, - 1.449034119000146 - ], - [ - 112.29519169200015, - 1.503811137000142 - ], - [ - 112.319066203, - 1.511743469000095 - ], - [ - 112.38097456900007, - 1.517712097000114 - ], - [ - 112.39854455600013, - 1.523344828000148 - ], - [ - 112.41590783700022, - 1.536651510000155 - ], - [ - 112.42975712100011, - 1.550681662000073 - ], - [ - 112.44588016800017, - 1.562076315000169 - ], - [ - 112.47047815000016, - 1.567657369000173 - ], - [ - 112.76885787000006, - 1.552231954000192 - ], - [ - 112.79479943900017, - 1.544377136000151 - ], - [ - 112.80151737500003, - 1.5437828580001 - ], - [ - 112.81350630800009, - 1.549338073000115 - ], - [ - 112.82053430200008, - 1.557632141000155 - ], - [ - 112.82663212100013, - 1.56719228100016 - ], - [ - 112.83645064300012, - 1.576054789000167 - ], - [ - 112.85495080600006, - 1.582721049 - ], - [ - 112.8713839120002, - 1.580653991000034 - ], - [ - 112.88812707600007, - 1.574866232000147 - ], - [ - 112.90766076700007, - 1.570525411000077 - ], - [ - 112.95602990799998, - 1.572334086000069 - ], - [ - 112.97318648300015, - 1.569853618000181 - ], - [ - 112.9971643480001, - 1.560164287000063 - ], - [ - 113.01411421700018, - 1.550785014000098 - ], - [ - 113.02341597500012, - 1.53701324400015 - ], - [ - 113.02434615100006, - 1.514378968000116 - ], - [ - 113.01845503800016, - 1.492390645000128 - ], - [ - 113.00729292800023, - 1.473270365000133 - ], - [ - 112.9916866450001, - 1.456966452000117 - ], - [ - 112.9611975510002, - 1.434383850000174 - ], - [ - 112.95530643700019, - 1.423557638000048 - ], - [ - 112.95820031800011, - 1.415651143 - ], - [ - 112.97318648300015, - 1.415082703000124 - ], - [ - 113.01142704300005, - 1.42797597300013 - ], - [ - 113.05059777800003, - 1.434797262000174 - ], - [ - 113.08904504400013, - 1.431334940000141 - ], - [ - 113.1257353120001, - 1.41363576300013 - ], - [ - 113.15860152200005, - 1.388159281000114 - ], - [ - 113.17276086500019, - 1.383740946000032 - ], - [ - 113.21771936100018, - 1.380898742000056 - ], - [ - 113.27601037600013, - 1.368883973000081 - ], - [ - 113.32365604700018, - 1.351391500000119 - ], - [ - 113.39755334500015, - 1.293927307000118 - ], - [ - 113.48230269400008, - 1.308706767000132 - ], - [ - 113.50338667900022, - 1.314494527000107 - ], - [ - 113.52447066200014, - 1.313564351000139 - ], - [ - 113.54617476400014, - 1.301575419000187 - ], - [ - 113.59650760900004, - 1.241630758000099 - ], - [ - 113.62482629500019, - 1.227574768000181 - ], - [ - 113.64952762900012, - 1.233259176000132 - ], - [ - 113.80817427600013, - 1.339712626000065 - ], - [ - 113.86822229000015, - 1.415496114000135 - ], - [ - 113.89116662600017, - 1.434952291000045 - ], - [ - 113.90966678900011, - 1.442471212000072 - ], - [ - 114.05394738800013, - 1.465053813000026 - ], - [ - 114.09425500500006, - 1.465673930000165 - ], - [ - 114.13094527200022, - 1.454175924000154 - ], - [ - 114.14107385300005, - 1.445261739000046 - ], - [ - 114.15027225800017, - 1.43428049700006 - ], - [ - 114.16040083900023, - 1.42479787200017 - ], - [ - 114.17342329900018, - 1.420508728000101 - ], - [ - 114.18324182200004, - 1.423454285000105 - ], - [ - 114.20484257100011, - 1.438362935000157 - ], - [ - 114.20740588700019, - 1.439443127000175 - ], - [ - 114.35573775300011, - 1.501950786000137 - ], - [ - 114.37485803299998, - 1.506937562000175 - ], - [ - 114.39821578000024, - 1.503552754000168 - ], - [ - 114.42136682200024, - 1.492183940000089 - ], - [ - 114.50063846900017, - 1.43603749600004 - ], - [ - 114.52223921800024, - 1.429422913000124 - ], - [ - 114.5455969650001, - 1.434952291000045 - ], - [ - 114.56161665800002, - 1.450015971000127 - ], - [ - 114.56802453700018, - 1.469394633000178 - ], - [ - 114.56771447700012, - 1.49091786700005 - ], - [ - 114.56316695200016, - 1.512260233000049 - ], - [ - 114.56316695200016, - 1.5363931280001 - ], - [ - 114.57453576700007, - 1.553420512000116 - ], - [ - 114.60967574100019, - 1.581635844000175 - ], - [ - 114.62445520100013, - 1.598792420000137 - ], - [ - 114.65029341700014, - 1.64145131500014 - ], - [ - 114.66900028500012, - 1.694006246000114 - ], - [ - 114.68005904200012, - 1.763278504000141 - ], - [ - 114.67892216000021, - 1.794361878000174 - ], - [ - 114.67582157400008, - 1.806738383000138 - ], - [ - 114.6726176350002, - 1.814076436000136 - ], - [ - 114.67137740100017, - 1.820975240000109 - ], - [ - 114.67416792900022, - 1.831904806000182 - ], - [ - 114.67954227699997, - 1.840741476000176 - ], - [ - 114.68863733000015, - 1.850224101000066 - ], - [ - 114.69917932100012, - 1.85805308000009 - ], - [ - 114.7089978440001, - 1.86198049000015 - ], - [ - 114.76305139200016, - 1.86869842500009 - ], - [ - 114.8190686450001, - 1.890299174000063 - ], - [ - 114.8319877530001, - 1.902520650000071 - ], - [ - 114.83364139800008, - 1.921356710000097 - ], - [ - 114.82940393100003, - 1.942647400000084 - ], - [ - 114.82940393100003, - 1.959778138000132 - ], - [ - 114.83384810400011, - 1.976676331000036 - ], - [ - 114.84252974400025, - 1.997166036000095 - ], - [ - 114.84511356700008, - 2.009749248000105 - ], - [ - 114.84532027200012, - 2.024967957000143 - ], - [ - 114.84108280500018, - 2.038222962000134 - ], - [ - 114.83136763500013, - 2.044760030000035 - ], - [ - 114.80821659400024, - 2.041969502000072 - ], - [ - 114.7921969000001, - 2.034812317000032 - ], - [ - 114.78062137900022, - 2.036052552000143 - ], - [ - 114.77028609200013, - 2.058221741000168 - ], - [ - 114.76925256400014, - 2.066644999000076 - ], - [ - 114.77028609200013, - 2.100053813000144 - ], - [ - 114.76801233000012, - 2.110208232000019 - ], - [ - 114.75674686700009, - 2.1260470590002 - ], - [ - 114.75302616400015, - 2.134806213 - ], - [ - 114.7520959880001, - 2.15351308200016 - ], - [ - 114.76346480400017, - 2.208083395000102 - ], - [ - 114.77876102700023, - 2.247202454000117 - ], - [ - 114.80904341700008, - 2.264669088000161 - ], - [ - 114.88645471200019, - 2.275159404000036 - ], - [ - 114.91332645700018, - 2.284047750000127 - ], - [ - 114.91963098100021, - 2.295674947000094 - ], - [ - 114.91673710200021, - 2.311229554000036 - ], - [ - 114.91529016200005, - 2.332055155000177 - ], - [ - 114.92221480300012, - 2.353914287000123 - ], - [ - 114.93451379500007, - 2.360683899000151 - ], - [ - 114.97296106000013, - 2.357479960000177 - ], - [ - 114.99208133900018, - 2.369882304000157 - ], - [ - 115.0347660730001, - 2.406417541000081 - ], - [ - 115.05202600100009, - 2.414013977000138 - ], - [ - 115.06742557800018, - 2.423109029000116 - ], - [ - 115.1050460210001, - 2.465690409000089 - ], - [ - 115.12654341700014, - 2.479229634000077 - ], - [ - 115.17181197100004, - 2.483312073000164 - ], - [ - 115.1926892500002, - 2.490546773000133 - ], - [ - 115.20612512200015, - 2.509873759000101 - ], - [ - 115.2037480070002, - 2.527547099000103 - ], - [ - 115.19237919200012, - 2.551059876000181 - ], - [ - 115.17697961500014, - 2.57415924100016 - ], - [ - 115.16189009600023, - 2.590385641000168 - ], - [ - 115.15196822100015, - 2.597051900000082 - ], - [ - 115.13977258300022, - 2.602839661000147 - ], - [ - 115.12685347500022, - 2.606767070000117 - ], - [ - 115.1149678960002, - 2.607903951000125 - ], - [ - 115.10411584500005, - 2.604751689000082 - ], - [ - 115.0825150960001, - 2.594364726000151 - ], - [ - 115.07145634000008, - 2.594623108000036 - ], - [ - 115.0564701750001, - 2.60862742200004 - ], - [ - 115.05864058500018, - 2.628832906000113 - ], - [ - 115.06742557800018, - 2.651208801000095 - ], - [ - 115.07186975200008, - 2.671827698000186 - ], - [ - 115.06876916500013, - 2.681542868000051 - ], - [ - 115.0579171150001, - 2.701489970000068 - ], - [ - 115.05698693900004, - 2.711256816000116 - ], - [ - 115.0631881100002, - 2.723659159000178 - ], - [ - 115.07217981000016, - 2.727431539000023 - ], - [ - 115.082721802, - 2.729550273000172 - ], - [ - 115.0935738530001, - 2.737043356000115 - ], - [ - 115.1046326100001, - 2.761486308000158 - ], - [ - 115.09812137900022, - 2.781071676000167 - ], - [ - 115.07186975200008, - 2.814764710000048 - ], - [ - 115.06690881300014, - 2.828200582000093 - ], - [ - 115.06907922400003, - 2.832644755000089 - ], - [ - 115.07755415900013, - 2.836520488000147 - ], - [ - 115.09119673700005, - 2.8481476850001 - ], - [ - 115.09905155500016, - 2.859671529000138 - ], - [ - 115.1027722580001, - 2.869955139000126 - ], - [ - 115.10525272600015, - 2.88029042500014 - ], - [ - 115.10959354700006, - 2.89202097600004 - ], - [ - 115.12282271400014, - 2.912949931000028 - ], - [ - 115.13904911300014, - 2.928452860000121 - ], - [ - 115.1964099530002, - 2.967623596000166 - ], - [ - 115.20798547400008, - 2.980697734000117 - ], - [ - 115.2250386970002, - 3.01588938400009 - ], - [ - 115.24209192000004, - 3.041624247000172 - ], - [ - 115.25583785000018, - 3.037490133000063 - ], - [ - 115.2813660080001, - 2.999559631000139 - ], - [ - 115.30999475100018, - 2.985917053000051 - ], - [ - 115.34151737500022, - 2.991136373000145 - ], - [ - 115.4068363850001, - 3.019506734000075 - ], - [ - 115.44797082500017, - 3.024054261000018 - ], - [ - 115.46409387300005, - 3.030823873000131 - ], - [ - 115.47215539600015, - 3.050512594000097 - ], - [ - 115.47597945200019, - 3.093042297000139 - ], - [ - 115.48218062400016, - 3.110974020000114 - ], - [ - 115.51701053900004, - 3.157276103000186 - ], - [ - 115.51442671800012, - 3.164769186000129 - ], - [ - 115.49933719900005, - 3.169781800000095 - ], - [ - 115.48352421100006, - 3.189005432000116 - ], - [ - 115.48280074100015, - 3.206472066000075 - ], - [ - 115.5176306560002, - 3.357160543000106 - ], - [ - 115.53582076000023, - 3.403617656000122 - ], - [ - 115.55721480300016, - 3.425450948000162 - ], - [ - 115.56713667800014, - 3.423848979000041 - ], - [ - 115.57602502500006, - 3.419404805000113 - ], - [ - 115.58501672400021, - 3.416820984000111 - ], - [ - 115.59545536300007, - 3.42085174600011 - ], - [ - 115.60124312400004, - 3.430231019000161 - ], - [ - 115.60062300600023, - 3.441212260000057 - ], - [ - 115.59266483600018, - 3.46196034800009 - ], - [ - 115.5761283780001, - 3.491674296000156 - ], - [ - 115.57271773300025, - 3.504154155000137 - ], - [ - 115.57240767500016, - 3.51425689700001 - ], - [ - 115.57447473100015, - 3.534565735000115 - ], - [ - 115.57333785000006, - 3.545004374000058 - ], - [ - 115.54853316300003, - 3.605284933000121 - ], - [ - 115.54439904800009, - 3.629159445000198 - ], - [ - 115.54460575400006, - 3.668976136000126 - ], - [ - 115.55049686700013, - 3.708224385000094 - ], - [ - 115.58935754500018, - 3.824522197000192 - ], - [ - 115.58863407400011, - 3.857595113000173 - ], - [ - 115.57457808400025, - 3.872090353000203 - ], - [ - 115.55411421700003, - 3.88356252000014 - ], - [ - 115.53830122900004, - 3.897825216000115 - ], - [ - 115.53881799400008, - 3.920614522000108 - ], - [ - 115.54584598900024, - 3.927720032000138 - ], - [ - 115.58098596200003, - 3.946917827000149 - ], - [ - 115.59028772000013, - 3.95800242100016 - ], - [ - 115.60951135200017, - 3.996914774000132 - ], - [ - 115.62212040200009, - 4.040219625000191 - ], - [ - 115.63328251200014, - 4.128560486000197 - ], - [ - 115.63913433100007, - 4.145949698000138 - ], - [ - 115.64692508900012, - 4.169100647000121 - ], - [ - 115.65591678900009, - 4.178634949000113 - ], - [ - 115.67596724500012, - 4.184164327000119 - ], - [ - 115.68278853400008, - 4.190649720000167 - ], - [ - 115.68981652900018, - 4.199977315000112 - ], - [ - 115.73260461500004, - 4.239380595000114 - ], - [ - 115.74025272700018, - 4.236202495000143 - ], - [ - 115.74717736900007, - 4.227624207000119 - ], - [ - 115.75689253800013, - 4.222172343000139 - ], - [ - 115.77074182100009, - 4.225608825000165 - ], - [ - 115.77539270100013, - 4.236099142000128 - ], - [ - 115.77942346200021, - 4.248940735000119 - ], - [ - 115.81745731700008, - 4.281316020000105 - ], - [ - 115.82190149000004, - 4.311236674000142 - ], - [ - 115.82117802000008, - 4.344335429000125 - ], - [ - 115.83099654200024, - 4.376116435000156 - ], - [ - 115.84412235500011, - 4.389216410000131 - ], - [ - 115.85611128800016, - 4.390766703000139 - ], - [ - 115.86489628100006, - 4.382575989000117 - ], - [ - 115.86944380700018, - 4.366685486000108 - ], - [ - 115.87884891800005, - 4.35213857000015 - ], - [ - 115.89879602100004, - 4.347125956000184 - ], - [ - 115.94096398900004, - 4.344361267000139 - ], - [ - 115.96483850100012, - 4.335472921000118 - ], - [ - 115.97724084500018, - 4.32862579400016 - ], - [ - 115.98344201700016, - 4.321391093000102 - ], - [ - 115.98736942600013, - 4.304777120000082 - ], - [ - 115.99357059800005, - 4.288912455000172 - ], - [ - 116.00400923700025, - 4.276690980000154 - ], - [ - 116.02064904800008, - 4.270851542000159 - ], - [ - 116.03315474500008, - 4.27772450700013 - ], - [ - 116.08121382700014, - 4.325473531000114 - ], - [ - 116.09940393100024, - 4.336506449000112 - ], - [ - 116.10994592300014, - 4.345110575000135 - ], - [ - 116.11749068300017, - 4.357228699000132 - ], - [ - 116.125758912, - 4.37890696200013 - ], - [ - 116.13650760900023, - 4.373041687000125 - ], - [ - 116.14684289600015, - 4.37120717300013 - ], - [ - 116.17009729000009, - 4.369915263000081 - ], - [ - 116.21505578700018, - 4.3578488160001 - ], - [ - 116.22880171700004, - 4.356117656000137 - ], - [ - 116.25722375600006, - 4.364153341000119 - ], - [ - 116.28512902900005, - 4.378390198000176 - ], - [ - 116.31065718600004, - 4.383376974000143 - ], - [ - 116.3375289310001, - 4.357228699000132 - ], - [ - 116.34424686700018, - 4.356918640000146 - ], - [ - 116.35127486200011, - 4.357900492000113 - ], - [ - 116.35819950400017, - 4.355445862000153 - ], - [ - 116.36181685400007, - 4.350381572000174 - ], - [ - 116.36543420400008, - 4.337695008000125 - ], - [ - 116.39106571500011, - 4.294674377000135 - ], - [ - 116.4008842370001, - 4.289997661000157 - ], - [ - 116.41132287600013, - 4.288654074000192 - ], - [ - 116.42176151600003, - 4.291832174000163 - ], - [ - 116.44635949700015, - 4.317256979000163 - ], - [ - 116.45710819500007, - 4.316766052000133 - ], - [ - 116.46837365800005, - 4.312321879000137 - ], - [ - 116.48594364400012, - 4.316921082000178 - ], - [ - 116.49410852100013, - 4.324853414000131 - ], - [ - 116.49193811000012, - 4.331287130000177 - ], - [ - 116.4869771730001, - 4.338573507000163 - ], - [ - 116.48646040900022, - 4.348831278000148 - ], - [ - 116.49431522600017, - 4.363223165000164 - ], - [ - 116.51539921100019, - 4.384152120000152 - ], - [ - 116.52222050000015, - 4.396787008000089 - ], - [ - 116.53327925700015, - 4.395365906000094 - ], - [ - 116.57689416600013, - 4.332010600000089 - ] - ] - ], - [ - [ - [ - 126.87501061300011, - 4.494330145000148 - ], - [ - 126.87728925899998, - 4.478013414000117 - ], - [ - 126.877207879, - 4.478176174000083 - ], - [ - 126.88477623800023, - 4.456854559000121 - ], - [ - 126.87907962300008, - 4.43585846600017 - ], - [ - 126.86890709700006, - 4.414374091000141 - ], - [ - 126.86353600400017, - 4.391913153000147 - ], - [ - 126.85912907900004, - 4.367569102000118 - ], - [ - 126.87070871900008, - 4.33139332800009 - ], - [ - 126.90042581300023, - 4.306702378000139 - ], - [ - 126.922129754, - 4.282049872000172 - ], - [ - 126.86353600400017, - 4.210638739000103 - ], - [ - 126.80987476200002, - 4.157243649000151 - ], - [ - 126.80830740000013, - 4.086611311000127 - ], - [ - 126.8099787150002, - 4.037348902000161 - ], - [ - 126.79843750500007, - 4.017644473000161 - ], - [ - 126.75889699200016, - 3.993006460000146 - ], - [ - 126.71452884200008, - 4.01162344000015 - ], - [ - 126.67641998500002, - 4.004482550000134 - ], - [ - 126.66476202300012, - 4.034055368000153 - ], - [ - 126.67628605300015, - 4.060346120000133 - ], - [ - 126.69118589000018, - 4.078410261000144 - ], - [ - 126.72092916300019, - 4.09646819200016 - ], - [ - 126.75869722000007, - 4.185200129000108 - ], - [ - 126.80320654700003, - 4.222968111000071 - ], - [ - 126.79163159300006, - 4.241055919000175 - ], - [ - 126.77677227500007, - 4.245998363000112 - ], - [ - 126.75860813200009, - 4.250943112000144 - ], - [ - 126.71070033200007, - 4.264137215000076 - ], - [ - 126.70735641200011, - 4.287164127000111 - ], - [ - 126.71565150200004, - 4.308494709000101 - ], - [ - 126.70720462300008, - 4.333563544000143 - ], - [ - 126.70337975400005, - 4.343247789000117 - ], - [ - 126.69996178500006, - 4.355454820000176 - ], - [ - 126.69922936300011, - 4.367905992000189 - ], - [ - 126.69720714800022, - 4.397426780000089 - ], - [ - 126.70540705599998, - 4.42374730000013 - ], - [ - 126.73951256600017, - 4.473089911000073 - ], - [ - 126.74073326900012, - 4.480169989000117 - ], - [ - 126.74122155000006, - 4.491888739000117 - ], - [ - 126.74008222700004, - 4.501695054000137 - ], - [ - 126.73487389400023, - 4.523871161000116 - ], - [ - 126.73373457100004, - 4.535874742000132 - ], - [ - 126.74439537900005, - 4.545599677000084 - ], - [ - 126.76872806100019, - 4.550279039000188 - ], - [ - 126.79639733200011, - 4.550482489000146 - ], - [ - 126.81625410200004, - 4.546454169000171 - ], - [ - 126.82984459700018, - 4.537054755000071 - ], - [ - 126.83334394600016, - 4.52773672100011 - ], - [ - 126.83513431100008, - 4.517523505000085 - ], - [ - 126.843028191, - 4.50486888200011 - ], - [ - 126.85572350400017, - 4.498277085000126 - ], - [ - 126.86695397200018, - 4.497992255000099 - ], - [ - 126.87501061300011, - 4.494330145000148 - ] - ] - ], - [ - [ - [ - 107.99341881600017, - 4.69131094000015 - ], - [ - 107.98121178500017, - 4.683661200000131 - ], - [ - 107.95899498800006, - 4.684393622000158 - ], - [ - 107.94646243600002, - 4.686712958000129 - ], - [ - 107.93734785200016, - 4.691392320000134 - ], - [ - 107.93555748800006, - 4.694525458000115 - ], - [ - 107.935313347, - 4.698391018000123 - ], - [ - 107.93677819100017, - 4.703070380000142 - ], - [ - 107.94060306100019, - 4.70864492400014 - ], - [ - 107.95191491000017, - 4.717678127000156 - ], - [ - 107.96664472700016, - 4.7261416690001 - ], - [ - 107.97917728000007, - 4.735988674000126 - ], - [ - 107.984629754, - 4.748765367000161 - ], - [ - 107.98633873800011, - 4.755804755000128 - ], - [ - 107.99122155000006, - 4.763983466000141 - ], - [ - 107.99781334700006, - 4.770453192000147 - ], - [ - 108.00513756600006, - 4.772365627000099 - ], - [ - 108.01270592500012, - 4.768133856000176 - ], - [ - 108.01197350400017, - 4.760931708000143 - ], - [ - 108.00782311300006, - 4.75263092700007 - ], - [ - 108.00513756600006, - 4.745062567000119 - ], - [ - 108.00049889400012, - 4.709133205000128 - ], - [ - 107.99341881600017, - 4.69131094000015 - ] - ] - ], - [ - [ - [ - 127.14576256600006, - 4.752183335000083 - ], - [ - 127.135996941, - 4.7403832050001 - ], - [ - 127.12305748800011, - 4.752508856000105 - ], - [ - 127.12142988399998, - 4.768500067000105 - ], - [ - 127.12403405000006, - 4.772040106000176 - ], - [ - 127.13038170700011, - 4.774400132000125 - ], - [ - 127.13917076900006, - 4.766587632000139 - ], - [ - 127.14576256600006, - 4.752183335000083 - ] - ] - ], - [ - [ - [ - 126.59937584700012, - 5.553615627000099 - ], - [ - 126.595469597, - 5.548407294000114 - ], - [ - 126.59115644600004, - 5.557114976000179 - ], - [ - 126.59864342500006, - 5.56537506700009 - ], - [ - 126.60287519599999, - 5.5640322940001 - ], - [ - 126.59937584700012, - 5.553615627000099 - ] - ] - ], - [ - [ - [ - 95.50269616, - 5.605129299000083 - ], - [ - 95.51124108200005, - 5.603013414000159 - ], - [ - 95.521250847, - 5.609198309000135 - ], - [ - 95.53370201900006, - 5.622137762000136 - ], - [ - 95.57618248800011, - 5.631252346000139 - ], - [ - 95.61158287900011, - 5.626654364000103 - ], - [ - 95.76221764400006, - 5.576849677000126 - ], - [ - 95.83961022200006, - 5.528550523000192 - ], - [ - 95.85547936300006, - 5.522162177000084 - ], - [ - 95.87256920700011, - 5.519720770000148 - ], - [ - 95.88754316500015, - 5.512152411000102 - ], - [ - 95.89437910200016, - 5.49380117400014 - ], - [ - 95.90357506600006, - 5.450751044000114 - ], - [ - 95.93043053500006, - 5.414496161000102 - ], - [ - 96.05494225400011, - 5.313625393000137 - ], - [ - 96.08806399800002, - 5.295477606000134 - ], - [ - 96.126231316, - 5.281805731000105 - ], - [ - 96.29053795700011, - 5.258978583000086 - ], - [ - 96.30396569100017, - 5.254299221000082 - ], - [ - 96.34441165500002, - 5.23232656500015 - ], - [ - 96.3621525400001, - 5.225490627000141 - ], - [ - 96.40658613400015, - 5.217230536000145 - ], - [ - 96.42945397200006, - 5.2183291690001 - ], - [ - 96.44849694100006, - 5.228583075000117 - ], - [ - 96.46631920700011, - 5.235541083000115 - ], - [ - 96.48633873800006, - 5.229396877000127 - ], - [ - 96.50709069100017, - 5.218573309000135 - ], - [ - 96.52735436300006, - 5.211167710000055 - ], - [ - 96.56763756600017, - 5.208441473000093 - ], - [ - 96.65056399800008, - 5.216253973000079 - ], - [ - 96.6849064460001, - 5.225490627000141 - ], - [ - 96.78513172900014, - 5.259857206000135 - ], - [ - 96.82837975400011, - 5.280178127000084 - ], - [ - 96.84864342500012, - 5.276597398000106 - ], - [ - 96.89437910200016, - 5.262111721000153 - ], - [ - 96.90723717500006, - 5.262681382000125 - ], - [ - 96.92286217500006, - 5.269476630000071 - ], - [ - 96.97339928500017, - 5.273423570000148 - ], - [ - 97.03019801000008, - 5.251295019000111 - ], - [ - 97.0743385660002, - 5.238154799000185 - ], - [ - 97.10964054600007, - 5.214092463000114 - ], - [ - 97.1493447770001, - 5.198772387000133 - ], - [ - 97.16602623800006, - 5.173732815000122 - ], - [ - 97.17595462300008, - 5.161281643000095 - ], - [ - 97.19516035200016, - 5.156642971000082 - ], - [ - 97.22655294300009, - 5.146221342000118 - ], - [ - 97.26836827800011, - 5.155068075000159 - ], - [ - 97.49683678500006, - 5.251898505000128 - ], - [ - 97.5262150400001, - 5.242254950000159 - ], - [ - 97.66439863400015, - 5.073431708000129 - ], - [ - 97.83008873800011, - 4.938788153000175 - ], - [ - 97.87387129000015, - 4.918850002000099 - ], - [ - 97.89380944100006, - 4.905829169000114 - ], - [ - 97.90919030000012, - 4.889593817000076 - ], - [ - 97.95606530000006, - 4.808010158000144 - ], - [ - 97.9632267590001, - 4.78949616100013 - ], - [ - 97.97535241000017, - 4.706244208000101 - ], - [ - 97.98373457100016, - 4.678412177000141 - ], - [ - 98.00700931100008, - 4.63385651200015 - ], - [ - 98.00879967500006, - 4.623683986000117 - ], - [ - 98.00709069100006, - 4.597723700000117 - ], - [ - 97.996836785, - 4.570217190000093 - ], - [ - 97.9925236340001, - 4.553778387000179 - ], - [ - 97.996836785, - 4.546454169000171 - ], - [ - 98.0262150400001, - 4.55316803600013 - ], - [ - 98.03882897200018, - 4.551947333000115 - ], - [ - 98.04802493600008, - 4.539007880000113 - ], - [ - 98.05396569100017, - 4.55316803600013 - ], - [ - 98.06128991000011, - 4.554836330000143 - ], - [ - 98.075938347, - 4.546454169000171 - ], - [ - 98.07886803500006, - 4.540513414000159 - ], - [ - 98.0828556650001, - 4.53607819200009 - ], - [ - 98.08961022200006, - 4.532782294000143 - ], - [ - 98.09400475400011, - 4.533189195000148 - ], - [ - 98.10572350400011, - 4.537827867000175 - ], - [ - 98.11353600400011, - 4.539007880000113 - ], - [ - 98.13819420700011, - 4.534409898000163 - ], - [ - 98.15967858200005, - 4.522284247000172 - ], - [ - 98.1761173840001, - 4.504828192000119 - ], - [ - 98.18580162900017, - 4.484442450000131 - ], - [ - 98.192149285, - 4.484442450000131 - ], - [ - 98.1951603520001, - 4.489203192000133 - ], - [ - 98.20191491000006, - 4.494086005000099 - ], - [ - 98.20573978000007, - 4.498032945000176 - ], - [ - 98.21900475400011, - 4.484767971000153 - ], - [ - 98.2405705090001, - 4.456732489000146 - ], - [ - 98.25416100400017, - 4.443426825000131 - ], - [ - 98.26832116000017, - 4.432318427000098 - ], - [ - 98.2755639980002, - 4.425360419000114 - ], - [ - 98.278575066, - 4.415472723000093 - ], - [ - 98.282481316, - 4.364935614000089 - ], - [ - 98.2677514980002, - 4.292629299000126 - ], - [ - 98.26758873800006, - 4.287909247000115 - ], - [ - 98.26636803500006, - 4.211574611000088 - ], - [ - 98.263438347, - 4.202866929000095 - ], - [ - 98.24048912900011, - 4.190171617000132 - ], - [ - 98.1961369150001, - 4.175116278000118 - ], - [ - 98.18580162900017, - 4.169745184000163 - ], - [ - 98.1800236340001, - 4.158189195000134 - ], - [ - 98.1780705090001, - 4.141831773000121 - ], - [ - 98.17896569100017, - 4.108221747000101 - ], - [ - 98.20183353000007, - 4.132147528000161 - ], - [ - 98.21705162900017, - 4.1441104190001 - ], - [ - 98.23707116, - 4.149237372000115 - ], - [ - 98.2395939460001, - 4.153713283000073 - ], - [ - 98.25684655000006, - 4.171779690000093 - ], - [ - 98.26091556100019, - 4.173163153000161 - ], - [ - 98.2630314460001, - 4.177313544000114 - ], - [ - 98.29948978000007, - 4.089016018000137 - ], - [ - 98.30567467500006, - 4.080308335000069 - ], - [ - 98.36296634200008, - 4.087551174000083 - ], - [ - 98.38445071700019, - 4.086493231000134 - ], - [ - 98.40577233200005, - 4.078924872000172 - ], - [ - 98.44166100400017, - 4.057521877000127 - ], - [ - 98.462657097, - 4.05304596600017 - ], - [ - 98.47722415500002, - 4.046210028000147 - ], - [ - 98.49756920700005, - 4.014553127000084 - ], - [ - 98.50798587300014, - 4.004584052000084 - ], - [ - 98.52637780000006, - 4.003241278000104 - ], - [ - 98.54420006600006, - 4.005194403000147 - ], - [ - 98.55779056100019, - 4.000799872000158 - ], - [ - 98.56788170700005, - 3.966457424000112 - ], - [ - 98.57960045700005, - 3.953843492000132 - ], - [ - 98.59489993600019, - 3.94367096600017 - ], - [ - 98.61036217500012, - 3.936346747000172 - ], - [ - 98.6766198010001, - 3.914546933000153 - ], - [ - 98.70026879800011, - 3.875304345000131 - ], - [ - 98.69971764400006, - 3.833929755000085 - ], - [ - 98.71062259200002, - 3.80377838700015 - ], - [ - 98.79658192100007, - 3.725442643000108 - ], - [ - 98.89658286500011, - 3.681402408000125 - ], - [ - 98.95753014400006, - 3.671332098000022 - ], - [ - 98.97790659800009, - 3.657914212000122 - ], - [ - 99.00925159800013, - 3.63541709500015 - ], - [ - 99.02688536000002, - 3.629545113000134 - ], - [ - 99.05235717900021, - 3.621714495999981 - ], - [ - 99.0739100480001, - 3.608994286 - ], - [ - 99.10134006900014, - 3.582579167000119 - ], - [ - 99.1797609440001, - 3.546337688000065 - ], - [ - 99.2700380590002, - 3.484585772000102 - ], - [ - 99.36817467500006, - 3.407945053999981 - ], - [ - 99.38396243600019, - 3.398871161000059 - ], - [ - 99.42090905000006, - 3.391546942000147 - ], - [ - 99.43327884200019, - 3.382879950000159 - ], - [ - 99.45386803500006, - 3.360988674000041 - ], - [ - 99.47877037900017, - 3.346014716000099 - ], - [ - 99.48975670700011, - 3.336249091000141 - ], - [ - 99.49756920700011, - 3.309515692000133 - ], - [ - 99.50603274800008, - 3.295965887000165 - ], - [ - 99.52767988400015, - 3.271551825000117 - ], - [ - 99.55811608200011, - 3.244574285999988 - ], - [ - 99.58936608200005, - 3.227972723000107 - ], - [ - 99.68531334700006, - 3.204738674000083 - ], - [ - 99.71949303500006, - 3.19159577000012 - ], - [ - 99.73755944100017, - 3.189032294000114 - ], - [ - 99.750743035, - 3.180487372000016 - ], - [ - 99.7815861340001, - 3.120754299000126 - ], - [ - 99.83399498800006, - 3.072414455000114 - ], - [ - 99.8528751960001, - 3.047267971000124 - ], - [ - 99.85792076900012, - 3.011460679000109 - ], - [ - 99.8899845710001, - 3.018255927000055 - ], - [ - 99.91130618600008, - 3.000067450000145 - ], - [ - 99.9305119150001, - 2.975409247000158 - ], - [ - 99.95728600400011, - 2.963080145000106 - ], - [ - 99.97950280000006, - 2.948472398000177 - ], - [ - 99.99024498800011, - 2.914496161000059 - ], - [ - 99.9978947270001, - 2.799139716000141 - ], - [ - 99.99586022200018, - 2.785589911000088 - ], - [ - 99.98861738400015, - 2.772040106000119 - ], - [ - 99.97901451900012, - 2.759466864000046 - ], - [ - 99.97071373800011, - 2.74542877800009 - ], - [ - 99.96713300900015, - 2.727240302000098 - ], - [ - 99.964610222, - 2.719387111000103 - ], - [ - 99.95435631600012, - 2.703843492000104 - ], - [ - 99.9534611340001, - 2.696234442000076 - ], - [ - 99.95923912900017, - 2.687892971000096 - ], - [ - 99.9676212900001, - 2.684312242000118 - ], - [ - 99.9767358730002, - 2.682440497000158 - ], - [ - 99.98414147200012, - 2.678778387000023 - ], - [ - 99.99268639400012, - 2.668768622000115 - ], - [ - 99.99170983200005, - 2.664211330000086 - ], - [ - 99.9876408210001, - 2.660874742000061 - ], - [ - 99.9876408210001, - 2.654608466000099 - ], - [ - 100.00879967500012, - 2.620428778000104 - ], - [ - 100.00586998800006, - 2.609198309000107 - ], - [ - 100.0079858730002, - 2.602606512000136 - ], - [ - 100.01392662900011, - 2.601629950000159 - ], - [ - 100.02247155000012, - 2.607407945000119 - ], - [ - 100.0281681650001, - 2.617580471000068 - ], - [ - 100.025157097, - 2.624579169000143 - ], - [ - 100.01889082100016, - 2.630804755000113 - ], - [ - 100.01563561300011, - 2.638128973000107 - ], - [ - 100.0144962900001, - 2.671535549000083 - ], - [ - 100.01221764400012, - 2.678778387000023 - ], - [ - 99.980235222, - 2.697333075000117 - ], - [ - 99.97396894600016, - 2.703070380000085 - ], - [ - 99.98568769600016, - 2.718451239000117 - ], - [ - 100.01856530000006, - 2.731675523000163 - ], - [ - 100.05494225400011, - 2.72728099200009 - ], - [ - 100.0769962900001, - 2.689398505000142 - ], - [ - 100.07781009200002, - 2.675848700000174 - ], - [ - 100.07601972700016, - 2.648260809000078 - ], - [ - 100.0769962900001, - 2.634711005000099 - ], - [ - 100.08838951900006, - 2.601507880000085 - ], - [ - 100.09009850400017, - 2.590073960000126 - ], - [ - 100.09595787900011, - 2.570461330000072 - ], - [ - 100.10971113400015, - 2.545640367000033 - ], - [ - 100.1258244150001, - 2.53009674700003 - ], - [ - 100.13851972700016, - 2.537909247000101 - ], - [ - 100.13746178500006, - 2.551947333000058 - ], - [ - 100.12142988400015, - 2.588202216000155 - ], - [ - 100.11744225400017, - 2.603705145000077 - ], - [ - 100.11744225400017, - 2.645168361 - ], - [ - 100.12110436300011, - 2.663560289000131 - ], - [ - 100.13111412900011, - 2.681870835000097 - ], - [ - 100.14380944100006, - 2.695054429000052 - ], - [ - 100.15943444100006, - 2.703762111000117 - ], - [ - 100.17920983200005, - 2.708441473000136 - ], - [ - 100.20337975400017, - 2.709865627000028 - ], - [ - 100.21062259200019, - 2.706244208000143 - ], - [ - 100.21257571700002, - 2.69769928600013 - ], - [ - 100.21338951900006, - 2.687445380000099 - ], - [ - 100.21745853000019, - 2.678778387000023 - ], - [ - 100.22486412900011, - 2.673773504999986 - ], - [ - 100.24244225400011, - 2.666327216000084 - ], - [ - 100.24838300900015, - 2.662054755000085 - ], - [ - 100.25131269600016, - 2.65477122600015 - ], - [ - 100.254649285, - 2.627264716000042 - ], - [ - 100.25806725400011, - 2.619086005000113 - ], - [ - 100.26693769600016, - 2.602606512000136 - ], - [ - 100.26880944100006, - 2.596869208000072 - ], - [ - 100.27369225400011, - 2.590155341000113 - ], - [ - 100.29957116, - 2.572088934000092 - ], - [ - 100.30836022200018, - 2.569484768000095 - ], - [ - 100.31218509200019, - 2.562892971000039 - ], - [ - 100.31364993600008, - 2.554551499000155 - ], - [ - 100.31373131600006, - 2.554266669000114 - ], - [ - 100.3816837900001, - 2.355047919000128 - ], - [ - 100.40528405000006, - 2.31268952000012 - ], - [ - 100.434336785, - 2.273342190000136 - ], - [ - 100.50733483200011, - 2.199164130000099 - ], - [ - 100.56104576900012, - 2.15680573100002 - ], - [ - 100.61784915500007, - 2.129055080000128 - ], - [ - 100.66618899800008, - 2.134466864000075 - ], - [ - 100.78907311300011, - 2.048529364000061 - ], - [ - 100.81275475400011, - 2.039740302000013 - ], - [ - 100.83228600400011, - 2.016302802000112 - ], - [ - 100.84083092500006, - 2.010972398000064 - ], - [ - 100.85572350400011, - 1.999212958000072 - ], - [ - 100.87240644600016, - 1.971991278000161 - ], - [ - 100.88624108200005, - 1.940985419000143 - ], - [ - 100.89210045700005, - 1.918158270000134 - ], - [ - 100.89551842500006, - 1.886216539000117 - ], - [ - 100.90593509200008, - 1.856919664000102 - ], - [ - 100.923106316, - 1.834947007000096 - ], - [ - 100.94727623800011, - 1.825384833000101 - ], - [ - 100.94190514400006, - 1.841864325000088 - ], - [ - 100.94605553500011, - 1.861314195000176 - ], - [ - 100.94825280000006, - 1.882757880000128 - ], - [ - 100.93702233200011, - 1.904527085000083 - ], - [ - 100.92408287900017, - 1.92275625200007 - ], - [ - 100.91578209700012, - 1.944728908 - ], - [ - 100.90577233200011, - 1.990464585000097 - ], - [ - 100.88550866, - 2.036322333000086 - ], - [ - 100.82349694100006, - 2.115952867000146 - ], - [ - 100.80323326900006, - 2.161810614000146 - ], - [ - 100.79997806100019, - 2.208929755000142 - ], - [ - 100.81275475400011, - 2.249823309000163 - ], - [ - 100.84115644600016, - 2.2808291690001 - ], - [ - 100.88591556100019, - 2.298285223000065 - ], - [ - 100.90788821700002, - 2.299505927 - ], - [ - 101.05030358200005, - 2.291489976000136 - ], - [ - 101.05860436300006, - 2.280422268000095 - ], - [ - 101.05648847700016, - 2.24115631700009 - ], - [ - 101.06739342500012, - 2.219794012000122 - ], - [ - 101.18181399800002, - 2.145005601000136 - ], - [ - 101.29997806100019, - 2.046616929000109 - ], - [ - 101.317149285, - 2.024603583000015 - ], - [ - 101.32585696700019, - 2.002183335000083 - ], - [ - 101.32699629000015, - 1.98126862200013 - ], - [ - 101.32341556100008, - 1.938950914000117 - ], - [ - 101.32667076900012, - 1.91644928600013 - ], - [ - 101.35132897200012, - 1.860093492000161 - ], - [ - 101.37761478000002, - 1.773260809000163 - ], - [ - 101.39730879000015, - 1.736395575000103 - ], - [ - 101.42701256600017, - 1.709295966000155 - ], - [ - 101.4944767590001, - 1.678697007000054 - ], - [ - 101.52963300900015, - 1.670803127000084 - ], - [ - 101.56739342500012, - 1.655910549000126 - ], - [ - 101.591563347, - 1.65468984600011 - ], - [ - 101.67351321700002, - 1.669501044000086 - ], - [ - 101.711680535, - 1.671128648000106 - ], - [ - 101.74919681100002, - 1.661525783000116 - ], - [ - 101.77857506600006, - 1.644273179000109 - ], - [ - 102.02149498800011, - 1.437892971 - ], - [ - 102.11817467500006, - 1.386542059000149 - ], - [ - 102.14332116, - 1.357733466000042 - ], - [ - 102.15333092500012, - 1.311468817000048 - ], - [ - 102.14698326900006, - 1.273138739000103 - ], - [ - 102.14722741, - 1.247788804000081 - ], - [ - 102.15674889400012, - 1.236314195000119 - ], - [ - 102.17310631600006, - 1.230902411000088 - ], - [ - 102.18726647200006, - 1.217271226000136 - ], - [ - 102.19727623800006, - 1.199611721000124 - ], - [ - 102.20101972700016, - 1.181708075000074 - ], - [ - 102.19312584700018, - 1.104234117000189 - ], - [ - 102.19418379000015, - 1.065904039000074 - ], - [ - 102.20850670700005, - 1.024074611000145 - ], - [ - 102.2400822270001, - 0.982082424000154 - ], - [ - 102.32105553500017, - 0.917181708 - ], - [ - 102.425059441, - 0.804266669000029 - ], - [ - 102.46387780000012, - 0.774115302000098 - ], - [ - 102.50953209700018, - 0.750311591000099 - ], - [ - 102.53223717500012, - 0.742377020000049 - ], - [ - 102.55193118600008, - 0.738104559000121 - ], - [ - 102.59498131600017, - 0.736029364000103 - ], - [ - 102.61638431100002, - 0.738267320000176 - ], - [ - 102.64795983200005, - 0.748114325000103 - ], - [ - 102.66716556100019, - 0.750311591000099 - ], - [ - 102.78126061300006, - 0.730902411000088 - ], - [ - 102.8771264980002, - 0.72638580900005 - ], - [ - 102.9181421230002, - 0.70766836100016 - ], - [ - 102.95378665500007, - 0.675848700000046 - ], - [ - 103.05632571700002, - 0.558294989000132 - ], - [ - 103.08375084700018, - 0.515570380000128 - ], - [ - 103.09229576900012, - 0.469183661000059 - ], - [ - 103.07471764400006, - 0.442328192000076 - ], - [ - 103.03728274800002, - 0.420640367000189 - ], - [ - 102.96143639400006, - 0.387193101000136 - ], - [ - 102.9212345710001, - 0.357367255000128 - ], - [ - 102.89909915500013, - 0.344183661000088 - ], - [ - 102.8615014980002, - 0.33576080900005 - ], - [ - 102.74626712300008, - 0.277655341000084 - ], - [ - 102.73243248800006, - 0.266506252000156 - ], - [ - 102.71566816500015, - 0.257635809000121 - ], - [ - 102.64600670700011, - 0.242621161000088 - ], - [ - 102.62769616000006, - 0.234320380000028 - ], - [ - 102.61988366000006, - 0.229478257000125 - ], - [ - 102.61198978000007, - 0.222154039000131 - ], - [ - 102.59180748800011, - 0.186265367000047 - ], - [ - 102.5818791020001, - 0.181097723000121 - ], - [ - 102.55494225400017, - 0.186428127000013 - ], - [ - 102.53663170700011, - 0.199774481000105 - ], - [ - 102.50269616000006, - 0.236395575000046 - ], - [ - 102.48585045700005, - 0.242743231000162 - ], - [ - 102.45997155000006, - 0.247503973000065 - ], - [ - 102.43726647200018, - 0.249172268 - ], - [ - 102.43043053500017, - 0.246323960000126 - ], - [ - 102.43962649800002, - 0.239243882000082 - ], - [ - 102.4493921230002, - 0.236476955000029 - ], - [ - 102.47201582100016, - 0.236395575000046 - ], - [ - 102.48072350400011, - 0.234279690000037 - ], - [ - 102.48658287900017, - 0.228908596000068 - ], - [ - 102.49586022200006, - 0.215969143000152 - ], - [ - 102.51783287900017, - 0.192572333000072 - ], - [ - 102.5457462900001, - 0.169134833000015 - ], - [ - 102.57789147200006, - 0.158514716000155 - ], - [ - 102.61198978000007, - 0.173651434000064 - ], - [ - 102.61898847700016, - 0.181626695000105 - ], - [ - 102.62794030000006, - 0.195624091000155 - ], - [ - 102.63306725400017, - 0.201646226000165 - ], - [ - 102.64437910200016, - 0.209540106000148 - ], - [ - 102.66773522200006, - 0.219183661000031 - ], - [ - 102.67774498800006, - 0.225572007000139 - ], - [ - 102.69548587300002, - 0.232082424000126 - ], - [ - 102.74154707100016, - 0.226629950000088 - ], - [ - 102.763438347, - 0.228949286000059 - ], - [ - 102.8182072270001, - 0.253729559000035 - ], - [ - 102.88591556100008, - 0.261419989000132 - ], - [ - 102.9026798840001, - 0.26776764499999 - ], - [ - 102.97291100400011, - 0.313137111000074 - ], - [ - 102.99244225400011, - 0.318304755000085 - ], - [ - 103.007578972, - 0.324652411000102 - ], - [ - 103.05762780000012, - 0.372951565000122 - ], - [ - 103.07593834700018, - 0.383002020000021 - ], - [ - 103.09888756600017, - 0.391791083000072 - ], - [ - 103.12256920700011, - 0.39793528900006 - ], - [ - 103.14356530000006, - 0.400213934000035 - ], - [ - 103.16627037900017, - 0.407904364000132 - ], - [ - 103.18132571700019, - 0.426418361000145 - ], - [ - 103.20150800900015, - 0.469183661000059 - ], - [ - 103.22364342500012, - 0.4884300800001 - ], - [ - 103.28012129000015, - 0.498602606000063 - ], - [ - 103.30811608200005, - 0.513169664000088 - ], - [ - 103.33578535200016, - 0.531683661000102 - ], - [ - 103.36215254000015, - 0.536281643000123 - ], - [ - 103.38990319100006, - 0.53001536700009 - ], - [ - 103.4212345710001, - 0.516302802000055 - ], - [ - 103.48096764400006, - 0.482326565000122 - ], - [ - 103.54102623800006, - 0.434637762000065 - ], - [ - 103.58765709700018, - 0.3765322940001 - ], - [ - 103.60629316500015, - 0.310858466000099 - ], - [ - 103.61752363400015, - 0.330267645000106 - ], - [ - 103.62501061300011, - 0.33982982000019 - ], - [ - 103.63428795700005, - 0.345648505000142 - ], - [ - 103.64527428500006, - 0.345282294000128 - ], - [ - 103.65577233200011, - 0.340399481000162 - ], - [ - 103.6648869150001, - 0.33470286700009 - ], - [ - 103.69019616000006, - 0.325995184000092 - ], - [ - 103.71119225400017, - 0.311468817000062 - ], - [ - 103.73047936300011, - 0.293443101000122 - ], - [ - 103.743418816, - 0.277329820000148 - ], - [ - 103.76002037900017, - 0.239488023000121 - ], - [ - 103.80046634200019, - 0.03457265800013 - ], - [ - 103.80836022200018, - 0.023504950000017 - ], - [ - 103.81397545700011, - 0.018866278000161 - ], - [ - 103.81128991, - 0.008530992000075 - ], - [ - 103.80176842500012, - -0.007256768999966 - ], - [ - 103.79151451900006, - -0.012546481999863 - ], - [ - 103.77833092500006, - -0.013116143999838 - ], - [ - 103.75652103000019, - -0.010674737999892 - ], - [ - 103.67115319100006, - -0.017429294999928 - ], - [ - 103.66374759200008, - -0.021742445999919 - ], - [ - 103.66423587300002, - -0.040541273999963 - ], - [ - 103.657481316, - -0.044732354999908 - ], - [ - 103.64470462300008, - -0.045993747999916 - ], - [ - 103.63624108200011, - -0.048028252999856 - ], - [ - 103.62916100400017, - -0.04839446399987 - ], - [ - 103.61988366, - -0.044732354999908 - ], - [ - 103.61182701900006, - -0.036879164999917 - ], - [ - 103.60075931100002, - -0.016900322999945 - ], - [ - 103.59205162900017, - -0.010674737999892 - ], - [ - 103.58619225400011, - -0.011081638999897 - ], - [ - 103.57699629000015, - -0.013970635999925 - ], - [ - 103.56869550900015, - -0.018568617999861 - ], - [ - 103.56470787900017, - -0.024265231999934 - ], - [ - 103.56690514400006, - -0.035210869999915 - ], - [ - 103.57341556100008, - -0.037163994999858 - ], - [ - 103.58082116000006, - -0.03777434699991 - ], - [ - 103.5857853520001, - -0.044732354999908 - ], - [ - 103.58423912900017, - -0.053155205999857 - ], - [ - 103.58033287900017, - -0.063531182999867 - ], - [ - 103.57813561300006, - -0.07402923 - ], - [ - 103.58716881600017, - -0.094984632999882 - ], - [ - 103.57585696700019, - -0.104424737999977 - ], - [ - 103.55827884200008, - -0.110772393999838 - ], - [ - 103.544200066, - -0.113702080999857 - ], - [ - 103.5079858730002, - -0.114434502999885 - ], - [ - 103.49439537900017, - -0.118422132999854 - ], - [ - 103.48902428500017, - -0.130791924999897 - ], - [ - 103.48308353000007, - -0.159437757999868 - ], - [ - 103.46680748800006, - -0.183038018999895 - ], - [ - 103.44304446700002, - -0.202080987999977 - ], - [ - 103.41456139400012, - -0.216729424999897 - ], - [ - 103.30144290500019, - -0.237562757999967 - ], - [ - 103.27051842500006, - -0.257582289999945 - ], - [ - 103.28711998800011, - -0.257745049999912 - ], - [ - 103.31666100400017, - -0.262872002999828 - ], - [ - 103.33253014400012, - -0.263848565999893 - ], - [ - 103.34986412900011, - -0.260186455999857 - ], - [ - 103.38062584700018, - -0.247002862999892 - ], - [ - 103.39714603000007, - -0.244073174999883 - ], - [ - 103.42481530000006, - -0.23495859199997 - ], - [ - 103.45932050900015, - -0.218438408999901 - ], - [ - 103.48926842500012, - -0.211521091999913 - ], - [ - 103.50269616000006, - -0.230401299999841 - ], - [ - 103.49463951900012, - -0.253594658999958 - ], - [ - 103.45671634200008, - -0.288995049999883 - ], - [ - 103.44800866000017, - -0.315362237999963 - ], - [ - 103.43677819100017, - -0.33798593499985 - ], - [ - 103.4095158210001, - -0.349704684999921 - ], - [ - 103.3455509770001, - -0.360039971999839 - ], - [ - 103.3455509770001, - -0.366875908999944 - ], - [ - 103.37940514400006, - -0.380303643999937 - ], - [ - 103.40056399800008, - -0.384535414999874 - ], - [ - 103.41797936300006, - -0.377536716999884 - ], - [ - 103.42953535200016, - -0.374932549999897 - ], - [ - 103.48218834700018, - -0.373711846999882 - ], - [ - 103.49301191500015, - -0.375420830999886 - ], - [ - 103.50269616000006, - -0.378513278999861 - ], - [ - 103.51148522200018, - -0.383558851999808 - ], - [ - 103.52003014400012, - -0.391208591999927 - ], - [ - 103.53052819100017, - -0.397149346999939 - ], - [ - 103.55250084700012, - -0.399997653999975 - ], - [ - 103.59050540500019, - -0.424574476999808 - ], - [ - 103.59839928500017, - -0.436781507999882 - ], - [ - 103.59205162900017, - -0.456312757999868 - ], - [ - 103.57325280000012, - -0.475355726999851 - ], - [ - 103.54704837300008, - -0.489841403999904 - ], - [ - 103.5157983730002, - -0.499607028999847 - ], - [ - 103.41797936300006, - -0.517754815999851 - ], - [ - 103.401621941, - -0.509535414999931 - ], - [ - 103.39014733200005, - -0.490411065999865 - ], - [ - 103.37289472700016, - -0.449395440999865 - ], - [ - 103.38038170700005, - -0.514336846999839 - ], - [ - 103.38477623800011, - -0.522881768999852 - ], - [ - 103.40650475400017, - -0.540785414999903 - ], - [ - 103.41456139400012, - -0.551853122999859 - ], - [ - 103.41627037900011, - -0.575372002999899 - ], - [ - 103.4085392590001, - -0.604913018999866 - ], - [ - 103.39356530000006, - -0.632012627999899 - ], - [ - 103.37289472700016, - -0.648125908999873 - ], - [ - 103.37289472700016, - -0.654880466999899 - ], - [ - 103.38892662900017, - -0.665948174999855 - ], - [ - 103.38575280000006, - -0.680922132999882 - ], - [ - 103.36939537900017, - -0.693291924999826 - ], - [ - 103.3455509770001, - -0.695896091999913 - ], - [ - 103.35645592500006, - -0.711358330999843 - ], - [ - 103.37598717500006, - -0.726820570999863 - ], - [ - 103.39991295700011, - -0.738864841999956 - ], - [ - 103.43604576900006, - -0.745293877999885 - ], - [ - 103.43873131600006, - -0.746189059999878 - ], - [ - 103.45069420700005, - -0.750095309999878 - ], - [ - 103.46314537900017, - -0.757745049999983 - ], - [ - 103.46851647200006, - -0.767836195999863 - ], - [ - 103.46485436300006, - -0.78297291499986 - ], - [ - 103.44752037900011, - -0.799411716999856 - ], - [ - 103.44117272200018, - -0.812595309999907 - ], - [ - 103.48536217500006, - -0.804945570999962 - ], - [ - 103.50733483200005, - -0.804945570999962 - ], - [ - 103.52711022200018, - -0.816013278999918 - ], - [ - 103.53760826900006, - -0.830336195999905 - ], - [ - 103.55250084700012, - -0.861097914999888 - ], - [ - 103.56470787900017, - -0.874607028999861 - ], - [ - 103.56910241000017, - -0.87566497199991 - ], - [ - 103.58106530000006, - -0.873793226999851 - ], - [ - 103.5857853520001, - -0.874607028999861 - ], - [ - 103.58741295700011, - -0.877048434999892 - ], - [ - 103.59050540500019, - -0.8851864559999 - ], - [ - 103.59205162900017, - -0.88762786299985 - ], - [ - 103.59831790500019, - -0.894463799999869 - ], - [ - 103.604746941, - -0.903578382999939 - ], - [ - 103.6126408210001, - -0.911553643999909 - ], - [ - 103.63445071700002, - -0.91936614399998 - ], - [ - 103.64063561300011, - -0.928887627999899 - ], - [ - 103.64478600400011, - -0.938571872999859 - ], - [ - 103.65040123800006, - -0.942966403999932 - ], - [ - 103.68873131600017, - -0.949151299999897 - ], - [ - 103.70289147200018, - -0.960056247999887 - ], - [ - 103.72510826900006, - -0.985609632999953 - ], - [ - 103.73975670700005, - -0.9906552059999 - ], - [ - 103.7620548840001, - -0.992771091999913 - ], - [ - 103.78003991000006, - -0.998793226999908 - ], - [ - 103.79411868600019, - -1.009454033999859 - ], - [ - 103.80494225400017, - -1.024834893999895 - ], - [ - 103.82081139400012, - -1.063083591999927 - ], - [ - 103.82886803500006, - -1.073418877999856 - ], - [ - 103.83912194100017, - -1.032810153999932 - ], - [ - 103.8562931650001, - -1.01376718499985 - ], - [ - 103.87859134200002, - -0.999281507999896 - ], - [ - 103.90040123800011, - -0.9906552059999 - ], - [ - 103.94239342500006, - -0.98202890399989 - ], - [ - 103.95582116000017, - -0.976983330999872 - ], - [ - 104.0223087900001, - -1.008233330999843 - ], - [ - 104.04078209700012, - -1.021742445999905 - ], - [ - 104.05689537900017, - -1.027520440999865 - ], - [ - 104.10792076900006, - -1.02898528399983 - ], - [ - 104.12696373800006, - -1.0316708309999 - ], - [ - 104.18946373800011, - -1.068129164999874 - ], - [ - 104.21241295700005, - -1.073337497999873 - ], - [ - 104.25367272200006, - -1.055840752999913 - ], - [ - 104.26270592500006, - -1.050551040000016 - ], - [ - 104.31959069100017, - -1.033623955999943 - ], - [ - 104.37720787900011, - -1.0316708309999 - ], - [ - 104.38184655000006, - -1.040785414999903 - ], - [ - 104.41049238400015, - -1.128350518999923 - ], - [ - 104.39747155000006, - -1.191338799999855 - ], - [ - 104.40137780000006, - -1.230889580999985 - ], - [ - 104.41065514400012, - -1.262465101999808 - ], - [ - 104.41504967500006, - -1.271905205999914 - ], - [ - 104.44499759200008, - -1.304620049999841 - ], - [ - 104.44922936300006, - -1.316013278999904 - ], - [ - 104.45606530000012, - -1.379082940999908 - ], - [ - 104.45435631600017, - -1.531019789999945 - ], - [ - 104.46273847700016, - -1.573500257999825 - ], - [ - 104.47925866000006, - -1.615817966999913 - ], - [ - 104.517344597, - -1.688409112999835 - ], - [ - 104.5315861340001, - -1.734063408999944 - ], - [ - 104.53353925900015, - -1.740492445999877 - ], - [ - 104.53760826900012, - -1.760674737999892 - ], - [ - 104.53736412900017, - -1.772149346999853 - ], - [ - 104.53345787900017, - -1.783461196 - ], - [ - 104.5174259770001, - -1.809340101999837 - ], - [ - 104.51238040500007, - -1.821465752999842 - ], - [ - 104.48902428500017, - -1.860039971999896 - ], - [ - 104.48340905000006, - -1.881442966999856 - ], - [ - 104.48406009200019, - -1.897067966999842 - ], - [ - 104.48682701900006, - -1.91033294099995 - ], - [ - 104.49708092500012, - -1.935967705999843 - ], - [ - 104.5135197270001, - -1.918633721999853 - ], - [ - 104.52735436300011, - -1.867445570999891 - ], - [ - 104.53736412900017, - -1.854099216999884 - ], - [ - 104.56446373800011, - -1.857679945999948 - ], - [ - 104.58668053500017, - -1.877211195999919 - ], - [ - 104.60572350400017, - -1.899021091999884 - ], - [ - 104.62354576900006, - -1.909356377999885 - ], - [ - 104.63697350400011, - -1.921563408999873 - ], - [ - 104.62964928500006, - -1.949151299999883 - ], - [ - 104.61426842500006, - -1.978204033999944 - ], - [ - 104.60279381600006, - -1.994724216999842 - ], - [ - 104.59473717500012, - -2.003024997999916 - ], - [ - 104.58741295700011, - -2.012790622999859 - ], - [ - 104.58887780000006, - -2.019463799999912 - ], - [ - 104.60621178500006, - -2.018487237999835 - ], - [ - 104.62061608200011, - -2.010430596999981 - ], - [ - 104.64258873800011, - -1.981703382999854 - ], - [ - 104.65455162900017, - -1.970147393999824 - ], - [ - 104.65984134200002, - -1.990166924999883 - ], - [ - 104.66041100400011, - -2.012872002999842 - ], - [ - 104.663828972, - -2.031345309999864 - ], - [ - 104.67790774800008, - -2.038995049999883 - ], - [ - 104.68083743600008, - -2.040134372999916 - ], - [ - 104.682871941, - -2.04241301899998 - ], - [ - 104.68580162900011, - -2.044691664999874 - ], - [ - 104.69190514400012, - -2.045830987999906 - ], - [ - 104.69467207100016, - -2.043715101999808 - ], - [ - 104.69678795700011, - -2.038995049999883 - ], - [ - 104.69996178500006, - -2.03435637799987 - ], - [ - 104.70582116000011, - -2.03232187299993 - ], - [ - 104.71045983200011, - -2.029473565999893 - ], - [ - 104.72917728000019, - -2.011651299999826 - ], - [ - 104.77263431100002, - -1.997735283999845 - ], - [ - 104.8146264980002, - -2.008396091999956 - ], - [ - 104.85027103000007, - -2.037855726999851 - ], - [ - 104.874278191, - -2.080010674999897 - ], - [ - 104.88282311300006, - -2.125664971999839 - ], - [ - 104.87614993600008, - -2.164727471999896 - ], - [ - 104.8597111340001, - -2.199395440999865 - ], - [ - 104.82829837300008, - -2.246677341999927 - ], - [ - 104.75700931100008, - -2.330498955999829 - ], - [ - 104.74341881600017, - -2.341241143999852 - ], - [ - 104.7268986340001, - -2.344496351999894 - ], - [ - 104.68474368600008, - -2.345798434999892 - ], - [ - 104.67139733200005, - -2.351250908999916 - ], - [ - 104.65723717500006, - -2.364515882999854 - ], - [ - 104.6233830090001, - -2.387465101999851 - ], - [ - 104.60621178500006, - -2.40211353999986 - ], - [ - 104.67603600400017, - -2.371758721999882 - ], - [ - 104.70964603000019, - -2.370863539999888 - ], - [ - 104.72917728000019, - -2.408949476999879 - ], - [ - 104.73015384200008, - -2.452732028999847 - ], - [ - 104.72681725400011, - -2.478122653999861 - ], - [ - 104.71314537900011, - -2.511488539999931 - ], - [ - 104.71314537900011, - -2.557793877999828 - ], - [ - 104.70923912900011, - -2.573988539999874 - ], - [ - 104.69874108200005, - -2.582207940999879 - ], - [ - 104.68091881600006, - -2.590997002999842 - ], - [ - 104.66098066500015, - -2.597832940999865 - ], - [ - 104.64380944100006, - -2.600762627999885 - ], - [ - 104.63282311300011, - -2.605157158999873 - ], - [ - 104.60279381600006, - -2.626641533999887 - ], - [ - 104.56950931100002, - -2.656426690999893 - ], - [ - 104.54867597700016, - -2.684828382999839 - ], - [ - 104.5359806650001, - -2.719333591999842 - ], - [ - 104.53736412900017, - -2.759047132999939 - ], - [ - 104.53541100400011, - -2.757256768999952 - ], - [ - 104.53321373800006, - -2.762627862999835 - ], - [ - 104.5310978520001, - -2.772637627999899 - ], - [ - 104.5472111340001, - -2.759535415000016 - ], - [ - 104.56275475400011, - -2.738376559999935 - ], - [ - 104.5743921230002, - -2.714532158999859 - ], - [ - 104.57886803500017, - -2.693536065999822 - ], - [ - 104.58513431100002, - -2.677666924999969 - ], - [ - 104.59986412900011, - -2.663750908999987 - ], - [ - 104.633555535, - -2.642347914999945 - ], - [ - 104.70281009200019, - -2.609470309999864 - ], - [ - 104.73145592500006, - -2.590752862999892 - ], - [ - 104.75025475400011, - -2.560316664999931 - ], - [ - 104.76856530000006, - -2.494724216999913 - ], - [ - 104.77076256600017, - -2.47380950299987 - ], - [ - 104.76823978000007, - -2.430108330999872 - ], - [ - 104.7718205090001, - -2.414239190999936 - ], - [ - 104.78435306100013, - -2.395277601999837 - ], - [ - 104.81641686300011, - -2.364922783999859 - ], - [ - 104.83220462300002, - -2.345310153999904 - ], - [ - 104.84595787900017, - -2.302178643999966 - ], - [ - 104.8626408210001, - -2.288750908999972 - ], - [ - 104.88331139400012, - -2.284926039999959 - ], - [ - 104.90105228000013, - -2.292901299999841 - ], - [ - 104.90870201900006, - -2.312676690999851 - ], - [ - 104.90870201900006, - -2.337334893999852 - ], - [ - 104.91163170700005, - -2.360284112999835 - ], - [ - 104.92896569100006, - -2.374769789999888 - ], - [ - 104.93091881600012, - -2.351169528999932 - ], - [ - 104.94141686300006, - -2.33619557099999 - ], - [ - 104.95826256600017, - -2.328545830999886 - ], - [ - 104.98023522200018, - -2.326429945999877 - ], - [ - 105.00196373800006, - -2.331963799999883 - ], - [ - 105.0164494150001, - -2.34465911299985 - ], - [ - 105.02906334700018, - -2.358493747999859 - ], - [ - 105.04509524800008, - -2.367364190999979 - ], - [ - 105.05396569100006, - -2.3671200499999 - ], - [ - 105.07520592500012, - -2.361504815999851 - ], - [ - 105.08668053500006, - -2.361260674999912 - ], - [ - 105.09701582100016, - -2.365411065999936 - ], - [ - 105.11133873800006, - -2.377699476999808 - ], - [ - 105.11670983200011, - -2.380466403999861 - ], - [ - 105.13843834700018, - -2.376234632999854 - ], - [ - 105.20215905000012, - -2.347426039999903 - ], - [ - 105.22364342500006, - -2.343438408999845 - ], - [ - 105.24691816500015, - -2.342868747999873 - ], - [ - 105.26929772200018, - -2.34734465899983 - ], - [ - 105.30738366000017, - -2.368829033999944 - ], - [ - 105.33106530000012, - -2.373142184999864 - ], - [ - 105.3802189460001, - -2.374769789999888 - ], - [ - 105.46680748800006, - -2.388441664999917 - ], - [ - 105.51124108200011, - -2.390801690999879 - ], - [ - 105.5350041020001, - -2.394789320999948 - ], - [ - 105.55209394600016, - -2.40211353999986 - ], - [ - 105.55209394600016, - -2.408949476999879 - ], - [ - 105.54883873800011, - -2.409356377999885 - ], - [ - 105.54175866000006, - -2.408786716999913 - ], - [ - 105.5384220710001, - -2.408949476999879 - ], - [ - 105.54900149800008, - -2.421156507999854 - ], - [ - 105.56381269600016, - -2.414971612999963 - ], - [ - 105.57886803500006, - -2.402276299999826 - ], - [ - 105.59001712300008, - -2.395277601999837 - ], - [ - 105.60857181100008, - -2.39617278399983 - ], - [ - 105.62378991000006, - -2.401788018999838 - ], - [ - 105.63331139400006, - -2.416192315999979 - ], - [ - 105.63477623800011, - -2.443047783999887 - ], - [ - 105.6292423840001, - -2.464613539999974 - ], - [ - 105.61117597700016, - -2.505954684999921 - ], - [ - 105.60743248800006, - -2.528741143999937 - ], - [ - 105.60840905000012, - -2.55234140399989 - ], - [ - 105.61207116000017, - -2.574151299999841 - ], - [ - 105.61841881600012, - -2.594903252999927 - ], - [ - 105.62794030000012, - -2.615004164999888 - ], - [ - 105.63851972700016, - -2.630791924999841 - ], - [ - 105.65447024800008, - -2.648614190999908 - ], - [ - 105.67310631600006, - -2.663018487999878 - ], - [ - 105.70199629000015, - -2.671319268999852 - ], - [ - 105.7225041020001, - -2.681084893999895 - ], - [ - 105.73340905000006, - -2.683282158999887 - ], - [ - 105.757090691, - -2.682875257999882 - ], - [ - 105.76807701900006, - -2.684747002999856 - ], - [ - 105.77808678500006, - -2.690118096999896 - ], - [ - 105.79493248800006, - -2.724053643999937 - ], - [ - 105.79175866000017, - -2.862074476999823 - ], - [ - 105.80958092500006, - -2.899021091999856 - ], - [ - 105.8401798840001, - -2.930108330999872 - ], - [ - 105.87924238400015, - -2.951104424999897 - ], - [ - 105.92261803500011, - -2.957696221999882 - ], - [ - 105.93327884200002, - -2.955987237999878 - ], - [ - 105.95183353000002, - -2.950941664999931 - ], - [ - 105.96314537900005, - -2.950290622999887 - ], - [ - 105.97510826900006, - -2.952813408999901 - ], - [ - 105.99097741000017, - -2.961846612999821 - ], - [ - 106.0008244150001, - -2.963799737999864 - ], - [ - 106.01563561300006, - -2.969496351999936 - ], - [ - 106.02849368600019, - -2.982842705999857 - ], - [ - 106.04558353000007, - -3.012302341999842 - ], - [ - 106.0540470710001, - -3.046970309999921 - ], - [ - 106.05347741, - -3.12859465899983 - ], - [ - 106.05933678500017, - -3.17001718499985 - ], - [ - 106.06373131600006, - -3.17986419099995 - ], - [ - 106.0765080090001, - -3.200860283999987 - ], - [ - 106.07976321700002, - -3.211521091999927 - ], - [ - 106.07935631600006, - -3.223728122999916 - ], - [ - 106.07422936300011, - -3.244724216999941 - ], - [ - 106.07300866000011, - -3.255547783999859 - ], - [ - 106.06316165500007, - -3.266696872999873 - ], - [ - 105.99724368600002, - -3.300225518999909 - ], - [ - 105.9627384770001, - -3.328789971999981 - ], - [ - 105.9290470710001, - -3.365411065999837 - ], - [ - 105.90023847700016, - -3.407159112999949 - ], - [ - 105.881114129, - -3.451104424999897 - ], - [ - 105.81959069100006, - -3.672539971999853 - ], - [ - 105.82569420700005, - -3.711521091999927 - ], - [ - 105.85108483200005, - -3.74334075299987 - ], - [ - 105.9334416020001, - -3.802341403999989 - ], - [ - 105.9524845710001, - -3.833754165000016 - ], - [ - 105.95289147200018, - -3.869073174999869 - ], - [ - 105.93580162900005, - -3.90984465899983 - ], - [ - 105.87012780000006, - -4.004164320999806 - ], - [ - 105.86060631600006, - -4.036716403999876 - ], - [ - 105.85523522200018, - -4.070896091999856 - ], - [ - 105.83130944100006, - -4.140232028999904 - ], - [ - 105.8279728520001, - -4.157972914999988 - ], - [ - 105.81275475400005, - -4.238702080999914 - ], - [ - 105.81421959700018, - -4.273125908999944 - ], - [ - 105.81902103000007, - -4.300225518999881 - ], - [ - 105.82960045700011, - -4.324476820999877 - ], - [ - 105.8460392590001, - -4.353204033999916 - ], - [ - 105.85743248800006, - -4.381280205999829 - ], - [ - 105.85328209700006, - -4.403903903999975 - ], - [ - 105.86817467500012, - -4.412041924999912 - ], - [ - 105.87916100400017, - -4.42489999799993 - ], - [ - 105.89478600400005, - -4.458428643999881 - ], - [ - 105.89698326900012, - -4.455498955999857 - ], - [ - 105.89747155000012, - -4.454522393999881 - ], - [ - 105.90162194100006, - -4.451755467 - ], - [ - 105.90626061300006, - -4.469333591999856 - ], - [ - 105.89869225400005, - -4.511976820999877 - ], - [ - 105.90943444100006, - -4.546644789999945 - ], - [ - 105.9026798840001, - -4.565687757999939 - ], - [ - 105.8929142590001, - -4.585137627999856 - ], - [ - 105.887950066, - -4.601820570999891 - ], - [ - 105.89063561300011, - -4.619398695999834 - ], - [ - 105.90503991000017, - -4.670098565999893 - ], - [ - 105.89047285200016, - -4.677829684999892 - ], - [ - 105.88184655000012, - -4.69622161299985 - ], - [ - 105.86866295700011, - -4.780938408999845 - ], - [ - 105.86744225400017, - -4.824639580999914 - ], - [ - 105.8724064460001, - -4.848565362999892 - ], - [ - 105.90845787900017, - -4.910332940999893 - ], - [ - 105.90967858200011, - -4.943129164999903 - ], - [ - 105.89682050900015, - -4.975192966999884 - ], - [ - 105.87956790500007, - -5.007582289999888 - ], - [ - 105.86744225400017, - -5.041273695999806 - ], - [ - 105.86182701900006, - -5.126560153999861 - ], - [ - 105.86744225400017, - -5.211358330999829 - ], - [ - 105.86451256600006, - -5.255547783999901 - ], - [ - 105.83952884200002, - -5.337172132999825 - ], - [ - 105.83334394600016, - -5.383233330999857 - ], - [ - 105.839610222, - -5.468926690999822 - ], - [ - 105.836192254, - -5.491794528999918 - ], - [ - 105.8240666020001, - -5.530450127999885 - ], - [ - 105.83277428500017, - -5.592543226999823 - ], - [ - 105.83334394600016, - -5.633721612999878 - ], - [ - 105.82960045700011, - -5.654717705999829 - ], - [ - 105.81128991000017, - -5.696872653999876 - ], - [ - 105.805430535, - -5.718438408999873 - ], - [ - 105.79363040500007, - -5.795586846999825 - ], - [ - 105.7825626960001, - -5.8285458309999 - ], - [ - 105.76441491, - -5.856215101999808 - ], - [ - 105.73357181100008, - -5.890313408999901 - ], - [ - 105.72974694100006, - -5.896661065999837 - ], - [ - 105.71989993600019, - -5.887139580999843 - ], - [ - 105.719493035, - -5.848728122999916 - ], - [ - 105.71290123800006, - -5.832126559999864 - ], - [ - 105.6810001960001, - -5.819024346999896 - ], - [ - 105.60206139400006, - -5.809828382999839 - ], - [ - 105.58619225400017, - -5.790785414999931 - ], - [ - 105.58082116000011, - -5.713148695999806 - ], - [ - 105.56861412900005, - -5.680352471999896 - ], - [ - 105.54525800900015, - -5.657647393999852 - ], - [ - 105.53988691500015, - -5.662692966999884 - ], - [ - 105.53028405000012, - -5.675551039999903 - ], - [ - 105.52540123800011, - -5.678806247999859 - ], - [ - 105.51498457100016, - -5.677829684999878 - ], - [ - 105.50733483200011, - -5.67278411299985 - ], - [ - 105.50074303500006, - -5.667087497999859 - ], - [ - 105.493907097, - -5.664483330999872 - ], - [ - 105.48357181100019, - -5.658949476999851 - ], - [ - 105.44971764400006, - -5.623467705999857 - ], - [ - 105.39820397200006, - -5.581312757999825 - ], - [ - 105.37598717500012, - -5.557712497999873 - ], - [ - 105.3107202480002, - -5.465997002999899 - ], - [ - 105.2796330090001, - -5.444268487999835 - ], - [ - 105.25049889400006, - -5.459079684999892 - ], - [ - 105.246348504, - -5.478773695999848 - ], - [ - 105.25700931100002, - -5.517266533999845 - ], - [ - 105.24708092500012, - -5.537530205999843 - ], - [ - 105.24789472700016, - -5.541273695999877 - ], - [ - 105.23878014400006, - -5.56894296699987 - ], - [ - 105.23617597700016, - -5.571954033999873 - ], - [ - 105.2308048840001, - -5.576348565999865 - ], - [ - 105.21900475400005, - -5.574802341999913 - ], - [ - 105.20215905000012, - -5.56894296699987 - ], - [ - 105.18002363400015, - -5.5804989559999 - ], - [ - 105.18018639400012, - -5.596937757999811 - ], - [ - 105.1897892590001, - -5.617282809999892 - ], - [ - 105.19581139400012, - -5.640313408999859 - ], - [ - 105.19581139400012, - -5.667901299999869 - ], - [ - 105.19922936300011, - -5.678887627999842 - ], - [ - 105.20671634200008, - -5.686944268999866 - ], - [ - 105.21371504000015, - -5.692966403999876 - ], - [ - 105.21631920700005, - -5.698011976999808 - ], - [ - 105.20191491000017, - -5.706801039999874 - ], - [ - 105.17546634200019, - -5.715590101999837 - ], - [ - 105.15479576900012, - -5.726820570999848 - ], - [ - 105.15805097700016, - -5.742933851999823 - ], - [ - 105.17798912900005, - -5.750420830999872 - ], - [ - 105.20215905000012, - -5.753594658999845 - ], - [ - 105.21534264400006, - -5.759047132999882 - ], - [ - 105.20215905000012, - -5.773695570999806 - ], - [ - 105.18360436300011, - -5.782159112999835 - ], - [ - 105.16325931100002, - -5.786065362999835 - ], - [ - 105.13062584700018, - -5.787367445999834 - ], - [ - 105.118418816, - -5.782159112999835 - ], - [ - 105.07300866, - -5.74635182099982 - ], - [ - 104.90105228000013, - -5.671319268999881 - ], - [ - 104.83863366000017, - -5.623467705999857 - ], - [ - 104.79078209700006, - -5.609470309999892 - ], - [ - 104.76929772200012, - -5.591973565999851 - ], - [ - 104.70972741000017, - -5.525811455999857 - ], - [ - 104.69841556100019, - -5.515557549999841 - ], - [ - 104.68132571700008, - -5.506931247999916 - ], - [ - 104.64226321700019, - -5.497816664999931 - ], - [ - 104.62281334700012, - -5.490655205999886 - ], - [ - 104.61304772200018, - -5.4789364559999 - ], - [ - 104.60621178500006, - -5.4789364559999 - ], - [ - 104.60816491000011, - -5.483330987999892 - ], - [ - 104.61304772200018, - -5.499281507999811 - ], - [ - 104.58708743600008, - -5.499281507999811 - ], - [ - 104.56763756600017, - -5.501234632999854 - ], - [ - 104.55144290500002, - -5.508477471999868 - ], - [ - 104.53419030000012, - -5.5238583309999 - ], - [ - 104.52849368600002, - -5.540459893999866 - ], - [ - 104.53321373800006, - -5.559828382999882 - ], - [ - 104.68873131600006, - -5.807875257999882 - ], - [ - 104.69776451900006, - -5.845391533999901 - ], - [ - 104.70240319100017, - -5.886976820999877 - ], - [ - 104.71387780000012, - -5.910088799999826 - ], - [ - 104.716075066, - -5.921075127999885 - ], - [ - 104.71094811300011, - -5.927829684999921 - ], - [ - 104.69906660200016, - -5.930433851999823 - ], - [ - 104.56128991000006, - -5.928317966999899 - ], - [ - 104.55339603000007, - -5.919122002999842 - ], - [ - 104.558360222, - -5.883558851999865 - ], - [ - 104.55372155000012, - -5.86003997199991 - ], - [ - 104.54175866000017, - -5.841892184999907 - ], - [ - 104.48878014400012, - -5.796970309999907 - ], - [ - 104.47877037900011, - -5.79021575299987 - ], - [ - 104.46314537900017, - -5.782810153999876 - ], - [ - 104.45671634200002, - -5.77206796699987 - ], - [ - 104.44922936300006, - -5.752618096999868 - ], - [ - 104.38404381600017, - -5.692478122999887 - ], - [ - 104.36768639400006, - -5.685723565999851 - ], - [ - 104.29769941500015, - -5.643324476999865 - ], - [ - 104.29078209700006, - -5.6254208309999 - ], - [ - 104.31446373800006, - -5.605075778999904 - ], - [ - 104.30152428500017, - -5.585625908999916 - ], - [ - 104.25798587300002, - -5.539808851999823 - ], - [ - 104.2361759770001, - -5.527276299999826 - ], - [ - 104.2247827480002, - -5.52402109199987 - ], - [ - 104.2156681650001, - -5.522719007999868 - ], - [ - 104.20671634200019, - -5.520440362999892 - ], - [ - 104.19532311300006, - -5.513604424999883 - ], - [ - 104.1897892590001, - -5.505303643999895 - ], - [ - 104.18490644600016, - -5.493747653999876 - ], - [ - 104.17750084700006, - -5.483330987999892 - ], - [ - 104.1448673840001, - -5.473890882999868 - ], - [ - 104.12663821700002, - -5.461683851999808 - ], - [ - 104.11085045700011, - -5.446221612999878 - ], - [ - 104.03882897200006, - -5.356622002999913 - ], - [ - 103.99317467500012, - -5.312676690999879 - ], - [ - 103.9881291020001, - -5.296319268999866 - ], - [ - 103.99976647200018, - -5.276950778999847 - ], - [ - 104.00245201900006, - -5.262872002999899 - ], - [ - 103.99138431100002, - -5.246351820999834 - ], - [ - 103.97510826900012, - -5.232354424999869 - ], - [ - 103.96257571700019, - -5.225030205999872 - ], - [ - 103.94109134200008, - -5.222832940999879 - ], - [ - 103.91879316500015, - -5.223077080999829 - ], - [ - 103.90137780000006, - -5.218519789999874 - ], - [ - 103.89429772200012, - -5.201429945999834 - ], - [ - 103.8973087900001, - -5.191664320999891 - ], - [ - 103.91098066500015, - -5.172295830999872 - ], - [ - 103.91407311300011, - -5.160088799999897 - ], - [ - 103.91342207100016, - -5.139255466999913 - ], - [ - 103.91187584700006, - -5.130791924999869 - ], - [ - 103.90845787900011, - -5.123223565999837 - ], - [ - 103.89112389400006, - -5.104180596999839 - ], - [ - 103.83228600400017, - -5.068047783999887 - ], - [ - 103.80762780000006, - -5.04192473799985 - ], - [ - 103.79216556100002, - -5.030938408999887 - ], - [ - 103.7737736340001, - -5.026462497999916 - ], - [ - 103.7482202480002, - -5.026543877999899 - ], - [ - 103.73682701900006, - -5.023695570999863 - ], - [ - 103.72608483200005, - -5.016778252999856 - ], - [ - 103.72584069100017, - -5.007012627999828 - ], - [ - 103.73552493600008, - -4.977959893999852 - ], - [ - 103.73292076900006, - -4.971774997999873 - ], - [ - 103.72681725400017, - -4.968682549999883 - ], - [ - 103.71745853000002, - -4.961846612999878 - ], - [ - 103.7054142590001, - -4.955010674999855 - ], - [ - 103.69206790500019, - -4.951918226999865 - ], - [ - 103.68165123800011, - -4.954685153999918 - ], - [ - 103.6717228520001, - -4.961521091999856 - ], - [ - 103.65406334700018, - -4.979180596999868 - ], - [ - 103.630625847, - -4.934991143999881 - ], - [ - 103.61695397200018, - -4.919854424999883 - ], - [ - 103.59205162900017, - -4.910332940999893 - ], - [ - 103.58464603000007, - -4.909600518999866 - ], - [ - 103.56128991000017, - -4.910332940999893 - ], - [ - 103.55355879000015, - -4.908868096999839 - ], - [ - 103.55005944100017, - -4.90536874799993 - ], - [ - 103.54786217500006, - -4.901055596999839 - ], - [ - 103.544200066, - -4.897230726999837 - ], - [ - 103.53370201900006, - -4.890232028999932 - ], - [ - 103.51832116, - -4.875664971999825 - ], - [ - 103.51002037900011, - -4.869317315999879 - ], - [ - 103.50001061300006, - -4.863946221999839 - ], - [ - 103.48780358200005, - -4.859144790000016 - ], - [ - 103.4747827480002, - -4.856052341999941 - ], - [ - 103.461680535, - -4.855726820999919 - ], - [ - 103.44988040500007, - -4.859795830999971 - ], - [ - 103.43702233200011, - -4.866306247999887 - ], - [ - 103.42481530000006, - -4.870863539999917 - ], - [ - 103.41456139400012, - -4.869317315999879 - ], - [ - 103.40984134200019, - -4.860039971999839 - ], - [ - 103.3934025400001, - -4.814141533999859 - ], - [ - 103.38599694100006, - -4.804945570999877 - ], - [ - 103.37818444100006, - -4.798923434999878 - ], - [ - 103.3592228520001, - -4.787367445999848 - ], - [ - 103.34449303500006, - -4.800469658999916 - ], - [ - 103.32886803500006, - -4.79412200299997 - ], - [ - 103.3165796230002, - -4.776543877999941 - ], - [ - 103.3035587900001, - -4.734144789999874 - ], - [ - 103.2845158210001, - -4.715020440999893 - ], - [ - 103.17286217500006, - -4.617933851999865 - ], - [ - 103.04997806100019, - -4.543064059999892 - ], - [ - 102.92042076900006, - -4.492608330999872 - ], - [ - 102.90430748800011, - -4.477797132999896 - ], - [ - 102.88990319100006, - -4.440362237999864 - ], - [ - 102.8763126960001, - -4.420586846999839 - ], - [ - 102.70118248800011, - -4.270440362999963 - ], - [ - 102.5275171230002, - -4.151136976999894 - ], - [ - 102.36622155000012, - -4.02646249799993 - ], - [ - 102.33936608200005, - -4.011325778999932 - ], - [ - 102.31251061300006, - -3.991469007999839 - ], - [ - 102.29175866000017, - -3.96542734199987 - ], - [ - 102.28353925900015, - -3.930922132999939 - ], - [ - 102.28785241000017, - -3.915297132999953 - ], - [ - 102.30665123800011, - -3.884698174999855 - ], - [ - 102.31088300900015, - -3.865411065999822 - ], - [ - 102.3045353520001, - -3.845147393999895 - ], - [ - 102.27409915500007, - -3.810479424999826 - ], - [ - 102.26319420700005, - -3.793145440999837 - ], - [ - 102.26107832100016, - -3.781914971999925 - ], - [ - 102.26172936300011, - -3.772556247999901 - ], - [ - 102.26319420700005, - -3.764825127999885 - ], - [ - 102.26319420700005, - -3.758396091999884 - ], - [ - 102.25766035200016, - -3.746840101999851 - ], - [ - 102.25082441500015, - -3.737725518999866 - ], - [ - 102.24512780000006, - -3.727959893999824 - ], - [ - 102.24268639400012, - -3.714613539999903 - ], - [ - 102.24048912900011, - -3.678480726999879 - ], - [ - 102.23438561300006, - -3.659356377999899 - ], - [ - 102.22217858200005, - -3.642836195999834 - ], - [ - 102.06568444100017, - -3.550469658999901 - ], - [ - 101.87696373800006, - -3.421319268999881 - ], - [ - 101.63746178500017, - -3.250664971999882 - ], - [ - 101.61133873800006, - -3.224541924999826 - ], - [ - 101.58448326900006, - -3.176853122999859 - ], - [ - 101.56495201900006, - -3.162286065999922 - ], - [ - 101.41895592500006, - -2.927341403999904 - ], - [ - 101.40796959700018, - -2.885511976999879 - ], - [ - 101.32699629000015, - -2.739190362999935 - ], - [ - 101.29932701900006, - -2.707614841999941 - ], - [ - 101.26254316500015, - -2.683282158999887 - ], - [ - 101.17839603000002, - -2.641289971999896 - ], - [ - 101.13982181100008, - -2.616875908999859 - ], - [ - 101.10482832100016, - -2.587090752999856 - ], - [ - 101.01783287900017, - -2.467950127999828 - ], - [ - 100.923106316, - -2.333428643999937 - ], - [ - 100.83952884200008, - -2.167250257999811 - ], - [ - 100.83399498800011, - -2.159112237999892 - ], - [ - 100.83155358200011, - -2.141289971999825 - ], - [ - 100.84571373800011, - -2.119398695999877 - ], - [ - 100.8782658210001, - -2.080010674999897 - ], - [ - 100.88721764400012, - -2.037204684999907 - ], - [ - 100.88135826900006, - -1.994886976999808 - ], - [ - 100.87061608200005, - -1.953301690999822 - ], - [ - 100.86459394600016, - -1.912367445999976 - ], - [ - 100.85759524800008, - -1.891859632999839 - ], - [ - 100.84107506600017, - -1.870375257999825 - ], - [ - 100.78394616, - -1.815524997999987 - ], - [ - 100.77605228000002, - -1.805759372999873 - ], - [ - 100.7713322270001, - -1.79558684699991 - ], - [ - 100.76465905000006, - -1.77206796699987 - ], - [ - 100.71843509200008, - -1.698174737999949 - ], - [ - 100.6683048840001, - -1.639743747999887 - ], - [ - 100.65447024800008, - -1.6176083309999 - ], - [ - 100.64551842500006, - -1.594008070999877 - ], - [ - 100.6365666020001, - -1.551364841999927 - ], - [ - 100.63257897200006, - -1.507989190999879 - ], - [ - 100.62435957100016, - -1.497491143999909 - ], - [ - 100.58464603000002, - -1.460381768999895 - ], - [ - 100.57056725400011, - -1.442559502999828 - ], - [ - 100.57642662900011, - -1.437758070999919 - ], - [ - 100.5799259770001, - -1.431898695999891 - ], - [ - 100.58423912900011, - -1.415785414999917 - ], - [ - 100.58171634200019, - -1.41668059699991 - ], - [ - 100.57325280000006, - -1.40764739399998 - ], - [ - 100.57056725400011, - -1.408379815999837 - ], - [ - 100.57276451900006, - -1.404473565999922 - ], - [ - 100.577403191, - -1.398125908999901 - ], - [ - 100.58187910200016, - -1.393649997999844 - ], - [ - 100.58423912900011, - -1.394707940999893 - ], - [ - 100.57683353000007, - -1.355645440999922 - ], - [ - 100.5691837900001, - -1.330824476999879 - ], - [ - 100.55990644600016, - -1.319594007999882 - ], - [ - 100.539805535, - -1.314222914999917 - ], - [ - 100.49870853000002, - -1.290297132999854 - ], - [ - 100.47917728000007, - -1.282972914999945 - ], - [ - 100.47348066500015, - -1.27849700299997 - ], - [ - 100.46412194100006, - -1.268161716999884 - ], - [ - 100.45826256600017, - -1.263848565999879 - ], - [ - 100.45557701900012, - -1.26572030999985 - ], - [ - 100.4534611340001, - -1.269707940999822 - ], - [ - 100.45045006600017, - -1.271905205999914 - ], - [ - 100.42579186300011, - -1.276055596999939 - ], - [ - 100.41553795700005, - -1.274509372999901 - ], - [ - 100.40601647200018, - -1.264418226999851 - ], - [ - 100.40967858200011, - -1.258558851999894 - ], - [ - 100.42652428500006, - -1.243910414999974 - ], - [ - 100.4318139980002, - -1.234551690999865 - ], - [ - 100.43360436300011, - -1.228692315999822 - ], - [ - 100.43327884200008, - -1.206719658999901 - ], - [ - 100.42741946700014, - -1.19255950299987 - ], - [ - 100.38493899800008, - -1.155205987999821 - ], - [ - 100.37012780000006, - -1.160902601999894 - ], - [ - 100.3660587900001, - -1.15048593499999 - ], - [ - 100.36801191500015, - -1.133721612999892 - ], - [ - 100.3712671230002, - -1.121026299999841 - ], - [ - 100.37419681100002, - -1.117608330999829 - ], - [ - 100.3787541020001, - -1.115166924999969 - ], - [ - 100.38306725400017, - -1.11142343499985 - ], - [ - 100.38493899800008, - -1.103936455999886 - ], - [ - 100.38331139400012, - -1.09677499799993 - ], - [ - 100.3712671230002, - -1.073337497999873 - ], - [ - 100.38103274800008, - -1.068617445999863 - ], - [ - 100.3919376960001, - -1.067071221999825 - ], - [ - 100.40284264400012, - -1.068617445999863 - ], - [ - 100.41285241000017, - -1.073337497999873 - ], - [ - 100.4163517590001, - -1.064629815999965 - ], - [ - 100.41773522200006, - -1.056247653999918 - ], - [ - 100.4163517590001, - -1.047784112999963 - ], - [ - 100.41285241000017, - -1.039157809999878 - ], - [ - 100.39096113400015, - -1.041599216999913 - ], - [ - 100.37989342500012, - -1.030450127999885 - ], - [ - 100.35303795700005, - -0.977146091999927 - ], - [ - 100.34400475400011, - -0.908786716999856 - ], - [ - 100.32789147200006, - -0.858819268999909 - ], - [ - 100.30144290500007, - -0.816338799999841 - ], - [ - 100.15967858200005, - -0.667901299999897 - ], - [ - 100.134043816, - -0.634698174999883 - ], - [ - 100.09058678500017, - -0.557224216999899 - ], - [ - 100.03492272200006, - -0.487969658999845 - ], - [ - 100.0013126960001, - -0.456312757999868 - ], - [ - 99.93043053500006, - -0.409437757999811 - ], - [ - 99.91944420700005, - -0.398044528999932 - ], - [ - 99.9103296230002, - -0.375176690999837 - ], - [ - 99.88884524800008, - -0.357598565999908 - ], - [ - 99.8435978520001, - -0.332126559999892 - ], - [ - 99.82398522200018, - -0.313409112999921 - ], - [ - 99.8138126960001, - -0.294610283999887 - ], - [ - 99.81006920700011, - -0.273370049999897 - ], - [ - 99.80958092500012, - -0.247165622999859 - ], - [ - 99.80591881600006, - -0.227797132999854 - ], - [ - 99.79721113400015, - -0.215915622999887 - ], - [ - 99.78598066500015, - -0.206638278999847 - ], - [ - 99.77540123800011, - -0.195570570999905 - ], - [ - 99.76587975400011, - -0.181247653999918 - ], - [ - 99.75945071700019, - -0.168389580999886 - ], - [ - 99.7560327480002, - -0.154717705999943 - ], - [ - 99.75489342500006, - -0.13730234199997 - ], - [ - 99.75798587300002, - -0.115817966999856 - ], - [ - 99.7638452480002, - -0.095879815999879 - ], - [ - 99.76677493600019, - -0.075372002999828 - ], - [ - 99.76172936300006, - -0.052178643999881 - ], - [ - 99.74724368600002, - -0.029839776999864 - ], - [ - 99.68946373800011, - 0.020086981000091 - ], - [ - 99.63282311300011, - 0.08100006700009 - ], - [ - 99.61085045700011, - 0.098578192000119 - ], - [ - 99.53402754000015, - 0.140326239000075 - ], - [ - 99.49048912900017, - 0.155422268000081 - ], - [ - 99.45020592500006, - 0.161281643000109 - ], - [ - 99.42693118600008, - 0.161363023000192 - ], - [ - 99.40821373800011, - 0.163885809000107 - ], - [ - 99.39258873800011, - 0.171698309000021 - ], - [ - 99.37818444100006, - 0.187974351000051 - ], - [ - 99.35661868600002, - 0.225653387000122 - ], - [ - 99.34107506600006, - 0.238755601000094 - ], - [ - 99.31617272200018, - 0.242621161000088 - ], - [ - 99.29656009200002, - 0.237697658000044 - ], - [ - 99.26059004000015, - 0.219875393000066 - ], - [ - 99.24415123800006, - 0.215969143000152 - ], - [ - 99.23340905000006, - 0.217027085000112 - ], - [ - 99.22193444100012, - 0.220363674000055 - ], - [ - 99.21127363400015, - 0.225653387000122 - ], - [ - 99.20313561300006, - 0.23273346600017 - ], - [ - 99.19369550900015, - 0.243150132000068 - ], - [ - 99.18881269600016, - 0.245591539000102 - ], - [ - 99.18230228000007, - 0.244086005000057 - ], - [ - 99.168711785, - 0.242621161000088 - ], - [ - 99.16211998800006, - 0.245266018000081 - ], - [ - 99.142344597, - 0.258246161000073 - ], - [ - 99.13795006600006, - 0.263088283000144 - ], - [ - 99.13933353000013, - 0.273749091000084 - ], - [ - 99.15308678500006, - 0.287176825000088 - ], - [ - 99.15845787900017, - 0.29783763200011 - ], - [ - 99.15845787900017, - 0.320013739000089 - ], - [ - 99.14844811300011, - 0.333156643000052 - ], - [ - 99.13152103000002, - 0.340562242000118 - ], - [ - 99.11060631600017, - 0.345648505000142 - ], - [ - 99.12875410200016, - 0.391791083000072 - ], - [ - 99.13233483200005, - 0.412054755 - ], - [ - 99.12720787900011, - 0.484361070000148 - ], - [ - 99.12256920700011, - 0.509019273000135 - ], - [ - 99.11060631600017, - 0.52383047100011 - ], - [ - 99.09839928500017, - 0.514227606000048 - ], - [ - 99.09734134200002, - 0.530747789000117 - ], - [ - 99.1038517590001, - 0.578436591000084 - ], - [ - 99.10027103000007, - 0.601752020000077 - ], - [ - 99.08985436300006, - 0.62201569200009 - ], - [ - 99.07276451900012, - 0.630804755000057 - ], - [ - 99.048594597, - 0.619940497000158 - ], - [ - 99.04004967500006, - 0.650458075000103 - ], - [ - 99.04737389400012, - 0.73973216400006 - ], - [ - 99.04175866000011, - 0.777044989000117 - ], - [ - 99.00611412900011, - 0.818752346000153 - ], - [ - 98.99732506600017, - 0.825425523000121 - ], - [ - 98.981211785, - 0.831732489000061 - ], - [ - 98.97673587300002, - 0.847357489000132 - ], - [ - 98.9803166020001, - 0.88621653900006 - ], - [ - 98.97584069100006, - 0.920843817000048 - ], - [ - 98.9173283210001, - 1.117173570000105 - ], - [ - 98.85059655000012, - 1.277289130000057 - ], - [ - 98.83904056100019, - 1.301255601000193 - ], - [ - 98.83692467500012, - 1.311468817000048 - ], - [ - 98.83887780000006, - 1.321356512000136 - ], - [ - 98.84294681100019, - 1.33344147300015 - ], - [ - 98.8445744150001, - 1.345892645000077 - ], - [ - 98.84001712300008, - 1.356756903000147 - ], - [ - 98.79908287900017, - 1.398749091000127 - ], - [ - 98.78858483200005, - 1.413804429000052 - ], - [ - 98.77540123800006, - 1.45156484600011 - ], - [ - 98.770274285, - 1.474595445000091 - ], - [ - 98.76807701900012, - 1.493597723000093 - ], - [ - 98.76465905000012, - 1.498846747000158 - ], - [ - 98.75652103000019, - 1.504461981000162 - ], - [ - 98.74626712300008, - 1.508937893000137 - ], - [ - 98.73698978000002, - 1.510687567000133 - ], - [ - 98.73023522200018, - 1.514390367000161 - ], - [ - 98.725840691, - 1.523627020000049 - ], - [ - 98.72022545700011, - 1.545396226000193 - ], - [ - 98.70964603000007, - 1.564113674000069 - ], - [ - 98.7112736340001, - 1.569566148000192 - ], - [ - 98.72706139400012, - 1.572170315000108 - ], - [ - 98.73365319100012, - 1.569891669000043 - ], - [ - 98.74040774800002, - 1.563910223000107 - ], - [ - 98.74537194100017, - 1.556138414000117 - ], - [ - 98.7474064460001, - 1.548529364000075 - ], - [ - 98.75342858200011, - 1.53563060100015 - ], - [ - 98.7664494150001, - 1.549017645000063 - ], - [ - 98.78858483200005, - 1.586411851000193 - ], - [ - 98.79818769600016, - 1.599066473000079 - ], - [ - 98.81885826900006, - 1.61969635600002 - ], - [ - 98.8226017590001, - 1.630438544000114 - ], - [ - 98.8235783210001, - 1.666693427000041 - ], - [ - 98.81910241, - 1.682318427000027 - ], - [ - 98.80591881600017, - 1.688869533000101 - ], - [ - 98.78809655000012, - 1.691351630000113 - ], - [ - 98.78370201900012, - 1.699042059000135 - ], - [ - 98.7845158210001, - 1.711859442000076 - ], - [ - 98.78296959700018, - 1.729722398000135 - ], - [ - 98.77393639400006, - 1.748602606000162 - ], - [ - 98.7601017590001, - 1.764146226000165 - ], - [ - 98.72706139400012, - 1.791896877000141 - ], - [ - 98.7150171230002, - 1.784979559000064 - ], - [ - 98.7111108730002, - 1.779120184000107 - ], - [ - 98.7127384770001, - 1.763902085000126 - ], - [ - 98.71509850400011, - 1.763983466000028 - ], - [ - 98.7249455090001, - 1.756822007000068 - ], - [ - 98.72706139400012, - 1.756496486000145 - ], - [ - 98.7267358730002, - 1.749416408 - ], - [ - 98.7215275400001, - 1.739081122000172 - ], - [ - 98.72022545700011, - 1.733465887000165 - ], - [ - 98.7111108730002, - 1.725775458000058 - ], - [ - 98.69068444100006, - 1.736273505000128 - ], - [ - 98.65821373800006, - 1.763902085000126 - ], - [ - 98.57618248800006, - 1.888088283000087 - ], - [ - 98.53516686300006, - 1.93646881700009 - ], - [ - 98.44402103000002, - 1.991156317000133 - ], - [ - 98.42611738400015, - 1.997626044000143 - ], - [ - 98.40699303500011, - 2.001939195000134 - ], - [ - 98.38786868600013, - 2.003485419000086 - ], - [ - 98.36597741000017, - 2.002875067000119 - ], - [ - 98.35450280000006, - 2.003810940000108 - ], - [ - 98.34961998800006, - 2.007228908000116 - ], - [ - 98.349375847, - 2.021429755000128 - ], - [ - 98.34717858200005, - 2.028998114000089 - ], - [ - 98.3411564460001, - 2.033392645000063 - ], - [ - 98.32984459700006, - 2.038275458000129 - ], - [ - 98.31177819100006, - 2.039618231000119 - ], - [ - 98.28882897200006, - 2.037339585000055 - ], - [ - 98.26921634200008, - 2.038072007000082 - ], - [ - 98.26091556100019, - 2.048529364000061 - ], - [ - 98.25611412900011, - 2.073309637000122 - ], - [ - 98.24366295700011, - 2.087551174000126 - ], - [ - 98.20948326900012, - 2.109930731000063 - ], - [ - 98.15259850400017, - 2.156927802000084 - ], - [ - 98.08961022200006, - 2.195868231000162 - ], - [ - 97.98357181100019, - 2.24437083500014 - ], - [ - 97.9559025400001, - 2.271714585000026 - ], - [ - 97.93336022200012, - 2.269761459999984 - ], - [ - 97.88111412900011, - 2.250311591000155 - ], - [ - 97.86687259200019, - 2.247463283000116 - ], - [ - 97.85075931100013, - 2.251206773000149 - ], - [ - 97.82943769600016, - 2.264227606000134 - ], - [ - 97.81771894600016, - 2.258937893000066 - ], - [ - 97.80990644600016, - 2.263657945000162 - ], - [ - 97.80339603000019, - 2.272040106000048 - ], - [ - 97.79476972700016, - 2.277818101000193 - ], - [ - 97.78614342500006, - 2.278021552000055 - ], - [ - 97.76856530000006, - 2.273016669000114 - ], - [ - 97.75733483200005, - 2.271673895000035 - ], - [ - 97.74439537900011, - 2.281073309000135 - ], - [ - 97.70606530000012, - 2.346136786000088 - ], - [ - 97.67644290500007, - 2.37592194200009 - ], - [ - 97.66358483200005, - 2.392075914000145 - ], - [ - 97.65821373800006, - 2.411566473000136 - ], - [ - 97.66114342500012, - 2.527329820000148 - ], - [ - 97.64405358200005, - 2.66889069200009 - ], - [ - 97.60889733200011, - 2.848618882000096 - ], - [ - 97.60271243600002, - 2.866197007000125 - ], - [ - 97.59278405000012, - 2.873683986000017 - ], - [ - 97.57740319100017, - 2.87592194200009 - ], - [ - 97.5353296230002, - 2.888251044000043 - ], - [ - 97.48462975400017, - 2.91303131700009 - ], - [ - 97.46387780000006, - 2.91962311399999 - ], - [ - 97.44166100400011, - 2.922105210000012 - ], - [ - 97.42212975400011, - 2.928371486000145 - ], - [ - 97.40503991000017, - 2.943345445000176 - ], - [ - 97.33204186300006, - 3.0313988300001 - ], - [ - 97.31348717500006, - 3.061672268000095 - ], - [ - 97.30079186300011, - 3.09341054900014 - ], - [ - 97.28516686300011, - 3.178452867000161 - ], - [ - 97.27076256600006, - 3.214422919000057 - ], - [ - 97.24048912900017, - 3.238023179000081 - ], - [ - 97.20671634200008, - 3.240790106000134 - ], - [ - 97.18262780000006, - 3.245998440000051 - ], - [ - 97.17164147200018, - 3.25482819200009 - ], - [ - 97.1663517590001, - 3.267971096000153 - ], - [ - 97.01856530000012, - 3.522691148000192 - ], - [ - 96.99976647200006, - 3.545884507000139 - ], - [ - 96.9217228520001, - 3.605698960000012 - ], - [ - 96.90349368600002, - 3.634670315 - ], - [ - 96.89210045700005, - 3.666489976000122 - ], - [ - 96.88355553500006, - 3.68244049700013 - ], - [ - 96.87305748800006, - 3.689276434000064 - ], - [ - 96.8660587900001, - 3.692124742000189 - ], - [ - 96.84205162900017, - 3.706732489000117 - ], - [ - 96.83814537900017, - 3.712632554000052 - ], - [ - 96.828868035, - 3.716620184000121 - ], - [ - 96.817637566, - 3.719916083000072 - ], - [ - 96.80787194100017, - 3.724066473000107 - ], - [ - 96.77800540500019, - 3.742987372000115 - ], - [ - 96.76050866000006, - 3.748683986000103 - ], - [ - 96.55982506600017, - 3.746568101000179 - ], - [ - 96.5198673840001, - 3.75482819200009 - ], - [ - 96.47950280000006, - 3.778713283000144 - ], - [ - 96.43034915500002, - 3.825262762000179 - ], - [ - 96.27930748800011, - 4.025783596000082 - ], - [ - 96.21143639400012, - 4.093939520000106 - ], - [ - 96.20753014400012, - 4.100490627000099 - ], - [ - 96.20191491, - 4.115179755000099 - ], - [ - 96.19776451900006, - 4.121283270000077 - ], - [ - 96.19092858200005, - 4.125962632000096 - ], - [ - 96.17530358200005, - 4.132717190000136 - ], - [ - 96.16765384200002, - 4.138373114000117 - ], - [ - 96.15967858200005, - 4.141302802000141 - ], - [ - 96.14714603000007, - 4.142482815000079 - ], - [ - 96.13526451900012, - 4.14166901200015 - ], - [ - 96.130137566, - 4.138373114000117 - ], - [ - 96.12517337300008, - 4.136419989000075 - ], - [ - 96.11378014400012, - 4.147162177000098 - ], - [ - 96.06519616000006, - 4.205023505000099 - ], - [ - 96.04965254000015, - 4.21430084800015 - ], - [ - 96.03077233200011, - 4.217474677000112 - ], - [ - 96.01002037900011, - 4.225653387000122 - ], - [ - 95.90349368600008, - 4.344712632000082 - ], - [ - 95.81413821700002, - 4.432847398000163 - ], - [ - 95.80713951900006, - 4.446112372000101 - ], - [ - 95.75896243600019, - 4.484442450000131 - ], - [ - 95.72584069100017, - 4.531683661000102 - ], - [ - 95.65650475400011, - 4.579982815000122 - ], - [ - 95.61654707100016, - 4.628404039000117 - ], - [ - 95.59896894600016, - 4.635199286000145 - ], - [ - 95.57618248800011, - 4.634670315000079 - ], - [ - 95.56544030000012, - 4.637518622000115 - ], - [ - 95.56088300900015, - 4.645738023000192 - ], - [ - 95.563243035, - 4.651556708000072 - ], - [ - 95.57292728000007, - 4.660711981000134 - ], - [ - 95.57520592500006, - 4.666571356000176 - ], - [ - 95.57252037900017, - 4.673814195000105 - ], - [ - 95.56666100400011, - 4.675197658000087 - ], - [ - 95.55958092500006, - 4.674627997000115 - ], - [ - 95.5540470710001, - 4.676214911000145 - ], - [ - 95.52686608200011, - 4.697251695000176 - ], - [ - 95.51514733200005, - 4.713527736000117 - ], - [ - 95.48910566500015, - 4.762437242000189 - ], - [ - 95.46843509200002, - 4.78949616100013 - ], - [ - 95.45997155000012, - 4.797186591000155 - ], - [ - 95.4412541020001, - 4.810614325000145 - ], - [ - 95.43433678500006, - 4.817124742000146 - ], - [ - 95.42628014400012, - 4.827337958000086 - ], - [ - 95.42457116000011, - 4.832342841000127 - ], - [ - 95.42505944100017, - 4.837347723000065 - ], - [ - 95.42383873800006, - 4.847479559000121 - ], - [ - 95.41846764400012, - 4.862494208000143 - ], - [ - 95.40577233200005, - 4.88768138200011 - ], - [ - 95.40015709700006, - 4.910549221000124 - ], - [ - 95.385996941, - 4.935126044000128 - ], - [ - 95.37989342500006, - 4.960435289000173 - ], - [ - 95.348887566, - 5.037502346000139 - ], - [ - 95.33887780000012, - 5.05353424700013 - ], - [ - 95.32447350400017, - 5.070298570000148 - ], - [ - 95.31283613400015, - 5.087144273000149 - ], - [ - 95.30591881600006, - 5.103583075000145 - ], - [ - 95.29688561300006, - 5.116400458000086 - ], - [ - 95.27979576900012, - 5.122503973000079 - ], - [ - 95.2991642590001, - 5.150336005000128 - ], - [ - 95.30160566500015, - 5.172430731000119 - ], - [ - 95.29127037900011, - 5.191636460000083 - ], - [ - 95.27295983200005, - 5.211167710000055 - ], - [ - 95.2560327480002, - 5.223374742000132 - ], - [ - 95.24870853000019, - 5.231024481000148 - ], - [ - 95.24561608200011, - 5.241644598000107 - ], - [ - 95.2439884770001, - 5.256048895000077 - ], - [ - 95.239512566, - 5.270819403000147 - ], - [ - 95.23194420700005, - 5.282294012000179 - ], - [ - 95.22144616, - 5.286932684000121 - ], - [ - 95.19898522200012, - 5.292873440000136 - ], - [ - 95.20533287900011, - 5.307562567000147 - ], - [ - 95.22217858200005, - 5.326402085000083 - ], - [ - 95.23194420700005, - 5.344631252000156 - ], - [ - 95.23389733200011, - 5.359320380000071 - ], - [ - 95.24529056100019, - 5.379136460000083 - ], - [ - 95.25171959700012, - 5.395575262000165 - ], - [ - 95.25359134200008, - 5.411566473000079 - ], - [ - 95.24968509200008, - 5.424953518000081 - ], - [ - 95.23194420700005, - 5.450751044000114 - ], - [ - 95.24545332100016, - 5.460516669000143 - ], - [ - 95.23682701900006, - 5.474025783000116 - ], - [ - 95.22388756600006, - 5.489569403000118 - ], - [ - 95.22510826900006, - 5.505438544000143 - ], - [ - 95.20362389400012, - 5.533677476000122 - ], - [ - 95.19727623800011, - 5.546372789000173 - ], - [ - 95.2127384770001, - 5.573146877000084 - ], - [ - 95.22388756600006, - 5.580267645000134 - ], - [ - 95.23878014400012, - 5.5743675800001 - ], - [ - 95.25049889400006, - 5.579046942000119 - ], - [ - 95.26042728000019, - 5.577541408000158 - ], - [ - 95.26970462300002, - 5.574408270000092 - ], - [ - 95.27979576900012, - 5.5743675800001 - ], - [ - 95.288340691, - 5.578762111000088 - ], - [ - 95.30494225400017, - 5.59198639500012 - ], - [ - 95.3157658210001, - 5.597967841000141 - ], - [ - 95.33529707100016, - 5.612127997000158 - ], - [ - 95.34522545700005, - 5.615301825000131 - ], - [ - 95.35889733200011, - 5.616888739000061 - ], - [ - 95.36915123800011, - 5.621283270000134 - ], - [ - 95.41285241, - 5.649562893000095 - ], - [ - 95.43189537900011, - 5.65468984600011 - ], - [ - 95.44971764400006, - 5.649562893000095 - ], - [ - 95.47706139400006, - 5.623602606000105 - ], - [ - 95.49431399800008, - 5.612290757000125 - ], - [ - 95.50269616, - 5.605129299000083 - ] - ] - ], - [ - [ - [ - 95.17741946700019, - 5.628363348000107 - ], - [ - 95.19109134200002, - 5.608465887000108 - ], - [ - 95.1805119150001, - 5.609198309000135 - ], - [ - 95.17139733200011, - 5.607245184000178 - ], - [ - 95.16325931100008, - 5.602443752000099 - ], - [ - 95.15626061300011, - 5.594794012000165 - ], - [ - 95.14527428500006, - 5.604234117000175 - ], - [ - 95.13379967500006, - 5.606187242000132 - ], - [ - 95.12232506600006, - 5.606756903000104 - ], - [ - 95.11158287900011, - 5.611883856000119 - ], - [ - 95.10914147200018, - 5.622015692000076 - ], - [ - 95.11817467500012, - 5.631659247000144 - ], - [ - 95.12989342500006, - 5.640041408000101 - ], - [ - 95.13575280000006, - 5.646307684000149 - ], - [ - 95.14177493600002, - 5.664129950000131 - ], - [ - 95.15503991000017, - 5.656683661000145 - ], - [ - 95.17741946700019, - 5.628363348000107 - ] - ] - ], - [ - [ - [ - 95.0809025400001, - 5.740952867000146 - ], - [ - 95.10230553500017, - 5.720200914000145 - ], - [ - 95.12208092500012, - 5.704657294000143 - ], - [ - 95.11524498800006, - 5.711493231000162 - ], - [ - 95.12696373800006, - 5.702053127000141 - ], - [ - 95.13331139400012, - 5.691310940000136 - ], - [ - 95.13233483200005, - 5.68012116100013 - ], - [ - 95.12208092500012, - 5.669256903000132 - ], - [ - 95.09473717500012, - 5.683579820000119 - ], - [ - 95.0607202480002, - 5.656236070000148 - ], - [ - 95.05689537900017, - 5.669094143000081 - ], - [ - 95.05713951900012, - 5.674750067000076 - ], - [ - 95.0607202480002, - 5.683579820000119 - ], - [ - 95.05030358200011, - 5.686224677000112 - ], - [ - 95.04786217500006, - 5.68964264500012 - ], - [ - 95.05103600400011, - 5.694403387000122 - ], - [ - 95.05730228000019, - 5.700913804000109 - ], - [ - 95.05713951900012, - 5.707342841000127 - ], - [ - 95.05103600400011, - 5.712958075000131 - ], - [ - 95.0486759770001, - 5.718451239000146 - ], - [ - 95.0607202480002, - 5.724554755000142 - ], - [ - 95.0607202480002, - 5.732001044000114 - ], - [ - 95.04883873800006, - 5.736476955000086 - ], - [ - 95.0403751960001, - 5.736029364000089 - ], - [ - 95.03272545700005, - 5.733547268000152 - ], - [ - 95.02312259200019, - 5.732001044000114 - ], - [ - 95.01270592500012, - 5.735825914000131 - ], - [ - 95.01465905000006, - 5.744614976000193 - ], - [ - 95.02369225400017, - 5.754055080000114 - ], - [ - 95.03394616000011, - 5.759914455000157 - ], - [ - 95.05827884200008, - 5.757310289000159 - ], - [ - 95.0809025400001, - 5.740952867000146 - ] - ] - ], - [ - [ - [ - 95.27247155000012, - 5.870306708000115 - ], - [ - 95.28386478000007, - 5.85740794500019 - ], - [ - 95.29712975400011, - 5.858587958000129 - ], - [ - 95.30730228000002, - 5.872381903000132 - ], - [ - 95.31495201900006, - 5.887762762000165 - ], - [ - 95.32496178500006, - 5.8980166690001 - ], - [ - 95.34180748800006, - 5.896429755000071 - ], - [ - 95.35132897200006, - 5.887030341000141 - ], - [ - 95.38282311300006, - 5.841864325000103 - ], - [ - 95.38282311300006, - 5.807074286000145 - ], - [ - 95.37598717500006, - 5.807074286000145 - ], - [ - 95.37256920700005, - 5.813625393000123 - ], - [ - 95.36866295700005, - 5.818304755000142 - ], - [ - 95.35547936300006, - 5.827582098000107 - ], - [ - 95.3553166020001, - 5.795152085000112 - ], - [ - 95.35043379000015, - 5.783636786000073 - ], - [ - 95.33838951900006, - 5.779201565000093 - ], - [ - 95.32032311300011, - 5.780747789000131 - ], - [ - 95.30274498800011, - 5.785711981000176 - ], - [ - 95.28663170700011, - 5.794419664000173 - ], - [ - 95.27295983200005, - 5.807074286000145 - ], - [ - 95.26587975400011, - 5.821112372000101 - ], - [ - 95.25977623800006, - 5.839260158000101 - ], - [ - 95.25269616000017, - 5.854966539000159 - ], - [ - 95.23145592500006, - 5.869289455000143 - ], - [ - 95.2205509770001, - 5.885931708000101 - ], - [ - 95.21355228000002, - 5.902533270000148 - ], - [ - 95.21461022200018, - 5.910101630000099 - ], - [ - 95.2361759770001, - 5.909125067000133 - ], - [ - 95.24781334700012, - 5.905218817000133 - ], - [ - 95.25928795700005, - 5.896429755000071 - ], - [ - 95.27247155000012, - 5.870306708000115 - ] - ] - ], - [ - [ - [ - 111.4124455090001, - 2.38735586100006 - ], - [ - 111.413340691, - 2.378241278000147 - ], - [ - 111.4104923840001, - 2.372219143000152 - ], - [ - 111.40088951900012, - 2.377834377000141 - ], - [ - 111.3909611340001, - 2.382147528000147 - ], - [ - 111.38184655000012, - 2.377875067000133 - ], - [ - 111.37435957100016, - 2.369086005000085 - ], - [ - 111.36988366000017, - 2.359808661000116 - ], - [ - 111.35914147200006, - 2.373114325000145 - ], - [ - 111.3426212900001, - 2.413885809000107 - ], - [ - 111.33204186300011, - 2.422430731000134 - ], - [ - 111.3126733730002, - 2.43134186399999 - ], - [ - 111.30811608200005, - 2.452134507000068 - ], - [ - 111.315684441, - 2.496242580000143 - ], - [ - 111.31763756600017, - 2.536769924000069 - ], - [ - 111.29900149800008, - 2.702704169000157 - ], - [ - 111.30095462300014, - 2.752630927000112 - ], - [ - 111.31544030000006, - 2.784491278000132 - ], - [ - 111.3499455090001, - 2.771307684000092 - ], - [ - 111.37029056100008, - 2.739732164000188 - ], - [ - 111.3810327480002, - 2.697902736000088 - ], - [ - 111.38184655000012, - 2.523342190000079 - ], - [ - 111.390391472, - 2.449164130000057 - ], - [ - 111.41138756600017, - 2.391099351000179 - ], - [ - 111.4124455090001, - 2.38735586100006 - ] - ] - ], - [ - [ - [ - 104.19206790500019, - 2.709051825000017 - ], - [ - 104.17212975400011, - 2.707749742000189 - ], - [ - 104.15748131600017, - 2.713283596000124 - ], - [ - 104.13843834700012, - 2.733628648000106 - ], - [ - 104.130625847, - 2.745794989000103 - ], - [ - 104.130137566, - 2.754543361000074 - ], - [ - 104.1307072270001, - 2.760077216000099 - ], - [ - 104.1258244150001, - 2.777044989000075 - ], - [ - 104.12696373800006, - 2.785589911000088 - ], - [ - 104.13160241000017, - 2.791083075000031 - ], - [ - 104.14421634200008, - 2.797593492000104 - ], - [ - 104.15064537900017, - 2.802394924000097 - ], - [ - 104.16032962300002, - 2.817857164000117 - ], - [ - 104.16032962300002, - 2.832668361000088 - ], - [ - 104.15626061300006, - 2.847723700000103 - ], - [ - 104.15381920700005, - 2.864081122000115 - ], - [ - 104.15601647200006, - 2.8745791690001 - ], - [ - 104.16187584700018, - 2.884833075000117 - ], - [ - 104.17066491000006, - 2.891099351000079 - ], - [ - 104.18140709700006, - 2.889797268000081 - ], - [ - 104.18620853000007, - 2.885321356000105 - ], - [ - 104.18775475400017, - 2.879706122000101 - ], - [ - 104.18897545700011, - 2.86758047100011 - ], - [ - 104.19166100400017, - 2.860296942000105 - ], - [ - 104.20435631600006, - 2.840887762000179 - ], - [ - 104.21062259200019, - 2.827866929000109 - ], - [ - 104.22266686300011, - 2.785589911000088 - ], - [ - 104.22510826900006, - 2.735907294000086 - ], - [ - 104.22266686300011, - 2.724107164000031 - ], - [ - 104.21078535200016, - 2.715073960000112 - ], - [ - 104.19206790500019, - 2.709051825000017 - ] - ] - ], - [ - [ - [ - 101.2596134770001, - 3.030218817000076 - ], - [ - 101.24382571700019, - 3.026190497000101 - ], - [ - 101.23698978000007, - 3.035060940000065 - ], - [ - 101.24439537900017, - 3.04901764500012 - ], - [ - 101.26286868600008, - 3.056341864000132 - ], - [ - 101.27116946700008, - 3.046454169000114 - ], - [ - 101.26734459700006, - 3.035305080000015 - ], - [ - 101.2596134770001, - 3.030218817000076 - ] - ] - ], - [ - [ - [ - 101.27564537900011, - 2.967718817000133 - ], - [ - 101.26807701900006, - 2.965155341000127 - ], - [ - 101.26636803500017, - 2.971502997000073 - ], - [ - 101.26807701900006, - 2.982123114000103 - ], - [ - 101.29232832100016, - 3.042914130000128 - ], - [ - 101.305918816, - 3.063950914000159 - ], - [ - 101.32349694100006, - 3.071112372000115 - ], - [ - 101.33619225400011, - 3.065008856000119 - ], - [ - 101.33765709700018, - 3.051825262000165 - ], - [ - 101.33643639400006, - 3.044745184000107 - ], - [ - 101.33790123800011, - 3.031927802 - ], - [ - 101.3352970710001, - 3.009019273000177 - ], - [ - 101.32146243600013, - 2.996161200000145 - ], - [ - 101.30225670700005, - 2.988674221000096 - ], - [ - 101.28728274800014, - 2.978216864000103 - ], - [ - 101.28142337300008, - 2.97247955900005 - ], - [ - 101.27564537900011, - 2.967718817000133 - ] - ] - ], - [ - [ - [ - 117.90072675899998, - 4.171291408000101 - ], - [ - 117.90703902788991, - 4.15668301495252 - ], - [ - 117.85255730900022, - 4.157241908000088 - ], - [ - 117.78357224700008, - 4.157241908000088 - ], - [ - 117.73807146200014, - 4.157241908000088 - ], - [ - 117.70360790399397, - 4.163414541993006 - ], - [ - 117.69711347699999, - 4.169053453000117 - ], - [ - 117.64405358200005, - 4.215236721000139 - ], - [ - 117.64014733200005, - 4.227443752000113 - ], - [ - 117.64763431100008, - 4.240627346000153 - ], - [ - 117.66553795700011, - 4.253119208000072 - ], - [ - 117.68604576900017, - 4.262844143000123 - ], - [ - 117.70167076900023, - 4.267523505000128 - ], - [ - 117.72022545700023, - 4.266424872000087 - ], - [ - 117.75635826900006, - 4.254584052000126 - ], - [ - 117.77442467500012, - 4.251654364000103 - ], - [ - 117.78541100400017, - 4.246649481000162 - ], - [ - 117.79493248800017, - 4.235256252000099 - ], - [ - 117.80827884200008, - 4.214056708000115 - ], - [ - 117.81771894599999, - 4.204738674000154 - ], - [ - 117.8263452480002, - 4.199408270000106 - ], - [ - 117.836192254, - 4.196966864000075 - ], - [ - 117.84986412900005, - 4.196356512000108 - ], - [ - 117.896250847, - 4.181341864000089 - ], - [ - 117.900645379, - 4.171454169000157 - ], - [ - 117.90072675899998, - 4.171291408000101 - ] - ] - ], - [ - [ - [ - 118.68165123800023, - 4.4370791690001 - ], - [ - 118.67481530000023, - 4.436590887000108 - ], - [ - 118.66920006600006, - 4.439846096000153 - ], - [ - 118.66920006600006, - 4.443060614000117 - ], - [ - 118.66797936300011, - 4.463934637000179 - ], - [ - 118.66325931100019, - 4.46922435100015 - ], - [ - 118.65121503999998, - 4.479071356000176 - ], - [ - 118.64747155000018, - 4.484442450000131 - ], - [ - 118.64405358200017, - 4.495306708000115 - ], - [ - 118.64763431100002, - 4.498032945000176 - ], - [ - 118.65805097700004, - 4.498195705000143 - ], - [ - 118.66065514400012, - 4.498195705000143 - ], - [ - 118.67514082100016, - 4.498358466000113 - ], - [ - 118.72624759200002, - 4.491888739000117 - ], - [ - 118.74878991, - 4.485500393000095 - ], - [ - 118.760020379, - 4.47138092700007 - ], - [ - 118.75611412900005, - 4.457220770000134 - ], - [ - 118.73308353000007, - 4.450873114000103 - ], - [ - 118.69581139400006, - 4.450873114000103 - ], - [ - 118.68165123800023, - 4.4370791690001 - ] - ] - ], - [ - [ - [ - 118.49317467500006, - 4.661851304000081 - ], - [ - 118.51026451900012, - 4.648871161000088 - ], - [ - 118.52377363399998, - 4.665716864000089 - ], - [ - 118.54948978000002, - 4.665187893000109 - ], - [ - 118.57781009200019, - 4.655096747000144 - ], - [ - 118.59961998800023, - 4.642645575000117 - ], - [ - 118.59961998800023, - 4.635199286000145 - ], - [ - 118.58480879000015, - 4.634019273000121 - ], - [ - 118.57536868600008, - 4.627386786000145 - ], - [ - 118.57105553500006, - 4.616034247000172 - ], - [ - 118.57227623800006, - 4.601141669000128 - ], - [ - 118.55298912900005, - 4.61880117400014 - ], - [ - 118.54810631600006, - 4.621568101000193 - ], - [ - 118.54297936300023, - 4.616929429000081 - ], - [ - 118.53956139400023, - 4.607855536000073 - ], - [ - 118.53516686300023, - 4.601304429000095 - ], - [ - 118.52735436300017, - 4.604559637000136 - ], - [ - 118.51197350400005, - 4.616359768000109 - ], - [ - 118.49561608200011, - 4.623928127000156 - ], - [ - 118.47999108200023, - 4.627875067000133 - ], - [ - 118.46656334700006, - 4.629055080000157 - ], - [ - 118.46265709700006, - 4.630804755000071 - ], - [ - 118.45362389400012, - 4.639471747000158 - ], - [ - 118.44890384200014, - 4.642645575000117 - ], - [ - 118.41472415500002, - 4.648871161000088 - ], - [ - 118.34644616000006, - 4.669907945000119 - ], - [ - 118.34644616000006, - 4.676214911000145 - ], - [ - 118.42530358200005, - 4.676214911000145 - ], - [ - 118.43628991000006, - 4.679266669000143 - ], - [ - 118.44320722700004, - 4.686102606000162 - ], - [ - 118.44898522200012, - 4.693182684000121 - ], - [ - 118.456309441, - 4.697251695000176 - ], - [ - 118.47608483200023, - 4.693793036000088 - ], - [ - 118.48511803500006, - 4.679429429000109 - ], - [ - 118.49317467500006, - 4.661851304000081 - ] - ] - ], - [ - [ - [ - 115.25928795700005, - 5.291205145000134 - ], - [ - 115.24170983200023, - 5.272691148000121 - ], - [ - 115.23194420700011, - 5.273138739000117 - ], - [ - 115.21225019600016, - 5.284979559000163 - ], - [ - 115.20411217500023, - 5.283596096000096 - ], - [ - 115.18425540500002, - 5.267035223000121 - ], - [ - 115.15919030000023, - 5.252183335000069 - ], - [ - 115.16089928500006, - 5.26699453300013 - ], - [ - 115.18913821700019, - 5.344794012000122 - ], - [ - 115.19727623800011, - 5.354641018000152 - ], - [ - 115.22608483200023, - 5.381048895000134 - ], - [ - 115.24170983200023, - 5.38739655200007 - ], - [ - 115.24854576900023, - 5.36546458500014 - ], - [ - 115.25977623800023, - 5.315375067000133 - ], - [ - 115.25928795700005, - 5.291205145000134 - ] - ] - ], - [ - [ - [ - 100.30982506600006, - 5.450751044000114 - ], - [ - 100.3185327480002, - 5.435288804000095 - ], - [ - 100.33399498800006, - 5.426947333000115 - ], - [ - 100.34343509200008, - 5.417629299000083 - ], - [ - 100.32520592500006, - 5.383286851000122 - ], - [ - 100.32081139400012, - 5.344549872000172 - ], - [ - 100.31666100400017, - 5.326646226000122 - ], - [ - 100.29224694100012, - 5.280462958000115 - ], - [ - 100.28874759200019, - 5.262681382000125 - ], - [ - 100.2347111340001, - 5.272691148000121 - ], - [ - 100.19499759200019, - 5.272284247000115 - ], - [ - 100.19361412900011, - 5.270086981000119 - ], - [ - 100.19271894600016, - 5.267645575000174 - ], - [ - 100.18970787900011, - 5.266506252000141 - ], - [ - 100.18433678500017, - 5.268540757000082 - ], - [ - 100.1800236340001, - 5.273342190000065 - ], - [ - 100.178965691, - 5.277980861000088 - ], - [ - 100.19271894600016, - 5.285956122000144 - ], - [ - 100.19613691500015, - 5.299994208000101 - ], - [ - 100.19117272200018, - 5.352525132000139 - ], - [ - 100.19312584700006, - 5.399318752000113 - ], - [ - 100.19092858200005, - 5.408433335000097 - ], - [ - 100.18628991000006, - 5.416205145000106 - ], - [ - 100.18165123800011, - 5.422349351000179 - ], - [ - 100.17945397200012, - 5.426906643000123 - ], - [ - 100.18165123800011, - 5.436590887000179 - ], - [ - 100.18523196700008, - 5.444281317000105 - ], - [ - 100.1858830090001, - 5.451117255000128 - ], - [ - 100.17945397200012, - 5.458197333000086 - ], - [ - 100.19206790500019, - 5.462958075000174 - ], - [ - 100.1971134770001, - 5.457261460000097 - ], - [ - 100.20118248800006, - 5.448472398000135 - ], - [ - 100.21062259200019, - 5.44399648600016 - ], - [ - 100.21859785200016, - 5.446722723000136 - ], - [ - 100.2244572270001, - 5.452948309000107 - ], - [ - 100.22934004000015, - 5.45990631700009 - ], - [ - 100.2347111340001, - 5.464504299000126 - ], - [ - 100.2537541020001, - 5.46906159100017 - ], - [ - 100.27409915500019, - 5.468491929000109 - ], - [ - 100.29330488400015, - 5.462591864000075 - ], - [ - 100.30982506600006, - 5.450751044000114 - ] - ] - ], - [ - [ - [ - 118.19548587300008, - 5.820257880000099 - ], - [ - 118.189219597, - 5.819728908000116 - ], - [ - 118.181895379, - 5.820257880000099 - ], - [ - 118.17253665500007, - 5.822821356000105 - ], - [ - 118.16553795700011, - 5.827541408000116 - ], - [ - 118.16382897200018, - 5.834418036000116 - ], - [ - 118.16993248800006, - 5.843695380000071 - ], - [ - 118.18100019600004, - 5.851263739000117 - ], - [ - 118.193125847, - 5.854681708000129 - ], - [ - 118.219493035, - 5.855536200000131 - ], - [ - 118.23308353000007, - 5.851141669000143 - ], - [ - 118.23609459700018, - 5.841498114000089 - ], - [ - 118.23080488399998, - 5.831935940000093 - ], - [ - 118.219493035, - 5.827582098000107 - ], - [ - 118.21314537900017, - 5.82660553600013 - ], - [ - 118.19548587300008, - 5.820257880000099 - ] - ] - ], - [ - [ - [ - 99.81695288700004, - 6.176527626000151 - ], - [ - 99.80559648300002, - 6.171792982000085 - ], - [ - 99.78952269900006, - 6.185875956000118 - ], - [ - 99.78405904600007, - 6.201118998000112 - ], - [ - 99.77471042300007, - 6.204017199000106 - ], - [ - 99.7672344160002, - 6.223804251000118 - ], - [ - 99.78629161100011, - 6.241822148000111 - ], - [ - 99.80044244900009, - 6.272811332000089 - ], - [ - 99.82392178600017, - 6.282135856000139 - ], - [ - 99.83697849400019, - 6.294227056000125 - ], - [ - 99.83978225000007, - 6.277297115000167 - ], - [ - 99.832317974, - 6.268914560000084 - ], - [ - 99.82485877300016, - 6.257720434000149 - ], - [ - 99.82496178500006, - 6.245591539000159 - ], - [ - 99.82325280000006, - 6.239081122000158 - ], - [ - 99.82381200400002, - 6.22286747700015 - ], - [ - 99.83023316600011, - 6.205753451000149 - ], - [ - 99.82642783100013, - 6.190674611000148 - ], - [ - 99.81695288700004, - 6.176527626000151 - ] - ] - ], - [ - [ - [ - 99.86646569100006, - 6.429673570000162 - ], - [ - 99.8782658210001, - 6.419745184000149 - ], - [ - 99.89893639400012, - 6.410345770000134 - ], - [ - 99.89759415000017, - 6.402046953000138 - ], - [ - 99.90479576900006, - 6.397772528000147 - ], - [ - 99.91334069100017, - 6.3902041690001 - ], - [ - 99.90903044100017, - 6.378067794000103 - ], - [ - 99.90061659800003, - 6.364303784000171 - ], - [ - 99.91086526100017, - 6.348726301000127 - ], - [ - 99.91447663800008, - 6.339711457000121 - ], - [ - 99.91627037900011, - 6.331529039000173 - ], - [ - 99.90610298600004, - 6.32606739100008 - ], - [ - 99.89169428400007, - 6.321944661000117 - ], - [ - 99.88316172000012, - 6.312731168000113 - ], - [ - 99.8705080560002, - 6.304923615000092 - ], - [ - 99.86569178000016, - 6.290526604000192 - ], - [ - 99.849417945, - 6.300711598000106 - ], - [ - 99.84458594200007, - 6.324685901000095 - ], - [ - 99.82533255000007, - 6.324098670000168 - ], - [ - 99.80730692400007, - 6.317532434000086 - ], - [ - 99.79177021900009, - 6.298457169000173 - ], - [ - 99.77803186100007, - 6.282972726000182 - ], - [ - 99.76166422200012, - 6.282842796000097 - ], - [ - 99.7489492930001, - 6.270182652000102 - ], - [ - 99.73667266600015, - 6.264571008000132 - ], - [ - 99.72873460300016, - 6.261475800000184 - ], - [ - 99.71545779600015, - 6.310057516000143 - ], - [ - 99.72213222700012, - 6.32748349900011 - ], - [ - 99.7190436920001, - 6.353230673000141 - ], - [ - 99.70280726000007, - 6.35862542400011 - ], - [ - 99.67683825200007, - 6.363973760000135 - ], - [ - 99.65870201900012, - 6.362616278000175 - ], - [ - 99.65007571700019, - 6.376695054000123 - ], - [ - 99.64600670700005, - 6.394191799000083 - ], - [ - 99.64522806000011, - 6.435840878000178 - ], - [ - 99.66944363000019, - 6.426886127000088 - ], - [ - 99.68875121300002, - 6.435305316000097 - ], - [ - 99.72137140400011, - 6.434151632000123 - ], - [ - 99.73647816000002, - 6.423983516000177 - ], - [ - 99.77092667200006, - 6.419841624000142 - ], - [ - 99.7859962410001, - 6.422854432000108 - ], - [ - 99.80224884300017, - 6.436050476000119 - ], - [ - 99.81429161100002, - 6.454036660000071 - ], - [ - 99.82395070300007, - 6.454645857000116 - ], - [ - 99.83920332100016, - 6.454820054000137 - ], - [ - 99.83448326900006, - 6.463283596000082 - ], - [ - 99.83277428500006, - 6.470851955000128 - ], - [ - 99.84202909600018, - 6.469639039000143 - ], - [ - 99.85108483200011, - 6.46564362200013 - ], - [ - 99.85889733200011, - 6.443793036000102 - ], - [ - 99.86646569100006, - 6.429673570000162 - ] - ] - ], - [ - [ - [ - 100.21236332200007, - 6.689179383000138 - ], - [ - 100.22750451700009, - 6.688869324000152 - ], - [ - 100.22750451700009, - 6.6908330280001 - ], - [ - 100.2426457120001, - 6.700263977000148 - ], - [ - 100.25174076400006, - 6.701090801000177 - ], - [ - 100.26331628400007, - 6.700005595000093 - ], - [ - 100.27396163000017, - 6.696259053000162 - ], - [ - 100.28078291900013, - 6.688921000000164 - ], - [ - 100.31788659700013, - 6.57670562800017 - ], - [ - 100.3292037350001, - 6.557766215000129 - ], - [ - 100.3487891030002, - 6.540609639000166 - ], - [ - 100.37765899000007, - 6.526754413000148 - ], - [ - 100.38739139900011, - 6.522083639000144 - ], - [ - 100.40966394000006, - 6.515262349000182 - ], - [ - 100.42651045700015, - 6.513892925000121 - ], - [ - 100.45234867400004, - 6.516864319000206 - ], - [ - 100.4672314860002, - 6.513221131000137 - ], - [ - 100.49916752200008, - 6.490302633000113 - ], - [ - 100.51740930200006, - 6.481905213000118 - ], - [ - 100.57843916800013, - 6.46425771100013 - ], - [ - 100.61264896700013, - 6.449168193000133 - ], - [ - 100.63068404100014, - 6.444775696000136 - ], - [ - 100.64840905700012, - 6.447152812000169 - ], - [ - 100.71284956900016, - 6.493041484000145 - ], - [ - 100.7299544680001, - 6.4931965130001 - ], - [ - 100.73150476100008, - 6.487021179000109 - ], - [ - 100.73119470200012, - 6.464722799000157 - ], - [ - 100.73388187700007, - 6.456377055000175 - ], - [ - 100.74230513500007, - 6.450124207000087 - ], - [ - 100.75160689400016, - 6.448806457000131 - ], - [ - 100.76189050400015, - 6.448961487000162 - ], - [ - 100.77325931800007, - 6.447307841000125 - ], - [ - 100.79630700700014, - 6.433949484000095 - ], - [ - 100.80560876500013, - 6.414803365000182 - ], - [ - 100.80845096900012, - 6.367261048000074 - ], - [ - 100.81072473200001, - 6.355763041000145 - ], - [ - 100.81516890500015, - 6.344833476000176 - ], - [ - 100.8271061610001, - 6.324550477000159 - ], - [ - 100.82901818900021, - 6.316256409000118 - ], - [ - 100.82689945500013, - 6.307058004000112 - ], - [ - 100.82373221800017, - 6.29860427300018 - ], - [ - 100.82338545800005, - 6.297678731000161 - ], - [ - 100.82152510600017, - 6.288764547000142 - ], - [ - 100.82214522400014, - 6.259877422000102 - ], - [ - 100.8245740150002, - 6.251480001000118 - ], - [ - 100.83299727400018, - 6.236674703000091 - ], - [ - 100.83733809400016, - 6.23719146700013 - ], - [ - 100.84281579600022, - 6.243935242000163 - ], - [ - 100.85511478700019, - 6.247914328000149 - ], - [ - 100.86844730700014, - 6.246157328000081 - ], - [ - 100.91009851100014, - 6.235796204000152 - ], - [ - 100.92890873200022, - 6.24062795000016 - ], - [ - 100.95516036000018, - 6.268636576000176 - ], - [ - 100.97428064000005, - 6.272615662000149 - ], - [ - 101.00647505700013, - 6.246364034000123 - ], - [ - 101.02306319200014, - 6.240989685000159 - ], - [ - 101.06895186400018, - 6.250859883000146 - ], - [ - 101.08166426600016, - 6.246467387000152 - ], - [ - 101.08827884900015, - 6.233522441000133 - ], - [ - 101.0910177000001, - 6.213161926000112 - ], - [ - 101.08915734900009, - 6.188848165000195 - ], - [ - 101.0800106200002, - 6.180347392000087 - ], - [ - 101.0668848070002, - 6.174327088000155 - ], - [ - 101.0534489340001, - 6.157609761000117 - ], - [ - 101.05251875900015, - 6.13456207300014 - ], - [ - 101.06853845200007, - 6.119550069000169 - ], - [ - 101.08714196800005, - 6.10559743300017 - ], - [ - 101.0942733150001, - 6.085753683000178 - ], - [ - 101.08900232000022, - 6.046608785000146 - ], - [ - 101.08745202700013, - 5.989687195000087 - ], - [ - 101.08042403200008, - 5.957027690000118 - ], - [ - 101.07877038600006, - 5.938165792000177 - ], - [ - 101.07112227400009, - 5.919846497000108 - ], - [ - 101.05293217000022, - 5.913102722000176 - ], - [ - 101.0318481850002, - 5.908916931000135 - ], - [ - 101.01531172700012, - 5.898349101000164 - ], - [ - 100.97428064000005, - 5.815305075000197 - ], - [ - 100.96771773300011, - 5.804117126000165 - ], - [ - 100.96528894000014, - 5.792412415000172 - ], - [ - 100.96720096800007, - 5.781017762000175 - ], - [ - 100.97242665500008, - 5.772852627000148 - ], - [ - 100.98001672400014, - 5.760993144000139 - ], - [ - 100.99174727400012, - 5.73748036700016 - ], - [ - 100.99862023900019, - 5.729548035000107 - ], - [ - 101.00838708500012, - 5.725672302000149 - ], - [ - 101.02740401200012, - 5.726550802000176 - ], - [ - 101.03732588700021, - 5.724587097000153 - ], - [ - 101.05980513500012, - 5.709575094000172 - ], - [ - 101.07877038600006, - 5.687767640000146 - ], - [ - 101.09396325700018, - 5.662652893000129 - ], - [ - 101.10543542600013, - 5.637641500000129 - ], - [ - 101.12217858900007, - 5.62989003500013 - ], - [ - 101.14998050900013, - 5.638649190000194 - ], - [ - 101.19685103400016, - 5.666812846000155 - ], - [ - 101.21230228700014, - 5.681514791000154 - ], - [ - 101.22501469000011, - 5.699213969000155 - ], - [ - 101.23359297700014, - 5.719419454000146 - ], - [ - 101.23664188700016, - 5.7416661580001 - ], - [ - 101.24899255400013, - 5.786986389000106 - ], - [ - 101.27968835500016, - 5.803031921000169 - ], - [ - 101.3189624440001, - 5.810085755000088 - ], - [ - 101.3575647380002, - 5.828405050000157 - ], - [ - 101.39265303600015, - 5.851091004000125 - ], - [ - 101.50020142500009, - 5.892693601000119 - ], - [ - 101.53465987100006, - 5.906023051000147 - ], - [ - 101.55791426600015, - 5.9113457240001 - ], - [ - 101.57930831000007, - 5.90633310900013 - ], - [ - 101.59512129800007, - 5.885352478000129 - ], - [ - 101.59977217600013, - 5.874061178000161 - ], - [ - 101.6051465250001, - 5.866103007000106 - ], - [ - 101.6128979900001, - 5.86134877500011 - ], - [ - 101.62457686400015, - 5.859410909000175 - ], - [ - 101.63408532700007, - 5.855586853000148 - ], - [ - 101.63439538600014, - 5.847344462000194 - ], - [ - 101.63129480000006, - 5.837370911000107 - ], - [ - 101.63077803600007, - 5.828405050000157 - ], - [ - 101.65036340400016, - 5.782645569000124 - ], - [ - 101.6659180090002, - 5.765592346000105 - ], - [ - 101.68669193600013, - 5.761199849000192 - ], - [ - 101.6966138110001, - 5.766264140000175 - ], - [ - 101.69756670000018, - 5.767138300000113 - ], - [ - 101.71475223800016, - 5.782903951000108 - ], - [ - 101.72679284700021, - 5.786469625000166 - ], - [ - 101.74002201400006, - 5.782361349000155 - ], - [ - 101.74787683100007, - 5.772387797000135 - ], - [ - 101.75418135600009, - 5.760269674000142 - ], - [ - 101.76286299700021, - 5.749546814000141 - ], - [ - 101.78415368600022, - 5.738100484000128 - ], - [ - 101.80048343900015, - 5.739909159000206 - ], - [ - 101.81226566600006, - 5.752544047000143 - ], - [ - 101.82022383600022, - 5.7737313840002 - ], - [ - 101.82549483300014, - 5.779829203000162 - ], - [ - 101.85474369300019, - 5.797657573000109 - ], - [ - 101.86084151200006, - 5.806494242000113 - ], - [ - 101.8642521570001, - 5.815408427000136 - ], - [ - 101.86921309400012, - 5.823857524000132 - ], - [ - 101.88032352800016, - 5.831040548000175 - ], - [ - 101.9129313560002, - 5.859307556000161 - ], - [ - 101.91928755700022, - 5.897573955000155 - ], - [ - 101.91975264500016, - 5.940258687000153 - ], - [ - 101.93473881000014, - 5.981729024000117 - ], - [ - 101.95938846900006, - 6.011598002000142 - ], - [ - 102.03344079600006, - 6.068390402000162 - ], - [ - 102.06000248200004, - 6.09479705800014 - ], - [ - 102.07126794400014, - 6.126655579000101 - ], - [ - 102.06665583400016, - 6.204748336000122 - ], - [ - 102.07311375502772, - 6.257496632543237 - ], - [ - 102.09864342500006, - 6.239081122000158 - ], - [ - 102.15211022200018, - 6.203192450000174 - ], - [ - 102.16358483200005, - 6.197495835000097 - ], - [ - 102.18702233200011, - 6.203436591000113 - ], - [ - 102.19166100400011, - 6.215073960000126 - ], - [ - 102.18311608200011, - 6.223049221000082 - ], - [ - 102.1668400400001, - 6.217962958000058 - ], - [ - 102.1780705090001, - 6.233628648000135 - ], - [ - 102.1995548840001, - 6.232814846000124 - ], - [ - 102.31568444100006, - 6.190375067000133 - ], - [ - 102.33814537900011, - 6.176988023000135 - ], - [ - 102.37989342500006, - 6.132961330000128 - ], - [ - 102.4998478520001, - 5.897406317000133 - ], - [ - 102.52076256600017, - 5.871730861000088 - ], - [ - 102.54200280000006, - 5.854763088000112 - ], - [ - 102.55046634200019, - 5.848049221000153 - ], - [ - 102.60328209700018, - 5.815375067000119 - ], - [ - 102.62631269600016, - 5.797186591000127 - ], - [ - 102.64600670700011, - 5.772935289000145 - ], - [ - 102.65902754000015, - 5.740545966000141 - ], - [ - 102.669200066, - 5.725002346000139 - ], - [ - 102.69646243600019, - 5.712876695000148 - ], - [ - 102.87566165500002, - 5.571437893000081 - ], - [ - 102.9181421230002, - 5.55044179900014 - ], - [ - 102.95948326900006, - 5.542059637000165 - ], - [ - 102.97559655000012, - 5.531317450000159 - ], - [ - 103.02759850400017, - 5.485500393000066 - ], - [ - 103.12029056100002, - 5.381333726000165 - ], - [ - 103.22242272200018, - 5.221136786000145 - ], - [ - 103.25733483200011, - 5.136175848000107 - ], - [ - 103.35661868600002, - 4.970404364000075 - ], - [ - 103.41529381600006, - 4.863348700000145 - ], - [ - 103.4212345710001, - 4.844142971000096 - ], - [ - 103.42505944100017, - 4.837144273000106 - ], - [ - 103.44263756600006, - 4.816595770000077 - ], - [ - 103.44800866000017, - 4.806545315000093 - ], - [ - 103.44857832100016, - 4.795070705000143 - ], - [ - 103.44117272200018, - 4.765570380000085 - ], - [ - 103.44263756600006, - 4.742824611000131 - ], - [ - 103.45248457100016, - 4.701076565000108 - ], - [ - 103.46941165500002, - 4.550034898000149 - ], - [ - 103.4681095710001, - 4.527085679000066 - ], - [ - 103.458262566, - 4.508286851000122 - ], - [ - 103.45142662900011, - 4.488470770000106 - ], - [ - 103.46371504000015, - 4.443752346000153 - ], - [ - 103.461680535, - 4.429144598000136 - ], - [ - 103.49415123800011, - 4.336615302000141 - ], - [ - 103.4964298840001, - 4.306219794000171 - ], - [ - 103.49390709700006, - 4.29531484600011 - ], - [ - 103.4803166020001, - 4.260239976000122 - ], - [ - 103.47234134200008, - 4.248236395000106 - ], - [ - 103.46583092500006, - 4.242092190000122 - ], - [ - 103.45167076900006, - 4.225165106000134 - ], - [ - 103.44800866000017, - 4.217474677000112 - ], - [ - 103.44841556100019, - 4.208807684000121 - ], - [ - 103.45484459700012, - 4.182766018000152 - ], - [ - 103.44857832100016, - 4.172430731000134 - ], - [ - 103.44280032600008, - 4.168972072000145 - ], - [ - 103.44092858200011, - 4.167873440000093 - ], - [ - 103.43279056100019, - 4.164862372000101 - ], - [ - 103.4246525400001, - 4.15916575700011 - ], - [ - 103.40398196700008, - 4.131822007000139 - ], - [ - 103.39519290500019, - 4.116278387000136 - ], - [ - 103.39405358200005, - 4.098618882000125 - ], - [ - 103.40088951900006, - 4.067328192000076 - ], - [ - 103.43799889400012, - 3.975043036000116 - ], - [ - 103.43433678500006, - 3.950018622000115 - ], - [ - 103.41163170700011, - 3.963934637000179 - ], - [ - 103.3947046230002, - 3.935003973000093 - ], - [ - 103.38404381600017, - 3.890326239000132 - ], - [ - 103.38038170700005, - 3.857489325000131 - ], - [ - 103.38135826900012, - 3.820502020000092 - ], - [ - 103.37842858200011, - 3.802435614000075 - ], - [ - 103.36101321700019, - 3.801988023000163 - ], - [ - 103.35108483200011, - 3.789211330000128 - ], - [ - 103.34278405000012, - 3.77191803600013 - ], - [ - 103.3387150400001, - 3.758205471000096 - ], - [ - 103.33961022200018, - 3.738348700000103 - ], - [ - 103.34498131600006, - 3.721584377000084 - ], - [ - 103.38355553500011, - 3.637274481000176 - ], - [ - 103.38721764400006, - 3.624741929000095 - ], - [ - 103.40455162900011, - 3.600043036000102 - ], - [ - 103.43873131600006, - 3.567816473000065 - ], - [ - 103.462168816, - 3.534125067000062 - ], - [ - 103.44800866000017, - 3.504950262000108 - ], - [ - 103.48218834700018, - 3.511786200000131 - ], - [ - 103.43336022200018, - 3.408392645000148 - ], - [ - 103.4280705090001, - 3.36717357000019 - ], - [ - 103.44450931100019, - 3.243557033000101 - ], - [ - 103.45142662900011, - 3.223781643000081 - ], - [ - 103.45606530000012, - 3.203762111000117 - ], - [ - 103.43458092500006, - 2.961818752000099 - ], - [ - 103.44117272200018, - 2.922105210000012 - ], - [ - 103.47364342500006, - 2.851019598000136 - ], - [ - 103.52019290500019, - 2.789007880000014 - ], - [ - 103.638438347, - 2.672105210000055 - ], - [ - 103.64031009200008, - 2.67129140800013 - ], - [ - 103.65211022200006, - 2.666001695000162 - ], - [ - 103.66749108200011, - 2.662909247000087 - ], - [ - 103.68506920700011, - 2.662054755000085 - ], - [ - 103.69044030000006, - 2.659125067000147 - ], - [ - 103.7054142590001, - 2.645453192000033 - ], - [ - 103.7161564460001, - 2.641546942000119 - ], - [ - 103.72584069100017, - 2.643052476000165 - ], - [ - 103.74968509200008, - 2.654608466000099 - ], - [ - 103.76514733200011, - 2.648911851000122 - ], - [ - 103.76677493600019, - 2.641750393 - ], - [ - 103.76417076900012, - 2.633246161000145 - ], - [ - 103.76710045700005, - 2.623846747000115 - ], - [ - 103.80176842500012, - 2.596869208000072 - ], - [ - 103.81397545700011, - 2.581488348000036 - ], - [ - 103.83969160200016, - 2.524847723000121 - ], - [ - 103.83106530000012, - 2.501695054000095 - ], - [ - 103.83033287900011, - 2.482367255000071 - ], - [ - 103.837657097, - 2.463812567000147 - ], - [ - 103.91138756600006, - 2.370672919000114 - ], - [ - 103.92009524800002, - 2.362616278000161 - ], - [ - 103.94206790500007, - 2.346502997000101 - ], - [ - 103.94898522200006, - 2.339911200000131 - ], - [ - 103.95337975400011, - 2.329413153000147 - ], - [ - 103.95362389400006, - 2.30947500200007 - ], - [ - 103.95582116000017, - 2.298285223000065 - ], - [ - 103.96241295700005, - 2.287298895000021 - ], - [ - 103.97999108200005, - 2.265570380000128 - ], - [ - 103.983653191, - 2.25364817900001 - ], - [ - 103.98145592500012, - 2.244330145000148 - ], - [ - 103.97169030000006, - 2.224595445000119 - ], - [ - 103.96941165500013, - 2.212713934000163 - ], - [ - 103.9764103520001, - 2.192368882000082 - ], - [ - 104.02328535200016, - 2.134466864000075 - ], - [ - 104.04883873800006, - 2.071763414000173 - ], - [ - 104.0672306650001, - 2.046820380000057 - ], - [ - 104.07886803500017, - 2.021795966000141 - ], - [ - 104.08545983200005, - 2.010972398000064 - ], - [ - 104.10645592500012, - 1.986883856000119 - ], - [ - 104.11280358200005, - 1.976141669000029 - ], - [ - 104.12086022200018, - 1.954046942000119 - ], - [ - 104.12232506600006, - 1.934637762000122 - ], - [ - 104.11963951900006, - 1.891180731000162 - ], - [ - 104.12427819100017, - 1.87055084800015 - ], - [ - 104.13542728000019, - 1.848944403000061 - ], - [ - 104.149180535, - 1.8374697940001 - ], - [ - 104.16114342500006, - 1.847072658 - ], - [ - 104.16749108200005, - 1.847072658 - ], - [ - 104.19532311300006, - 1.798732815000079 - ], - [ - 104.20427493600008, - 1.75287506700009 - ], - [ - 104.22291100400017, - 1.726874091000099 - ], - [ - 104.22803795700005, - 1.712103583000115 - ], - [ - 104.22950280000012, - 1.678290106000134 - ], - [ - 104.23536217500006, - 1.664374091000155 - ], - [ - 104.24724368600013, - 1.650539455000157 - ], - [ - 104.25521894600016, - 1.637762762000037 - ], - [ - 104.2498478520001, - 1.627346096000124 - ], - [ - 104.25652103000007, - 1.613836981000148 - ], - [ - 104.26368248800011, - 1.572170315000108 - ], - [ - 104.2840275400001, - 1.51748281500015 - ], - [ - 104.29371178500017, - 1.471584377 - ], - [ - 104.29468834700006, - 1.446519273000177 - ], - [ - 104.28785241000006, - 1.435532945000119 - ], - [ - 104.27955162900011, - 1.426459052000126 - ], - [ - 104.28239993600019, - 1.382635809000163 - ], - [ - 104.27735436300006, - 1.3673363300001 - ], - [ - 104.2395939460001, - 1.3673363300001 - ], - [ - 104.23462975400011, - 1.363999742000175 - ], - [ - 104.22413170700005, - 1.349514065000122 - ], - [ - 104.21924889400012, - 1.346177476000108 - ], - [ - 104.17408287900017, - 1.348211981000134 - ], - [ - 104.1544702480002, - 1.352280992000175 - ], - [ - 104.11402428500006, - 1.368475653000132 - ], - [ - 104.10621178500017, - 1.37518952 - ], - [ - 104.10523522200018, - 1.385402736000117 - ], - [ - 104.10596764400012, - 1.404486395000106 - ], - [ - 104.10059655000006, - 1.418850002000084 - ], - [ - 104.08863366000006, - 1.429429429000137 - ], - [ - 104.07488040500019, - 1.438706773000177 - ], - [ - 104.06495201900012, - 1.448635158000087 - ], - [ - 104.0594181650001, - 1.485337632000096 - ], - [ - 104.0862736340001, - 1.502875067000133 - ], - [ - 104.12322024800014, - 1.517523505000142 - ], - [ - 104.14763431100008, - 1.545396226000193 - ], - [ - 104.12891686300011, - 1.549709377000099 - ], - [ - 104.1111759770001, - 1.545070705000072 - ], - [ - 104.09449303500017, - 1.535223700000145 - ], - [ - 104.06080162900017, - 1.51007721600017 - ], - [ - 104.05339603000019, - 1.506293036000059 - ], - [ - 104.04981530000012, - 1.513088283000073 - ], - [ - 104.04395592500006, - 1.531195380000085 - ], - [ - 104.01221764400012, - 1.596869208000086 - ], - [ - 103.98853600400011, - 1.632391669000157 - ], - [ - 103.96599368600019, - 1.647853908000087 - ], - [ - 103.96021569100006, - 1.635809637000165 - ], - [ - 103.97038821700019, - 1.608628648000163 - ], - [ - 104.00831139400012, - 1.548732815000122 - ], - [ - 104.00863691500015, - 1.534857489000132 - ], - [ - 104.00342858200005, - 1.506903387000023 - ], - [ - 104.0057072270001, - 1.493841864000132 - ], - [ - 104.01002037900011, - 1.479478257000054 - ], - [ - 104.01246178500006, - 1.464260158000073 - ], - [ - 104.00977623800006, - 1.448635158000087 - ], - [ - 103.97445722700016, - 1.41982656500015 - ], - [ - 103.92652428500006, - 1.431708075000103 - ], - [ - 103.83969160200016, - 1.476548570000134 - ], - [ - 103.8143009770001, - 1.474514065000108 - ], - [ - 103.77409915500013, - 1.453680731000119 - ], - [ - 103.75310306100008, - 1.448635158000087 - ], - [ - 103.71265709700006, - 1.45209381700009 - ], - [ - 103.6976017590001, - 1.450628973000121 - ], - [ - 103.68140709700018, - 1.441799221000082 - ], - [ - 103.63005618600008, - 1.377427476000079 - ], - [ - 103.60010826900006, - 1.353461005000113 - ], - [ - 103.56470787900017, - 1.359849351000051 - ], - [ - 103.56275475400011, - 1.364406643000081 - ], - [ - 103.5555119150001, - 1.37474192900001 - ], - [ - 103.54786217500006, - 1.382066148000192 - ], - [ - 103.544200066, - 1.377183335000041 - ], - [ - 103.5452580090001, - 1.365952867000118 - ], - [ - 103.55005944100017, - 1.351060289000159 - ], - [ - 103.55103600400011, - 1.342840887000165 - ], - [ - 103.54851321700014, - 1.331691799000154 - ], - [ - 103.53052819100017, - 1.305243231000162 - ], - [ - 103.51636803500017, - 1.270453192000119 - ], - [ - 103.5040796230002, - 1.289943752000113 - ], - [ - 103.46900475400011, - 1.319973049000069 - ], - [ - 103.45484459700012, - 1.339422919000157 - ], - [ - 103.44629967500006, - 1.359320380000071 - ], - [ - 103.41391035200016, - 1.467840887000136 - ], - [ - 103.39535566500015, - 1.506415106000034 - ], - [ - 103.36736087300002, - 1.538397528000033 - ], - [ - 103.32504316500015, - 1.565334377000084 - ], - [ - 103.20606530000006, - 1.61041901200015 - ], - [ - 103.03711998800006, - 1.715521552000041 - ], - [ - 102.99634850400011, - 1.734930731000048 - ], - [ - 102.97413170700005, - 1.74115631700009 - ], - [ - 102.95118248800006, - 1.743394273000163 - ], - [ - 102.93458092500012, - 1.747544664000031 - ], - [ - 102.92318769600016, - 1.757879950000117 - ], - [ - 102.90674889400006, - 1.784369208000101 - ], - [ - 102.887461785, - 1.807114976000122 - ], - [ - 102.8636173840001, - 1.82778554900014 - ], - [ - 102.83562259200019, - 1.845648505000028 - ], - [ - 102.804453972, - 1.860093492000161 - ], - [ - 102.7884220710001, - 1.854193427000126 - ], - [ - 102.73878014400012, - 1.846625067 - ], - [ - 102.72185306100002, - 1.847072658 - ], - [ - 102.69939212300002, - 1.859442450000117 - ], - [ - 102.68620853000019, - 1.87905508 - ], - [ - 102.66716556100019, - 1.921576239000132 - ], - [ - 102.65064537900011, - 1.940904039000159 - ], - [ - 102.56885826900006, - 2.006415106000105 - ], - [ - 102.55762780000006, - 2.018744208000058 - ], - [ - 102.55046634200019, - 2.03143952000012 - ], - [ - 102.55909264400012, - 2.033189195000105 - ], - [ - 102.560313347, - 2.036444403000147 - ], - [ - 102.55827884200019, - 2.040594794000015 - ], - [ - 102.55730228000013, - 2.045111395000063 - ], - [ - 102.54468834700006, - 2.057684637000136 - ], - [ - 102.52686608200005, - 2.070868231000091 - ], - [ - 102.489024285, - 2.092922268000095 - ], - [ - 102.34864342500012, - 2.149969794000086 - ], - [ - 102.18799889400006, - 2.216376044000114 - ], - [ - 102.15430748800006, - 2.235663153000147 - ], - [ - 102.12696373800011, - 2.257310289000145 - ], - [ - 102.05128014400012, - 2.340887762000108 - ], - [ - 102.04029381600017, - 2.346136786000088 - ], - [ - 102.01872806100008, - 2.350409247000016 - ], - [ - 101.99903405000012, - 2.361639716000099 - ], - [ - 101.98707116000017, - 2.377142645000106 - ], - [ - 101.98878014400006, - 2.394517320000176 - ], - [ - 101.97217858200011, - 2.398586330000143 - ], - [ - 101.95622806100013, - 2.404771226000122 - ], - [ - 101.92676842500012, - 2.422430731000134 - ], - [ - 101.90919030000012, - 2.410793361000117 - ], - [ - 101.87745201900006, - 2.408840236000074 - ], - [ - 101.86524498800006, - 2.394517320000176 - ], - [ - 101.85816491, - 2.419419664000131 - ], - [ - 101.85621178500017, - 2.451361395000049 - ], - [ - 101.85108483200005, - 2.478949286000145 - ], - [ - 101.83423912900017, - 2.490708726000122 - ], - [ - 101.82740319100006, - 2.494126695000134 - ], - [ - 101.81771894600016, - 2.502183335000083 - ], - [ - 101.80323326900012, - 2.518011786000116 - ], - [ - 101.7830509770001, - 2.575873114000117 - ], - [ - 101.77442467500006, - 2.586574611000145 - ], - [ - 101.76099694100012, - 2.592108466000155 - ], - [ - 101.71338951900012, - 2.596584377000042 - ], - [ - 101.70093834700018, - 2.604152736000074 - ], - [ - 101.69092858200011, - 2.614894924000097 - ], - [ - 101.67351321700002, - 2.627264716000042 - ], - [ - 101.61833743600019, - 2.636908270000092 - ], - [ - 101.59791100400011, - 2.646307684000035 - ], - [ - 101.56421959700006, - 2.652004299000097 - ], - [ - 101.5423283210001, - 2.661281643000066 - ], - [ - 101.50277754000015, - 2.689398505000142 - ], - [ - 101.47966556100019, - 2.716986395000063 - ], - [ - 101.43018639400006, - 2.792466539000102 - ], - [ - 101.39918053500006, - 2.819077867000132 - ], - [ - 101.35515384200014, - 2.829250393000081 - ], - [ - 101.31055748800006, - 2.833563544000086 - ], - [ - 101.28638756600006, - 2.849676825000145 - ], - [ - 101.30347741000017, - 2.894842841000099 - ], - [ - 101.28101647200018, - 2.897853908000101 - ], - [ - 101.2830509770001, - 2.911200262000122 - ], - [ - 101.33277428500011, - 2.972357489000075 - ], - [ - 101.34717858200005, - 2.985500393000038 - ], - [ - 101.36158287900011, - 2.991034247000144 - ], - [ - 101.37281334700006, - 3.002346096000039 - ], - [ - 101.37281334700006, - 3.02830638200011 - ], - [ - 101.36500084700006, - 3.076361395000092 - ], - [ - 101.35857181100002, - 3.089260158000116 - ], - [ - 101.32984459700018, - 3.111761786000102 - ], - [ - 101.32341556100008, - 3.124457098000065 - ], - [ - 101.30347741000017, - 3.25482819200009 - ], - [ - 101.29761803500006, - 3.274603583000115 - ], - [ - 101.28321373800006, - 3.290838934000149 - ], - [ - 101.2488712900001, - 3.319973049000112 - ], - [ - 101.24488366000006, - 3.32758209800015 - ], - [ - 101.24146569100006, - 3.33661530200007 - ], - [ - 101.23568769600016, - 3.344142971000039 - ], - [ - 101.215586785, - 3.349188544000157 - ], - [ - 101.20573978000019, - 3.353827216000084 - ], - [ - 101.1976017590001, - 3.359320380000028 - ], - [ - 101.19418379000015, - 3.364081122000115 - ], - [ - 101.18718509200019, - 3.38019440300009 - ], - [ - 101.13965905000006, - 3.442857164000088 - ], - [ - 101.10840905000012, - 3.473944403000175 - ], - [ - 101.10222415500007, - 3.482896226000108 - ], - [ - 101.09400475400017, - 3.505804755000028 - ], - [ - 101.07422936300006, - 3.534409898000177 - ], - [ - 101.06446373800011, - 3.579046942000062 - ], - [ - 101.05713951900006, - 3.60053131700009 - ], - [ - 101.04053795700005, - 3.621975002000042 - ], - [ - 100.96794681100002, - 3.672064520000049 - ], - [ - 100.94336998800011, - 3.682603257000096 - ], - [ - 100.93360436300006, - 3.689276434000064 - ], - [ - 100.92798912900017, - 3.696600653000147 - ], - [ - 100.9124455090001, - 3.724066473000107 - ], - [ - 100.88648522200018, - 3.756333726000136 - ], - [ - 100.86963951900006, - 3.768011786000045 - ], - [ - 100.82292728000019, - 3.77606842700007 - ], - [ - 100.81226647200006, - 3.78656647300005 - ], - [ - 100.81324303500006, - 3.80377838700015 - ], - [ - 100.82374108200011, - 3.827093817000062 - ], - [ - 100.84156334700018, - 3.843736070000105 - ], - [ - 100.84538821700019, - 3.851263739000075 - ], - [ - 100.83399498800011, - 3.854396877000141 - ], - [ - 100.81177819100017, - 3.851223049000083 - ], - [ - 100.80054772200018, - 3.847805080000157 - ], - [ - 100.79590905000006, - 3.843817450000088 - ], - [ - 100.78484134200019, - 3.839341539000131 - ], - [ - 100.76010175900015, - 3.847154039000117 - ], - [ - 100.73462975400011, - 3.859442450000174 - ], - [ - 100.72071373800006, - 3.868068752000084 - ], - [ - 100.70948326900006, - 3.883042710000112 - ], - [ - 100.70337975400017, - 3.898871161000145 - ], - [ - 100.70069420700005, - 3.917222398000192 - ], - [ - 100.70118248800006, - 3.96723053600013 - ], - [ - 100.70630944100017, - 3.983587958000143 - ], - [ - 100.71876061300011, - 3.99087148600016 - ], - [ - 100.78174889400012, - 3.988023179000123 - ], - [ - 100.80152428500006, - 3.991115627000099 - ], - [ - 100.81739342500006, - 4.010809637000136 - ], - [ - 100.83464603000019, - 4.018540757000068 - ], - [ - 100.85499108200005, - 4.022162177000112 - ], - [ - 100.87142988400015, - 4.018866278000175 - ], - [ - 100.86150149800008, - 4.040350653000104 - ], - [ - 100.83814537900017, - 4.037990627000156 - ], - [ - 100.8143009770001, - 4.026068427000112 - ], - [ - 100.80323326900006, - 4.018866278000175 - ], - [ - 100.77759850400017, - 4.021389065000093 - ], - [ - 100.77295983200005, - 4.037014065000079 - ], - [ - 100.7767033210001, - 4.060532945000134 - ], - [ - 100.77605228000002, - 4.086493231000134 - ], - [ - 100.76587975400011, - 4.09983958500014 - ], - [ - 100.71387780000012, - 4.13495514500012 - ], - [ - 100.69752037900011, - 4.150864976000136 - ], - [ - 100.67774498800011, - 4.165187893000123 - ], - [ - 100.65552819100006, - 4.169501044000114 - ], - [ - 100.63257897200006, - 4.155462958000072 - ], - [ - 100.62256920700005, - 4.175848700000145 - ], - [ - 100.61304772200006, - 4.208400783000116 - ], - [ - 100.60889733200011, - 4.238430080000157 - ], - [ - 100.61524498800006, - 4.251654364000103 - ], - [ - 100.60027103000013, - 4.256537177000084 - ], - [ - 100.59571373800006, - 4.268744208000143 - ], - [ - 100.59498131600006, - 4.284409898000121 - ], - [ - 100.59099368600008, - 4.300034898000106 - ], - [ - 100.57960045700011, - 4.311224677000126 - ], - [ - 100.5696720710001, - 4.313381252000127 - ], - [ - 100.56544030000006, - 4.319159247000172 - ], - [ - 100.57056725400011, - 4.341009833000129 - ], - [ - 100.57984459700006, - 4.366441148000135 - ], - [ - 100.58301842500012, - 4.380072333000086 - ], - [ - 100.58423912900011, - 4.399074611000088 - ], - [ - 100.58855228000002, - 4.412258205000143 - ], - [ - 100.60767662900011, - 4.426214911000116 - ], - [ - 100.61207116000017, - 4.440008856000119 - ], - [ - 100.61475670700005, - 4.467759507000096 - ], - [ - 100.63257897200006, - 4.532904364000117 - ], - [ - 100.64551842500006, - 4.560044664000131 - ], - [ - 100.6302189460001, - 4.553941148000149 - ], - [ - 100.61231530000012, - 4.558742580000143 - ], - [ - 100.59734134200019, - 4.571926174000097 - ], - [ - 100.59099368600008, - 4.590806382000125 - ], - [ - 100.59441165500007, - 4.610907294000157 - ], - [ - 100.60377037900011, - 4.629461981000162 - ], - [ - 100.61695397200006, - 4.638251044000143 - ], - [ - 100.63257897200006, - 4.629055080000157 - ], - [ - 100.63949629000015, - 4.643133856000105 - ], - [ - 100.64730879000015, - 4.65473053600013 - ], - [ - 100.6560978520001, - 4.66372304900014 - ], - [ - 100.66618899800008, - 4.669907945000119 - ], - [ - 100.64234459700018, - 4.674302476000193 - ], - [ - 100.62037194100017, - 4.666205145000077 - ], - [ - 100.60417728000013, - 4.665838934000149 - ], - [ - 100.59782962300008, - 4.693548895000134 - ], - [ - 100.59449303500006, - 4.743068752000084 - ], - [ - 100.6038517590001, - 4.756048895000077 - ], - [ - 100.63257897200006, - 4.758124091000099 - ], - [ - 100.63257897200006, - 4.765570380000085 - ], - [ - 100.62680097700016, - 4.766587632000139 - ], - [ - 100.61207116000017, - 4.772365627000099 - ], - [ - 100.61980228000019, - 4.786444403000147 - ], - [ - 100.61736087300008, - 4.792914130000142 - ], - [ - 100.59782962300008, - 4.799709377000084 - ], - [ - 100.58765709700006, - 4.800970770000092 - ], - [ - 100.58122806100002, - 4.797919012000179 - ], - [ - 100.57618248800011, - 4.799261786000088 - ], - [ - 100.57056725400011, - 4.813381252000113 - ], - [ - 100.56950931100002, - 4.827134507000125 - ], - [ - 100.577403191, - 4.843980210000126 - ], - [ - 100.577403191, - 4.85431549700013 - ], - [ - 100.57154381600017, - 4.857733466000141 - ], - [ - 100.56177819100006, - 4.858303127000113 - ], - [ - 100.55307050900015, - 4.862046617000146 - ], - [ - 100.55005944100006, - 4.875433661000145 - ], - [ - 100.5398869150001, - 4.870021877000099 - ], - [ - 100.52914472700016, - 4.867865302000098 - ], - [ - 100.50538170700005, - 4.867987372000172 - ], - [ - 100.49439537900011, - 4.872259833000086 - ], - [ - 100.49927819100017, - 4.881048895000148 - ], - [ - 100.5096134770001, - 4.888617255000099 - ], - [ - 100.51531009200008, - 4.889064846000096 - ], - [ - 100.51465905000012, - 4.902492580000086 - ], - [ - 100.51099694100017, - 4.90692780200007 - ], - [ - 100.50342858200005, - 4.910142320000119 - ], - [ - 100.49170983200005, - 4.919826565000079 - ], - [ - 100.48170006600006, - 4.924709377000141 - ], - [ - 100.47071373800011, - 4.922308661000102 - ], - [ - 100.460703972, - 4.916001695000162 - ], - [ - 100.45386803500011, - 4.908921617000189 - ], - [ - 100.44157962300002, - 4.922837632000082 - ], - [ - 100.43580162900017, - 4.936102606000105 - ], - [ - 100.43238366000017, - 4.949652411000073 - ], - [ - 100.42652428500006, - 4.964178778000118 - ], - [ - 100.40186608200005, - 4.9923363300001 - ], - [ - 100.39568118600008, - 5.013373114000132 - ], - [ - 100.3807072270001, - 5.047349351000165 - ], - [ - 100.37232506600017, - 5.061428127000113 - ], - [ - 100.36451256600017, - 5.084295966000113 - ], - [ - 100.36589603000007, - 5.092515367000118 - ], - [ - 100.36947675900015, - 5.093247789000145 - ], - [ - 100.37419681100002, - 5.091945705000143 - ], - [ - 100.37867272200012, - 5.094549872000144 - ], - [ - 100.38884524800002, - 5.105658270000077 - ], - [ - 100.40007571700008, - 5.114894924000126 - ], - [ - 100.4090275400001, - 5.126654364000117 - ], - [ - 100.41627037900011, - 5.159613348000093 - ], - [ - 100.430918816, - 5.190619208000115 - ], - [ - 100.43327884200008, - 5.211167710000055 - ], - [ - 100.43067467500006, - 5.222357489000075 - ], - [ - 100.42115319100017, - 5.242417710000126 - ], - [ - 100.41895592500006, - 5.248480536000116 - ], - [ - 100.42123457100016, - 5.260646877000099 - ], - [ - 100.43116295700005, - 5.278957424000154 - ], - [ - 100.43327884200008, - 5.29002513200011 - ], - [ - 100.4300236340001, - 5.302883205000128 - ], - [ - 100.40601647200018, - 5.348374742000189 - ], - [ - 100.38526451900006, - 5.376939195000176 - ], - [ - 100.38021894600016, - 5.390692450000103 - ], - [ - 100.37867272200012, - 5.413275458000086 - ], - [ - 100.38493899800008, - 5.499253648000177 - ], - [ - 100.37842858200005, - 5.522772528000132 - ], - [ - 100.35572350400011, - 5.562689520000106 - ], - [ - 100.35084069100006, - 5.584214585000126 - ], - [ - 100.34400475400011, - 5.669256903000132 - ], - [ - 100.35320071700019, - 5.665350653000147 - ], - [ - 100.36491946700019, - 5.662665106000162 - ], - [ - 100.37631269600016, - 5.663316148000121 - ], - [ - 100.38493899800008, - 5.669256903000132 - ], - [ - 100.38640384200019, - 5.679103908000158 - ], - [ - 100.3787541020001, - 5.68520742400014 - ], - [ - 100.36915123800011, - 5.689601955000128 - ], - [ - 100.36451256600017, - 5.694077867000189 - ], - [ - 100.37574303500017, - 5.810939846000153 - ], - [ - 100.34913170700005, - 6.012681382000068 - ], - [ - 100.340586785, - 6.02993398600016 - ], - [ - 100.32593834700012, - 6.04905833500014 - ], - [ - 100.31397545700005, - 6.070624091000155 - ], - [ - 100.29615319100012, - 6.115545966000155 - ], - [ - 100.26002037900017, - 6.180894273000135 - ], - [ - 100.24789472700016, - 6.220770575000103 - ], - [ - 100.2325952480002, - 6.236232815000122 - ], - [ - 100.19996178500017, - 6.258978583000072 - ], - [ - 100.17457116000006, - 6.290961005000071 - ], - [ - 100.15284264400006, - 6.333929755000113 - ], - [ - 100.13746178500006, - 6.38051992400014 - ], - [ - 100.13111412900011, - 6.423407294000114 - ], - [ - 100.1272892590001, - 6.442287502000141 - ], - [ - 100.13557214400007, - 6.457720643000144 - ], - [ - 100.14435713700018, - 6.479579773000182 - ], - [ - 100.14849125200007, - 6.504487814000157 - ], - [ - 100.14807784100017, - 6.513221131000137 - ], - [ - 100.14482222500013, - 6.530584412000152 - ], - [ - 100.14570072500013, - 6.539524435000175 - ], - [ - 100.15241866100004, - 6.549988912000117 - ], - [ - 100.16120365400016, - 6.557456156000143 - ], - [ - 100.16719812000011, - 6.56613779700011 - ], - [ - 100.16518273900013, - 6.580322978000154 - ], - [ - 100.15717289200003, - 6.603525696000162 - ], - [ - 100.15608768800016, - 6.620578919000195 - ], - [ - 100.16275394700008, - 6.66111908000012 - ], - [ - 100.1640458580001, - 6.683727519000158 - ], - [ - 100.16683638600009, - 6.695122172000154 - ], - [ - 100.17329593900016, - 6.703416240000195 - ], - [ - 100.18755863400011, - 6.707963766000148 - ], - [ - 100.19665368700007, - 6.702486064000155 - ], - [ - 100.19920020200013, - 6.699413639000142 - ], - [ - 100.2037850350001, - 6.693881938000118 - ], - [ - 100.21236332200007, - 6.689179383000138 - ] - ] - ], - [ - [ - [ - 117.44304446700019, - 6.635728257000082 - ], - [ - 117.412364129, - 6.634914455000157 - ], - [ - 117.38168378999998, - 6.639349677000141 - ], - [ - 117.35621178500011, - 6.64789459800015 - ], - [ - 117.34693444100006, - 6.654974677000126 - ], - [ - 117.34343509200008, - 6.663519598000136 - ], - [ - 117.34595787900017, - 6.672308661000116 - ], - [ - 117.35499108200005, - 6.679632880000113 - ], - [ - 117.36557050900004, - 6.683050848000121 - ], - [ - 117.41627037900011, - 6.685288804000109 - ], - [ - 117.43213951900012, - 6.689357815000065 - ], - [ - 117.44385826900012, - 6.698553778000132 - ], - [ - 117.44825280000006, - 6.715155341000099 - ], - [ - 117.43930097700016, - 6.723944403000161 - ], - [ - 117.40357506600006, - 6.725816148000121 - ], - [ - 117.39991295700005, - 6.739325262000108 - ], - [ - 117.41163170700005, - 6.751369533000116 - ], - [ - 117.45248457100004, - 6.75674062700007 - ], - [ - 117.46876061300023, - 6.766669012000165 - ], - [ - 117.493907097, - 6.735419012000108 - ], - [ - 117.51075280000012, - 6.704291083000115 - ], - [ - 117.50660241000017, - 6.67348867400014 - ], - [ - 117.46876061300023, - 6.643133856000162 - ], - [ - 117.44304446700019, - 6.635728257000082 - ] - ] - ], - [ - [ - [ - 116.83814537900017, - 6.962144273000135 - ], - [ - 116.85181725400005, - 6.890204169000171 - ], - [ - 116.833262566, - 6.90082428600013 - ], - [ - 116.822520379, - 6.904120184000163 - ], - [ - 116.81763756600006, - 6.900091864000103 - ], - [ - 116.81120853000002, - 6.868841864000132 - ], - [ - 116.810801629, - 6.862860419000114 - ], - [ - 116.82227623800017, - 6.852850653000132 - ], - [ - 116.83814537900017, - 6.847398179000095 - ], - [ - 116.85238691499998, - 6.838527736000145 - ], - [ - 116.85865319100006, - 6.817857164000131 - ], - [ - 116.85466556100008, - 6.778509833000129 - ], - [ - 116.84392337300002, - 6.752264716000113 - ], - [ - 116.810801629, - 6.704575914000145 - ], - [ - 116.79273522200018, - 6.669745184000107 - ], - [ - 116.77849368600019, - 6.6265322940001 - ], - [ - 116.78394616000006, - 6.591620184000178 - ], - [ - 116.82447350400005, - 6.581732489000075 - ], - [ - 116.84546959700018, - 6.592027085000097 - ], - [ - 116.86101321700019, - 6.610541083000101 - ], - [ - 116.87305748800011, - 6.628363348000079 - ], - [ - 116.88306725400011, - 6.636297919000143 - ], - [ - 116.89673912900005, - 6.642075914000102 - ], - [ - 116.94117272200006, - 6.684759833000129 - ], - [ - 116.97380618600019, - 6.708075262000136 - ], - [ - 116.98023522200012, - 6.720363674000097 - ], - [ - 116.98414147200012, - 6.754950262000179 - ], - [ - 116.98902428500017, - 6.759182033000101 - ], - [ - 116.99561608200023, - 6.761135158000144 - ], - [ - 117.00261478000002, - 6.766669012000165 - ], - [ - 117.01628665500007, - 6.793931382000068 - ], - [ - 117.05250084700018, - 6.830755927000141 - ], - [ - 117.05787194100006, - 6.845526434000121 - ], - [ - 117.05176842500023, - 6.866197007000139 - ], - [ - 117.02930748800023, - 6.909979559000107 - ], - [ - 117.03052819100017, - 6.931138414000117 - ], - [ - 117.03858483200011, - 6.942613023000149 - ], - [ - 117.04656009200008, - 6.943793036000088 - ], - [ - 117.05583743600019, - 6.940375067000076 - ], - [ - 117.06812584700006, - 6.937974351000122 - ], - [ - 117.07667076900006, - 6.94131094000015 - ], - [ - 117.08326256600006, - 6.948472398000192 - ], - [ - 117.08594811300023, - 6.955755927000112 - ], - [ - 117.08204186300023, - 6.959051825000145 - ], - [ - 117.07447350400011, - 6.963771877000156 - ], - [ - 117.07252037900005, - 6.974310614000117 - ], - [ - 117.07447350400011, - 6.98566315300009 - ], - [ - 117.07837975400011, - 6.992621161000088 - ], - [ - 117.08887780000023, - 6.994696356000105 - ], - [ - 117.10084069100017, - 6.991603908000116 - ], - [ - 117.1121525400001, - 6.98729075700011 - ], - [ - 117.11988366000017, - 6.985785223000065 - ], - [ - 117.12867272200006, - 6.99066803600013 - ], - [ - 117.14380944100006, - 7.003729559000107 - ], - [ - 117.15023847700016, - 7.003119208000143 - ], - [ - 117.15805097700016, - 6.99872467700007 - ], - [ - 117.18344160200016, - 6.987860419000171 - ], - [ - 117.19166100400017, - 6.985785223000065 - ], - [ - 117.19499759200019, - 6.981838283000087 - ], - [ - 117.24675540500002, - 6.950506903000132 - ], - [ - 117.25245201900012, - 6.945786851000122 - ], - [ - 117.25652103000007, - 6.937974351000122 - ], - [ - 117.25733483200005, - 6.92084381700009 - ], - [ - 117.25098717500023, - 6.872788804000109 - ], - [ - 117.24659264400017, - 6.862860419000114 - ], - [ - 117.23275800900015, - 6.855454820000119 - ], - [ - 117.2283634770001, - 6.838080145000148 - ], - [ - 117.23031660200004, - 6.817531643000109 - ], - [ - 117.23601321700019, - 6.800767320000176 - ], - [ - 117.27198326900006, - 6.753729559000163 - ], - [ - 117.27759850400017, - 6.735663153000147 - ], - [ - 117.28028405000018, - 6.673570054000123 - ], - [ - 117.284434441, - 6.657416083000058 - ], - [ - 117.29590905000023, - 6.636297919000143 - ], - [ - 117.30892988400004, - 6.628810940000079 - ], - [ - 117.34929446700019, - 6.630113023000163 - ], - [ - 117.36475670700011, - 6.625148830000128 - ], - [ - 117.378184441, - 6.61347077000012 - ], - [ - 117.39991295700005, - 6.588568427000098 - ], - [ - 117.42481530000012, - 6.565578518000109 - ], - [ - 117.44223066499998, - 6.553045966000113 - ], - [ - 117.45850670700011, - 6.547552802000084 - ], - [ - 117.47486412900005, - 6.551459052000084 - ], - [ - 117.48585045700011, - 6.562445380000128 - ], - [ - 117.50977623800023, - 6.602199611000131 - ], - [ - 117.52540123800023, - 6.620998440000093 - ], - [ - 117.53370201900012, - 6.621039130000085 - ], - [ - 117.53695722700016, - 6.605698960000126 - ], - [ - 117.53760826900012, - 6.578314520000063 - ], - [ - 117.54175866000006, - 6.577582098000136 - ], - [ - 117.56495201900006, - 6.554388739000103 - ], - [ - 117.56104576900006, - 6.555731512000179 - ], - [ - 117.55844160199999, - 6.55121491100013 - ], - [ - 117.55738366000006, - 6.544745184000135 - ], - [ - 117.55811608200005, - 6.540106512000108 - ], - [ - 117.561778191, - 6.538316148000121 - ], - [ - 117.57455488400015, - 6.534979559000178 - ], - [ - 117.57862389400012, - 6.533270575000174 - ], - [ - 117.59359785200016, - 6.519598700000145 - ], - [ - 117.603282097, - 6.514715887000179 - ], - [ - 117.61622155000012, - 6.512844143000109 - ], - [ - 117.6302189460001, - 6.519842841000099 - ], - [ - 117.640879754, - 6.521714585000069 - ], - [ - 117.65064537900005, - 6.516546942000147 - ], - [ - 117.67465253999998, - 6.488959052000141 - ], - [ - 117.68531334700006, - 6.473089911000116 - ], - [ - 117.69532311300011, - 6.451361395000134 - ], - [ - 117.70215905000023, - 6.451361395000134 - ], - [ - 117.70582116000017, - 6.460028387000136 - ], - [ - 117.71070397200006, - 6.46377187700007 - ], - [ - 117.71631920700017, - 6.462958075000159 - ], - [ - 117.72250410200004, - 6.458197333000072 - ], - [ - 117.72706139400006, - 6.451157945000176 - ], - [ - 117.72828209700018, - 6.443670966000127 - ], - [ - 117.72820071700019, - 6.434759833000086 - ], - [ - 117.72950280000012, - 6.423407294000114 - ], - [ - 117.73275800900015, - 6.414129950000159 - ], - [ - 117.741953972, - 6.396714585000097 - ], - [ - 117.74382571700019, - 6.389878648000163 - ], - [ - 117.74000084700018, - 6.380560614000132 - ], - [ - 117.73308353000007, - 6.371568101000193 - ], - [ - 117.72852623800023, - 6.362372137000136 - ], - [ - 117.73878014400023, - 6.335679429000109 - ], - [ - 117.72950280000012, - 6.269476630000128 - ], - [ - 117.72299238400004, - 6.254624742000161 - ], - [ - 117.70801842500006, - 6.252875067000076 - ], - [ - 117.67481530000023, - 6.258978583000072 - ], - [ - 117.65626061300023, - 6.252752997000101 - ], - [ - 117.63819420700023, - 6.24062734600011 - ], - [ - 117.60922285200004, - 6.214829820000176 - ], - [ - 117.60035241000011, - 6.197821356000119 - ], - [ - 117.60564212300008, - 6.18183014500012 - ], - [ - 117.6271264980002, - 6.156480210000083 - ], - [ - 117.64332116000006, - 6.117499091000113 - ], - [ - 117.65788821700008, - 6.111273505000142 - ], - [ - 117.66114342500012, - 6.105617580000157 - ], - [ - 117.66260826900006, - 6.095770575000131 - ], - [ - 117.66521243600019, - 6.088202216000084 - ], - [ - 117.66553795700011, - 6.079901434000107 - ], - [ - 117.66114342500012, - 6.067775783000116 - ], - [ - 117.65284264400023, - 6.059312242000161 - ], - [ - 117.64356530000006, - 6.056301174000069 - ], - [ - 117.63607832100004, - 6.051947333000086 - ], - [ - 117.63331139400017, - 6.039862372000172 - ], - [ - 117.63990319100006, - 6.023423570000176 - ], - [ - 117.65414472700004, - 6.019761460000126 - ], - [ - 117.66830488400015, - 6.013413804000095 - ], - [ - 117.67481530000023, - 5.988959052000055 - ], - [ - 117.66895592500012, - 5.972642320000134 - ], - [ - 117.65463300900004, - 5.958685614000061 - ], - [ - 117.61963951900023, - 5.937445380000085 - ], - [ - 117.49284915500007, - 5.894680080000072 - ], - [ - 117.46876061300023, - 5.868557033000116 - ], - [ - 117.48650149800002, - 5.871771552000084 - ], - [ - 117.54379316499998, - 5.896429755000071 - ], - [ - 117.56934655000018, - 5.902899481000162 - ], - [ - 117.64014733200005, - 5.90326569200009 - ], - [ - 117.70704186300011, - 5.911607164000145 - ], - [ - 117.75660241000006, - 5.906154690000122 - ], - [ - 117.77426191500015, - 5.908026434000178 - ], - [ - 117.78028405000023, - 5.919419664000145 - ], - [ - 117.77165774800002, - 5.94428131700009 - ], - [ - 117.78223717500012, - 5.950628973000121 - ], - [ - 117.79265384200019, - 5.950018622000158 - ], - [ - 117.80445397200006, - 5.946478583000086 - ], - [ - 117.81885826900012, - 5.94428131700009 - ], - [ - 117.83659915500002, - 5.945502020000106 - ], - [ - 117.88404381600006, - 5.9546572940001 - ], - [ - 117.89389082100016, - 5.961330471000139 - ], - [ - 117.90007571700002, - 5.973944403000132 - ], - [ - 117.91391035200004, - 5.986476955000128 - ], - [ - 117.94109134200002, - 6.005682684000178 - ], - [ - 117.97364342500012, - 6.047756252000141 - ], - [ - 117.99138431100019, - 6.056789455000157 - ], - [ - 117.99545332100016, - 6.061712958000115 - ], - [ - 118.00261478000019, - 6.064601955000143 - ], - [ - 118.016856316, - 6.060980536000088 - ], - [ - 118.0509546230002, - 6.02619049700013 - ], - [ - 118.05323326900006, - 6.016302802000126 - ], - [ - 118.05250084700006, - 6.005316473000079 - ], - [ - 118.05372155000006, - 5.99632396000014 - ], - [ - 118.07097415500019, - 5.987372137000122 - ], - [ - 118.0735783210001, - 5.975287177000112 - ], - [ - 118.07203209700006, - 5.954779364000075 - ], - [ - 118.07715905000023, - 5.931586005000128 - ], - [ - 118.11898847700016, - 5.875392971000139 - ], - [ - 118.12452233200011, - 5.870347398000192 - ], - [ - 118.12517337300002, - 5.863918361000088 - ], - [ - 118.095957879, - 5.824164130000099 - ], - [ - 118.08106530000023, - 5.815375067000119 - ], - [ - 118.05884850400017, - 5.80898672100011 - ], - [ - 118.035411004, - 5.807766018000095 - ], - [ - 118.016856316, - 5.814520575000117 - ], - [ - 118.00001061300011, - 5.80898672100011 - ], - [ - 117.93799889400023, - 5.814520575000117 - ], - [ - 117.92115319100006, - 5.809027411000102 - ], - [ - 117.91041100400005, - 5.796861070000105 - ], - [ - 117.90845787900011, - 5.784654039000131 - ], - [ - 117.91773522200006, - 5.779201565000093 - ], - [ - 117.92204837300002, - 5.771714585000126 - ], - [ - 117.95199629000004, - 5.694077867000189 - ], - [ - 117.96029707099999, - 5.687160549000097 - ], - [ - 117.96485436300023, - 5.686224677000112 - ], - [ - 117.97055097700004, - 5.688544012000165 - ], - [ - 117.982676629, - 5.691066799000097 - ], - [ - 117.99805748800023, - 5.69594961100016 - ], - [ - 118.03785241000006, - 5.714300848000121 - ], - [ - 118.05469811300023, - 5.718329169000171 - ], - [ - 118.06275475400017, - 5.716620184000178 - ], - [ - 118.06959069100012, - 5.707993882000082 - ], - [ - 118.07886803500006, - 5.704657294000143 - ], - [ - 118.08659915500007, - 5.706366278000147 - ], - [ - 118.09620201900023, - 5.7105166690001 - ], - [ - 118.10661868600002, - 5.712591864000117 - ], - [ - 118.11646569100006, - 5.70807526200015 - ], - [ - 118.12671959700018, - 5.69354889500012 - ], - [ - 118.13404381600017, - 5.68964264500012 - ], - [ - 118.14372806100002, - 5.694077867000189 - ], - [ - 118.15154056100002, - 5.705145575000131 - ], - [ - 118.151621941, - 5.714097398000163 - ], - [ - 118.14714603000007, - 5.724554755000142 - ], - [ - 118.15381920700011, - 5.742132880000085 - ], - [ - 118.15821373800011, - 5.749009507000082 - ], - [ - 118.16456139400012, - 5.756170966000127 - ], - [ - 118.16724694100012, - 5.764390367000118 - ], - [ - 118.15935306100002, - 5.782782294000157 - ], - [ - 118.16081790500019, - 5.793402411000116 - ], - [ - 118.17628014400012, - 5.805161851000179 - ], - [ - 118.22095787900017, - 5.809556382000082 - ], - [ - 118.26221764400012, - 5.827866929000137 - ], - [ - 118.28370201900023, - 5.82322825700011 - ], - [ - 118.33578535199999, - 5.795843817000147 - ], - [ - 118.34066816500015, - 5.794256903000118 - ], - [ - 118.34571373800011, - 5.798407294000143 - ], - [ - 118.35670006600006, - 5.810777085000097 - ], - [ - 118.36524498800006, - 5.81378815300009 - ], - [ - 118.37533613400015, - 5.809881903000104 - ], - [ - 118.384532097, - 5.803941148000163 - ], - [ - 118.39079837300008, - 5.800930080000157 - ], - [ - 118.41065514400006, - 5.796128648000177 - ], - [ - 118.5130314460001, - 5.736761786000116 - ], - [ - 118.54810631600006, - 5.70807526200015 - ], - [ - 118.5618595710001, - 5.699774481000176 - ], - [ - 118.57927493600008, - 5.691717841000141 - ], - [ - 118.59400475400005, - 5.682074286000073 - ], - [ - 118.59961998800023, - 5.669256903000132 - ], - [ - 118.59595787900017, - 5.659369208000129 - ], - [ - 118.58863366000017, - 5.653631903000147 - ], - [ - 118.58171634200008, - 5.6499697940001 - ], - [ - 118.57846113400004, - 5.646307684000149 - ], - [ - 118.56869550899998, - 5.589544989000089 - ], - [ - 118.56202233200023, - 5.568019924000069 - ], - [ - 118.55884850400017, - 5.546861070000162 - ], - [ - 118.56544030000023, - 5.525946356000105 - ], - [ - 118.57227623800006, - 5.525946356000105 - ], - [ - 118.58220462300008, - 5.551336981000134 - ], - [ - 118.58838951900023, - 5.562689520000106 - ], - [ - 118.59595787900017, - 5.571234442000119 - ], - [ - 118.60059655000012, - 5.581284898000192 - ], - [ - 118.59896894599999, - 5.607977606000119 - ], - [ - 118.60303795700023, - 5.618719794000128 - ], - [ - 118.62907962300014, - 5.636623440000093 - ], - [ - 118.65105228000002, - 5.636419989000132 - ], - [ - 118.67025800899998, - 5.623032945000134 - ], - [ - 118.71729576900012, - 5.565822658000087 - ], - [ - 118.73658287900005, - 5.547837632000139 - ], - [ - 118.75391686300023, - 5.540187893000109 - ], - [ - 118.78028405000012, - 5.535345770000134 - ], - [ - 118.80005944100006, - 5.522121486000088 - ], - [ - 118.81299889400023, - 5.502346096000068 - ], - [ - 118.81934655000006, - 5.478094794000171 - ], - [ - 118.82683353000007, - 5.483628648000192 - ], - [ - 118.83106530000006, - 5.488592841000141 - ], - [ - 118.83277428500017, - 5.495266018000109 - ], - [ - 118.8323673840001, - 5.505438544000143 - ], - [ - 118.87956790500007, - 5.469794012000108 - ], - [ - 118.89795983200011, - 5.464504299000126 - ], - [ - 118.9187931650001, - 5.454982815000122 - ], - [ - 118.93572024800008, - 5.433986721000096 - ], - [ - 118.93946373800011, - 5.412827867000175 - ], - [ - 118.92172285199999, - 5.403021552000055 - ], - [ - 118.93262780000006, - 5.394110419000114 - ], - [ - 118.94825280000023, - 5.388576565000093 - ], - [ - 118.96452884200019, - 5.388413804000137 - ], - [ - 118.97641035200004, - 5.395575262000165 - ], - [ - 118.97925866000017, - 5.409125067000133 - ], - [ - 118.97339928500006, - 5.419582424000126 - ], - [ - 118.97087649800014, - 5.428290106000105 - ], - [ - 118.98389733200011, - 5.43650950700011 - ], - [ - 119.00831139400023, - 5.435858466000155 - ], - [ - 119.05567467500012, - 5.410956122000115 - ], - [ - 119.08570397200006, - 5.409857489000075 - ], - [ - 119.16382897200018, - 5.446966864000089 - ], - [ - 119.18930097700016, - 5.450751044000114 - ], - [ - 119.20484459700018, - 5.443345445000119 - ], - [ - 119.21957441500015, - 5.427923895000092 - ], - [ - 119.24333743600008, - 5.395575262000165 - ], - [ - 119.26498457100016, - 5.374212958000115 - ], - [ - 119.27426191500004, - 5.361151434000135 - ], - [ - 119.27808678500006, - 5.344631252000156 - ], - [ - 119.27588951900023, - 5.322943427000084 - ], - [ - 119.26644941500004, - 5.289780992000161 - ], - [ - 119.26441491000017, - 5.272691148000121 - ], - [ - 119.26929772200006, - 5.226223049000069 - ], - [ - 119.26710045700005, - 5.201076565000093 - ], - [ - 119.24415123800006, - 5.181341864000146 - ], - [ - 119.19556725400005, - 5.128648179000052 - ], - [ - 119.15593509200019, - 5.106187242000146 - ], - [ - 118.97315514400012, - 5.039943752000084 - ], - [ - 118.78663170700017, - 4.986029364000146 - ], - [ - 118.75074303500017, - 4.964056708000143 - ], - [ - 118.72730553500017, - 4.953924872000172 - ], - [ - 118.70248457100004, - 4.946600653000175 - ], - [ - 118.68148847699999, - 4.94432200700011 - ], - [ - 118.66586347699999, - 4.947984117000161 - ], - [ - 118.63445071700008, - 4.961330471000082 - ], - [ - 118.60580488400004, - 4.965765692000147 - ], - [ - 118.58497155000012, - 4.971869208000129 - ], - [ - 118.57227623800006, - 4.97162506700009 - ], - [ - 118.56023196700008, - 4.96743398600016 - ], - [ - 118.53077233200005, - 4.94432200700011 - ], - [ - 118.50904381600012, - 4.931057033000087 - ], - [ - 118.49935957100004, - 4.931463934000178 - ], - [ - 118.48633873800023, - 4.940619208000072 - ], - [ - 118.48072350400005, - 4.947984117000161 - ], - [ - 118.46265709700006, - 4.97874583500014 - ], - [ - 118.42839603000007, - 5.018784898000163 - ], - [ - 118.39698326900023, - 5.034816799000154 - ], - [ - 118.37623131600006, - 5.041083075000117 - ], - [ - 118.36687259200019, - 5.035874742000118 - ], - [ - 118.35718834700006, - 5.038804429000137 - ], - [ - 118.33578535199999, - 5.025132554000109 - ], - [ - 118.30486087300008, - 4.99892812700007 - ], - [ - 118.29672285200004, - 5.00458405200007 - ], - [ - 118.29167728000019, - 5.000921942000105 - ], - [ - 118.28972415500007, - 4.990952867000118 - ], - [ - 118.291270379, - 4.977850653000147 - ], - [ - 118.25269616000006, - 4.987127997000101 - ], - [ - 118.2169702480002, - 4.965806382000139 - ], - [ - 118.16081790500019, - 4.902777411000116 - ], - [ - 118.14389082099999, - 4.890285549000112 - ], - [ - 118.136485222, - 4.882310289000159 - ], - [ - 118.13355553500011, - 4.871730861000103 - ], - [ - 118.13493899800008, - 4.859605210000112 - ], - [ - 118.13900800900004, - 4.855373440000093 - ], - [ - 118.14576256600017, - 4.853216864000089 - ], - [ - 118.17139733200023, - 4.836574611000145 - ], - [ - 118.177989129, - 4.830755927000098 - ], - [ - 118.18384850400017, - 4.821844794000143 - ], - [ - 118.19499759200008, - 4.792914130000142 - ], - [ - 118.21900475400005, - 4.756293036000116 - ], - [ - 118.2464298840001, - 4.723822333000129 - ], - [ - 118.27759850400017, - 4.695135809000163 - ], - [ - 118.31226647200006, - 4.669907945000119 - ], - [ - 118.32520592500023, - 4.657863674000097 - ], - [ - 118.33350670700023, - 4.651556708000072 - ], - [ - 118.34262129000004, - 4.648871161000088 - ], - [ - 118.35181725400017, - 4.648627020000134 - ], - [ - 118.372813347, - 4.645819403000175 - ], - [ - 118.38054446700002, - 4.642645575000117 - ], - [ - 118.38526451900023, - 4.636664130000113 - ], - [ - 118.39323978000019, - 4.618353583000143 - ], - [ - 118.39771569100017, - 4.611314195000162 - ], - [ - 118.40406334700018, - 4.605861721000139 - ], - [ - 118.41114342500023, - 4.601507880000142 - ], - [ - 118.42839603000007, - 4.594305731000105 - ], - [ - 118.43083743600019, - 4.611273505000085 - ], - [ - 118.444590691, - 4.614935614000132 - ], - [ - 118.46241295700011, - 4.610012111000074 - ], - [ - 118.47673587300008, - 4.601141669000128 - ], - [ - 118.48747806100019, - 4.587591864000075 - ], - [ - 118.489512566, - 4.575100002000156 - ], - [ - 118.48438561300011, - 4.562730210000112 - ], - [ - 118.47331790500007, - 4.549872137000179 - ], - [ - 118.46941165500007, - 4.537176825000131 - ], - [ - 118.47820071700002, - 4.526068427000098 - ], - [ - 118.4904077480002, - 4.516506252000113 - ], - [ - 118.49659264400006, - 4.508286851000122 - ], - [ - 118.50489342500023, - 4.502386786000088 - ], - [ - 118.52328535199999, - 4.511623440000136 - ], - [ - 118.55193118600008, - 4.532782294000143 - ], - [ - 118.56316165500007, - 4.527248440000122 - ], - [ - 118.58741295700005, - 4.523830471000124 - ], - [ - 118.59961998800023, - 4.519191799000097 - ], - [ - 118.59400475400005, - 4.505519924000154 - ], - [ - 118.60564212300002, - 4.486883856000162 - ], - [ - 118.64527428500017, - 4.444037177000084 - ], - [ - 118.64576256600006, - 4.436753648000163 - ], - [ - 118.63721764400023, - 4.426011460000069 - ], - [ - 118.62623131600017, - 4.419338283000101 - ], - [ - 118.61752363399998, - 4.420721747000172 - ], - [ - 118.6075952480002, - 4.425523179000081 - ], - [ - 118.5921330090001, - 4.429144598000136 - ], - [ - 118.59742272200006, - 4.412298895000134 - ], - [ - 118.59278405000012, - 4.397365627000084 - ], - [ - 118.58277428500006, - 4.384588934000135 - ], - [ - 118.57227623800006, - 4.374579169000157 - ], - [ - 118.55689537900005, - 4.363511460000126 - ], - [ - 118.5428166020001, - 4.360012111000131 - ], - [ - 118.50342858200011, - 4.361517645000092 - ], - [ - 118.486582879, - 4.359523830000143 - ], - [ - 118.45435631600006, - 4.350287177000084 - ], - [ - 118.43523196700008, - 4.347235419000086 - ], - [ - 118.39193769599999, - 4.346380927000084 - ], - [ - 118.36890709700006, - 4.35057200700011 - ], - [ - 118.35328209700006, - 4.361517645000092 - ], - [ - 118.34017988399998, - 4.344061591000127 - ], - [ - 118.33253014400023, - 4.339016018000095 - ], - [ - 118.24203535199999, - 4.313666083000058 - ], - [ - 118.16081790500019, - 4.306219794000171 - ], - [ - 118.13705488399998, - 4.298651434000135 - ], - [ - 118.00456790500007, - 4.231634833000143 - ], - [ - 117.982676629, - 4.231146552000055 - ], - [ - 117.92107181100008, - 4.249090887000108 - ], - [ - 117.9044702480002, - 4.251654364000103 - ], - [ - 117.89226321700002, - 4.256984768000081 - ], - [ - 117.85368899800008, - 4.292629299000126 - ], - [ - 117.839610222, - 4.300848700000117 - ], - [ - 117.83122806100008, - 4.304673570000134 - ], - [ - 117.82252037900017, - 4.306219794000171 - ], - [ - 117.81885826900012, - 4.310532945000176 - ], - [ - 117.81202233200011, - 4.329291083000143 - ], - [ - 117.80827884200008, - 4.333563544000143 - ], - [ - 117.79476972699999, - 4.334906317000133 - ], - [ - 117.76351972700004, - 4.347235419000086 - ], - [ - 117.73845462300002, - 4.351792710000126 - ], - [ - 117.72950280000012, - 4.354681708000072 - ], - [ - 117.70753014400006, - 4.36994049700013 - ], - [ - 117.69613691500004, - 4.387762762000108 - ], - [ - 117.68702233200023, - 4.407049872000144 - ], - [ - 117.671153191, - 4.426011460000069 - ], - [ - 117.656016472, - 4.424221096000082 - ], - [ - 117.6341251960001, - 4.410101630000142 - ], - [ - 117.61459394599999, - 4.393052476000179 - ], - [ - 117.60580488400004, - 4.382025458000129 - ], - [ - 117.60962975400005, - 4.373358466000141 - ], - [ - 117.62875410200004, - 4.36176178600013 - ], - [ - 117.63331139400017, - 4.350978908000116 - ], - [ - 117.63331139400017, - 4.309637762000179 - ], - [ - 117.636973504, - 4.299017645000148 - ], - [ - 117.652110222, - 4.284857489000117 - ], - [ - 117.65365644600016, - 4.27216217700007 - ], - [ - 117.64909915500013, - 4.26072825700011 - ], - [ - 117.64047285199999, - 4.251369533000073 - ], - [ - 117.61963951900023, - 4.237372137000108 - ], - [ - 117.61304772200006, - 4.230902411000116 - ], - [ - 117.60808353000019, - 4.222235419000114 - ], - [ - 117.60206139400012, - 4.21527741100013 - ], - [ - 117.59896894600004, - 4.20693594000015 - ], - [ - 117.60271243600008, - 4.201727606000162 - ], - [ - 117.62029056100008, - 4.184719143000095 - ], - [ - 117.6271264980002, - 4.176499742000189 - ], - [ - 117.61703535200004, - 4.177435614000089 - ], - [ - 117.60840905000012, - 4.176214911000073 - ], - [ - 117.56714928500017, - 4.159654039000188 - ], - [ - 117.55833296800009, - 4.167653707000127 - ], - [ - 117.54220992000009, - 4.173829040000101 - ], - [ - 117.51461470500018, - 4.171942851000097 - ], - [ - 117.49838830600018, - 4.172614644000163 - ], - [ - 117.46417850800017, - 4.177911479000116 - ], - [ - 117.43647994000017, - 4.185611267000112 - ], - [ - 117.41291548700016, - 4.20008066800014 - ], - [ - 117.35658817600003, - 4.259508566000179 - ], - [ - 117.27555953000015, - 4.300978903000143 - ], - [ - 117.23866255800013, - 4.326868795000095 - ], - [ - 117.23060103400022, - 4.337178243000096 - ], - [ - 117.22481327300014, - 4.346583354000146 - ], - [ - 117.21716516200016, - 4.353430481000188 - ], - [ - 117.20269576100023, - 4.356065979000121 - ], - [ - 117.1903967690001, - 4.353017069000188 - ], - [ - 117.17437707500002, - 4.338418477000118 - ], - [ - 117.16466190600008, - 4.333147481000182 - ], - [ - 116.98059045400007, - 4.329555970000115 - ], - [ - 116.9242631430001, - 4.344955547000097 - ], - [ - 116.8830253510001, - 4.344903870000095 - ], - [ - 116.80447717300015, - 4.330072733000151 - ], - [ - 116.76613326100014, - 4.338573507000163 - ], - [ - 116.72944299300016, - 4.364463399000101 - ], - [ - 116.71166630000013, - 4.366788838000133 - ], - [ - 116.68004032400015, - 4.339917094000128 - ], - [ - 116.6611267500002, - 4.334387716000123 - ], - [ - 116.64179976500023, - 4.333870952000098 - ], - [ - 116.61554813699999, - 4.344077047000155 - ], - [ - 116.59022668500015, - 4.331132101000136 - ], - [ - 116.57689416600013, - 4.332010600000089 - ], - [ - 116.53327925700015, - 4.395365906000094 - ], - [ - 116.52222050000015, - 4.396787008000089 - ], - [ - 116.51539921100019, - 4.384152120000152 - ], - [ - 116.49431522600017, - 4.363223165000164 - ], - [ - 116.48646040900022, - 4.348831278000148 - ], - [ - 116.4869771730001, - 4.338573507000163 - ], - [ - 116.49193811000012, - 4.331287130000177 - ], - [ - 116.49410852100013, - 4.324853414000131 - ], - [ - 116.48594364400012, - 4.316921082000178 - ], - [ - 116.46837365800005, - 4.312321879000137 - ], - [ - 116.45710819500007, - 4.316766052000133 - ], - [ - 116.44635949700015, - 4.317256979000163 - ], - [ - 116.42176151600003, - 4.291832174000163 - ], - [ - 116.41132287600013, - 4.288654074000192 - ], - [ - 116.4008842370001, - 4.289997661000157 - ], - [ - 116.39106571500011, - 4.294674377000135 - ], - [ - 116.36543420400008, - 4.337695008000125 - ], - [ - 116.36181685400007, - 4.350381572000174 - ], - [ - 116.35819950400017, - 4.355445862000153 - ], - [ - 116.35127486200011, - 4.357900492000113 - ], - [ - 116.34424686700018, - 4.356918640000146 - ], - [ - 116.3375289310001, - 4.357228699000132 - ], - [ - 116.31065718600004, - 4.383376974000143 - ], - [ - 116.28512902900005, - 4.378390198000176 - ], - [ - 116.25722375600006, - 4.364153341000119 - ], - [ - 116.22880171700004, - 4.356117656000137 - ], - [ - 116.21505578700018, - 4.3578488160001 - ], - [ - 116.17009729000009, - 4.369915263000081 - ], - [ - 116.14684289600015, - 4.37120717300013 - ], - [ - 116.13650760900023, - 4.373041687000125 - ], - [ - 116.125758912, - 4.37890696200013 - ], - [ - 116.11749068300017, - 4.357228699000132 - ], - [ - 116.10994592300014, - 4.345110575000135 - ], - [ - 116.09940393100024, - 4.336506449000112 - ], - [ - 116.08121382700014, - 4.325473531000114 - ], - [ - 116.03315474500008, - 4.27772450700013 - ], - [ - 116.02064904800008, - 4.270851542000159 - ], - [ - 116.00400923700025, - 4.276690980000154 - ], - [ - 115.99357059800005, - 4.288912455000172 - ], - [ - 115.98736942600013, - 4.304777120000082 - ], - [ - 115.98344201700016, - 4.321391093000102 - ], - [ - 115.97724084500018, - 4.32862579400016 - ], - [ - 115.96483850100012, - 4.335472921000118 - ], - [ - 115.94096398900004, - 4.344361267000139 - ], - [ - 115.89879602100004, - 4.347125956000184 - ], - [ - 115.87884891800005, - 4.35213857000015 - ], - [ - 115.86944380700018, - 4.366685486000108 - ], - [ - 115.86489628100006, - 4.382575989000117 - ], - [ - 115.85611128800016, - 4.390766703000139 - ], - [ - 115.84412235500011, - 4.389216410000131 - ], - [ - 115.83099654200024, - 4.376116435000156 - ], - [ - 115.82117802000008, - 4.344335429000125 - ], - [ - 115.82190149000004, - 4.311236674000142 - ], - [ - 115.81745731700008, - 4.281316020000105 - ], - [ - 115.77942346200021, - 4.248940735000119 - ], - [ - 115.77539270100013, - 4.236099142000128 - ], - [ - 115.77074182100009, - 4.225608825000165 - ], - [ - 115.75689253800013, - 4.222172343000139 - ], - [ - 115.74717736900007, - 4.227624207000119 - ], - [ - 115.74025272700018, - 4.236202495000143 - ], - [ - 115.73260461500004, - 4.239380595000114 - ], - [ - 115.68981652900018, - 4.199977315000112 - ], - [ - 115.68278853400008, - 4.190649720000167 - ], - [ - 115.67596724500012, - 4.184164327000119 - ], - [ - 115.65591678900009, - 4.178634949000113 - ], - [ - 115.64692508900012, - 4.169100647000121 - ], - [ - 115.63913433100007, - 4.145949698000138 - ], - [ - 115.63328251200014, - 4.128560486000197 - ], - [ - 115.62212040200009, - 4.040219625000191 - ], - [ - 115.60951135200017, - 3.996914774000132 - ], - [ - 115.59028772000013, - 3.95800242100016 - ], - [ - 115.58098596200003, - 3.946917827000149 - ], - [ - 115.54584598900024, - 3.927720032000138 - ], - [ - 115.53881799400008, - 3.920614522000108 - ], - [ - 115.53830122900004, - 3.897825216000115 - ], - [ - 115.55411421700003, - 3.88356252000014 - ], - [ - 115.57457808400025, - 3.872090353000203 - ], - [ - 115.58863407400011, - 3.857595113000173 - ], - [ - 115.58935754500018, - 3.824522197000192 - ], - [ - 115.55049686700013, - 3.708224385000094 - ], - [ - 115.54460575400006, - 3.668976136000126 - ], - [ - 115.54439904800009, - 3.629159445000198 - ], - [ - 115.54853316300003, - 3.605284933000121 - ], - [ - 115.57333785000006, - 3.545004374000058 - ], - [ - 115.57447473100015, - 3.534565735000115 - ], - [ - 115.57240767500016, - 3.51425689700001 - ], - [ - 115.57271773300025, - 3.504154155000137 - ], - [ - 115.5761283780001, - 3.491674296000156 - ], - [ - 115.59266483600018, - 3.46196034800009 - ], - [ - 115.60062300600023, - 3.441212260000057 - ], - [ - 115.60124312400004, - 3.430231019000161 - ], - [ - 115.59545536300007, - 3.42085174600011 - ], - [ - 115.58501672400021, - 3.416820984000111 - ], - [ - 115.57602502500006, - 3.419404805000113 - ], - [ - 115.56713667800014, - 3.423848979000041 - ], - [ - 115.55721480300016, - 3.425450948000162 - ], - [ - 115.53582076000023, - 3.403617656000122 - ], - [ - 115.5176306560002, - 3.357160543000106 - ], - [ - 115.48280074100015, - 3.206472066000075 - ], - [ - 115.48352421100006, - 3.189005432000116 - ], - [ - 115.49933719900005, - 3.169781800000095 - ], - [ - 115.51442671800012, - 3.164769186000129 - ], - [ - 115.51701053900004, - 3.157276103000186 - ], - [ - 115.48218062400016, - 3.110974020000114 - ], - [ - 115.47597945200019, - 3.093042297000139 - ], - [ - 115.47215539600015, - 3.050512594000097 - ], - [ - 115.46409387300005, - 3.030823873000131 - ], - [ - 115.44797082500017, - 3.024054261000018 - ], - [ - 115.4068363850001, - 3.019506734000075 - ], - [ - 115.34151737500022, - 2.991136373000145 - ], - [ - 115.30999475100018, - 2.985917053000051 - ], - [ - 115.2813660080001, - 2.999559631000139 - ], - [ - 115.25583785000018, - 3.037490133000063 - ], - [ - 115.24209192000004, - 3.041624247000172 - ], - [ - 115.2250386970002, - 3.01588938400009 - ], - [ - 115.20798547400008, - 2.980697734000117 - ], - [ - 115.1964099530002, - 2.967623596000166 - ], - [ - 115.13904911300014, - 2.928452860000121 - ], - [ - 115.12282271400014, - 2.912949931000028 - ], - [ - 115.10959354700006, - 2.89202097600004 - ], - [ - 115.10525272600015, - 2.88029042500014 - ], - [ - 115.1027722580001, - 2.869955139000126 - ], - [ - 115.09905155500016, - 2.859671529000138 - ], - [ - 115.09119673700005, - 2.8481476850001 - ], - [ - 115.07755415900013, - 2.836520488000147 - ], - [ - 115.06907922400003, - 2.832644755000089 - ], - [ - 115.06690881300014, - 2.828200582000093 - ], - [ - 115.07186975200008, - 2.814764710000048 - ], - [ - 115.09812137900022, - 2.781071676000167 - ], - [ - 115.1046326100001, - 2.761486308000158 - ], - [ - 115.0935738530001, - 2.737043356000115 - ], - [ - 115.082721802, - 2.729550273000172 - ], - [ - 115.07217981000016, - 2.727431539000023 - ], - [ - 115.0631881100002, - 2.723659159000178 - ], - [ - 115.05698693900004, - 2.711256816000116 - ], - [ - 115.0579171150001, - 2.701489970000068 - ], - [ - 115.06876916500013, - 2.681542868000051 - ], - [ - 115.07186975200008, - 2.671827698000186 - ], - [ - 115.06742557800018, - 2.651208801000095 - ], - [ - 115.05864058500018, - 2.628832906000113 - ], - [ - 115.0564701750001, - 2.60862742200004 - ], - [ - 115.07145634000008, - 2.594623108000036 - ], - [ - 115.0825150960001, - 2.594364726000151 - ], - [ - 115.10411584500005, - 2.604751689000082 - ], - [ - 115.1149678960002, - 2.607903951000125 - ], - [ - 115.12685347500022, - 2.606767070000117 - ], - [ - 115.13977258300022, - 2.602839661000147 - ], - [ - 115.15196822100015, - 2.597051900000082 - ], - [ - 115.16189009600023, - 2.590385641000168 - ], - [ - 115.17697961500014, - 2.57415924100016 - ], - [ - 115.19237919200012, - 2.551059876000181 - ], - [ - 115.2037480070002, - 2.527547099000103 - ], - [ - 115.20612512200015, - 2.509873759000101 - ], - [ - 115.1926892500002, - 2.490546773000133 - ], - [ - 115.17181197100004, - 2.483312073000164 - ], - [ - 115.12654341700014, - 2.479229634000077 - ], - [ - 115.1050460210001, - 2.465690409000089 - ], - [ - 115.06742557800018, - 2.423109029000116 - ], - [ - 115.05202600100009, - 2.414013977000138 - ], - [ - 115.0347660730001, - 2.406417541000081 - ], - [ - 114.99208133900018, - 2.369882304000157 - ], - [ - 114.97296106000013, - 2.357479960000177 - ], - [ - 114.93451379500007, - 2.360683899000151 - ], - [ - 114.92221480300012, - 2.353914287000123 - ], - [ - 114.91529016200005, - 2.332055155000177 - ], - [ - 114.91673710200021, - 2.311229554000036 - ], - [ - 114.91963098100021, - 2.295674947000094 - ], - [ - 114.91332645700018, - 2.284047750000127 - ], - [ - 114.88645471200019, - 2.275159404000036 - ], - [ - 114.80904341700008, - 2.264669088000161 - ], - [ - 114.77876102700023, - 2.247202454000117 - ], - [ - 114.76346480400017, - 2.208083395000102 - ], - [ - 114.7520959880001, - 2.15351308200016 - ], - [ - 114.75302616400015, - 2.134806213 - ], - [ - 114.75674686700009, - 2.1260470590002 - ], - [ - 114.76801233000012, - 2.110208232000019 - ], - [ - 114.77028609200013, - 2.100053813000144 - ], - [ - 114.76925256400014, - 2.066644999000076 - ], - [ - 114.77028609200013, - 2.058221741000168 - ], - [ - 114.78062137900022, - 2.036052552000143 - ], - [ - 114.7921969000001, - 2.034812317000032 - ], - [ - 114.80821659400024, - 2.041969502000072 - ], - [ - 114.83136763500013, - 2.044760030000035 - ], - [ - 114.84108280500018, - 2.038222962000134 - ], - [ - 114.84532027200012, - 2.024967957000143 - ], - [ - 114.84511356700008, - 2.009749248000105 - ], - [ - 114.84252974400025, - 1.997166036000095 - ], - [ - 114.83384810400011, - 1.976676331000036 - ], - [ - 114.82940393100003, - 1.959778138000132 - ], - [ - 114.82940393100003, - 1.942647400000084 - ], - [ - 114.83364139800008, - 1.921356710000097 - ], - [ - 114.8319877530001, - 1.902520650000071 - ], - [ - 114.8190686450001, - 1.890299174000063 - ], - [ - 114.76305139200016, - 1.86869842500009 - ], - [ - 114.7089978440001, - 1.86198049000015 - ], - [ - 114.69917932100012, - 1.85805308000009 - ], - [ - 114.68863733000015, - 1.850224101000066 - ], - [ - 114.67954227699997, - 1.840741476000176 - ], - [ - 114.67416792900022, - 1.831904806000182 - ], - [ - 114.67137740100017, - 1.820975240000109 - ], - [ - 114.6726176350002, - 1.814076436000136 - ], - [ - 114.67582157400008, - 1.806738383000138 - ], - [ - 114.67892216000021, - 1.794361878000174 - ], - [ - 114.68005904200012, - 1.763278504000141 - ], - [ - 114.66900028500012, - 1.694006246000114 - ], - [ - 114.65029341700014, - 1.64145131500014 - ], - [ - 114.62445520100013, - 1.598792420000137 - ], - [ - 114.60967574100019, - 1.581635844000175 - ], - [ - 114.57453576700007, - 1.553420512000116 - ], - [ - 114.56316695200016, - 1.5363931280001 - ], - [ - 114.56316695200016, - 1.512260233000049 - ], - [ - 114.56771447700012, - 1.49091786700005 - ], - [ - 114.56802453700018, - 1.469394633000178 - ], - [ - 114.56161665800002, - 1.450015971000127 - ], - [ - 114.5455969650001, - 1.434952291000045 - ], - [ - 114.52223921800024, - 1.429422913000124 - ], - [ - 114.50063846900017, - 1.43603749600004 - ], - [ - 114.42136682200024, - 1.492183940000089 - ], - [ - 114.39821578000024, - 1.503552754000168 - ], - [ - 114.37485803299998, - 1.506937562000175 - ], - [ - 114.35573775300011, - 1.501950786000137 - ], - [ - 114.20740588700019, - 1.439443127000175 - ], - [ - 114.20484257100011, - 1.438362935000157 - ], - [ - 114.18324182200004, - 1.423454285000105 - ], - [ - 114.17342329900018, - 1.420508728000101 - ], - [ - 114.16040083900023, - 1.42479787200017 - ], - [ - 114.15027225800017, - 1.43428049700006 - ], - [ - 114.14107385300005, - 1.445261739000046 - ], - [ - 114.13094527200022, - 1.454175924000154 - ], - [ - 114.09425500500006, - 1.465673930000165 - ], - [ - 114.05394738800013, - 1.465053813000026 - ], - [ - 113.90966678900011, - 1.442471212000072 - ], - [ - 113.89116662600017, - 1.434952291000045 - ], - [ - 113.86822229000015, - 1.415496114000135 - ], - [ - 113.80817427600013, - 1.339712626000065 - ], - [ - 113.64952762900012, - 1.233259176000132 - ], - [ - 113.62482629500019, - 1.227574768000181 - ], - [ - 113.59650760900004, - 1.241630758000099 - ], - [ - 113.54617476400014, - 1.301575419000187 - ], - [ - 113.52447066200014, - 1.313564351000139 - ], - [ - 113.50338667900022, - 1.314494527000107 - ], - [ - 113.48230269400008, - 1.308706767000132 - ], - [ - 113.39755334500015, - 1.293927307000118 - ], - [ - 113.32365604700018, - 1.351391500000119 - ], - [ - 113.27601037600013, - 1.368883973000081 - ], - [ - 113.21771936100018, - 1.380898742000056 - ], - [ - 113.17276086500019, - 1.383740946000032 - ], - [ - 113.15860152200005, - 1.388159281000114 - ], - [ - 113.1257353120001, - 1.41363576300013 - ], - [ - 113.08904504400013, - 1.431334940000141 - ], - [ - 113.05059777800003, - 1.434797262000174 - ], - [ - 113.01142704300005, - 1.42797597300013 - ], - [ - 112.97318648300015, - 1.415082703000124 - ], - [ - 112.95820031800011, - 1.415651143 - ], - [ - 112.95530643700019, - 1.423557638000048 - ], - [ - 112.9611975510002, - 1.434383850000174 - ], - [ - 112.9916866450001, - 1.456966452000117 - ], - [ - 113.00729292800023, - 1.473270365000133 - ], - [ - 113.01845503800016, - 1.492390645000128 - ], - [ - 113.02434615100006, - 1.514378968000116 - ], - [ - 113.02341597500012, - 1.53701324400015 - ], - [ - 113.01411421700018, - 1.550785014000098 - ], - [ - 112.9971643480001, - 1.560164287000063 - ], - [ - 112.97318648300015, - 1.569853618000181 - ], - [ - 112.95602990799998, - 1.572334086000069 - ], - [ - 112.90766076700007, - 1.570525411000077 - ], - [ - 112.88812707600007, - 1.574866232000147 - ], - [ - 112.8713839120002, - 1.580653991000034 - ], - [ - 112.85495080600006, - 1.582721049 - ], - [ - 112.83645064300012, - 1.576054789000167 - ], - [ - 112.82663212100013, - 1.56719228100016 - ], - [ - 112.82053430200008, - 1.557632141000155 - ], - [ - 112.81350630800009, - 1.549338073000115 - ], - [ - 112.80151737500003, - 1.5437828580001 - ], - [ - 112.79479943900017, - 1.544377136000151 - ], - [ - 112.76885787000006, - 1.552231954000192 - ], - [ - 112.47047815000016, - 1.567657369000173 - ], - [ - 112.44588016800017, - 1.562076315000169 - ], - [ - 112.42975712100011, - 1.550681662000073 - ], - [ - 112.41590783700022, - 1.536651510000155 - ], - [ - 112.39854455600013, - 1.523344828000148 - ], - [ - 112.38097456900007, - 1.517712097000114 - ], - [ - 112.319066203, - 1.511743469000095 - ], - [ - 112.29519169200015, - 1.503811137000142 - ], - [ - 112.18005660000009, - 1.449034119000146 - ], - [ - 112.16155643700014, - 1.434538880000034 - ], - [ - 112.1541150310002, - 1.409527486000115 - ], - [ - 112.15907596900016, - 1.40079416900015 - ], - [ - 112.18181359900021, - 1.400019022000052 - ], - [ - 112.18801477100013, - 1.3914148960001 - ], - [ - 112.18739465300015, - 1.37965850800019 - ], - [ - 112.18398400900006, - 1.369039001000118 - ], - [ - 112.15266809100004, - 1.306277975000157 - ], - [ - 112.10006148300013, - 1.154917705000145 - ], - [ - 112.0929301350001, - 1.143135478000133 - ], - [ - 112.07949426300004, - 1.137244365000143 - ], - [ - 112.05406945800021, - 1.133627014000069 - ], - [ - 111.97335087100006, - 1.134040426000169 - ], - [ - 111.9100989180001, - 1.114041646000132 - ], - [ - 111.82307580600016, - 1.008466695000152 - ], - [ - 111.76282108600017, - 0.993015442000143 - ], - [ - 111.7341923430001, - 1.001438700000136 - ], - [ - 111.68210249800003, - 1.023452861000038 - ], - [ - 111.65523075400009, - 1.030790914000121 - ], - [ - 111.63735070800007, - 1.032237854000115 - ], - [ - 111.62267460100011, - 1.030274150000167 - ], - [ - 111.53885542900011, - 0.997717997000123 - ], - [ - 111.51539432800016, - 0.964490051000098 - ], - [ - 111.50319869000006, - 0.958443909000152 - ], - [ - 111.49203658100012, - 0.980871480000147 - ], - [ - 111.48800581900011, - 0.997924703000095 - ], - [ - 111.48242476400011, - 1.012859192000136 - ], - [ - 111.47208947800019, - 1.022212627000087 - ], - [ - 111.45451949100013, - 1.022626038000098 - ], - [ - 111.41503869700009, - 1.010223694000132 - ], - [ - 111.3955050050001, - 1.006296285000161 - ], - [ - 111.37411096200017, - 1.007536519000098 - ], - [ - 111.35178674300019, - 1.013892721000119 - ], - [ - 111.21753137200014, - 1.07326894200007 - ], - [ - 111.19758427000014, - 1.075232646000188 - ], - [ - 110.9734119070001, - 1.017716776000157 - ], - [ - 110.91057336500015, - 1.015701396000111 - ], - [ - 110.88039432900021, - 1.010533753000118 - ], - [ - 110.8526957610002, - 0.997201233000098 - ], - [ - 110.79698856600007, - 0.949658915000072 - ], - [ - 110.78706669100009, - 0.93415598600015 - ], - [ - 110.78623986800002, - 0.91627594000002 - ], - [ - 110.78396610600012, - 0.908162740000193 - ], - [ - 110.77673140500016, - 0.903253479000156 - ], - [ - 110.7712537030001, - 0.904390361000083 - ], - [ - 110.7611251230002, - 0.912865296000163 - ], - [ - 110.7583345950001, - 0.91451894100004 - ], - [ - 110.74572554600016, - 0.908007711000067 - ], - [ - 110.7447953700001, - 0.905062154000149 - ], - [ - 110.72484826700006, - 0.897259013000138 - ], - [ - 110.72071415200006, - 0.897362366000067 - ], - [ - 110.70944869000019, - 0.901393127000148 - ], - [ - 110.70417769400015, - 0.901393127000148 - ], - [ - 110.6930155850001, - 0.894675192000136 - ], - [ - 110.67441206900017, - 0.877001851000045 - ], - [ - 110.66128625500019, - 0.87214426700011 - ], - [ - 110.64774703000009, - 0.873901266000175 - ], - [ - 110.63885868300011, - 0.880774231000146 - ], - [ - 110.63214074800007, - 0.888629049000187 - ], - [ - 110.62480269400007, - 0.89312489800011 - ], - [ - 110.6134338790001, - 0.89395172100005 - ], - [ - 110.60960982300006, - 0.890851136000094 - ], - [ - 110.60599247300016, - 0.883306376000135 - ], - [ - 110.59607059800007, - 0.871110738000127 - ], - [ - 110.55390262900013, - 0.851370341000077 - ], - [ - 110.50636031100012, - 0.857313131000168 - ], - [ - 110.4602649330001, - 0.879740703 - ], - [ - 110.42264449100006, - 0.909454651000061 - ], - [ - 110.38068322800015, - 0.966608785000176 - ], - [ - 110.36414676900009, - 0.98138824500009 - ], - [ - 110.35164107300008, - 0.986504211000181 - ], - [ - 110.30079146400007, - 0.997717997000123 - ], - [ - 110.2863220630002, - 0.995340881000175 - ], - [ - 110.27278283800015, - 0.991051737000035 - ], - [ - 110.26348107900012, - 0.99430735300011 - ], - [ - 110.2617240800001, - 1.014719544000144 - ], - [ - 110.25655643700011, - 1.039059144000163 - ], - [ - 110.2067403570002, - 1.1117162070002 - ], - [ - 110.18513960800013, - 1.154194234000059 - ], - [ - 110.17036014900012, - 1.174451396000151 - ], - [ - 110.15217004500008, - 1.183856507000201 - ], - [ - 110.09346561700013, - 1.19160797100011 - ], - [ - 110.07455204300018, - 1.198635966000126 - ], - [ - 110.05181441200008, - 1.215482483000187 - ], - [ - 110.03073042800006, - 1.253568014000138 - ], - [ - 110.01212691200013, - 1.270517883000153 - ], - [ - 109.97626346900009, - 1.287726136000131 - ], - [ - 109.9637577720001, - 1.298578186000086 - ], - [ - 109.9517688390001, - 1.3196621700001 - ], - [ - 109.93254520700012, - 1.378521627000097 - ], - [ - 109.92024621600015, - 1.394773865000118 - ], - [ - 109.90205611200011, - 1.403791402000152 - ], - [ - 109.88272912600016, - 1.403843079000168 - ], - [ - 109.86288537700008, - 1.401465963000135 - ], - [ - 109.84283492000012, - 1.403274638000127 - ], - [ - 109.82547164000019, - 1.417563171000111 - ], - [ - 109.8077982990001, - 1.45996368400013 - ], - [ - 109.80056359900013, - 1.46675913500016 - ], - [ - 109.78154667200008, - 1.456294658000132 - ], - [ - 109.77555220500014, - 1.457948303000165 - ], - [ - 109.77317509000008, - 1.485853577000071 - ], - [ - 109.76635380100007, - 1.496473084000058 - ], - [ - 109.6772636320002, - 1.572850850000094 - ], - [ - 109.65803999900012, - 1.597190450000198 - ], - [ - 109.64698124200018, - 1.617628479000075 - ], - [ - 109.64171024600009, - 1.63716217100017 - ], - [ - 109.64057336400006, - 1.683025004000129 - ], - [ - 109.64718794800015, - 1.761883240000159 - ], - [ - 109.64181359900007, - 1.781003520000155 - ], - [ - 109.62403690700009, - 1.787773132000012 - ], - [ - 109.58011193900015, - 1.78797983800014 - ], - [ - 109.56698612500006, - 1.792553203000182 - ], - [ - 109.55561731000009, - 1.802165019000199 - ], - [ - 109.54662561000012, - 1.814334818000106 - ], - [ - 109.5398043220001, - 1.826556295000046 - ], - [ - 109.5347400320002, - 1.838984477000025 - ], - [ - 109.53432662000009, - 1.846451721000051 - ], - [ - 109.5347400320002, - 1.853893127000148 - ], - [ - 109.52843550600019, - 1.889989116000066 - ], - [ - 109.52936568200008, - 1.905156149 - ], - [ - 109.53794397000016, - 1.917713522000099 - ], - [ - 109.57442753100011, - 1.94859019000009 - ], - [ - 109.58507287600017, - 1.96091501900014 - ], - [ - 109.60026574700012, - 1.983135885000166 - ], - [ - 109.62662072800018, - 2.029696350000123 - ], - [ - 109.64527428500017, - 2.083238023000121 - ], - [ - 109.64543704500014, - 2.082586981000176 - ], - [ - 109.64991295700011, - 2.065578518000109 - ], - [ - 109.6521916020001, - 2.043443101000051 - ], - [ - 109.66211998800011, - 2.002752997000144 - ], - [ - 109.66358483200005, - 1.983058986000117 - ], - [ - 109.66000410200016, - 1.967027085000126 - ], - [ - 109.65528405000006, - 1.953111070000134 - ], - [ - 109.6546330090001, - 1.936997789000159 - ], - [ - 109.66358483200005, - 1.914740302000126 - ], - [ - 109.69304446700002, - 1.873114325000145 - ], - [ - 109.71143639400006, - 1.854478257000068 - ], - [ - 109.73178144600016, - 1.839585679000109 - ], - [ - 109.79346764400012, - 1.813462631999982 - ], - [ - 109.8289494150001, - 1.790106512000165 - ], - [ - 109.86963951900006, - 1.77289459800015 - ], - [ - 109.88672936300011, - 1.760199286000088 - ], - [ - 109.8987736340001, - 1.743109442000133 - ], - [ - 109.91553795700005, - 1.708400783000073 - ], - [ - 109.92774498800011, - 1.692287502000099 - ], - [ - 109.9417423840001, - 1.689195054000123 - ], - [ - 109.99122155000012, - 1.690171617000189 - ], - [ - 110.00318444100006, - 1.692287502000099 - ], - [ - 110.01840254000015, - 1.700181382 - ], - [ - 110.04004967500012, - 1.702785549000083 - ], - [ - 110.16765384200019, - 1.701849677000098 - ], - [ - 110.18091881600006, - 1.698716539000031 - ], - [ - 110.200450066, - 1.685207424000055 - ], - [ - 110.211680535, - 1.682033596 - ], - [ - 110.21631920700005, - 1.684759833000058 - ], - [ - 110.23170006600017, - 1.697699286000145 - ], - [ - 110.23902428500017, - 1.701849677000098 - ], - [ - 110.2483830090001, - 1.705226955000114 - ], - [ - 110.25416100400017, - 1.706203518000081 - ], - [ - 110.26002037900005, - 1.702622789000117 - ], - [ - 110.28394616000017, - 1.676092841000141 - ], - [ - 110.29078209700012, - 1.673976955000143 - ], - [ - 110.29566491000017, - 1.691555080000072 - ], - [ - 110.30534915500002, - 1.703314520000063 - ], - [ - 110.30787194100006, - 1.709295966000155 - ], - [ - 110.30713951900012, - 1.715521552000041 - ], - [ - 110.30225670700005, - 1.725653387000179 - ], - [ - 110.30103600400005, - 1.729722398000135 - ], - [ - 110.29957116000017, - 1.761419989000103 - ], - [ - 110.30103600400005, - 1.770738023000149 - ], - [ - 110.3133244150001, - 1.792629299000083 - ], - [ - 110.32935631600017, - 1.802557684000092 - ], - [ - 110.343028191, - 1.797512111000145 - ], - [ - 110.35075931100013, - 1.768500067000076 - ], - [ - 110.35987389400012, - 1.756293036000088 - ], - [ - 110.36304772200018, - 1.750230210000012 - ], - [ - 110.36378014400012, - 1.743597723000121 - ], - [ - 110.3621525400001, - 1.729437567000105 - ], - [ - 110.36304772200018, - 1.722967841000099 - ], - [ - 110.36646569100017, - 1.715887762000136 - ], - [ - 110.37094160200016, - 1.710191148000149 - ], - [ - 110.3763126960001, - 1.705715236000103 - ], - [ - 110.38298587300008, - 1.701849677000098 - ], - [ - 110.39014733200011, - 1.699042059000135 - ], - [ - 110.39893639400006, - 1.697088934000092 - ], - [ - 110.42115319100006, - 1.69570547100011 - ], - [ - 110.43132571700008, - 1.699896552000055 - ], - [ - 110.44361412900005, - 1.718695380000099 - ], - [ - 110.47364342500006, - 1.728949286000116 - ], - [ - 110.49187259200008, - 1.738959052000098 - ], - [ - 110.50798587300002, - 1.740912177000055 - ], - [ - 110.52076256600017, - 1.722967841000099 - ], - [ - 110.50847415500002, - 1.707586981000162 - ], - [ - 110.49968509200008, - 1.693589585000097 - ], - [ - 110.49463951900012, - 1.678127346000082 - ], - [ - 110.49284915500002, - 1.658107815000108 - ], - [ - 110.4891056650001, - 1.650295315000037 - ], - [ - 110.47136478000019, - 1.631984768000152 - ], - [ - 110.46558678500006, - 1.620550848000022 - ], - [ - 110.49244225400005, - 1.63165924700013 - ], - [ - 110.50635826900012, - 1.63300202000012 - ], - [ - 110.52076256600017, - 1.627346096000124 - ], - [ - 110.53028405000006, - 1.616156317000119 - ], - [ - 110.53296959700006, - 1.605373440000122 - ], - [ - 110.53630618600019, - 1.596869208000086 - ], - [ - 110.54753665500019, - 1.592596747000172 - ], - [ - 110.55665123800006, - 1.59467194200009 - ], - [ - 110.57740319100017, - 1.605210679000066 - ], - [ - 110.58904056100008, - 1.606268622000115 - ], - [ - 110.60254967500006, - 1.601507880000028 - ], - [ - 110.64356530000006, - 1.579006252000113 - ], - [ - 110.70118248800011, - 1.561712958000115 - ], - [ - 110.7267358730002, - 1.547430731000119 - ], - [ - 110.73926842500012, - 1.523667710000041 - ], - [ - 110.73340905000006, - 1.498683986000103 - ], - [ - 110.71558678500017, - 1.480617580000086 - ], - [ - 110.6779077480002, - 1.456040757 - ], - [ - 110.6779077480002, - 1.448635158000087 - ], - [ - 110.70435631600017, - 1.449367580000114 - ], - [ - 110.72510826900006, - 1.453111070000148 - ], - [ - 110.7435001960001, - 1.462388414000102 - ], - [ - 110.763438347, - 1.479681708000101 - ], - [ - 110.77344811300011, - 1.498602606000119 - ], - [ - 110.77222741000017, - 1.51801178600013 - ], - [ - 110.76726321700002, - 1.536200262000122 - ], - [ - 110.76661217500006, - 1.551662502000141 - ], - [ - 110.7933048840001, - 1.572414455000057 - ], - [ - 110.83961022200018, - 1.565985419000128 - ], - [ - 110.92481530000006, - 1.531195380000085 - ], - [ - 110.96794681100019, - 1.503241278000147 - ], - [ - 111.04395592500012, - 1.426947333000115 - ], - [ - 111.0823673840001, - 1.401434637000108 - ], - [ - 111.1419376960001, - 1.37152741100013 - ], - [ - 111.154551629, - 1.3673363300001 - ], - [ - 111.17855879000015, - 1.370794989000103 - ], - [ - 111.21176191500015, - 1.388088283000101 - ], - [ - 111.23267662900005, - 1.394598700000103 - ], - [ - 111.26514733200011, - 1.381781317000062 - ], - [ - 111.30128014400006, - 1.351996161000059 - ], - [ - 111.34058678500006, - 1.333319403000175 - ], - [ - 111.383555535, - 1.353664455000072 - ], - [ - 111.36695397200006, - 1.354396877000099 - ], - [ - 111.33912194100017, - 1.364691473000121 - ], - [ - 111.32553144600016, - 1.3673363300001 - ], - [ - 111.32105553500017, - 1.373602606000148 - ], - [ - 111.311778191, - 1.401353257000125 - ], - [ - 111.30469811300006, - 1.407619533 - ], - [ - 111.28882897200006, - 1.410060940000122 - ], - [ - 111.26099694100017, - 1.419907945000134 - ], - [ - 111.24634850400017, - 1.421332098000107 - ], - [ - 111.23462975400017, - 1.417954820000176 - ], - [ - 111.19849694100006, - 1.401434637000108 - ], - [ - 111.17676842500006, - 1.400580145000106 - ], - [ - 111.157969597, - 1.406154690000037 - ], - [ - 111.14161217500012, - 1.416937567000119 - ], - [ - 111.12720787900005, - 1.431830145000077 - ], - [ - 111.1092228520001, - 1.445013739000132 - ], - [ - 111.06495201900006, - 1.462713934000135 - ], - [ - 111.04835045700005, - 1.476548570000134 - ], - [ - 111.03028405000006, - 1.524318752000084 - ], - [ - 111.0110783210001, - 1.542954820000162 - ], - [ - 111.00684655000006, - 1.555080471000068 - ], - [ - 111.00562584700018, - 1.58445872600015 - ], - [ - 111.00684655000006, - 1.592596747000172 - ], - [ - 111.02035566500015, - 1.627346096000124 - ], - [ - 111.02857506600006, - 1.664007880000142 - ], - [ - 111.03785241, - 1.676947333000058 - ], - [ - 111.09546959700018, - 1.687974351000108 - ], - [ - 111.1175236340001, - 1.688869533000101 - ], - [ - 111.13705488400015, - 1.682033596 - ], - [ - 111.1502384770001, - 1.664129950000117 - ], - [ - 111.16334069100017, - 1.640855210000112 - ], - [ - 111.17945397200006, - 1.627020575000103 - ], - [ - 111.20232181100008, - 1.637274481000048 - ], - [ - 111.21509850400011, - 1.639837958000143 - ], - [ - 111.22901451900006, - 1.630031643000109 - ], - [ - 111.24577884200019, - 1.621323960000041 - ], - [ - 111.2674259770001, - 1.627346096000124 - ], - [ - 111.24732506600006, - 1.633368231000134 - ], - [ - 111.23780358200005, - 1.637762762000037 - ], - [ - 111.21998131600017, - 1.65143463700015 - ], - [ - 111.21119225400011, - 1.652492580000029 - ], - [ - 111.20240319100006, - 1.651922919000057 - ], - [ - 111.18262780000012, - 1.657294012000108 - ], - [ - 111.1761173840001, - 1.656805731000119 - ], - [ - 111.17286217500006, - 1.659369208000115 - ], - [ - 111.17188561300011, - 1.671454169000128 - ], - [ - 111.16041100400005, - 1.687811591000141 - ], - [ - 111.15821373800006, - 1.692287502000099 - ], - [ - 111.154551629, - 1.695990302000141 - ], - [ - 111.13648522200018, - 1.699611721000025 - ], - [ - 111.13021894600016, - 1.701849677000098 - ], - [ - 111.12614993600008, - 1.706610419000086 - ], - [ - 111.10303795700011, - 1.746079820000148 - ], - [ - 111.0979923840001, - 1.759588934000121 - ], - [ - 111.09603925900015, - 1.774481512000179 - ], - [ - 111.10084069100006, - 1.780259507000139 - ], - [ - 111.12322024800008, - 1.785793361000074 - ], - [ - 111.13021894600016, - 1.791896877000141 - ], - [ - 111.12859134200019, - 1.797593492000047 - ], - [ - 111.11353600400011, - 1.807196356000105 - ], - [ - 111.10987389400006, - 1.815415757000025 - ], - [ - 111.1131291020001, - 1.835516669000157 - ], - [ - 111.12159264400012, - 1.853908596000096 - ], - [ - 111.14389082100016, - 1.888088283000087 - ], - [ - 111.17530358200011, - 1.953192450000117 - ], - [ - 111.20394941500015, - 2.045640367000132 - ], - [ - 111.2059025400001, - 2.068996486000117 - ], - [ - 111.2112736340001, - 2.073919989 - ], - [ - 111.22339928500017, - 2.072088934000107 - ], - [ - 111.24333743600008, - 2.065578518000109 - ], - [ - 111.26783287900017, - 2.067531643000066 - ], - [ - 111.24187259200019, - 2.089422919000015 - ], - [ - 111.2400822270001, - 2.113348700000159 - ], - [ - 111.25391686300011, - 2.126125393000109 - ], - [ - 111.27173912900017, - 2.124701239000046 - ], - [ - 111.29151451900012, - 2.117621161000073 - ], - [ - 111.32797285200016, - 2.110419012000051 - ], - [ - 111.33643639400012, - 2.112127997000144 - ], - [ - 111.3499455090001, - 2.120794989000132 - ], - [ - 111.35645592500006, - 2.128078518000152 - ], - [ - 111.37501061300006, - 2.153998114000146 - ], - [ - 111.37794030000012, - 2.161810614000146 - ], - [ - 111.36866295700005, - 2.169989325000145 - ], - [ - 111.3567814460001, - 2.16620514500012 - ], - [ - 111.34685306100019, - 2.15574778900006 - ], - [ - 111.33863366, - 2.130804755000113 - ], - [ - 111.32911217500012, - 2.128729559000107 - ], - [ - 111.31861412900005, - 2.132798570000148 - ], - [ - 111.29127037900017, - 2.150376695000176 - ], - [ - 111.27051842500006, - 2.153794664000188 - ], - [ - 111.19890384200002, - 2.143255927000141 - ], - [ - 111.18474368600013, - 2.145086981000119 - ], - [ - 111.17945397200006, - 2.155910549000026 - ], - [ - 111.17872155000012, - 2.178859768000095 - ], - [ - 111.18482506600012, - 2.194769598000121 - ], - [ - 111.2000431650001, - 2.210882880000085 - ], - [ - 111.21998131600017, - 2.220404364 - ], - [ - 111.2400822270001, - 2.216376044000114 - ], - [ - 111.22950280000006, - 2.235256252000141 - ], - [ - 111.210703972, - 2.242173570000148 - ], - [ - 111.19288170700005, - 2.245591539000145 - ], - [ - 111.18482506600012, - 2.25364817900001 - ], - [ - 111.18653405000012, - 2.271714585000026 - ], - [ - 111.19849694100006, - 2.318793036000031 - ], - [ - 111.20850670700011, - 2.388861395000106 - ], - [ - 111.22095787900005, - 2.416083075000017 - ], - [ - 111.24634850400017, - 2.436102606000077 - ], - [ - 111.2547306650001, - 2.419256903000075 - ], - [ - 111.26783287900017, - 2.411200262000122 - ], - [ - 111.30152428500017, - 2.40070221600007 - ], - [ - 111.31299889400006, - 2.390814520000148 - ], - [ - 111.33806399800002, - 2.360093492000146 - ], - [ - 111.34636478000013, - 2.353583075000074 - ], - [ - 111.35206139400012, - 2.350572006999982 - ], - [ - 111.35840905000012, - 2.344794012000094 - ], - [ - 111.36548912900017, - 2.340765692000133 - ], - [ - 111.37387129000015, - 2.343003648000106 - ], - [ - 111.40528405000006, - 2.364325262000165 - ], - [ - 111.41456139400012, - 2.367254950000017 - ], - [ - 111.44825280000012, - 2.372381903000118 - ], - [ - 111.45557701900006, - 2.370672919000114 - ], - [ - 111.47364342500006, - 2.357326565000093 - ], - [ - 111.49341881600017, - 2.346136786000088 - ], - [ - 111.485118035, - 2.364162502000113 - ], - [ - 111.46509850400005, - 2.384833075000046 - ], - [ - 111.4324650400001, - 2.414984442000147 - ], - [ - 111.4241642590001, - 2.427232164000117 - ], - [ - 111.41228274800008, - 2.469224351000108 - ], - [ - 111.40455162900005, - 2.4839541690001 - ], - [ - 111.43555748800006, - 2.482123114000032 - ], - [ - 111.46338951900012, - 2.474920966000084 - ], - [ - 111.48731530000012, - 2.473944403000104 - ], - [ - 111.507090691, - 2.490708726000122 - ], - [ - 111.51254316500015, - 2.48826732000019 - ], - [ - 111.5140080090001, - 2.486965236000103 - ], - [ - 111.51563561300006, - 2.487494208000072 - ], - [ - 111.52125084700006, - 2.490708726000122 - ], - [ - 111.49952233200005, - 2.498846747000059 - ], - [ - 111.46168053500006, - 2.50800202000012 - ], - [ - 111.44556725400017, - 2.518011786000116 - ], - [ - 111.43295332100016, - 2.528753973000121 - ], - [ - 111.42286217500012, - 2.539618231000105 - ], - [ - 111.417246941, - 2.555121161000116 - ], - [ - 111.41765384200019, - 2.57953522299999 - ], - [ - 111.43531334700006, - 2.640936591000155 - ], - [ - 111.4402775400001, - 2.680121161000102 - ], - [ - 111.447032097, - 2.694647528000047 - ], - [ - 111.4578556650001, - 2.705633856000091 - ], - [ - 111.52979576900006, - 2.760687567000062 - ], - [ - 111.638926629, - 2.828192450000131 - ], - [ - 111.66960696700019, - 2.84308502800009 - ], - [ - 111.860606316, - 2.880601304000095 - ], - [ - 112.01351972700004, - 2.885931707999987 - ], - [ - 112.29786217500012, - 2.961004950000088 - ], - [ - 112.57471764400023, - 3.033921617000033 - ], - [ - 112.72730553500006, - 3.06610748899999 - ], - [ - 112.78882897200018, - 3.090277411000073 - ], - [ - 112.80054772200018, - 3.090033270000134 - ], - [ - 112.97437584700006, - 3.144232489000089 - ], - [ - 113.00782311300011, - 3.161688544000143 - ], - [ - 113.06120853000007, - 3.218654690000065 - ], - [ - 113.08228600400017, - 3.256781317000133 - ], - [ - 113.06934655000006, - 3.278998114000018 - ], - [ - 113.07691491000006, - 3.28778717700007 - ], - [ - 113.10336347699999, - 3.305650132000125 - ], - [ - 113.15137780000006, - 3.347723700000103 - ], - [ - 113.16211998800011, - 3.353461005000071 - ], - [ - 113.16618899800008, - 3.362941799000083 - ], - [ - 113.19955488400015, - 3.415513414000102 - ], - [ - 113.27759850400017, - 3.484198309000107 - ], - [ - 113.29590905000023, - 3.511786200000131 - ], - [ - 113.299082879, - 3.519598700000117 - ], - [ - 113.30111738400015, - 3.527736721000139 - ], - [ - 113.30274498800017, - 3.549261786000059 - ], - [ - 113.30811608200011, - 3.559312242000132 - ], - [ - 113.33155358200011, - 3.577541408000116 - ], - [ - 113.33676191499998, - 3.583807684000149 - ], - [ - 113.34359785199999, - 3.594468492000189 - ], - [ - 113.39144941500004, - 3.648342190000122 - ], - [ - 113.41488691500004, - 3.688706773000092 - ], - [ - 113.42302493600002, - 3.711249091000155 - ], - [ - 113.42611738400004, - 3.734605209999984 - ], - [ - 113.43425540500002, - 3.753159898000078 - ], - [ - 113.45313561300023, - 3.768744208000072 - ], - [ - 113.49447675899998, - 3.792303778000118 - ], - [ - 113.73682701900012, - 4.001288153000147 - ], - [ - 113.94678795700011, - 4.273830471000082 - ], - [ - 113.96778405000023, - 4.322170315000093 - ], - [ - 113.96062259200019, - 4.361517645000092 - ], - [ - 113.98194420700005, - 4.394720770000106 - ], - [ - 113.99219811300011, - 4.4370791690001 - ], - [ - 113.99187259200008, - 4.484442450000131 - ], - [ - 113.96941165500019, - 4.578517971000153 - ], - [ - 113.97584069100017, - 4.59471263200011 - ], - [ - 113.99878991000017, - 4.601141669000128 - ], - [ - 114.06417932200006, - 4.570032247000157 - ], - [ - 114.1189563400001, - 4.561634827000162 - ], - [ - 114.14004032400007, - 4.550653585000177 - ], - [ - 114.17269983000008, - 4.525228780000177 - ], - [ - 114.19729781100014, - 4.515823670000131 - ], - [ - 114.20908003800017, - 4.508149719000144 - ], - [ - 114.21672814900015, - 4.48766001400017 - ], - [ - 114.222929322, - 4.484636943000154 - ], - [ - 114.2383288980001, - 4.484223532000144 - ], - [ - 114.24556359900018, - 4.481433004000081 - ], - [ - 114.24783736200018, - 4.474766744000163 - ], - [ - 114.24876753800007, - 4.466886088000123 - ], - [ - 114.25207483000023, - 4.460349020000152 - ], - [ - 114.2626168210002, - 4.448721823000184 - ], - [ - 114.26850793500003, - 4.437740581000114 - ], - [ - 114.27625940000021, - 4.409731954000108 - ], - [ - 114.27625940000021, - 4.38185251900012 - ], - [ - 114.28990197800013, - 4.361311137000143 - ], - [ - 114.29672326700009, - 4.316662700000109 - ], - [ - 114.29341597500016, - 4.307050883000102 - ], - [ - 114.27946333800017, - 4.294881084000096 - ], - [ - 114.27625940000021, - 4.289015808000102 - ], - [ - 114.27801639800018, - 4.274055481000133 - ], - [ - 114.28266727700023, - 4.264908753000142 - ], - [ - 114.31677372200014, - 4.262505799000095 - ], - [ - 114.3604919850001, - 4.253875834000155 - ], - [ - 114.40141971900013, - 4.261213887000139 - ], - [ - 114.41991988200007, - 4.260128683000147 - ], - [ - 114.43252893100018, - 4.246925354000155 - ], - [ - 114.45330285700012, - 4.183699239000177 - ], - [ - 114.46312137900017, - 4.164139709000082 - ], - [ - 114.47738407500006, - 4.144967753000159 - ], - [ - 114.54022261600014, - 4.086935120000192 - ], - [ - 114.5614099530001, - 4.072026469000136 - ], - [ - 114.56936812400025, - 4.064404195000165 - ], - [ - 114.57422570800017, - 4.054146423000176 - ], - [ - 114.5816671150001, - 4.029341736000148 - ], - [ - 114.58662805200007, - 4.021435242000095 - ], - [ - 114.62776249200013, - 4.016681010000113 - ], - [ - 114.67489139800003, - 4.044069519000146 - ], - [ - 114.7668754480002, - 4.131816101000183 - ], - [ - 114.77452356000018, - 4.14646637000007 - ], - [ - 114.78010461500011, - 4.187755839000175 - ], - [ - 114.78713260900011, - 4.20721201600017 - ], - [ - 114.80997359200003, - 4.241292623000135 - ], - [ - 114.8172082930001, - 4.25966359500012 - ], - [ - 114.81379764900024, - 4.277104391000165 - ], - [ - 114.78258508400009, - 4.264417826000113 - ], - [ - 114.78196496600012, - 4.284933370000189 - ], - [ - 114.78785607900014, - 4.294157613000095 - ], - [ - 114.79416325000008, - 4.300239528000162 - ], - [ - 114.81824182100016, - 4.323458151000153 - ], - [ - 114.82899051900009, - 4.340485535000184 - ], - [ - 114.8364319250002, - 4.357228699000132 - ], - [ - 114.8456303310002, - 4.395107524000124 - ], - [ - 114.84790409400014, - 4.423736268000198 - ], - [ - 114.84046268800003, - 4.428619691000137 - ], - [ - 114.8256832270001, - 4.426190898000172 - ], - [ - 114.80604618300006, - 4.433322246000117 - ], - [ - 114.7881661380001, - 4.461201680000087 - ], - [ - 114.78217167200009, - 4.497788595000131 - ], - [ - 114.77731408700006, - 4.614654847000168 - ], - [ - 114.77390344200003, - 4.636824036000107 - ], - [ - 114.76811568300016, - 4.657494609000125 - ], - [ - 114.74878869699998, - 4.694391581000147 - ], - [ - 114.74134729000016, - 4.712943420000087 - ], - [ - 114.74196740800002, - 4.729454040000164 - ], - [ - 114.74319203400003, - 4.73058520800015 - ], - [ - 114.75178593000012, - 4.738523255000132 - ], - [ - 114.78847619700016, - 4.753896993000112 - ], - [ - 114.80542606700018, - 4.764568177000115 - ], - [ - 114.83767216000015, - 4.795315654000163 - ], - [ - 114.85575891100004, - 4.806658630000143 - ], - [ - 114.87818648300006, - 4.812808126000121 - ], - [ - 114.8964799400002, - 4.811826274000154 - ], - [ - 114.91487675000022, - 4.808725688000109 - ], - [ - 114.9324467370001, - 4.80913909900012 - ], - [ - 114.9483630780002, - 4.818931783000082 - ], - [ - 114.95487430900019, - 4.834202169000136 - ], - [ - 114.95570113100021, - 4.85091949500017 - ], - [ - 114.9589050700001, - 4.866293234000153 - ], - [ - 114.98170006600012, - 4.889064846000096 - ], - [ - 114.99244225400005, - 4.894232489000103 - ], - [ - 115.00196373800011, - 4.900051174000154 - ], - [ - 115.00993899800008, - 4.907171942000105 - ], - [ - 115.0157983730002, - 4.916408596000068 - ], - [ - 115.02263431100002, - 4.895900783000116 - ], - [ - 115.0236108730002, - 4.857082424000097 - ], - [ - 115.02955162900005, - 4.820868231000176 - ], - [ - 115.02977835200025, - 4.820641508000151 - ], - [ - 115.02277714100015, - 4.741365458000104 - ], - [ - 115.02680790200023, - 4.660026754000114 - ], - [ - 115.03548954300018, - 4.62124359200007 - ], - [ - 115.06814904800015, - 4.543367208000106 - ], - [ - 115.07982792200002, - 4.503963928000189 - ], - [ - 115.0918168540002, - 4.405416972000125 - ], - [ - 115.09977502500024, - 4.391231791000166 - ], - [ - 115.11300419200003, - 4.382369284000163 - ], - [ - 115.16995162000003, - 4.361259460000127 - ], - [ - 115.1908288980002, - 4.356763611000105 - ], - [ - 115.22069787600012, - 4.359760844000121 - ], - [ - 115.22906945800011, - 4.356763611000105 - ], - [ - 115.24467574100007, - 4.343663635000141 - ], - [ - 115.25511438100008, - 4.339245300000144 - ], - [ - 115.27433801300018, - 4.340020447000157 - ], - [ - 115.28312300700017, - 4.336764832000171 - ], - [ - 115.30120975800011, - 4.32469838500019 - ], - [ - 115.32436080000016, - 4.314595642000143 - ], - [ - 115.34627160700015, - 4.313768820000121 - ], - [ - 115.36074100800025, - 4.329555970000115 - ], - [ - 115.3582605390001, - 4.350278219000145 - ], - [ - 115.34379113800017, - 4.371672261000157 - ], - [ - 115.308651164, - 4.404693502000129 - ], - [ - 115.28560347500016, - 4.435363465000165 - ], - [ - 115.27247766200017, - 4.474663391000135 - ], - [ - 115.26689660600007, - 4.516857198000196 - ], - [ - 115.26741337100012, - 4.556208802000185 - ], - [ - 115.27547489399998, - 4.59574127200014 - ], - [ - 115.27702518800012, - 4.613052877000143 - ], - [ - 115.27268436700015, - 4.636772359000176 - ], - [ - 115.2073653570001, - 4.825598043000184 - ], - [ - 115.18225061100017, - 4.861228943000171 - ], - [ - 115.16933150200023, - 4.86998809800015 - ], - [ - 115.15599898300005, - 4.876292623000069 - ], - [ - 115.14680057800015, - 4.885620219000188 - ], - [ - 115.14616946700008, - 4.908514716000184 - ], - [ - 115.16285241000017, - 4.908026434000107 - ], - [ - 115.17823326900023, - 4.910060940000136 - ], - [ - 115.18946373800023, - 4.917466539000117 - ], - [ - 115.19890384200002, - 4.950751044000114 - ], - [ - 115.21062259200002, - 4.959702867000146 - ], - [ - 115.22437584700006, - 4.958319403000161 - ], - [ - 115.23552493600008, - 4.94432200700011 - ], - [ - 115.23861738400015, - 4.937323309000121 - ], - [ - 115.24390709700006, - 4.93545156500015 - ], - [ - 115.26563561300011, - 4.936916408000116 - ], - [ - 115.27523847700016, - 4.935248114000103 - ], - [ - 115.28532962300002, - 4.931219794000143 - ], - [ - 115.293223504, - 4.925726630000113 - ], - [ - 115.30396569100006, - 4.906154690000136 - ], - [ - 115.32162519600016, - 4.900132554000137 - ], - [ - 115.34229576900023, - 4.899807033000116 - ], - [ - 115.35840905000023, - 4.902777411000116 - ], - [ - 115.37029056100019, - 4.910874742000146 - ], - [ - 115.40349368600019, - 4.94432200700011 - ], - [ - 115.40788821700008, - 4.950344143000109 - ], - [ - 115.44776451900023, - 4.985296942000119 - ], - [ - 115.47974694100006, - 5.026027736000103 - ], - [ - 115.49219811300006, - 5.032456773000106 - ], - [ - 115.51246178500017, - 5.035874742000118 - ], - [ - 115.53174889400012, - 5.044623114000103 - ], - [ - 115.54761803500006, - 5.055812893000109 - ], - [ - 115.5569767590001, - 5.067206122000158 - ], - [ - 115.56299889400006, - 5.083156643000081 - ], - [ - 115.56983483200011, - 5.123724677000098 - ], - [ - 115.57129967500023, - 5.160060940000079 - ], - [ - 115.57349694100006, - 5.169663804000066 - ], - [ - 115.58423912900017, - 5.190130927000126 - ], - [ - 115.59253991000006, - 5.198675848000136 - ], - [ - 115.601328972, - 5.204575914000173 - ], - [ - 115.605235222, - 5.212103583000129 - ], - [ - 115.59864342500023, - 5.225490627000141 - ], - [ - 115.56080162900011, - 5.20783112200013 - ], - [ - 115.52377363400015, - 5.208807684000107 - ], - [ - 115.48975670700023, - 5.222967841000127 - ], - [ - 115.40064537900017, - 5.299994208000101 - ], - [ - 115.39812259200002, - 5.309312242000132 - ], - [ - 115.40040123800011, - 5.317857164000159 - ], - [ - 115.39975019600016, - 5.32420482000019 - ], - [ - 115.38917076900012, - 5.326646226000122 - ], - [ - 115.38477623800023, - 5.324408270000148 - ], - [ - 115.36524498800023, - 5.307440497000172 - ], - [ - 115.35962975400005, - 5.319647528000147 - ], - [ - 115.36264082100016, - 5.33388906500015 - ], - [ - 115.36866295700017, - 5.349310614000089 - ], - [ - 115.37525475400005, - 5.381984768000123 - ], - [ - 115.38233483200011, - 5.395249742000146 - ], - [ - 115.38941491000006, - 5.405666408000144 - ], - [ - 115.39258873800011, - 5.413275458000086 - ], - [ - 115.40430748800011, - 5.423895575000117 - ], - [ - 115.45639082100016, - 5.454331773000177 - ], - [ - 115.46827233200011, - 5.474676825000159 - ], - [ - 115.47950280000012, - 5.489691473000093 - ], - [ - 115.55014082100016, - 5.540187893000109 - ], - [ - 115.58521569100006, - 5.616156317000133 - ], - [ - 115.60482832099999, - 5.635809637000179 - ], - [ - 115.61882571700008, - 5.6128604190001 - ], - [ - 115.58432050900015, - 5.548488674000097 - ], - [ - 115.60482832099999, - 5.519720770000148 - ], - [ - 115.61003665500019, - 5.530096747000144 - ], - [ - 115.61443118600019, - 5.557277736000145 - ], - [ - 115.61915123800011, - 5.568060614000061 - ], - [ - 115.65333092500006, - 5.538641669000157 - ], - [ - 115.67408287900017, - 5.529364325000117 - ], - [ - 115.76238040500007, - 5.523138739000146 - ], - [ - 115.79127037900017, - 5.524888414000145 - ], - [ - 115.81771894600004, - 5.5333519550001 - ], - [ - 115.84864342500006, - 5.560003973000121 - ], - [ - 115.87435957100004, - 5.599351304000123 - ], - [ - 115.89421634200002, - 5.64325592700007 - ], - [ - 115.90650475400017, - 5.683579820000119 - ], - [ - 115.91407311300023, - 5.727443752000084 - ], - [ - 115.91993248800006, - 5.746771552000098 - ], - [ - 115.93067467500012, - 5.763006903000147 - ], - [ - 115.94532311300011, - 5.774847723000107 - ], - [ - 116.03516686300011, - 5.824937242000118 - ], - [ - 116.05079186300011, - 5.842271226000193 - ], - [ - 116.05738366000017, - 5.865139065000108 - ], - [ - 116.06031334700018, - 5.911281643000123 - ], - [ - 116.06641686300006, - 5.930650132000139 - ], - [ - 116.12769616000011, - 6.029771226000193 - ], - [ - 116.141856316, - 6.073065497000087 - ], - [ - 116.12623131600006, - 6.102525132000082 - ], - [ - 116.10377037900005, - 6.094712632000082 - ], - [ - 116.09595787900005, - 6.107733466000155 - ], - [ - 116.10596764400023, - 6.126450914000131 - ], - [ - 116.13640384200019, - 6.136053778000118 - ], - [ - 116.15406334700018, - 6.147284247000115 - ], - [ - 116.20134524800008, - 6.217962958000058 - ], - [ - 116.22266686300011, - 6.237209377000099 - ], - [ - 116.23536217500006, - 6.243475653000147 - ], - [ - 116.25220787900017, - 6.245917059000178 - ], - [ - 116.26400800900015, - 6.241888739000117 - ], - [ - 116.27898196700019, - 6.234930731000134 - ], - [ - 116.29151451900006, - 6.232611395000077 - ], - [ - 116.29688561300023, - 6.24249909100017 - ], - [ - 116.29273522200012, - 6.275783596000082 - ], - [ - 116.28052819100006, - 6.278550523000135 - ], - [ - 116.26140384200008, - 6.269354559000163 - ], - [ - 116.236094597, - 6.266343492000161 - ], - [ - 116.236094597, - 6.272609768000109 - ], - [ - 116.26335696700019, - 6.286851304000109 - ], - [ - 116.27906334700018, - 6.303941148000149 - ], - [ - 116.28321373800011, - 6.307359117000161 - ], - [ - 116.29053795700011, - 6.308579820000176 - ], - [ - 116.31055748800006, - 6.307359117000161 - ], - [ - 116.31999759200019, - 6.313381252000084 - ], - [ - 116.322032097, - 6.316717841000099 - ], - [ - 116.32195071700002, - 6.322333075000103 - ], - [ - 116.33057701900023, - 6.354234117000118 - ], - [ - 116.33326256600006, - 6.360581773000149 - ], - [ - 116.33838951900023, - 6.368841864000132 - ], - [ - 116.34766686300011, - 6.379584052000055 - ], - [ - 116.43637129000015, - 6.446844794000086 - ], - [ - 116.45142662900017, - 6.46190013200011 - ], - [ - 116.46949303500011, - 6.475775458000101 - ], - [ - 116.48829186300023, - 6.484279690000122 - ], - [ - 116.503184441, - 6.495184637000108 - ], - [ - 116.50912519600004, - 6.516546942000147 - ], - [ - 116.50977623800006, - 6.534613348000079 - ], - [ - 116.51319420700011, - 6.553697007000068 - ], - [ - 116.52068118600008, - 6.568752346000082 - ], - [ - 116.53394616000017, - 6.57485586100016 - ], - [ - 116.551524285, - 6.588364976000136 - ], - [ - 116.61353600400017, - 6.671087958000101 - ], - [ - 116.62859134200008, - 6.685370184000178 - ], - [ - 116.6390080090001, - 6.699286200000159 - ], - [ - 116.64503014400006, - 6.716945705000086 - ], - [ - 116.64698326900012, - 6.742417710000083 - ], - [ - 116.64535566499998, - 6.776312567000133 - ], - [ - 116.64698326900012, - 6.786525783000087 - ], - [ - 116.65113366000017, - 6.794419664000145 - ], - [ - 116.66334069100006, - 6.811021226000193 - ], - [ - 116.66749108200005, - 6.821275132000139 - ], - [ - 116.66578209700018, - 6.859605210000069 - ], - [ - 116.66920006600017, - 6.876410223000079 - ], - [ - 116.69752037900005, - 6.889715887000094 - ], - [ - 116.70582116, - 6.905340887000179 - ], - [ - 116.71534264400012, - 6.94476959800015 - ], - [ - 116.716563347, - 6.966742255000071 - ], - [ - 116.71892337300008, - 6.975409247000158 - ], - [ - 116.72608483200011, - 6.978949286000145 - ], - [ - 116.73023522200006, - 6.982407945000148 - ], - [ - 116.74097741000017, - 6.998439846000139 - ], - [ - 116.74642988400004, - 7.01044342700007 - ], - [ - 116.75505618600013, - 7.018744208000129 - ], - [ - 116.765879754, - 7.025091864000075 - ], - [ - 116.77735436300023, - 7.026760158000087 - ], - [ - 116.780528191, - 7.022772528000104 - ], - [ - 116.79086347700004, - 7.000067450000159 - ], - [ - 116.83204186300011, - 6.973334052000141 - ], - [ - 116.83814537900017, - 6.962144273000135 - ] - ] - ], - [ - [ - [ - 117.02271569100017, - 7.318833726000179 - ], - [ - 117.02035566500004, - 7.294582424000097 - ], - [ - 117.010020379, - 7.279974677000084 - ], - [ - 116.99154707099999, - 7.297186591000099 - ], - [ - 116.9767358730002, - 7.290228583000115 - ], - [ - 116.97144616000006, - 7.271389065000079 - ], - [ - 116.98218834700006, - 7.253322658000144 - ], - [ - 116.88648522200012, - 7.229396877000084 - ], - [ - 116.89112389400012, - 7.219916083000086 - ], - [ - 116.89975019600004, - 7.214585679000109 - ], - [ - 116.90512128999998, - 7.208929755000128 - ], - [ - 116.90015709700006, - 7.19806549700013 - ], - [ - 116.89096113400015, - 7.193670966000155 - ], - [ - 116.87680097700004, - 7.192531643000123 - ], - [ - 116.86231530000006, - 7.194159247000144 - ], - [ - 116.85181725400005, - 7.19806549700013 - ], - [ - 116.90015709700006, - 7.287420966000155 - ], - [ - 116.91439863400015, - 7.293931382000054 - ], - [ - 116.94800866000017, - 7.301906643000109 - ], - [ - 116.96168053500011, - 7.307928778000118 - ], - [ - 117.00261478000002, - 7.355698960000069 - ], - [ - 117.01685631600006, - 7.342596747000087 - ], - [ - 117.02271569100017, - 7.318833726000179 - ] - ] - ], - [ - [ - [ - 117.26238040500019, - 7.20197174700013 - ], - [ - 117.24708092500023, - 7.183172919000171 - ], - [ - 117.22974694100006, - 7.191839911000088 - ], - [ - 117.21094811300011, - 7.184393622000101 - ], - [ - 117.15284264400023, - 7.173081773000121 - ], - [ - 117.14039147200006, - 7.167629299000083 - ], - [ - 117.13477623800023, - 7.161932684000107 - ], - [ - 117.10808353000013, - 7.149562893000152 - ], - [ - 117.09888756600006, - 7.143459377000084 - ], - [ - 117.09205162900005, - 7.131984768000123 - ], - [ - 117.08790123800006, - 7.120754299000126 - ], - [ - 117.08236738400015, - 7.110663153000161 - ], - [ - 117.07154381600017, - 7.102484442000147 - ], - [ - 117.06413821700019, - 7.126654364000075 - ], - [ - 117.05640709700018, - 7.202866929000123 - ], - [ - 117.06128991000006, - 7.219142971000153 - ], - [ - 117.06519616000006, - 7.226385809000178 - ], - [ - 117.06413821700019, - 7.270738023000121 - ], - [ - 117.06771894600016, - 7.280015367000161 - ], - [ - 117.07325280000006, - 7.284979559000121 - ], - [ - 117.08904056100002, - 7.290350653000175 - ], - [ - 117.09888756600006, - 7.295843817000105 - ], - [ - 117.12289472699999, - 7.320013739000117 - ], - [ - 117.145274285, - 7.335516669000128 - ], - [ - 117.15772545700023, - 7.340725002000127 - ], - [ - 117.171153191, - 7.34267812700007 - ], - [ - 117.24626712300002, - 7.355780341000141 - ], - [ - 117.27003014400023, - 7.348863023000135 - ], - [ - 117.28191165500019, - 7.332342841000155 - ], - [ - 117.28321373800006, - 7.30878327000012 - ], - [ - 117.27344811300023, - 7.231919664000188 - ], - [ - 117.26238040500019, - 7.20197174700013 - ] - ] - ], - [ - [ - [ - 119.84978274800014, - 4.796861070000134 - ], - [ - 119.83399498800006, - 4.796616929000095 - ], - [ - 119.81934655000018, - 4.803859768000109 - ], - [ - 119.8123478520001, - 4.816839911000116 - ], - [ - 119.83090253999998, - 4.82094961100016 - ], - [ - 119.853770379, - 4.808254299000097 - ], - [ - 119.85767662900011, - 4.798570054000137 - ], - [ - 119.84978274800014, - 4.796861070000134 - ] - ] - ], - [ - [ - [ - 119.46705162900011, - 4.666449286000116 - ], - [ - 119.45655358200023, - 4.655707098000107 - ], - [ - 119.45655358200023, - 4.717759507000139 - ], - [ - 119.46273847699999, - 4.77578359600011 - ], - [ - 119.45687910200016, - 4.842718817000119 - ], - [ - 119.44849694100017, - 4.874416408000087 - ], - [ - 119.43539472700004, - 4.902777411000116 - ], - [ - 119.447032097, - 4.905503648000177 - ], - [ - 119.45850670700005, - 4.90180084800015 - ], - [ - 119.46876061300011, - 4.893703518000123 - ], - [ - 119.47592207100004, - 4.883775132000125 - ], - [ - 119.47934004000015, - 4.875962632000125 - ], - [ - 119.48145592500023, - 4.867743231000134 - ], - [ - 119.48292076900012, - 4.859361070000162 - ], - [ - 119.48324629000015, - 4.850897528000132 - ], - [ - 119.48658287900017, - 4.832220770000148 - ], - [ - 119.50098717500023, - 4.799139716000113 - ], - [ - 119.50440514400023, - 4.78261953300013 - ], - [ - 119.50359134200002, - 4.764227606000176 - ], - [ - 119.5008244150001, - 4.74848053600013 - ], - [ - 119.49659264400023, - 4.733587958000086 - ], - [ - 119.46705162900011, - 4.666449286000116 - ] - ] - ], - [ - [ - [ - 119.83692467500012, - 4.862860419000157 - ], - [ - 119.82105553500017, - 4.862779039000173 - ], - [ - 119.79859459700018, - 4.879787502000141 - ], - [ - 119.79037519600016, - 4.905951239000089 - ], - [ - 119.79314212300002, - 4.92186107000019 - ], - [ - 119.80437259200002, - 4.927435614000117 - ], - [ - 119.815684441, - 4.922430731000162 - ], - [ - 119.82146243600008, - 4.914129950000103 - ], - [ - 119.8426212900001, - 4.904852606000134 - ], - [ - 119.85075931100019, - 4.887884833000072 - ], - [ - 119.849864129, - 4.87327708500014 - ], - [ - 119.842051629, - 4.865668036000116 - ], - [ - 119.83692467500012, - 4.862860419000157 - ] - ] - ], - [ - [ - [ - 119.80795332099999, - 5.058661200000145 - ], - [ - 119.801036004, - 5.05516185100015 - ], - [ - 119.79656009200002, - 5.057603257000096 - ], - [ - 119.79224694100006, - 5.055894273000177 - ], - [ - 119.79029381600017, - 5.053045966000141 - ], - [ - 119.78614342500023, - 5.046332098000107 - ], - [ - 119.774668816, - 5.041896877000127 - ], - [ - 119.75212649800014, - 5.036078192000076 - ], - [ - 119.74577884200019, - 5.044012762000136 - ], - [ - 119.74870853000013, - 5.06268952000012 - ], - [ - 119.76929772200006, - 5.097560940000136 - ], - [ - 119.78296959700018, - 5.11098867400014 - ], - [ - 119.79835045700023, - 5.121039130000113 - ], - [ - 119.80600019600016, - 5.118475653000104 - ], - [ - 119.80551191500015, - 5.105047919000114 - ], - [ - 119.80713951900006, - 5.093410549000112 - ], - [ - 119.81055748800011, - 5.08246491100013 - ], - [ - 119.81251061300023, - 5.069891669000143 - ], - [ - 119.80795332099999, - 5.058661200000145 - ] - ] - ], - [ - [ - [ - 120.22022545700011, - 5.269598700000131 - ], - [ - 120.22754967500012, - 5.268459377000099 - ], - [ - 120.23568769600004, - 5.271958726000179 - ], - [ - 120.243907097, - 5.273504950000131 - ], - [ - 120.25196373800023, - 5.266506252000141 - ], - [ - 120.25294030000012, - 5.251532294000114 - ], - [ - 120.23764082100016, - 5.190130927000126 - ], - [ - 120.23243248800006, - 5.150458075000103 - ], - [ - 120.22681725400017, - 5.129380601000179 - ], - [ - 120.21656334700006, - 5.114976304000109 - ], - [ - 120.20199629000004, - 5.119940497000158 - ], - [ - 120.191172722, - 5.126369533000087 - ], - [ - 120.18458092500023, - 5.136460679000137 - ], - [ - 120.18238366000006, - 5.15281810100015 - ], - [ - 120.18873131600017, - 5.182359117000118 - ], - [ - 120.18962649800008, - 5.196519273000135 - ], - [ - 120.18238366000006, - 5.204413153000118 - ], - [ - 120.17595462300002, - 5.202622789000131 - ], - [ - 120.17310631600012, - 5.195624091000141 - ], - [ - 120.17156009200008, - 5.1876488300001 - ], - [ - 120.168711785, - 5.183294989000103 - ], - [ - 120.16358483200011, - 5.182318427000126 - ], - [ - 120.14551842500006, - 5.183294989000103 - ], - [ - 120.13795006600006, - 5.187201239000103 - ], - [ - 120.13054446700002, - 5.196600653000118 - ], - [ - 120.12452233200023, - 5.208075262000165 - ], - [ - 120.12094160200016, - 5.218003648000163 - ], - [ - 120.11052493600008, - 5.203436591000141 - ], - [ - 120.10816491000006, - 5.17084381700009 - ], - [ - 120.10043379000004, - 5.156642971000082 - ], - [ - 120.08594811300006, - 5.150702216000141 - ], - [ - 120.07097415500002, - 5.153876044000114 - ], - [ - 120.0569767590001, - 5.159898179000123 - ], - [ - 120.04574629000015, - 5.163478908000087 - ], - [ - 120.02540123800006, - 5.160549221000068 - ], - [ - 120.01742597700004, - 5.152492580000128 - ], - [ - 120.01351972700004, - 5.141262111000131 - ], - [ - 120.00489342500012, - 5.128648179000052 - ], - [ - 119.99773196700008, - 5.126898505000057 - ], - [ - 119.98829186300006, - 5.127671617000175 - ], - [ - 119.98047936300006, - 5.126450914000159 - ], - [ - 119.97706139400017, - 5.118719794000143 - ], - [ - 119.97022545700023, - 5.087713934000121 - ], - [ - 119.95411217500006, - 5.075506903000147 - ], - [ - 119.94336998800017, - 5.078070380000057 - ], - [ - 119.93425540500007, - 5.085516669000128 - ], - [ - 119.92237389400012, - 5.087713934000121 - ], - [ - 119.91431725400017, - 5.082017320000134 - ], - [ - 119.90015709700006, - 5.063706773000177 - ], - [ - 119.89161217500023, - 5.059800523000177 - ], - [ - 119.86036217500006, - 5.059800523000177 - ], - [ - 119.84717858200023, - 5.054510809000107 - ], - [ - 119.838145379, - 5.048976955000086 - ], - [ - 119.82984459700006, - 5.048814195000119 - ], - [ - 119.81934655000018, - 5.059800523000177 - ], - [ - 119.81690514400023, - 5.072211005000113 - ], - [ - 119.81910241, - 5.106634833000143 - ], - [ - 119.81251061300023, - 5.122503973000079 - ], - [ - 119.82178795700011, - 5.130560614000103 - ], - [ - 119.82943769600004, - 5.134955145000092 - ], - [ - 119.86475670700017, - 5.146470445000119 - ], - [ - 119.89551842500023, - 5.161200262000122 - ], - [ - 119.90186608200005, - 5.166896877000099 - ], - [ - 119.90796959700006, - 5.169378973000121 - ], - [ - 119.94271894600004, - 5.190130927000126 - ], - [ - 119.95671634200008, - 5.21482982000019 - ], - [ - 119.96485436300011, - 5.222601630000113 - ], - [ - 119.99626712300014, - 5.227525132000068 - ], - [ - 120.01986738400015, - 5.236517645000092 - ], - [ - 120.02849368600008, - 5.238511460000126 - ], - [ - 120.03614342500006, - 5.241603908000116 - ], - [ - 120.05258222699999, - 5.258978583000086 - ], - [ - 120.06299889400006, - 5.259751695000105 - ], - [ - 120.07007897200006, - 5.25665924700013 - ], - [ - 120.07683353000007, - 5.254828192000147 - ], - [ - 120.08692467500023, - 5.258978583000086 - ], - [ - 120.08871504000004, - 5.263739325000174 - ], - [ - 120.09327233200005, - 5.282700914000188 - ], - [ - 120.097422722, - 5.29002513200011 - ], - [ - 120.12419681100013, - 5.305650132000096 - ], - [ - 120.13379967500006, - 5.317572333000129 - ], - [ - 120.146250847, - 5.323879299000069 - ], - [ - 120.16879316499998, - 5.332261460000126 - ], - [ - 120.18783613399998, - 5.345119533000144 - ], - [ - 120.19857832099999, - 5.349595445000119 - ], - [ - 120.20875084700006, - 5.347967841000099 - ], - [ - 120.21436608200023, - 5.340236721000082 - ], - [ - 120.21631920700011, - 5.329046942000076 - ], - [ - 120.21631920700011, - 5.276841539000145 - ], - [ - 120.22022545700011, - 5.269598700000131 - ] - ] - ], - [ - [ - [ - 125.42335045700005, - 5.377915757000068 - ], - [ - 125.41871178500006, - 5.368475653000147 - ], - [ - 125.41163170700005, - 5.368109442000133 - ], - [ - 125.39909915500019, - 5.371771552000084 - ], - [ - 125.38062584700006, - 5.370347398000121 - ], - [ - 125.36378014400023, - 5.367173570000148 - ], - [ - 125.35157311300006, - 5.371730861000103 - ], - [ - 125.34327233200011, - 5.380601304000137 - ], - [ - 125.33423912900017, - 5.38768138200011 - ], - [ - 125.33350670700017, - 5.392523505000085 - ], - [ - 125.34205162900017, - 5.400295315000093 - ], - [ - 125.35816491000006, - 5.422064520000148 - ], - [ - 125.37680097700004, - 5.431219794000128 - ], - [ - 125.40479576900023, - 5.430487372000101 - ], - [ - 125.41871178500006, - 5.425482489000146 - ], - [ - 125.42221113400004, - 5.42023346600017 - ], - [ - 125.42457116000017, - 5.407375393000137 - ], - [ - 125.42335045700005, - 5.377915757000068 - ] - ] - ], - [ - [ - [ - 120.89779707099999, - 5.49852122600015 - ], - [ - 120.87989342500012, - 5.495754299000097 - ], - [ - 120.85084069100006, - 5.505438544000143 - ], - [ - 120.84343509200008, - 5.51007721600017 - ], - [ - 120.83301842500006, - 5.521063544000128 - ], - [ - 120.82374108200023, - 5.53363678600013 - ], - [ - 120.81983483200023, - 5.543280341000099 - ], - [ - 120.82439212300008, - 5.553208726000193 - ], - [ - 120.83529707100016, - 5.562933661000145 - ], - [ - 120.848887566, - 5.5704613300001 - ], - [ - 120.86068769600016, - 5.5743675800001 - ], - [ - 120.87305748800011, - 5.572414455000143 - ], - [ - 120.88998457099999, - 5.557928778000104 - ], - [ - 120.90455162900005, - 5.538031317000105 - ], - [ - 120.90919030000023, - 5.519720770000148 - ], - [ - 120.89779707099999, - 5.49852122600015 - ] - ] - ], - [ - [ - [ - 120.81999759200019, - 5.667181708000115 - ], - [ - 120.80811608200023, - 5.664292710000097 - ], - [ - 120.79932701900006, - 5.667629299000112 - ], - [ - 120.79664147200018, - 5.678615627000084 - ], - [ - 120.80738366, - 5.695705471000124 - ], - [ - 120.83301842500006, - 5.706773179000066 - ], - [ - 120.84864342500023, - 5.706976630000113 - ], - [ - 120.860118035, - 5.703843492000132 - ], - [ - 120.87924238399998, - 5.694077867000189 - ], - [ - 120.88266035199999, - 5.685288804000123 - ], - [ - 120.87370853000007, - 5.682928778000175 - ], - [ - 120.860118035, - 5.675848700000117 - ], - [ - 120.83887780000012, - 5.668646552000084 - ], - [ - 120.81999759200019, - 5.667181708000115 - ] - ] - ], - [ - [ - [ - 120.92432701900023, - 5.711737372000115 - ], - [ - 120.90992272200018, - 5.700018622000115 - ], - [ - 120.89087975400017, - 5.709784247000158 - ], - [ - 120.89234459700006, - 5.741441148000135 - ], - [ - 120.90430748800006, - 5.759100653000147 - ], - [ - 120.91618899800002, - 5.753241278000104 - ], - [ - 120.92937259200008, - 5.73322174700013 - ], - [ - 120.92432701900023, - 5.711737372000115 - ] - ] - ], - [ - [ - [ - 121.23113040500007, - 5.800930080000157 - ], - [ - 121.22527103000019, - 5.799261786000145 - ], - [ - 121.19703209700006, - 5.800930080000157 - ], - [ - 121.16211998800011, - 5.78758372600015 - ], - [ - 121.14649498800023, - 5.789536851000193 - ], - [ - 121.13502037900017, - 5.807074286000145 - ], - [ - 121.13502037900017, - 5.821519273000192 - ], - [ - 121.14226321700019, - 5.833889065000136 - ], - [ - 121.15267988399998, - 5.843085028000118 - ], - [ - 121.16285241000006, - 5.848049221000153 - ], - [ - 121.17994225400011, - 5.846747137000165 - ], - [ - 121.19516035200016, - 5.840480861000117 - ], - [ - 121.20785566500004, - 5.831203518000152 - ], - [ - 121.21745853000019, - 5.820746161000088 - ], - [ - 121.22982832100016, - 5.816148179000137 - ], - [ - 121.23462975400005, - 5.810695705000114 - ], - [ - 121.23113040500007, - 5.800930080000157 - ] - ] - ], - [ - [ - [ - 121.84620201900012, - 6.042792059000092 - ], - [ - 121.87094160200016, - 6.033107815000136 - ], - [ - 121.90235436300011, - 6.033636786000116 - ], - [ - 121.92904707100004, - 6.045355536000102 - ], - [ - 121.94044030000006, - 6.046087958000129 - ], - [ - 121.94320722700016, - 6.033636786000116 - ], - [ - 121.937754754, - 6.029445705000086 - ], - [ - 121.91277103000019, - 6.016017971000096 - ], - [ - 121.86841881600006, - 5.999741929000066 - ], - [ - 121.85767662900005, - 6.00226471600017 - ], - [ - 121.80494225400005, - 6.037176825000103 - ], - [ - 121.78467858200023, - 6.05955638200011 - ], - [ - 121.776621941, - 6.077378648000177 - ], - [ - 121.79371178500006, - 6.074611721000124 - ], - [ - 121.84620201900012, - 6.042792059000092 - ] - ] - ], - [ - [ - [ - 121.04224694100006, - 6.097113348000121 - ], - [ - 121.077403191, - 6.095282294000143 - ], - [ - 121.09636478000002, - 6.096136786000145 - ], - [ - 121.11475670700005, - 6.095119533000087 - ], - [ - 121.12582441500004, - 6.090643622000115 - ], - [ - 121.14828535200004, - 6.077378648000177 - ], - [ - 121.15935306100008, - 6.074611721000124 - ], - [ - 121.17904707099999, - 6.063625393000081 - ], - [ - 121.20232181100019, - 6.013169664000145 - ], - [ - 121.21778405000023, - 5.998928127000141 - ], - [ - 121.23601321700019, - 6.003566799000083 - ], - [ - 121.25245201900012, - 6.017320054000095 - ], - [ - 121.27125084700006, - 6.02619049700013 - ], - [ - 121.31657962300008, - 6.006089585000097 - ], - [ - 121.33887780000012, - 6.004339911000102 - ], - [ - 121.38160241, - 6.005682684000178 - ], - [ - 121.40349368600008, - 5.999457098000121 - ], - [ - 121.42123457100016, - 5.987127997000172 - ], - [ - 121.42872155000012, - 5.969794012000179 - ], - [ - 121.41944420700005, - 5.947984117000132 - ], - [ - 121.40992272200018, - 5.943019924000083 - ], - [ - 121.39991295700005, - 5.942816473000136 - ], - [ - 121.39177493600008, - 5.939886786000116 - ], - [ - 121.38843834700006, - 5.926906643000109 - ], - [ - 121.38949628999998, - 5.909857489000061 - ], - [ - 121.38575280000023, - 5.911363023000106 - ], - [ - 121.34766686300006, - 5.906195380000113 - ], - [ - 121.340586785, - 5.90326569200009 - ], - [ - 121.33082116000017, - 5.895331122000115 - ], - [ - 121.302989129, - 5.865139065000108 - ], - [ - 121.29249108200023, - 5.858832098000079 - ], - [ - 121.2814233730002, - 5.859035549000126 - ], - [ - 121.27100670700011, - 5.863918361000088 - ], - [ - 121.26172936300017, - 5.871975002000127 - ], - [ - 121.25342858200005, - 5.885321356000134 - ], - [ - 121.25196373800011, - 5.89679596600017 - ], - [ - 121.25318444100006, - 5.906927802000141 - ], - [ - 121.25245201900012, - 5.916327216000155 - ], - [ - 121.227793816, - 5.942124742000189 - ], - [ - 121.18946373800006, - 5.94025299700013 - ], - [ - 121.10792076900023, - 5.90326569200009 - ], - [ - 121.08822675900004, - 5.891180731000176 - ], - [ - 121.08106530000006, - 5.888169664000173 - ], - [ - 121.07300866000006, - 5.889064846000082 - ], - [ - 121.06714928500011, - 5.894232489000075 - ], - [ - 121.05445397200006, - 5.912339585000083 - ], - [ - 121.04981530000012, - 5.916327216000155 - ], - [ - 121.00831139400012, - 5.923773505000142 - ], - [ - 120.99952233200023, - 5.9200707050001 - ], - [ - 120.96387780000006, - 5.896429755000071 - ], - [ - 120.94361412900017, - 5.886867580000086 - ], - [ - 120.93409264400006, - 5.885687567000147 - ], - [ - 120.92286217500006, - 5.889064846000082 - ], - [ - 120.91765384200019, - 5.893988348000136 - ], - [ - 120.91675866000011, - 5.899969794000143 - ], - [ - 120.91724694100017, - 5.905707098000121 - ], - [ - 120.91537519600004, - 5.910101630000099 - ], - [ - 120.90935306100019, - 5.913519598000107 - ], - [ - 120.89682050900004, - 5.916571356000105 - ], - [ - 120.89185631600006, - 5.9200707050001 - ], - [ - 120.87631269600016, - 5.942572333000086 - ], - [ - 120.87183678500011, - 5.961004950000117 - ], - [ - 120.87647545700011, - 5.97870514500012 - ], - [ - 120.88884524800008, - 5.998928127000141 - ], - [ - 120.90552819100012, - 6.015041408000116 - ], - [ - 120.94320722700016, - 6.031154690000093 - ], - [ - 120.97095787900005, - 6.050116278000104 - ], - [ - 120.99284915500019, - 6.052679755000113 - ], - [ - 121.00171959700006, - 6.057562567000076 - ], - [ - 121.02418053500006, - 6.088609117000189 - ], - [ - 121.03272545700017, - 6.095119533000087 - ], - [ - 121.04224694100006, - 6.097113348000121 - ] - ] - ], - [ - [ - [ - 120.55982506600012, - 6.239081122000158 - ], - [ - 120.54558353000019, - 6.238470770000106 - ], - [ - 120.50611412900005, - 6.244086005000113 - ], - [ - 120.49463951900006, - 6.249335028000104 - ], - [ - 120.48861738399998, - 6.260158596000096 - ], - [ - 120.49203535199999, - 6.267401434000121 - ], - [ - 120.50196373800011, - 6.271389065000093 - ], - [ - 120.5149845710001, - 6.272609768000109 - ], - [ - 120.52214603000002, - 6.277248440000136 - ], - [ - 120.53003991000011, - 6.288072007000125 - ], - [ - 120.53646894599999, - 6.300685940000108 - ], - [ - 120.53931725400005, - 6.310492255000142 - ], - [ - 120.54249108200011, - 6.318019924000097 - ], - [ - 120.55665123800023, - 6.340521552000098 - ], - [ - 120.56267337300002, - 6.362005927000126 - ], - [ - 120.56959069100006, - 6.37189362200013 - ], - [ - 120.57862389400023, - 6.379095770000077 - ], - [ - 120.58814537900005, - 6.380764065000079 - ], - [ - 120.59538821700008, - 6.376044012000165 - ], - [ - 120.60035241, - 6.367580471000124 - ], - [ - 120.60352623800006, - 6.357814846000096 - ], - [ - 120.60499108200023, - 6.349351304000052 - ], - [ - 120.60434003999998, - 6.329657294000114 - ], - [ - 120.58285566500015, - 6.261460679000095 - ], - [ - 120.57732181100008, - 6.251532294000086 - ], - [ - 120.56983483200005, - 6.243638414000117 - ], - [ - 120.55982506600012, - 6.239081122000158 - ] - ] - ], - [ - [ - [ - 121.62330162900017, - 6.567531643000152 - ], - [ - 121.61638431100019, - 6.56142812700007 - ], - [ - 121.61036217500006, - 6.569566148000177 - ], - [ - 121.60792076900023, - 6.591620184000178 - ], - [ - 121.60157311300011, - 6.605454820000176 - ], - [ - 121.58961022200018, - 6.620103257000096 - ], - [ - 121.58253014400012, - 6.631659247000115 - ], - [ - 121.59083092500012, - 6.636297919000143 - ], - [ - 121.59929446700002, - 6.645656643000081 - ], - [ - 121.60726972699999, - 6.662990627000156 - ], - [ - 121.61670983200011, - 6.672267971000124 - ], - [ - 121.62891686300006, - 6.657416083000058 - ], - [ - 121.62891686300006, - 6.588568427000098 - ], - [ - 121.62330162900017, - 6.567531643000152 - ] - ] - ], - [ - [ - [ - 122.05762780000006, - 6.413885809000121 - ], - [ - 122.03874759200002, - 6.410223700000159 - ], - [ - 121.99488366000011, - 6.410345770000134 - ], - [ - 121.96225019600016, - 6.404852606000105 - ], - [ - 121.95753014400023, - 6.407294012000136 - ], - [ - 121.95639082099999, - 6.428127346000124 - ], - [ - 121.95411217500012, - 6.436916408000087 - ], - [ - 121.95004316500015, - 6.444525458000129 - ], - [ - 121.88005618600008, - 6.503241278000132 - ], - [ - 121.87956790500019, - 6.556138414000188 - ], - [ - 121.87501061300023, - 6.57485586100016 - ], - [ - 121.8556421230002, - 6.583400783000087 - ], - [ - 121.83318118600013, - 6.585150458000086 - ], - [ - 121.81446373800023, - 6.592922268000081 - ], - [ - 121.8068139980002, - 6.619289455000086 - ], - [ - 121.81080162900011, - 6.645168361000088 - ], - [ - 121.82203209700018, - 6.66095612200013 - ], - [ - 121.83920332100004, - 6.668931382000096 - ], - [ - 121.94019616000006, - 6.677313544000143 - ], - [ - 121.94825280000006, - 6.680568752000099 - ], - [ - 121.95834394600016, - 6.695054429000137 - ], - [ - 121.99789472699999, - 6.712062893000109 - ], - [ - 122.012950066, - 6.729925848000079 - ], - [ - 122.02312259200008, - 6.736639716000127 - ], - [ - 122.04021243600019, - 6.739325262000108 - ], - [ - 122.06666100400017, - 6.740708726000179 - ], - [ - 122.07520592500012, - 6.739813544000086 - ], - [ - 122.084239129, - 6.735663153000147 - ], - [ - 122.09815514400012, - 6.721584377000113 - ], - [ - 122.10596764400006, - 6.715562242000189 - ], - [ - 122.11646569100006, - 6.711086330000128 - ], - [ - 122.14128665500013, - 6.705389716000155 - ], - [ - 122.15284264400023, - 6.704575914000145 - ], - [ - 122.15626061300023, - 6.700344143000123 - ], - [ - 122.16114342500012, - 6.690904039000102 - ], - [ - 122.16871178500017, - 6.681586005000071 - ], - [ - 122.18043053500006, - 6.677313544000143 - ], - [ - 122.22510826900012, - 6.671087958000101 - ], - [ - 122.23536217500023, - 6.66620514500012 - ], - [ - 122.24154707100004, - 6.660386460000069 - ], - [ - 122.246348504, - 6.654689846000096 - ], - [ - 122.25171959700006, - 6.649969794000171 - ], - [ - 122.26254316500015, - 6.645453192000119 - ], - [ - 122.28809655000023, - 6.637884833000086 - ], - [ - 122.29672285200004, - 6.633246161000145 - ], - [ - 122.32927493600019, - 6.613836981000134 - ], - [ - 122.33521569100006, - 6.603338934000163 - ], - [ - 122.32129967500023, - 6.588568427000098 - ], - [ - 122.30062910200004, - 6.582342841000127 - ], - [ - 122.25416100400011, - 6.581284898000163 - ], - [ - 122.23536217500023, - 6.571193752000113 - ], - [ - 122.22486412900017, - 6.558254299000112 - ], - [ - 122.21566816499998, - 6.544012762000108 - ], - [ - 122.20866946700014, - 6.528753973000136 - ], - [ - 122.20386803500006, - 6.512844143000109 - ], - [ - 122.19825280000012, - 6.467596747000172 - ], - [ - 122.18864993600008, - 6.451076565000108 - ], - [ - 122.16635175900004, - 6.444525458000129 - ], - [ - 122.14380944100006, - 6.4429385440001 - ], - [ - 122.12175540500002, - 6.438544012000108 - ], - [ - 122.05762780000006, - 6.413885809000121 - ] - ] - ], - [ - [ - [ - 118.52458743600019, - 7.043646552000084 - ], - [ - 118.53248131600017, - 7.035101630000142 - ], - [ - 118.54444420700011, - 7.013088283000144 - ], - [ - 118.53760826900006, - 7.006293036000116 - ], - [ - 118.52051842500023, - 7.013373114000089 - ], - [ - 118.520274285, - 7.003159898000135 - ], - [ - 118.53077233200005, - 6.978949286000145 - ], - [ - 118.51872806100008, - 6.970933335000097 - ], - [ - 118.50310306100008, - 6.971421617000175 - ], - [ - 118.47673587300008, - 6.978949286000145 - ], - [ - 118.4451603520001, - 6.982326565000065 - ], - [ - 118.43555748800011, - 6.989243882000068 - ], - [ - 118.42839603000007, - 7.006293036000116 - ], - [ - 118.42725670700023, - 7.01821523600016 - ], - [ - 118.43140709700018, - 7.027085679000109 - ], - [ - 118.44109134200002, - 7.034328518000123 - ], - [ - 118.456309441, - 7.041001695000176 - ], - [ - 118.47478274800002, - 7.037014065000108 - ], - [ - 118.48698978000019, - 7.039780992000161 - ], - [ - 118.497325066, - 7.044663804000137 - ], - [ - 118.51026451900012, - 7.047186591000155 - ], - [ - 118.52458743600019, - 7.043646552000084 - ] - ] - ], - [ - [ - [ - 125.78394616, - 6.917425848000093 - ], - [ - 125.77686608200023, - 6.894029039000188 - ], - [ - 125.76775149800008, - 6.898871161000088 - ], - [ - 125.753672722, - 6.917466539000173 - ], - [ - 125.74537194100006, - 6.936957098000065 - ], - [ - 125.73829186300006, - 6.979193427000098 - ], - [ - 125.72535241000017, - 7.004787502000156 - ], - [ - 125.72193444100017, - 7.015570380000071 - ], - [ - 125.71762129000015, - 7.052232164000173 - ], - [ - 125.71216881600006, - 7.05630117400014 - ], - [ - 125.70378665500007, - 7.056708075000145 - ], - [ - 125.68384850400017, - 7.065252997000172 - ], - [ - 125.67790774800008, - 7.066392320000105 - ], - [ - 125.67408287900005, - 7.070217190000122 - ], - [ - 125.6717228520001, - 7.081976630000099 - ], - [ - 125.67269941500015, - 7.09275950700011 - ], - [ - 125.67693118600019, - 7.103908596000124 - ], - [ - 125.682871941, - 7.112616278000118 - ], - [ - 125.68913821700008, - 7.116115627000099 - ], - [ - 125.69654381600006, - 7.12693919500019 - ], - [ - 125.70215905000023, - 7.177150783000087 - ], - [ - 125.70655358200023, - 7.191839911000088 - ], - [ - 125.71583092500006, - 7.195949611000131 - ], - [ - 125.72364342500018, - 7.193101304000095 - ], - [ - 125.72934004000015, - 7.186102606000105 - ], - [ - 125.73316491000017, - 7.177557684000178 - ], - [ - 125.74952233200005, - 7.162054755000071 - ], - [ - 125.76734459700006, - 7.149725653000118 - ], - [ - 125.78191165500019, - 7.135199286000088 - ], - [ - 125.78785241, - 7.112982489000132 - ], - [ - 125.78126061300023, - 6.984849351000179 - ], - [ - 125.78419030000023, - 6.963120835000112 - ], - [ - 125.79127037900005, - 6.948187567000076 - ], - [ - 125.79371178500006, - 6.939520575000159 - ], - [ - 125.78972415500019, - 6.92877838700015 - ], - [ - 125.78394616, - 6.917425848000093 - ] - ] - ], - [ - [ - [ - 122.96176191500004, - 7.39891185100015 - ], - [ - 122.97169030000023, - 7.383612372000101 - ], - [ - 122.95167076900006, - 7.386419989000146 - ], - [ - 122.94450931100002, - 7.389837958000058 - ], - [ - 122.95053144600004, - 7.373480536000145 - ], - [ - 122.95232181100013, - 7.36351146000014 - ], - [ - 122.95069420700011, - 7.355698960000069 - ], - [ - 122.94353274800008, - 7.34926992400014 - ], - [ - 122.936778191, - 7.348578192000105 - ], - [ - 122.93034915500019, - 7.349676825000145 - ], - [ - 122.92457116000006, - 7.348863023000135 - ], - [ - 122.89478600400005, - 7.326808986000145 - ], - [ - 122.88298587300008, - 7.320949611000103 - ], - [ - 122.87452233200023, - 7.318670966000127 - ], - [ - 122.86158287900005, - 7.316961981000119 - ], - [ - 122.85499108200023, - 7.314764716000127 - ], - [ - 122.85075931100002, - 7.310288804000066 - ], - [ - 122.84555097700004, - 7.297796942000147 - ], - [ - 122.84205162900005, - 7.294256903000175 - ], - [ - 122.82699629000004, - 7.291327216000155 - ], - [ - 122.816661004, - 7.294907945000119 - ], - [ - 122.80860436300006, - 7.30487702000012 - ], - [ - 122.80054772200006, - 7.320949611000103 - ], - [ - 122.79468834700012, - 7.346340236000117 - ], - [ - 122.794200066, - 7.383937893000123 - ], - [ - 122.80372155000012, - 7.417466539000159 - ], - [ - 122.828379754, - 7.430812893000081 - ], - [ - 122.84310957099999, - 7.422796942000133 - ], - [ - 122.85499108200023, - 7.407863674000083 - ], - [ - 122.86719811300011, - 7.395982164000131 - ], - [ - 122.88298587300008, - 7.39728424700013 - ], - [ - 122.88982181100019, - 7.407212632000139 - ], - [ - 122.89128665500007, - 7.419989325000174 - ], - [ - 122.89429772200006, - 7.431586005000099 - ], - [ - 122.90503991000017, - 7.437730210000083 - ], - [ - 122.92351321700019, - 7.430853583000072 - ], - [ - 122.94410241000006, - 7.41624583500014 - ], - [ - 122.96176191500004, - 7.39891185100015 - ] - ] - ], - [ - [ - [ - 117.08025149800008, - 8.02948639500012 - ], - [ - 117.08204186300023, - 8.02415599200016 - ], - [ - 117.09156334700006, - 8.011542059000178 - ], - [ - 117.08692467500012, - 8.00421784100017 - ], - [ - 117.07715905000006, - 7.999172268000137 - ], - [ - 117.07154381600017, - 7.993150132000139 - ], - [ - 117.07276451900006, - 7.977525132000054 - ], - [ - 117.08326256600006, - 7.941473700000103 - ], - [ - 117.08578535200016, - 7.921128648000192 - ], - [ - 117.08472741, - 7.915920315000108 - ], - [ - 117.07943769600016, - 7.907171942000133 - ], - [ - 117.07837975400011, - 7.903753973000121 - ], - [ - 117.07764733200017, - 7.884466864000089 - ], - [ - 117.07837975400011, - 7.883286851000065 - ], - [ - 117.08497155000018, - 7.876288153000175 - ], - [ - 117.08676191500015, - 7.872137762000136 - ], - [ - 117.08204186300023, - 7.870266018000081 - ], - [ - 117.08008873800011, - 7.868719794000128 - ], - [ - 117.07300866000006, - 7.861517645000106 - ], - [ - 117.07154381600017, - 7.85936107000019 - ], - [ - 117.06714928500017, - 7.848700262000165 - ], - [ - 117.05567467500023, - 7.835638739000089 - ], - [ - 117.040293816, - 7.824937242000161 - ], - [ - 117.02369225400005, - 7.821844794000171 - ], - [ - 117.03419030000012, - 7.804632880000071 - ], - [ - 117.02621504000015, - 7.7984072940001 - ], - [ - 117.00993899800002, - 7.800279039000159 - ], - [ - 116.99586022200018, - 7.80756256700009 - ], - [ - 117.00163821700008, - 7.82367584800015 - ], - [ - 116.99634850400017, - 7.839260158000144 - ], - [ - 116.97592207099999, - 7.870266018000081 - ], - [ - 116.95582116000006, - 7.921087958000115 - ], - [ - 116.95492597700016, - 7.926011460000083 - ], - [ - 116.96168053500011, - 8.061997789000188 - ], - [ - 116.97266686300023, - 8.054836330000157 - ], - [ - 116.97494550900004, - 8.044745184000092 - ], - [ - 116.97592207099999, - 8.034572658000144 - ], - [ - 116.98218834700006, - 8.027289130000128 - ], - [ - 116.99675540500019, - 8.02732982000012 - ], - [ - 117.00196373800006, - 8.039943752000113 - ], - [ - 117.00513756600006, - 8.054836330000157 - ], - [ - 117.01319420700005, - 8.061997789000188 - ], - [ - 117.05844160199999, - 8.069810289000188 - ], - [ - 117.07585696700008, - 8.069566148000149 - ], - [ - 117.08497155000018, - 8.057847398000163 - ], - [ - 117.08090254000004, - 8.0382754580001 - ], - [ - 117.08025149800008, - 8.02948639500012 - ] - ] - ], - [ - [ - [ - 117.039805535, - 8.077215887000179 - ], - [ - 117.03052819100017, - 8.06826406500015 - ], - [ - 117.02051842500006, - 8.077866929000123 - ], - [ - 117.01539147200018, - 8.088120835000069 - ], - [ - 117.00904381600006, - 8.09715403900016 - ], - [ - 116.99586022200018, - 8.103013414000117 - ], - [ - 117.02711022200006, - 8.12872955900015 - ], - [ - 117.04542076900012, - 8.135809637000122 - ], - [ - 117.05787194100006, - 8.123480536000073 - ], - [ - 117.06836998800011, - 8.092759507000082 - ], - [ - 117.06812584700006, - 8.086249091000099 - ], - [ - 117.0594181650001, - 8.081244208000143 - ], - [ - 117.04965254000004, - 8.07982005400008 - ], - [ - 117.039805535, - 8.077215887000179 - ] - ] - ], - [ - [ - [ - 117.20573978000013, - 8.155503648000163 - ], - [ - 117.18482506600006, - 8.150132554000109 - ], - [ - 117.16179446700019, - 8.15672435100008 - ], - [ - 117.15235436300006, - 8.1700707050001 - ], - [ - 117.15479576900012, - 8.180405992000189 - ], - [ - 117.167735222, - 8.178127346000124 - ], - [ - 117.18970787900005, - 8.176743882000139 - ], - [ - 117.204844597, - 8.166815497000144 - ], - [ - 117.20573978000013, - 8.155503648000163 - ] - ] - ], - [ - [ - [ - 117.318125847, - 8.324530341000141 - ], - [ - 117.31959069100017, - 8.32355377800016 - ], - [ - 117.32227623800023, - 8.323635158000144 - ], - [ - 117.325450066, - 8.322739976000065 - ], - [ - 117.35531660199999, - 8.30272044500019 - ], - [ - 117.35531660199999, - 8.274644273000177 - ], - [ - 117.34888756600017, - 8.24469635600012 - ], - [ - 117.35954837300014, - 8.219061591000155 - ], - [ - 117.351328972, - 8.207220770000092 - ], - [ - 117.34253991000006, - 8.197211005000113 - ], - [ - 117.33187910200004, - 8.193182684000135 - ], - [ - 117.31861412900011, - 8.199204820000148 - ], - [ - 117.28972415500019, - 8.184312242000189 - ], - [ - 117.27881920700011, - 8.207098700000117 - ], - [ - 117.27564537900005, - 8.242987372000115 - ], - [ - 117.27003014400023, - 8.267523505000142 - ], - [ - 117.27654056100002, - 8.281398830000128 - ], - [ - 117.27963300900004, - 8.311102606000148 - ], - [ - 117.284434441, - 8.322739976000065 - ], - [ - 117.29281660200016, - 8.317857164000188 - ], - [ - 117.30152428500006, - 8.318019924000154 - ], - [ - 117.31006920700005, - 8.322007554000123 - ], - [ - 117.31861412900011, - 8.32892487200013 - ], - [ - 117.318125847, - 8.324530341000141 - ] - ] - ], - [ - [ - [ - 117.23601321700019, - 8.322739976000065 - ], - [ - 117.24284915500002, - 8.315252997000101 - ], - [ - 117.25342858200005, - 8.321966864000132 - ], - [ - 117.26075280000006, - 8.32111237200013 - ], - [ - 117.26449629000004, - 8.313788153000132 - ], - [ - 117.26392662900005, - 8.301011460000097 - ], - [ - 117.24333743600013, - 8.282904364000089 - ], - [ - 117.21461022200006, - 8.265122789000188 - ], - [ - 117.19011478000002, - 8.262030341000113 - ], - [ - 117.18140709700006, - 8.287990627000099 - ], - [ - 117.18946373800006, - 8.299546617000132 - ], - [ - 117.24284915500002, - 8.343207098000121 - ], - [ - 117.24089603000019, - 8.330511786000073 - ], - [ - 117.2395939460001, - 8.327215887000122 - ], - [ - 117.23601321700019, - 8.322739976000065 - ] - ] - ], - [ - [ - [ - 119.95972741000017, - 8.880601304000066 - ], - [ - 119.96062259200008, - 8.877101955000157 - ], - [ - 119.95834394599999, - 8.87718333500014 - ], - [ - 119.95972741000017, - 8.880601304000066 - ] - ] - ], - [ - [ - [ - 119.97144616000017, - 8.880926825000174 - ], - [ - 119.96924889400006, - 8.880926825000174 - ], - [ - 119.96827233200011, - 8.884100653000147 - ], - [ - 119.97193444100006, - 8.882391669000143 - ], - [ - 119.97144616000017, - 8.880926825000174 - ] - ] - ], - [ - [ - [ - 119.96517988400004, - 8.887925523000163 - ], - [ - 119.96534264400006, - 8.887193101000136 - ], - [ - 119.96566816499998, - 8.887396552000084 - ], - [ - 119.966075066, - 8.88568756700009 - ], - [ - 119.96485436300011, - 8.88499583500014 - ], - [ - 119.96436608200011, - 8.885646877000099 - ], - [ - 119.96420332100004, - 8.885565497000115 - ], - [ - 119.96322675900015, - 8.88703034100017 - ], - [ - 119.96517988400004, - 8.887925523000163 - ] - ] - ], - [ - [ - [ - 119.96762129000015, - 8.892279364000146 - ], - [ - 119.96778405000012, - 8.891546942000119 - ], - [ - 119.96827233200011, - 8.891791083000072 - ], - [ - 119.96851647200006, - 8.890041408000073 - ], - [ - 119.96729576900012, - 8.889349677000126 - ], - [ - 119.96680748800023, - 8.88996002800009 - ], - [ - 119.96680748800023, - 8.889878648000106 - ], - [ - 119.96566816499998, - 8.891424872000144 - ], - [ - 119.96762129000015, - 8.892279364000146 - ] - ] - ], - [ - [ - [ - 124.77947024800008, - 9.07949453300013 - ], - [ - 124.77019290500002, - 9.07737864800012 - ], - [ - 124.76295006600012, - 9.079006252000141 - ], - [ - 124.75709069100006, - 9.092718817000076 - ], - [ - 124.75001061300011, - 9.094305731000105 - ], - [ - 124.74089603000019, - 9.09446849200016 - ], - [ - 124.732676629, - 9.096136786000088 - ], - [ - 124.672129754, - 9.12539297100011 - ], - [ - 124.64673912900011, - 9.148871161000073 - ], - [ - 124.63648522200018, - 9.182359117000118 - ], - [ - 124.64673912900011, - 9.218898830000157 - ], - [ - 124.67310631600017, - 9.242377020000134 - ], - [ - 124.70850670700011, - 9.25018952000012 - ], - [ - 124.74634850400005, - 9.239488023000192 - ], - [ - 124.7630314460001, - 9.2144229190001 - ], - [ - 124.77247155000012, - 9.204046942000105 - ], - [ - 124.78419030000006, - 9.199774481000091 - ], - [ - 124.79346764400023, - 9.192694403000132 - ], - [ - 124.80323326900006, - 9.17609284100017 - ], - [ - 124.80836022200018, - 9.156805731000134 - ], - [ - 124.8009546230002, - 9.128729559000135 - ], - [ - 124.80258222700004, - 9.1124942080001 - ], - [ - 124.80128014400023, - 9.096258856000148 - ], - [ - 124.78785241000006, - 9.083075262000108 - ], - [ - 124.77947024800008, - 9.07949453300013 - ] - ] - ], - [ - [ - [ - 123.70053144600016, - 9.219631252000099 - ], - [ - 123.68995201900012, - 9.205959377000156 - ], - [ - 123.68376712300002, - 9.199693101000108 - ], - [ - 123.68344160200004, - 9.188299872000144 - ], - [ - 123.68653405000012, - 9.180609442000133 - ], - [ - 123.69800866000006, - 9.165025132000139 - ], - [ - 123.70248457100004, - 9.16453685100005 - ], - [ - 123.71452884200002, - 9.1574160830001 - ], - [ - 123.72242272200012, - 9.149115302000112 - ], - [ - 123.71534264400023, - 9.145168361000131 - ], - [ - 123.70329837300014, - 9.128363348000121 - ], - [ - 123.69800866000006, - 9.124009507000125 - ], - [ - 123.68970787900017, - 9.12254466400016 - ], - [ - 123.66041100400005, - 9.124009507000125 - ], - [ - 123.65300540500007, - 9.12295156500008 - ], - [ - 123.64763431100019, - 9.11969635600012 - ], - [ - 123.64454186300023, - 9.114325262000165 - ], - [ - 123.64332116, - 9.106919664000173 - ], - [ - 123.6399845710001, - 9.098578192000119 - ], - [ - 123.63233483200023, - 9.09833405200007 - ], - [ - 123.61548912900005, - 9.103583075000145 - ], - [ - 123.59636478000007, - 9.103989976000065 - ], - [ - 123.57846113400004, - 9.107001044000157 - ], - [ - 123.56120853000019, - 9.114243882000096 - ], - [ - 123.47950280000012, - 9.17182038000007 - ], - [ - 123.47120201900023, - 9.185451565000108 - ], - [ - 123.47461998800023, - 9.19708893400012 - ], - [ - 123.50001061300006, - 9.220282294000143 - ], - [ - 123.51758873800011, - 9.209865627000156 - ], - [ - 123.54086347700004, - 9.213446356000134 - ], - [ - 123.56495201900023, - 9.2261416690001 - ], - [ - 123.59473717500023, - 9.25128815300016 - ], - [ - 123.60254967500023, - 9.255438544000114 - ], - [ - 123.60743248800011, - 9.26215241100006 - ], - [ - 123.60922285199999, - 9.278265692000133 - ], - [ - 123.61443118600019, - 9.289252020000092 - ], - [ - 123.62696373800011, - 9.29393138200011 - ], - [ - 123.64210045700011, - 9.29364655200007 - ], - [ - 123.65544681100019, - 9.289129950000117 - ], - [ - 123.66480553500006, - 9.275458075000174 - ], - [ - 123.67920983200011, - 9.245306708000058 - ], - [ - 123.68751061300006, - 9.239488023000192 - ], - [ - 123.70386803500011, - 9.233303127000127 - ], - [ - 123.70053144600016, - 9.219631252000099 - ] - ] - ], - [ - [ - [ - 123.78516686300006, - 9.552313544000114 - ], - [ - 123.76514733200011, - 9.549953518000152 - ], - [ - 123.74984785200016, - 9.554144598000093 - ], - [ - 123.7376408210001, - 9.57908763200011 - ], - [ - 123.72632897200018, - 9.586981512000179 - ], - [ - 123.72722415500019, - 9.591213283000101 - ], - [ - 123.73926842500012, - 9.594061591000141 - ], - [ - 123.74789472699999, - 9.599107164000173 - ], - [ - 123.75456790500007, - 9.605414130000113 - ], - [ - 123.76587975400005, - 9.614081122000115 - ], - [ - 123.78191165500002, - 9.623521226000122 - ], - [ - 123.82064863400015, - 9.639593817000105 - ], - [ - 123.84131920700011, - 9.64240143400015 - ], - [ - 123.86052493600002, - 9.630072333000115 - ], - [ - 123.86833743600002, - 9.62051015800013 - ], - [ - 123.86231530000012, - 9.608547268000095 - ], - [ - 123.84424889400012, - 9.588853257000054 - ], - [ - 123.80453535199999, - 9.560288804000066 - ], - [ - 123.78516686300006, - 9.552313544000114 - ] - ] - ], - [ - [ - [ - 121.22364342500006, - 9.583319403000132 - ], - [ - 121.21094811300011, - 9.575873114000146 - ], - [ - 121.21355228000013, - 9.584377346000096 - ], - [ - 121.22364342500006, - 9.605698960000055 - ], - [ - 121.22803795700017, - 9.61005280200014 - ], - [ - 121.23910566499998, - 9.61432526200015 - ], - [ - 121.24488366000017, - 9.624416408000116 - ], - [ - 121.25001061300006, - 9.635931708000058 - ], - [ - 121.2586369150001, - 9.644842841000099 - ], - [ - 121.25782311300006, - 9.638373114000089 - ], - [ - 121.25660241000006, - 9.635565497000144 - ], - [ - 121.25473066499998, - 9.633856512000136 - ], - [ - 121.25245201900012, - 9.631170966000155 - ], - [ - 121.25684655000006, - 9.627346096000139 - ], - [ - 121.25717207100004, - 9.624457098000107 - ], - [ - 121.23462975400005, - 9.594305731000176 - ], - [ - 121.22364342500006, - 9.583319403000132 - ] - ] - ], - [ - [ - [ - 125.960215691, - 9.755804755000113 - ], - [ - 125.95972741000006, - 9.747219143000109 - ], - [ - 125.96908613400015, - 9.751939195000105 - ], - [ - 125.9728296230002, - 9.754624742000175 - ], - [ - 125.97461998800011, - 9.738348700000145 - ], - [ - 125.97291100400017, - 9.715277411000102 - ], - [ - 125.97543378999998, - 9.69464752800016 - ], - [ - 125.99024498800006, - 9.685736395000134 - ], - [ - 126.00147545700005, - 9.67674388200011 - ], - [ - 125.99756920700005, - 9.656073309000092 - ], - [ - 125.98023522200018, - 9.617499091000127 - ], - [ - 125.98511803500017, - 9.605658270000063 - ], - [ - 125.98414147200018, - 9.589504299000097 - ], - [ - 125.97852623800006, - 9.57518138200011 - ], - [ - 125.96941165500019, - 9.569077867000132 - ], - [ - 125.95394941500015, - 9.56565989800012 - ], - [ - 125.94695071700019, - 9.566229559000178 - ], - [ - 125.952891472, - 9.581976630000142 - ], - [ - 125.94629967500023, - 9.587591864000146 - ], - [ - 125.93523196700019, - 9.589911200000103 - ], - [ - 125.92505944100006, - 9.589544989000089 - ], - [ - 125.92505944100006, - 9.596380927000112 - ], - [ - 125.93531334700018, - 9.596014716000099 - ], - [ - 125.93873131600017, - 9.596380927000112 - ], - [ - 125.93873131600017, - 9.603827216000084 - ], - [ - 125.91814212300008, - 9.617499091000127 - ], - [ - 125.91814212300008, - 9.61005280200014 - ], - [ - 125.91553795700017, - 9.618963934000178 - ], - [ - 125.91651451900023, - 9.629136460000126 - ], - [ - 125.92505944100006, - 9.65102773600016 - ], - [ - 125.92969811300006, - 9.657945054000066 - ], - [ - 125.93360436300006, - 9.660386460000097 - ], - [ - 125.93669681100008, - 9.66356028900016 - ], - [ - 125.93873131600017, - 9.672756252000127 - ], - [ - 125.93897545700023, - 9.681341864000146 - ], - [ - 125.93751061300006, - 9.692531643000152 - ], - [ - 125.93873131600017, - 9.699408270000077 - ], - [ - 125.92888431100008, - 9.71507396000014 - ], - [ - 125.92725670700023, - 9.738714911000073 - ], - [ - 125.93482506600012, - 9.759914455000157 - ], - [ - 125.95240319100006, - 9.768296617000118 - ], - [ - 125.95801842500023, - 9.761379299000126 - ], - [ - 125.960215691, - 9.755804755000113 - ] - ] - ], - [ - [ - [ - 125.64356530000012, - 9.61127350500007 - ], - [ - 125.67090905000006, - 9.600083726000065 - ], - [ - 125.69288170700011, - 9.603827216000084 - ], - [ - 125.69109134200019, - 9.600165106000134 - ], - [ - 125.69011478000002, - 9.596909898000177 - ], - [ - 125.68864993600008, - 9.59349192900008 - ], - [ - 125.68531334700006, - 9.589544989000089 - ], - [ - 125.69849694100017, - 9.589992580000086 - ], - [ - 125.7059025400001, - 9.585150458000115 - ], - [ - 125.71273847699999, - 9.575873114000146 - ], - [ - 125.72266686300011, - 9.575506903000132 - ], - [ - 125.74398847700016, - 9.577378648000192 - ], - [ - 125.753672722, - 9.575873114000146 - ], - [ - 125.77247155000018, - 9.554836330000128 - ], - [ - 125.78101647200018, - 9.54857005400008 - ], - [ - 125.79086347700004, - 9.545314846000124 - ], - [ - 125.84896894600016, - 9.537176825000117 - ], - [ - 125.86801191500015, - 9.526922919000171 - ], - [ - 125.90113366000011, - 9.497056382000096 - ], - [ - 125.91065514400012, - 9.494208075000145 - ], - [ - 125.92318769599999, - 9.494289455000128 - ], - [ - 125.93409264400017, - 9.492336330000086 - ], - [ - 125.93873131600017, - 9.483710028000175 - ], - [ - 125.94044030000012, - 9.475002346000096 - ], - [ - 125.948985222, - 9.463080145000148 - ], - [ - 125.95240319100006, - 9.453029690000093 - ], - [ - 125.96338951900006, - 9.472479559000178 - ], - [ - 125.96599368600019, - 9.480292059000163 - ], - [ - 125.9728296230002, - 9.480292059000163 - ], - [ - 125.97266686300023, - 9.464016018000137 - ], - [ - 125.97120201900006, - 9.454087632000139 - ], - [ - 125.96745853000007, - 9.447170315000136 - ], - [ - 125.95972741000006, - 9.43935781500015 - ], - [ - 125.94857832100004, - 9.434230861000131 - ], - [ - 125.92025800900015, - 9.426906643000123 - ], - [ - 125.911875847, - 9.41819896000014 - ], - [ - 125.91098066500004, - 9.404933986000117 - ], - [ - 125.91675866000017, - 9.395412502000113 - ], - [ - 125.92693118600002, - 9.388902085000126 - ], - [ - 125.93873131600017, - 9.3847110050001 - ], - [ - 125.95582116000006, - 9.381781317000076 - ], - [ - 125.96664472700004, - 9.384263414000188 - ], - [ - 125.993907097, - 9.39777252800016 - ], - [ - 125.99195397200018, - 9.357855536000116 - ], - [ - 125.99659264400012, - 9.324652411000102 - ], - [ - 126.01172936300011, - 9.293850002000127 - ], - [ - 126.05795332099999, - 9.245998440000093 - ], - [ - 126.06544030000018, - 9.241766669000171 - ], - [ - 126.07585696700008, - 9.239488023000192 - ], - [ - 126.08912194100017, - 9.240871486000088 - ], - [ - 126.10987389400006, - 9.251206773000177 - ], - [ - 126.14340254000004, - 9.261419989000132 - ], - [ - 126.17937259200019, - 9.297186591000141 - ], - [ - 126.19996178500006, - 9.30841705900015 - ], - [ - 126.21989993600002, - 9.305650132000096 - ], - [ - 126.22461998800023, - 9.2909610050001 - ], - [ - 126.21941165500002, - 9.272202867000132 - ], - [ - 126.20036868600008, - 9.240627346000139 - ], - [ - 126.19336998800017, - 9.216376044000143 - ], - [ - 126.18572024800002, - 9.17182038000007 - ], - [ - 126.18572024800002, - 9.138332424000112 - ], - [ - 126.17896569100012, - 9.093003648000192 - ], - [ - 126.18360436300023, - 9.081488348000079 - ], - [ - 126.19450931100019, - 9.077460028000104 - ], - [ - 126.20704186300011, - 9.076117255000113 - ], - [ - 126.21705162900017, - 9.07249583500014 - ], - [ - 126.22299238400004, - 9.063910223000136 - ], - [ - 126.23365319100006, - 9.039374091000113 - ], - [ - 126.24024498800011, - 9.028469143000137 - ], - [ - 126.31275475400005, - 8.956244208000143 - ], - [ - 126.32227623800023, - 8.935370184000178 - ], - [ - 126.32357832100004, - 8.922349351000094 - ], - [ - 126.33594811300006, - 8.884466864000075 - ], - [ - 126.33187910200004, - 8.870021877000113 - ], - [ - 126.33236738399998, - 8.86107005400008 - ], - [ - 126.34546959700018, - 8.853257554000095 - ], - [ - 126.34310957100004, - 8.845119533000158 - ], - [ - 126.33822675900015, - 8.837632554000109 - ], - [ - 126.33594811300006, - 8.836086330000157 - ], - [ - 126.32878665500002, - 8.812730210000069 - ], - [ - 126.31690514400006, - 8.787990627000099 - ], - [ - 126.30005944100017, - 8.768296617000146 - ], - [ - 126.27816816500015, - 8.760321356000091 - ], - [ - 126.24024498800011, - 8.73505280200014 - ], - [ - 126.23414147200006, - 8.733628648000163 - ], - [ - 126.23414147200006, - 8.719183661000116 - ], - [ - 126.24187259200002, - 8.710598049000097 - ], - [ - 126.26148522200012, - 8.698879299000112 - ], - [ - 126.26148522200012, - 8.692694403000147 - ], - [ - 126.25757897200012, - 8.69049713700015 - ], - [ - 126.25700931100002, - 8.68968333500014 - ], - [ - 126.25684655000006, - 8.688544012000108 - ], - [ - 126.25456790500019, - 8.685207424000083 - ], - [ - 126.24219811300017, - 8.690008856000162 - ], - [ - 126.23161868600019, - 8.692206122000158 - ], - [ - 126.20997155000012, - 8.692694403000147 - ], - [ - 126.19776451900023, - 8.688299872000158 - ], - [ - 126.17367597700004, - 8.669094143000109 - ], - [ - 126.13843834700018, - 8.654038804000095 - ], - [ - 126.11890709700018, - 8.630560614000117 - ], - [ - 126.11052493600002, - 8.607123114000146 - ], - [ - 126.13038170700023, - 8.58649323100012 - ], - [ - 126.148203972, - 8.540676174000126 - ], - [ - 126.15845787900005, - 8.527573960000069 - ], - [ - 126.167246941, - 8.526597398000177 - ], - [ - 126.19996178500006, - 8.527573960000069 - ], - [ - 126.21957441499998, - 8.521714585000112 - ], - [ - 126.22877037900017, - 8.521470445000162 - ], - [ - 126.24024498800011, - 8.527573960000069 - ], - [ - 126.22071373800023, - 8.540432033000087 - ], - [ - 126.21420332100016, - 8.548244533000073 - ], - [ - 126.22046959700018, - 8.555487372000101 - ], - [ - 126.23178144600016, - 8.554836330000143 - ], - [ - 126.24480228000007, - 8.549302476000122 - ], - [ - 126.25749759200014, - 8.54686107000019 - ], - [ - 126.26832116, - 8.555487372000101 - ], - [ - 126.29151451900023, - 8.544623114000117 - ], - [ - 126.35694420700011, - 8.534369208000086 - ], - [ - 126.35621178500017, - 8.536281643000137 - ], - [ - 126.35914147200012, - 8.539374091000127 - ], - [ - 126.36443118600008, - 8.541815497000158 - ], - [ - 126.37012780000023, - 8.541815497000158 - ], - [ - 126.36980228000002, - 8.538885809000135 - ], - [ - 126.37322024800002, - 8.5308291690001 - ], - [ - 126.38062584700006, - 8.517645575000145 - ], - [ - 126.40105228000019, - 8.502183335000126 - ], - [ - 126.40528405000012, - 8.492621161000145 - ], - [ - 126.39795983200011, - 8.47915273600016 - ], - [ - 126.40202884200008, - 8.476304429000123 - ], - [ - 126.40691165500007, - 8.470404364000089 - ], - [ - 126.41163170700023, - 8.466131903000175 - ], - [ - 126.385020379, - 8.467352606000091 - ], - [ - 126.3743595710001, - 8.464544989000146 - ], - [ - 126.37012780000023, - 8.455552476000122 - ], - [ - 126.36687259200019, - 8.43207428600006 - ], - [ - 126.37012780000023, - 8.427639065000093 - ], - [ - 126.38379967500012, - 8.431952216000084 - ], - [ - 126.38770592500006, - 8.415350653000132 - ], - [ - 126.38005618600008, - 8.395575262000108 - ], - [ - 126.35694420700011, - 8.363714911000088 - ], - [ - 126.35230553500017, - 8.362372137000179 - ], - [ - 126.34050540500013, - 8.355169989000146 - ], - [ - 126.33253014400023, - 8.34707265800013 - ], - [ - 126.339610222, - 8.343207098000121 - ], - [ - 126.34327233200005, - 8.338120835000097 - ], - [ - 126.35694420700011, - 8.311916408000158 - ], - [ - 126.36500084700006, - 8.304999091000155 - ], - [ - 126.37989342500012, - 8.302069403000147 - ], - [ - 126.388438347, - 8.29291413000007 - ], - [ - 126.37761478000002, - 8.267523505000142 - ], - [ - 126.34587649800008, - 8.231390692000105 - ], - [ - 126.33863366000006, - 8.214585679000095 - ], - [ - 126.34644616000006, - 8.195502020000106 - ], - [ - 126.36158287900005, - 8.18716054900014 - ], - [ - 126.37761478000002, - 8.191595770000106 - ], - [ - 126.39332116000017, - 8.200506903000147 - ], - [ - 126.42335045700023, - 8.211004950000117 - ], - [ - 126.45932050900004, - 8.24017975500007 - ], - [ - 126.46306399800008, - 8.229925848000136 - ], - [ - 126.45728600400017, - 8.144720770000148 - ], - [ - 126.45394941500015, - 8.129339911000116 - ], - [ - 126.45533287900005, - 8.11505768400012 - ], - [ - 126.46615644600004, - 8.095526434000135 - ], - [ - 126.44288170700023, - 8.081447658000101 - ], - [ - 126.43148847700016, - 8.045599677000098 - ], - [ - 126.43425540500013, - 8.005926825000174 - ], - [ - 126.45313561300023, - 7.98012929900014 - ], - [ - 126.43482506600017, - 7.961818752000084 - ], - [ - 126.39551842500006, - 7.933335679000081 - ], - [ - 126.38379967500012, - 7.911200262000108 - ], - [ - 126.38347415500007, - 7.899562893000095 - ], - [ - 126.38306725400017, - 7.885687567000105 - ], - [ - 126.39136803500006, - 7.858303127000141 - ], - [ - 126.40609785200004, - 7.833238023000135 - ], - [ - 126.42530358200011, - 7.815008856000162 - ], - [ - 126.45492597700004, - 7.797308661000059 - ], - [ - 126.45932050900004, - 7.79169342700007 - ], - [ - 126.46338951900006, - 7.781073309000121 - ], - [ - 126.48747806100019, - 7.74673086100016 - ], - [ - 126.51099694100006, - 7.732733466000099 - ], - [ - 126.56226647200018, - 7.72752513200011 - ], - [ - 126.58285566500004, - 7.719427802000084 - ], - [ - 126.57569420700011, - 7.697088934000149 - ], - [ - 126.57178795700011, - 7.674953518000081 - ], - [ - 126.56918378999998, - 7.626369533000116 - ], - [ - 126.57357832100016, - 7.603501695000105 - ], - [ - 126.59278405000023, - 7.553900458000086 - ], - [ - 126.60092207100016, - 7.506415106000176 - ], - [ - 126.60726972700016, - 7.485174872000101 - ], - [ - 126.60865319100006, - 7.465318101000179 - ], - [ - 126.59734134200008, - 7.445054429000081 - ], - [ - 126.58570397200018, - 7.437323309000163 - ], - [ - 126.57471764400012, - 7.433010158000158 - ], - [ - 126.56641686300023, - 7.426011460000083 - ], - [ - 126.56299889400012, - 7.410345770000106 - ], - [ - 126.56674238400015, - 7.406683661000059 - ], - [ - 126.58969160200016, - 7.389837958000058 - ], - [ - 126.58204186300011, - 7.367377020000148 - ], - [ - 126.58073978000013, - 7.320013739000117 - ], - [ - 126.56918378999998, - 7.301092841000099 - ], - [ - 126.57740319100017, - 7.295314846000124 - ], - [ - 126.61036217500023, - 7.277044989000061 - ], - [ - 126.61768639400017, - 7.276841539000102 - ], - [ - 126.61231530000012, - 7.257879950000103 - ], - [ - 126.58838951900023, - 7.226792710000097 - ], - [ - 126.58285566500004, - 7.208644924000097 - ], - [ - 126.57976321700002, - 7.201076565000136 - ], - [ - 126.57195071700008, - 7.198187567000105 - ], - [ - 126.56299889400012, - 7.196356512000136 - ], - [ - 126.55567467500012, - 7.191839911000088 - ], - [ - 126.55030358200017, - 7.183050848000107 - ], - [ - 126.52963300900015, - 7.129136460000097 - ], - [ - 126.52320397200006, - 7.118841864000075 - ], - [ - 126.49105879000015, - 7.088812567000119 - ], - [ - 126.47641035200016, - 7.066229559000149 - ], - [ - 126.46851647200018, - 7.038763739000103 - ], - [ - 126.46615644600004, - 7.003119208000143 - ], - [ - 126.45150800900004, - 6.983547268000081 - ], - [ - 126.41749108200011, - 6.9800479190001 - ], - [ - 126.37859134200019, - 6.987372137000094 - ], - [ - 126.34945722700004, - 7.000067450000159 - ], - [ - 126.32398522200006, - 6.978094794000143 - ], - [ - 126.30958092500018, - 6.948919989000103 - ], - [ - 126.30323326900023, - 6.918646552000098 - ], - [ - 126.30176842500006, - 6.893255927000084 - ], - [ - 126.30746504000015, - 6.881415106000119 - ], - [ - 126.33448326900012, - 6.858587958000101 - ], - [ - 126.34327233200005, - 6.849188544000171 - ], - [ - 126.34750410199999, - 6.833889065000122 - ], - [ - 126.34929446700008, - 6.812933661000073 - ], - [ - 126.34701582100004, - 6.794501044000128 - ], - [ - 126.339610222, - 6.786525783000087 - ], - [ - 126.30884850400005, - 6.798041083000115 - ], - [ - 126.291270379, - 6.825832424000083 - ], - [ - 126.26832116, - 6.890204169000171 - ], - [ - 126.24268639400023, - 6.919256903000161 - ], - [ - 126.21290123800023, - 6.934027411000145 - ], - [ - 126.19190514400012, - 6.925116278000104 - ], - [ - 126.19255618600008, - 6.883368231000162 - ], - [ - 126.18572024800002, - 6.883368231000162 - ], - [ - 126.18311608200023, - 6.889471747000144 - ], - [ - 126.17212975400017, - 6.903876044000114 - ], - [ - 126.16797936300023, - 6.882554429000066 - ], - [ - 126.17855878999998, - 6.861395575000145 - ], - [ - 126.19288170700005, - 6.841701565000108 - ], - [ - 126.20785566500004, - 6.805894273000192 - ], - [ - 126.22575931100008, - 6.789740302000126 - ], - [ - 126.24431399800008, - 6.776516018000095 - ], - [ - 126.25456790500019, - 6.766669012000165 - ], - [ - 126.25717207099999, - 6.744818427000126 - ], - [ - 126.24415123800011, - 6.703924872000101 - ], - [ - 126.22877037900017, - 6.616197007000096 - ], - [ - 126.22689863400004, - 6.468939520000077 - ], - [ - 126.21021569100017, - 6.3902041690001 - ], - [ - 126.20606530000012, - 6.299302476000136 - ], - [ - 126.20020592500006, - 6.283189195000162 - ], - [ - 126.18572024800002, - 6.286851304000109 - ], - [ - 126.18213951900017, - 6.300726630000099 - ], - [ - 126.17774498800006, - 6.35146719000015 - ], - [ - 126.17554772200018, - 6.362616278000175 - ], - [ - 126.14128665500013, - 6.386175848000121 - ], - [ - 126.13721764400023, - 6.39557526200015 - ], - [ - 126.136973504, - 6.407416083000115 - ], - [ - 126.13819420700023, - 6.419867255000128 - ], - [ - 126.13786868600019, - 6.430853583000086 - ], - [ - 126.11296634200008, - 6.47736237200013 - ], - [ - 126.10010826900023, - 6.493719794000143 - ], - [ - 126.09506269600004, - 6.514105536000116 - ], - [ - 126.08269290500019, - 6.63971588700015 - ], - [ - 126.08432050900004, - 6.663072007000139 - ], - [ - 126.09636478000013, - 6.725043036000102 - ], - [ - 126.095957879, - 6.747219143000081 - ], - [ - 126.08529707100016, - 6.782619533000087 - ], - [ - 126.08269290500019, - 6.804510809000121 - ], - [ - 126.08269290500019, - 6.830877997000115 - ], - [ - 126.07911217500012, - 6.842515367000118 - ], - [ - 126.06714928500017, - 6.847886460000083 - ], - [ - 126.04175866000006, - 6.855414130000128 - ], - [ - 126.02214603000019, - 6.866766669000114 - ], - [ - 125.98340905000023, - 6.920884507000082 - ], - [ - 125.97681725400017, - 6.939601955000143 - ], - [ - 125.98568769600004, - 6.986070054000095 - ], - [ - 125.98650149800002, - 7.006293036000116 - ], - [ - 125.97478274800008, - 7.027736721000153 - ], - [ - 125.91504967500006, - 7.085028387000094 - ], - [ - 125.90259850400017, - 7.101141669000157 - ], - [ - 125.89795983200023, - 7.116034247000115 - ], - [ - 125.89087975400017, - 7.15704987200013 - ], - [ - 125.85059655000006, - 7.253892320000119 - ], - [ - 125.84986412900017, - 7.294256903000175 - ], - [ - 125.85320071700019, - 7.316229559000178 - ], - [ - 125.85320071700019, - 7.336004950000117 - ], - [ - 125.84538821700019, - 7.350246486000117 - ], - [ - 125.83073978000019, - 7.354274807000181 - ], - [ - 125.825450066, - 7.355698960000069 - ], - [ - 125.806895379, - 7.351141669000114 - ], - [ - 125.746836785, - 7.307928778000118 - ], - [ - 125.68783613400015, - 7.274644273000121 - ], - [ - 125.67676842500012, - 7.264634507000125 - ], - [ - 125.67660566500015, - 7.264471747000158 - ], - [ - 125.6683048840001, - 7.257025458000101 - ], - [ - 125.65691165500013, - 7.237046617000118 - ], - [ - 125.65398196700019, - 7.215073960000097 - ], - [ - 125.65935306100008, - 7.149847723000093 - ], - [ - 125.65805097700016, - 7.129136460000097 - ], - [ - 125.65455162900017, - 7.119574286000102 - ], - [ - 125.64616946700019, - 7.107855536000116 - ], - [ - 125.64437910200004, - 7.09906647300015 - ], - [ - 125.63900800900015, - 7.088771877000127 - ], - [ - 125.60352623800006, - 7.054632880000128 - ], - [ - 125.57545006600017, - 7.038723049000112 - ], - [ - 125.54175866000017, - 7.030585028000104 - ], - [ - 125.50993899800014, - 7.015570380000071 - ], - [ - 125.48747806100002, - 6.978949286000145 - ], - [ - 125.48462975400017, - 6.935126044000086 - ], - [ - 125.4806421230002, - 6.913234768000152 - ], - [ - 125.46973717500023, - 6.903876044000114 - ], - [ - 125.42465254000015, - 6.849188544000171 - ], - [ - 125.40357506600006, - 6.811835028000118 - ], - [ - 125.38892662900005, - 6.768296617000189 - ], - [ - 125.38038170700011, - 6.72150299700013 - ], - [ - 125.37761478000007, - 6.674221096000068 - ], - [ - 125.38062584700006, - 6.65721263200011 - ], - [ - 125.39429772200018, - 6.618231512000122 - ], - [ - 125.39747155000023, - 6.598456122000101 - ], - [ - 125.40552819100017, - 6.588853257000125 - ], - [ - 125.42188561300011, - 6.582342841000127 - ], - [ - 125.43458092500018, - 6.58820221600017 - ], - [ - 125.43213951900023, - 6.615790106000176 - ], - [ - 125.465098504, - 6.594671942000076 - ], - [ - 125.50806725400017, - 6.539496161000145 - ], - [ - 125.53451582100004, - 6.512844143000109 - ], - [ - 125.55323326900012, - 6.524847723000136 - ], - [ - 125.57357832099999, - 6.516913153000161 - ], - [ - 125.58985436300023, - 6.499172268000081 - ], - [ - 125.59669030000023, - 6.481756903000104 - ], - [ - 125.59766686300023, - 6.442694403000147 - ], - [ - 125.60141035200016, - 6.427883205000086 - ], - [ - 125.630137566, - 6.366197007000054 - ], - [ - 125.64096113400004, - 6.352362372000144 - ], - [ - 125.64478600400005, - 6.344142971000153 - ], - [ - 125.64551842500023, - 6.332586981000134 - ], - [ - 125.64437910200004, - 6.310492255000142 - ], - [ - 125.64584394600016, - 6.299627997000158 - ], - [ - 125.64926191499998, - 6.292425848000121 - ], - [ - 125.65805097700016, - 6.280015367000189 - ], - [ - 125.70655358200023, - 6.149725653000147 - ], - [ - 125.71013431100019, - 6.132066148000135 - ], - [ - 125.71062259200019, - 6.111029364000103 - ], - [ - 125.70655358200023, - 6.089544989000075 - ], - [ - 125.69605553500006, - 6.071193752000127 - ], - [ - 125.69239342500012, - 6.060980536000088 - ], - [ - 125.69922936300011, - 6.040472723000136 - ], - [ - 125.69605553500006, - 6.02993398600016 - ], - [ - 125.69214928500017, - 6.021877346000139 - ], - [ - 125.68531334700006, - 5.992661851000193 - ], - [ - 125.66732832099999, - 5.950140692000133 - ], - [ - 125.59457441500015, - 5.862127997000101 - ], - [ - 125.49903405000023, - 5.726141669000171 - ], - [ - 125.43637129000015, - 5.617661851000179 - ], - [ - 125.42164147200006, - 5.598211981000176 - ], - [ - 125.40300540500007, - 5.580877997000101 - ], - [ - 125.38754316500015, - 5.573797919000128 - ], - [ - 125.3712671230002, - 5.572943427000126 - ], - [ - 125.32276451900023, - 5.575506903000132 - ], - [ - 125.30836022200018, - 5.579575914000188 - ], - [ - 125.30241946700008, - 5.592189846000082 - ], - [ - 125.3001408210001, - 5.67133209800015 - ], - [ - 125.29509524800002, - 5.691066799000097 - ], - [ - 125.28825931100002, - 5.706040757000125 - ], - [ - 125.27865644600016, - 5.716498114000103 - ], - [ - 125.26433353000007, - 5.722560940000108 - ], - [ - 125.24317467500023, - 5.724554755000142 - ], - [ - 125.23780358200011, - 5.72797272300015 - ], - [ - 125.23194420700017, - 5.736273505000128 - ], - [ - 125.22730553500006, - 5.74656810100015 - ], - [ - 125.22543379000015, - 5.756170966000127 - ], - [ - 125.220957879, - 5.766424872000144 - ], - [ - 125.21045983200023, - 5.772121486000131 - ], - [ - 125.19898522200018, - 5.775580145000134 - ], - [ - 125.19141686300023, - 5.779201565000093 - ], - [ - 125.18116295700011, - 5.798325914000159 - ], - [ - 125.18506920700011, - 5.814520575000117 - ], - [ - 125.19402103000002, - 5.829494533000158 - ], - [ - 125.19874108200023, - 5.844916083000086 - ], - [ - 125.20183353000002, - 5.860541083000072 - ], - [ - 125.20899498800006, - 5.876857815000093 - ], - [ - 125.22543379000015, - 5.90326569200009 - ], - [ - 125.26400800900015, - 5.949937242000175 - ], - [ - 125.27800540500019, - 5.979234117000189 - ], - [ - 125.28077233200017, - 6.019354559000121 - ], - [ - 125.27670332099999, - 6.036037502000156 - ], - [ - 125.26319420700023, - 6.072211005000085 - ], - [ - 125.26026451900012, - 6.084540106000134 - ], - [ - 125.250743035, - 6.093085028000147 - ], - [ - 125.24008222700016, - 6.094224351000179 - ], - [ - 125.22925866000017, - 6.095404364000117 - ], - [ - 125.19141686300023, - 6.095119533000087 - ], - [ - 125.179453972, - 6.10675690300009 - ], - [ - 125.16895592500023, - 6.111965236000088 - ], - [ - 125.15788821700019, - 6.108791408000116 - ], - [ - 125.15528405000012, - 6.100165106000119 - ], - [ - 125.15772545700023, - 6.074286200000103 - ], - [ - 125.1544702480002, - 6.064357815000108 - ], - [ - 125.145274285, - 6.050034898000121 - ], - [ - 125.11223392000025, - 5.953355210000097 - ], - [ - 125.08871504000004, - 5.884711005000085 - ], - [ - 125.06910241000006, - 5.861721096000096 - ], - [ - 125.04981530000012, - 5.861395575000174 - ], - [ - 125.00220787900005, - 5.871975002000127 - ], - [ - 124.96363366000006, - 5.858587958000129 - ], - [ - 124.938731316, - 5.863959052000084 - ], - [ - 124.83741295700005, - 5.9122582050001 - ], - [ - 124.81088300900004, - 5.918605861000131 - ], - [ - 124.76791425900015, - 5.938055731000134 - ], - [ - 124.75611412900017, - 5.938177802000112 - ], - [ - 124.74366295700017, - 5.936957098000093 - ], - [ - 124.732676629, - 5.937445380000085 - ], - [ - 124.70801842500012, - 5.946600653000147 - ], - [ - 124.64332116000017, - 5.985256252000113 - ], - [ - 124.63648522200018, - 5.978420315000093 - ], - [ - 124.60580488400015, - 5.992336330000072 - ], - [ - 124.59620201900006, - 5.998928127000141 - ], - [ - 124.59245853000007, - 6.005519924000126 - ], - [ - 124.58969160199999, - 6.01463450700011 - ], - [ - 124.58594811300017, - 6.022691148000149 - ], - [ - 124.57911217500023, - 6.02619049700013 - ], - [ - 124.56137129000015, - 6.030015367000146 - ], - [ - 124.42188561300023, - 6.110296942000076 - ], - [ - 124.37012780000012, - 6.132717190000093 - ], - [ - 124.24577884200019, - 6.186509507000139 - ], - [ - 124.22877037900005, - 6.197007554000109 - ], - [ - 124.20167076900012, - 6.221747137000179 - ], - [ - 124.18946373800011, - 6.240545966000127 - ], - [ - 124.17660566499998, - 6.277818101000193 - ], - [ - 124.16480553500006, - 6.294338283000087 - ], - [ - 124.097911004, - 6.364650783000116 - ], - [ - 124.07195071700019, - 6.401516018000081 - ], - [ - 124.05494225400005, - 6.437689520000106 - ], - [ - 124.04249108200023, - 6.488470770000148 - ], - [ - 124.041270379, - 6.509711005000142 - ], - [ - 124.03484134200019, - 6.530585028000104 - ], - [ - 124.03296959700006, - 6.542425848000079 - ], - [ - 124.03744550899998, - 6.547552802000084 - ], - [ - 124.05176842500006, - 6.548895575000159 - ], - [ - 124.05583743600002, - 6.552720445000176 - ], - [ - 124.05494225400005, - 6.55902741100013 - ], - [ - 124.05494225400005, - 6.646551825000159 - ], - [ - 124.05225670700005, - 6.669378973000093 - ], - [ - 124.03386478000002, - 6.731919664000117 - ], - [ - 124.03720136800004, - 6.758408921000083 - ], - [ - 124.03980553500006, - 6.779120184000178 - ], - [ - 124.03663170700011, - 6.799709377000127 - ], - [ - 124.01710045700011, - 6.808294989000132 - ], - [ - 124.01433353000007, - 6.80609772300015 - ], - [ - 124.00326582100004, - 6.790228583000115 - ], - [ - 123.99732506600017, - 6.78607819200009 - ], - [ - 123.99447675900015, - 6.787909247000158 - ], - [ - 123.99268639400023, - 6.791815497000144 - ], - [ - 123.98943118600019, - 6.793931382000068 - ], - [ - 123.98218834700018, - 6.796820380000099 - ], - [ - 123.97494550900015, - 6.803900458000058 - ], - [ - 123.96892337300008, - 6.812730210000112 - ], - [ - 123.96550540500007, - 6.821275132000139 - ], - [ - 123.96517988400004, - 6.83234284100017 - ], - [ - 123.97120201900023, - 6.850775458000115 - ], - [ - 123.97291100400005, - 6.859116929000081 - ], - [ - 123.97486412900017, - 6.965318101000193 - ], - [ - 123.988536004, - 7.015611070000162 - ], - [ - 124.02947024800002, - 7.115139065000122 - ], - [ - 124.05111738400004, - 7.13662344000015 - ], - [ - 124.06836998800023, - 7.141343492000161 - ], - [ - 124.09131920700023, - 7.152777411000116 - ], - [ - 124.12940514400012, - 7.177557684000178 - ], - [ - 124.16675866000017, - 7.208400783000144 - ], - [ - 124.18376712300002, - 7.226385809000178 - ], - [ - 124.19459069100006, - 7.253648179000081 - ], - [ - 124.21273847700004, - 7.27057526200015 - ], - [ - 124.21924889400012, - 7.279974677000084 - ], - [ - 124.22087649800002, - 7.289292710000126 - ], - [ - 124.21924889400012, - 7.320949611000103 - ], - [ - 124.22087649800002, - 7.346584377000156 - ], - [ - 124.22584069100012, - 7.365790106000119 - ], - [ - 124.24675540500007, - 7.404120184000149 - ], - [ - 124.23226972700004, - 7.414740302000098 - ], - [ - 124.21900475400017, - 7.415757554000066 - ], - [ - 124.187754754, - 7.410345770000106 - ], - [ - 124.17603600400005, - 7.415716864000075 - ], - [ - 124.16732832100004, - 7.431911526000121 - ], - [ - 124.16309655000012, - 7.439642645000134 - ], - [ - 124.153575066, - 7.445054429000081 - ], - [ - 124.14242597699999, - 7.461249091000127 - ], - [ - 124.09522545700023, - 7.561183986000103 - ], - [ - 124.06519616000017, - 7.602728583000086 - ], - [ - 124.02076256600006, - 7.63349030200007 - ], - [ - 124.01335696700008, - 7.634344794000171 - ], - [ - 123.95923912900011, - 7.673895575000117 - ], - [ - 123.91089928500017, - 7.698919989000132 - ], - [ - 123.90349368600019, - 7.691473700000145 - ], - [ - 123.88607832100004, - 7.69940827000012 - ], - [ - 123.86296634200008, - 7.70343659100017 - ], - [ - 123.8616642590001, - 7.703477281000161 - ], - [ - 123.81812584700006, - 7.705145575000174 - ], - [ - 123.79420006600017, - 7.710516669000143 - ], - [ - 123.77784264400006, - 7.723944403000132 - ], - [ - 123.72380618600019, - 7.795599677000055 - ], - [ - 123.7039494150001, - 7.809393622000158 - ], - [ - 123.68067467500023, - 7.815008856000162 - ], - [ - 123.657969597, - 7.817206122000144 - ], - [ - 123.61459394600016, - 7.833522854000165 - ], - [ - 123.60922285199999, - 7.835516669000114 - ], - [ - 123.58692467500023, - 7.839341539000131 - ], - [ - 123.52295983200017, - 7.835516669000114 - ], - [ - 123.50489342500023, - 7.831732489000089 - ], - [ - 123.47999108200011, - 7.822658596000096 - ], - [ - 123.45687910200016, - 7.81146881700009 - ], - [ - 123.4446720710001, - 7.801336981000119 - ], - [ - 123.44825280000023, - 7.766424872000101 - ], - [ - 123.47559655000012, - 7.739325262000165 - ], - [ - 123.49781334700018, - 7.708807684000135 - ], - [ - 123.48568769599999, - 7.663560289000117 - ], - [ - 123.47706139400006, - 7.653306382000082 - ], - [ - 123.466563347, - 7.643866278000161 - ], - [ - 123.45541425899998, - 7.635931708000101 - ], - [ - 123.4446720710001, - 7.630072333000072 - ], - [ - 123.40919030000006, - 7.623480536000088 - ], - [ - 123.40007571700019, - 7.619452216000113 - ], - [ - 123.39625084700018, - 7.611761786000102 - ], - [ - 123.395274285, - 7.60040924700013 - ], - [ - 123.39625084700018, - 7.578558661000088 - ], - [ - 123.39234459700018, - 7.57562897300015 - ], - [ - 123.37159264400012, - 7.588039455000086 - ], - [ - 123.3621525400001, - 7.589056708000143 - ], - [ - 123.35352623800006, - 7.572088934000178 - ], - [ - 123.36687259200019, - 7.552191473000093 - ], - [ - 123.38640384200008, - 7.532619533000116 - ], - [ - 123.39625084700018, - 7.516791083000086 - ], - [ - 123.402598504, - 7.492092190000093 - ], - [ - 123.41765384200002, - 7.4786644550001 - ], - [ - 123.43572024800008, - 7.468207098000121 - ], - [ - 123.45167076900023, - 7.452541408000144 - ], - [ - 123.45866946700002, - 7.431301174000154 - ], - [ - 123.45777428500006, - 7.408636786000102 - ], - [ - 123.451426629, - 7.387925523000192 - ], - [ - 123.44125410200016, - 7.372748114000117 - ], - [ - 123.43100019600016, - 7.368719794000143 - ], - [ - 123.41944420700011, - 7.372259833000129 - ], - [ - 123.38803144599999, - 7.395412502000156 - ], - [ - 123.35596764400012, - 7.410345770000106 - ], - [ - 123.34213300900004, - 7.420477606000162 - ], - [ - 123.31316165500013, - 7.451320705000128 - ], - [ - 123.30437259200008, - 7.467433986000103 - ], - [ - 123.289805535, - 7.477606512000136 - ], - [ - 123.286387566, - 7.482611395000092 - ], - [ - 123.286387566, - 7.504584052000098 - ], - [ - 123.28443444100017, - 7.5132510440001 - ], - [ - 123.28028405000012, - 7.520209052000084 - ], - [ - 123.26441491000011, - 7.526353257000068 - ], - [ - 123.24382571700008, - 7.524074611000088 - ], - [ - 123.225840691, - 7.515611070000148 - ], - [ - 123.21810957100004, - 7.503404039000173 - ], - [ - 123.21257571700019, - 7.489325262000136 - ], - [ - 123.19947350400005, - 7.482001044000128 - ], - [ - 123.18360436300011, - 7.480943101000165 - ], - [ - 123.17042076900023, - 7.486029364000103 - ], - [ - 123.14063561300023, - 7.513128973000121 - ], - [ - 123.12745201900012, - 7.531480210000083 - ], - [ - 123.12208092500023, - 7.550604559000149 - ], - [ - 123.12761478000007, - 7.572577216000155 - ], - [ - 123.14177493600008, - 7.579820054000095 - ], - [ - 123.15967858200023, - 7.582098700000159 - ], - [ - 123.17725670700005, - 7.589056708000143 - ], - [ - 123.18751061300011, - 7.605861721000153 - ], - [ - 123.18677819100017, - 7.626206773000149 - ], - [ - 123.17530358200011, - 7.643296617000189 - ], - [ - 123.15333092500012, - 7.650539455000128 - ], - [ - 123.14039147200018, - 7.661363023000121 - ], - [ - 123.13542728000007, - 7.686468817000105 - ], - [ - 123.13347415500019, - 7.714178778000104 - ], - [ - 123.12940514400023, - 7.733099677000112 - ], - [ - 123.11793053500011, - 7.741359768000109 - ], - [ - 123.10726972700016, - 7.731919664000188 - ], - [ - 123.09644616000017, - 7.714300848000079 - ], - [ - 123.08472741000017, - 7.695217190000093 - ], - [ - 123.05713951900017, - 7.667303778000147 - ], - [ - 123.05030358200023, - 7.655096747000158 - ], - [ - 123.05152428500017, - 7.644964911000116 - ], - [ - 123.05469811300023, - 7.634833075000159 - ], - [ - 123.05372155000023, - 7.622544664000188 - ], - [ - 123.04957116, - 7.617987372000158 - ], - [ - 123.03614342500012, - 7.609320380000071 - ], - [ - 123.03321373800011, - 7.605861721000153 - ], - [ - 123.03451582099999, - 7.598618882000139 - ], - [ - 123.03777103000007, - 7.594671942000147 - ], - [ - 123.04021243600019, - 7.590155341000099 - ], - [ - 123.04004967500012, - 7.581610419000171 - ], - [ - 123.03451582099999, - 7.563869533000087 - ], - [ - 123.01905358200005, - 7.541978257000139 - ], - [ - 123.01221764400023, - 7.527655341000155 - ], - [ - 123.01059004000004, - 7.512844143000095 - ], - [ - 123.01221764400023, - 7.482611395000092 - ], - [ - 123.00660241000017, - 7.472357489000061 - ], - [ - 122.99561608200011, - 7.467271226000136 - ], - [ - 122.99000084700012, - 7.470363674000126 - ], - [ - 122.98462975400005, - 7.476060289000188 - ], - [ - 122.974864129, - 7.479193427000084 - ], - [ - 122.97364342500006, - 7.480373440000108 - ], - [ - 122.95069420700011, - 7.486029364000103 - ], - [ - 122.94239342500012, - 7.499701239000132 - ], - [ - 122.92725670700023, - 7.538153387000136 - ], - [ - 122.91724694100006, - 7.54751211100016 - ], - [ - 122.90528405000012, - 7.543402411000116 - ], - [ - 122.89234459700012, - 7.531439520000092 - ], - [ - 122.88168379000015, - 7.517401434000135 - ], - [ - 122.87614993600008, - 7.507147528000104 - ], - [ - 122.87525475400017, - 7.492824611000117 - ], - [ - 122.87794030000023, - 7.483710028000132 - ], - [ - 122.87647545700005, - 7.475978908000116 - ], - [ - 122.86255944100017, - 7.465562242000132 - ], - [ - 122.85141035200016, - 7.461004950000174 - ], - [ - 122.83725019600016, - 7.458441473000079 - ], - [ - 122.82203209700018, - 7.459418036000145 - ], - [ - 122.80738366000017, - 7.465562242000132 - ], - [ - 122.81348717500023, - 7.477769273000192 - ], - [ - 122.81031334700018, - 7.486070054000095 - ], - [ - 122.80396569100006, - 7.490179755000128 - ], - [ - 122.80054772200006, - 7.489732164000131 - ], - [ - 122.79859459700018, - 7.487127997000144 - ], - [ - 122.79444420700017, - 7.485256252000084 - ], - [ - 122.78988691500004, - 7.484686591000113 - ], - [ - 122.786875847, - 7.486029364000103 - ], - [ - 122.78565514400012, - 7.491766669000157 - ], - [ - 122.78809655000012, - 7.496812242000189 - ], - [ - 122.79167728000019, - 7.499945380000085 - ], - [ - 122.79371178500006, - 7.499701239000132 - ], - [ - 122.79249108200011, - 7.522691148000106 - ], - [ - 122.79712975400005, - 7.53558991100013 - ], - [ - 122.80892988400004, - 7.537543036000073 - ], - [ - 122.828379754, - 7.527655341000155 - ], - [ - 122.83073978000007, - 7.549790757000139 - ], - [ - 122.82276451900012, - 7.564439195000148 - ], - [ - 122.81234785200004, - 7.576890367000161 - ], - [ - 122.80738366000017, - 7.59247467700007 - ], - [ - 122.79997806100008, - 7.654201565000079 - ], - [ - 122.79371178500006, - 7.671047268000081 - ], - [ - 122.801524285, - 7.684393622000087 - ], - [ - 122.80836022200006, - 7.704250393000095 - ], - [ - 122.81299889400017, - 7.725531317000076 - ], - [ - 122.81470787900017, - 7.743353583000143 - ], - [ - 122.80437259200008, - 7.758612372000115 - ], - [ - 122.78044681100019, - 7.759833075000131 - ], - [ - 122.73902428500017, - 7.75413646000014 - ], - [ - 122.73047936300017, - 7.760728257000125 - ], - [ - 122.71485436300006, - 7.780951239000146 - ], - [ - 122.70427493600002, - 7.788316148000135 - ], - [ - 122.65984134200019, - 7.788316148000135 - ], - [ - 122.65105228000007, - 7.786078192000147 - ], - [ - 122.63070722700016, - 7.776312567000119 - ], - [ - 122.61866295700023, - 7.774074611000131 - ], - [ - 122.59669030000012, - 7.761419989000075 - ], - [ - 122.51148522200006, - 7.695705471000082 - ], - [ - 122.48560631600006, - 7.666896877000141 - ], - [ - 122.44385826900012, - 7.608587958000129 - ], - [ - 122.433848504, - 7.590643622000172 - ], - [ - 122.43360436300017, - 7.578558661000088 - ], - [ - 122.45167076900006, - 7.574408270000134 - ], - [ - 122.47185306100019, - 7.579901434000163 - ], - [ - 122.48560631600006, - 7.578517971000096 - ], - [ - 122.48511803500006, - 7.553697007000139 - ], - [ - 122.478770379, - 7.53986237200013 - ], - [ - 122.46753991, - 7.522853908000073 - ], - [ - 122.45443769600016, - 7.507757880000071 - ], - [ - 122.44361412900005, - 7.499701239000132 - ], - [ - 122.45142662900005, - 7.534165757000068 - ], - [ - 122.45101972700004, - 7.54067617400014 - ], - [ - 122.43995201900012, - 7.541937567000147 - ], - [ - 122.42847741000006, - 7.532904364000146 - ], - [ - 122.41968834700018, - 7.520168361000103 - ], - [ - 122.41627037900017, - 7.510239976000179 - ], - [ - 122.40593509200008, - 7.499945380000085 - ], - [ - 122.35987389400023, - 7.472845770000148 - ], - [ - 122.3479923840001, - 7.452541408000144 - ], - [ - 122.35425866000006, - 7.430405992000161 - ], - [ - 122.36882571700008, - 7.41046784100017 - ], - [ - 122.37907962300008, - 7.391587632000054 - ], - [ - 122.37256920700011, - 7.372748114000117 - ], - [ - 122.36378014400012, - 7.362209377000141 - ], - [ - 122.34498131600017, - 7.331773179000095 - ], - [ - 122.33350670700023, - 7.323879299000126 - ], - [ - 122.32292728000019, - 7.323146877000099 - ], - [ - 122.31226647200006, - 7.323960679000109 - ], - [ - 122.30014082100016, - 7.320949611000103 - ], - [ - 122.28044681100019, - 7.294501044000114 - ], - [ - 122.26587975400017, - 7.249090887000122 - ], - [ - 122.25171959700006, - 7.164496161000102 - ], - [ - 122.24935957099999, - 7.118109442000133 - ], - [ - 122.24350019600016, - 7.099269924000097 - ], - [ - 122.20240319100017, - 7.042629299000112 - ], - [ - 122.16732832099999, - 6.952704169000114 - ], - [ - 122.15447024800008, - 6.92812734600011 - ], - [ - 122.13428795700023, - 6.914211330000128 - ], - [ - 122.12370853000019, - 6.899644273000192 - ], - [ - 122.11866295700023, - 6.896429755000142 - ], - [ - 122.09571373800017, - 6.897406317000119 - ], - [ - 122.08676191500004, - 6.899644273000192 - ], - [ - 122.03793379000004, - 6.917385158000101 - ], - [ - 121.96119225400011, - 6.958197333000143 - ], - [ - 121.93702233200005, - 6.978949286000145 - ], - [ - 121.89893639400012, - 7.057196356000134 - ], - [ - 121.89779707100016, - 7.140285549000112 - ], - [ - 121.93344160200004, - 7.217922268000137 - ], - [ - 122.00538170700005, - 7.279974677000084 - ], - [ - 122.03891035199999, - 7.29559967700007 - ], - [ - 122.04688561300017, - 7.301092841000099 - ], - [ - 122.051036004, - 7.307806708000143 - ], - [ - 122.05347741000006, - 7.316880601000136 - ], - [ - 122.05176842500012, - 7.324896552000084 - ], - [ - 122.043223504, - 7.328355210000083 - ], - [ - 122.03256269600016, - 7.339829820000134 - ], - [ - 122.03467858200005, - 7.365790106000119 - ], - [ - 122.04688561300017, - 7.410345770000106 - ], - [ - 122.04558353000007, - 7.442531643000152 - ], - [ - 122.04688561300017, - 7.452541408000144 - ], - [ - 122.05209394600016, - 7.463283596000153 - ], - [ - 122.06495201900006, - 7.481105861000131 - ], - [ - 122.06739342500012, - 7.489732164000131 - ], - [ - 122.06999759200019, - 7.51365794500019 - ], - [ - 122.07764733200023, - 7.528021552000084 - ], - [ - 122.09017988400015, - 7.537543036000073 - ], - [ - 122.1077580090001, - 7.54751211100016 - ], - [ - 122.11963951900012, - 7.556545315000079 - ], - [ - 122.13721764400023, - 7.572984117000161 - ], - [ - 122.14600670700011, - 7.588812567000105 - ], - [ - 122.11353600400005, - 7.603257554000066 - ], - [ - 122.11158287900017, - 7.620672919000128 - ], - [ - 122.12208092500023, - 7.657375393000137 - ], - [ - 122.12273196700019, - 7.700384833000086 - ], - [ - 122.11752363400004, - 7.723211981000105 - ], - [ - 122.10474694100017, - 7.733099677000112 - ], - [ - 122.09652754000015, - 7.744696356000134 - ], - [ - 122.10499108200011, - 7.770819403000175 - ], - [ - 122.12891686300006, - 7.815008856000162 - ], - [ - 122.21452884200008, - 7.921128648000192 - ], - [ - 122.23959394600016, - 7.965725002000084 - ], - [ - 122.25171959700006, - 7.98012929900014 - ], - [ - 122.26303144600004, - 7.989813544000114 - ], - [ - 122.29224694100017, - 8.009914455000157 - ], - [ - 122.32276451900012, - 8.018215236000131 - ], - [ - 122.36003665500019, - 8.040472723000093 - ], - [ - 122.43799889400023, - 8.066555080000143 - ], - [ - 122.46257571700008, - 8.070990302000126 - ], - [ - 122.478282097, - 8.061997789000188 - ], - [ - 122.48243248800017, - 8.070542710000126 - ], - [ - 122.48959394600004, - 8.07510000200007 - ], - [ - 122.49781334700012, - 8.074652411000073 - ], - [ - 122.50505618600002, - 8.06826406500015 - ], - [ - 122.52271569100006, - 8.076361395000077 - ], - [ - 122.59994550900015, - 8.092922268000137 - ], - [ - 122.63843834700006, - 8.108547268000123 - ], - [ - 122.64966881600017, - 8.116034247000101 - ], - [ - 122.66773522200018, - 8.149969794000143 - ], - [ - 122.67920983200023, - 8.164211330000143 - ], - [ - 122.68441816500004, - 8.153957424000126 - ], - [ - 122.69190514400006, - 8.131659247000172 - ], - [ - 122.71094811300006, - 8.119777736000131 - ], - [ - 122.73519941500015, - 8.115464585000126 - ], - [ - 122.75879967500012, - 8.116034247000101 - ], - [ - 122.85523522200018, - 8.132473049000097 - ], - [ - 122.86850019600004, - 8.14183177300012 - ], - [ - 122.87956790500007, - 8.143988348000121 - ], - [ - 122.903086785, - 8.144680080000157 - ], - [ - 122.91391035200004, - 8.146551825000131 - ], - [ - 122.92457116000006, - 8.150132554000109 - ], - [ - 122.94532311300023, - 8.161851304000095 - ], - [ - 123.00261478000019, - 8.209133205000143 - ], - [ - 123.01368248800011, - 8.232407945000162 - ], - [ - 123.000743035, - 8.25039297100011 - ], - [ - 122.96436608200023, - 8.274359442000147 - ], - [ - 122.96208743600008, - 8.280829169000157 - ], - [ - 122.95818118600008, - 8.302394924000069 - ], - [ - 122.95818118600008, - 8.30849844000015 - ], - [ - 122.96338951900023, - 8.313950914000188 - ], - [ - 122.98161868600002, - 8.324693101000108 - ], - [ - 122.98536217500006, - 8.325873114000132 - ], - [ - 122.98747806100019, - 8.330633856000134 - ], - [ - 122.99195397200006, - 8.33576080900015 - ], - [ - 122.99642988400004, - 8.342718817000133 - ], - [ - 122.99838300900015, - 8.353176174000112 - ], - [ - 122.99724368600002, - 8.364650783000158 - ], - [ - 122.99203535200004, - 8.385484117000132 - ], - [ - 122.99219811300011, - 8.397202867000132 - ], - [ - 122.99927819100006, - 8.414943752000127 - ], - [ - 123.02173912900017, - 8.444403387000108 - ], - [ - 123.02637780000006, - 8.462713934000163 - ], - [ - 123.031016472, - 8.474554755000128 - ], - [ - 123.04200280000018, - 8.490139065000122 - ], - [ - 123.05543053500017, - 8.504950262000179 - ], - [ - 123.06739342500006, - 8.51455312700007 - ], - [ - 123.08204186300011, - 8.519232489000089 - ], - [ - 123.16049238400015, - 8.530666408000144 - ], - [ - 123.19507897200006, - 8.542222398000163 - ], - [ - 123.21127363399998, - 8.541815497000158 - ], - [ - 123.21550540500013, - 8.538316148000163 - ], - [ - 123.22559655000006, - 8.525091864000132 - ], - [ - 123.23194420700011, - 8.520697333000143 - ], - [ - 123.24203535200016, - 8.519110419000114 - ], - [ - 123.30095462300002, - 8.52423737200013 - ], - [ - 123.31820722700016, - 8.53351471600017 - ], - [ - 123.33106530000018, - 8.546616929000052 - ], - [ - 123.34644616, - 8.569769598000093 - ], - [ - 123.34961998800006, - 8.576605536000116 - ], - [ - 123.36353600400017, - 8.623277085000112 - ], - [ - 123.37159264400012, - 8.633449611000145 - ], - [ - 123.38672936300011, - 8.637437242000132 - ], - [ - 123.39234459700018, - 8.635728257000125 - ], - [ - 123.39763431100008, - 8.6323916690001 - ], - [ - 123.40333092500023, - 8.62982819200009 - ], - [ - 123.41065514400023, - 8.630560614000117 - ], - [ - 123.41553795700023, - 8.633693752000099 - ], - [ - 123.42758222700004, - 8.64423248900006 - ], - [ - 123.43637128999998, - 8.649481512000136 - ], - [ - 123.43197675900004, - 8.661078192000062 - ], - [ - 123.40007571700019, - 8.697658596000096 - ], - [ - 123.39185631600012, - 8.709418036000073 - ], - [ - 123.39014733200011, - 8.71938711100016 - ], - [ - 123.39714603000019, - 8.723211981000176 - ], - [ - 123.41114342500023, - 8.72638580900015 - ], - [ - 123.42481530000006, - 8.72695547100011 - ], - [ - 123.43100019600016, - 8.722805080000086 - ], - [ - 123.43669681100002, - 8.721828518000109 - ], - [ - 123.46192467500006, - 8.707261460000083 - ], - [ - 123.477793816, - 8.695298570000134 - ], - [ - 123.48845462300002, - 8.692124742000175 - ], - [ - 123.500254754, - 8.693101304000052 - ], - [ - 123.51295006600017, - 8.698879299000112 - ], - [ - 123.51417076900012, - 8.647284247000144 - ], - [ - 123.52182050900004, - 8.622544664000173 - ], - [ - 123.53972415500019, - 8.623765367000189 - ], - [ - 123.54590905000023, - 8.620062567000147 - ], - [ - 123.54900149800002, - 8.618841864000132 - ], - [ - 123.56137129000015, - 8.613836981000091 - ], - [ - 123.567637566, - 8.61009349200016 - ], - [ - 123.57178795700017, - 8.604681708000115 - ], - [ - 123.58130944100006, - 8.582831122000158 - ], - [ - 123.59099368600013, - 8.592759507000082 - ], - [ - 123.59253991000017, - 8.60228099200016 - ], - [ - 123.59213300900015, - 8.612372137000136 - ], - [ - 123.59498131600017, - 8.623765367000189 - ], - [ - 123.60035241000006, - 8.632554429000066 - ], - [ - 123.61548912900005, - 8.651068427000084 - ], - [ - 123.60328209700018, - 8.663072007000096 - ], - [ - 123.61670983200005, - 8.67072174700013 - ], - [ - 123.63306725400017, - 8.668443101000065 - ], - [ - 123.6290796230002, - 8.651068427000084 - ], - [ - 123.71029707100004, - 8.633246161000102 - ], - [ - 123.7225041020001, - 8.628078518000095 - ], - [ - 123.73096764400012, - 8.618882554000123 - ], - [ - 123.73894290500019, - 8.60268789300008 - ], - [ - 123.74577884200019, - 8.60268789300008 - ], - [ - 123.75407962300008, - 8.610296942000119 - ], - [ - 123.75879967500006, - 8.60748932500016 - ], - [ - 123.766856316, - 8.589016018000137 - ], - [ - 123.76490319100017, - 8.58909739800012 - ], - [ - 123.77702884200008, - 8.55735911700016 - ], - [ - 123.78052819100006, - 8.551743882000068 - ], - [ - 123.78638756600012, - 8.53766510600012 - ], - [ - 123.82837975400017, - 8.48655833500014 - ], - [ - 123.84473717500012, - 8.452215887000094 - ], - [ - 123.8575952480002, - 8.409409898000192 - ], - [ - 123.86605879000015, - 8.364325262000136 - ], - [ - 123.8693139980002, - 8.243312893000137 - ], - [ - 123.88477623800023, - 8.185451565000136 - ], - [ - 123.88298587300002, - 8.164496161000088 - ], - [ - 123.87330162900017, - 8.15326569200009 - ], - [ - 123.7677514980002, - 8.059027411000088 - ], - [ - 123.74577884200019, - 8.048407294000143 - ], - [ - 123.70240319100006, - 8.045803127000141 - ], - [ - 123.68474368600013, - 8.036810614000132 - ], - [ - 123.67766360800024, - 8.010728257000068 - ], - [ - 123.67758222700016, - 8.010606187000093 - ], - [ - 123.67750084700018, - 8.010199286000088 - ], - [ - 123.67644290500007, - 8.000067450000131 - ], - [ - 123.67172285200004, - 7.98065827000012 - ], - [ - 123.67066491000017, - 7.969224351000079 - ], - [ - 123.67074629000015, - 7.969183661000088 - ], - [ - 123.67212975400005, - 7.96775950700011 - ], - [ - 123.67644290500007, - 7.963364976000122 - ], - [ - 123.67644290500007, - 7.963405666000114 - ], - [ - 123.6766870450002, - 7.963487046000097 - ], - [ - 123.68897545700023, - 7.968329169000171 - ], - [ - 123.70085696700019, - 7.976467190000093 - ], - [ - 123.70484459700018, - 7.98012929900014 - ], - [ - 123.74097741, - 8.000433661000145 - ], - [ - 123.87370853000019, - 8.105169989000117 - ], - [ - 123.88640384200008, - 8.109198309000178 - ], - [ - 123.90748131600017, - 8.113226630000142 - ], - [ - 123.9220483730002, - 8.123236395000134 - ], - [ - 123.94507897200018, - 8.150132554000109 - ], - [ - 123.96892337300008, - 8.16779205900012 - ], - [ - 124.000254754, - 8.181341864000089 - ], - [ - 124.03630618600008, - 8.18984609600011 - ], - [ - 124.15577233200011, - 8.190252997000115 - ], - [ - 124.19849694100006, - 8.196478583000086 - ], - [ - 124.23226972700004, - 8.212876695000176 - ], - [ - 124.24244225400017, - 8.225327867000189 - ], - [ - 124.25806725400005, - 8.255926825000117 - ], - [ - 124.270274285, - 8.27094147300015 - ], - [ - 124.27466881600012, - 8.281073309000107 - ], - [ - 124.27076256600012, - 8.291449286000102 - ], - [ - 124.26392662900017, - 8.301825262000108 - ], - [ - 124.26042728000019, - 8.311916408000158 - ], - [ - 124.26172936300011, - 8.324530341000141 - ], - [ - 124.26539147200006, - 8.333970445000162 - ], - [ - 124.27393639400017, - 8.350043036000145 - ], - [ - 124.27458743600013, - 8.354559637000094 - ], - [ - 124.27320397200006, - 8.364813544000128 - ], - [ - 124.27393639400017, - 8.369289455000086 - ], - [ - 124.27702884200008, - 8.373521226000108 - ], - [ - 124.28394616000006, - 8.378607489000132 - ], - [ - 124.28695722700016, - 8.383530992000189 - ], - [ - 124.29623457100004, - 8.404730536000088 - ], - [ - 124.29948978000007, - 8.415472723000107 - ], - [ - 124.30201256600017, - 8.452460028000132 - ], - [ - 124.30591881600017, - 8.473700262000122 - ], - [ - 124.32178795700011, - 8.51455312700007 - ], - [ - 124.34253991000017, - 8.548651434000178 - ], - [ - 124.37110436300006, - 8.581366278000104 - ], - [ - 124.40577233200017, - 8.60789622600008 - ], - [ - 124.44459069100017, - 8.623765367000189 - ], - [ - 124.46998131600012, - 8.62482330900015 - ], - [ - 124.47608483200011, - 8.614569403000118 - ], - [ - 124.47535241000006, - 8.598700262000094 - ], - [ - 124.48015384200002, - 8.582831122000158 - ], - [ - 124.4851994150001, - 8.582464911000145 - ], - [ - 124.50855553500017, - 8.577337958000143 - ], - [ - 124.51050866, - 8.57599518400015 - ], - [ - 124.51742597700004, - 8.574652411000073 - ], - [ - 124.52588951900023, - 8.571112372000172 - ], - [ - 124.540782097, - 8.561712958000058 - ], - [ - 124.57154381600017, - 8.52814362200013 - ], - [ - 124.58253014400023, - 8.520697333000143 - ], - [ - 124.59994550900004, - 8.516180731000091 - ], - [ - 124.657481316, - 8.51455312700007 - ], - [ - 124.64844811300011, - 8.496323960000097 - ], - [ - 124.64096113400004, - 8.476019598000093 - ], - [ - 124.63648522200018, - 8.454291083000115 - ], - [ - 124.63648522200018, - 8.431952216000084 - ], - [ - 124.64332116000017, - 8.431952216000084 - ], - [ - 124.65064537900017, - 8.458197333000115 - ], - [ - 124.66309655000012, - 8.475816148000135 - ], - [ - 124.68295332100004, - 8.481838283000144 - ], - [ - 124.71216881600006, - 8.472967841000099 - ], - [ - 124.71648196700008, - 8.479803778000118 - ], - [ - 124.732676629, - 8.493394273000163 - ], - [ - 124.73633873800023, - 8.495021877000099 - ], - [ - 124.74976647200006, - 8.498724677000126 - ], - [ - 124.75318444100006, - 8.500230210000083 - ], - [ - 124.75367272200006, - 8.506577867000118 - ], - [ - 124.75098717500018, - 8.512518622000144 - ], - [ - 124.74773196700014, - 8.517401434000107 - ], - [ - 124.74634850400005, - 8.520697333000143 - ], - [ - 124.75049889400006, - 8.551499742000118 - ], - [ - 124.75318444100006, - 8.561712958000058 - ], - [ - 124.75733483200011, - 8.569077867000146 - ], - [ - 124.769786004, - 8.586330471000153 - ], - [ - 124.77361087300002, - 8.596421617000118 - ], - [ - 124.77149498800011, - 8.615871486000117 - ], - [ - 124.75147545700023, - 8.650458075000117 - ], - [ - 124.74634850400005, - 8.670965887000165 - ], - [ - 124.751231316, - 8.69277578300013 - ], - [ - 124.76319420700023, - 8.706000067000076 - ], - [ - 124.777110222, - 8.717352606000134 - ], - [ - 124.78785241000006, - 8.733628648000163 - ], - [ - 124.78003991000006, - 8.752875067000119 - ], - [ - 124.78077233200005, - 8.774603583000086 - ], - [ - 124.78785241000006, - 8.818996486000117 - ], - [ - 124.78785241000006, - 8.904282945000176 - ], - [ - 124.78077233200005, - 8.949123440000108 - ], - [ - 124.78174889400023, - 8.971136786000102 - ], - [ - 124.79102623800011, - 8.990627346000096 - ], - [ - 124.79908287900005, - 8.999986070000134 - ], - [ - 124.80941816500015, - 9.009466864000132 - ], - [ - 124.82081139400012, - 9.014553127000156 - ], - [ - 124.83204186300011, - 9.010728257000139 - ], - [ - 124.84359785200004, - 9.003729559000163 - ], - [ - 124.85377037900017, - 9.003973700000103 - ], - [ - 124.864024285, - 9.006740627000156 - ], - [ - 124.87671959700018, - 9.007391669000114 - ], - [ - 124.89519290500019, - 9.002752997000087 - ], - [ - 124.91529381600006, - 8.994126695000176 - ], - [ - 124.931407097, - 8.982733466000127 - ], - [ - 124.93816165500007, - 8.969794012000122 - ], - [ - 124.94727623800023, - 8.962469794000114 - ], - [ - 125.02637780000023, - 8.918524481000176 - ], - [ - 125.03443444100017, - 8.91176992400014 - ], - [ - 125.05738366000017, - 8.882269598000079 - ], - [ - 125.07276451900012, - 8.872788804000066 - ], - [ - 125.093028191, - 8.8397891300001 - ], - [ - 125.10596764400012, - 8.829779364000117 - ], - [ - 125.11573326900023, - 8.830552476000136 - ], - [ - 125.13746178500006, - 8.843491929000137 - ], - [ - 125.15935306100008, - 8.851141669000171 - ], - [ - 125.17644290500019, - 8.860581773000177 - ], - [ - 125.1873478520001, - 8.875921942000133 - ], - [ - 125.19532311300023, - 8.960882880000085 - ], - [ - 125.19141686300023, - 8.980047919000143 - ], - [ - 125.18775475400017, - 8.985907294000086 - ], - [ - 125.18311608200017, - 8.991400458000115 - ], - [ - 125.17920983200005, - 8.9979922550001 - ], - [ - 125.17774498800011, - 9.007391669000114 - ], - [ - 125.17994225400011, - 9.019476630000113 - ], - [ - 125.18921959700006, - 9.039374091000113 - ], - [ - 125.19141686300023, - 9.052069403000175 - ], - [ - 125.19190514400023, - 9.064927476000108 - ], - [ - 125.19410241, - 9.072414455000157 - ], - [ - 125.19947350400017, - 9.078273830000114 - ], - [ - 125.20875084700006, - 9.086493231000105 - ], - [ - 125.21851647200018, - 9.088120835000126 - ], - [ - 125.22722415500007, - 9.078843492000175 - ], - [ - 125.23975670700023, - 9.055161851000065 - ], - [ - 125.269297722, - 9.015570380000128 - ], - [ - 125.28874759200019, - 9.00043366100013 - ], - [ - 125.31177819100017, - 8.994330145000134 - ], - [ - 125.37671959700006, - 8.991359768000123 - ], - [ - 125.41993248800023, - 8.981594143000095 - ], - [ - 125.44117272200006, - 8.98041413000007 - ], - [ - 125.46216881600017, - 8.985174872000158 - ], - [ - 125.51661217500006, - 9.015936591000141 - ], - [ - 125.52654056100019, - 9.026190497000158 - ], - [ - 125.53451582100004, - 9.0489769550001 - ], - [ - 125.54070071700019, - 9.084051825000174 - ], - [ - 125.54200280000012, - 9.189195054000137 - ], - [ - 125.53931725400005, - 9.206691799000097 - ], - [ - 125.53321373800023, - 9.217596747000158 - ], - [ - 125.52605228000019, - 9.22695547100011 - ], - [ - 125.52100670700005, - 9.239488023000192 - ], - [ - 125.52027428500006, - 9.248236395000077 - ], - [ - 125.52149498800023, - 9.26618073100012 - ], - [ - 125.52100670700005, - 9.274847723000121 - ], - [ - 125.517832879, - 9.284491278000175 - ], - [ - 125.50904381600006, - 9.303697007000139 - ], - [ - 125.50294030000023, - 9.32916901200015 - ], - [ - 125.48373457099999, - 9.361273505000113 - ], - [ - 125.47730553500017, - 9.390611070000134 - ], - [ - 125.47291100400011, - 9.398342190000136 - ], - [ - 125.46827233200005, - 9.404242255000085 - ], - [ - 125.46631920700023, - 9.408351955000128 - ], - [ - 125.46631920700023, - 9.43935781500015 - ], - [ - 125.46526126400025, - 9.44468821800011 - ], - [ - 125.46241295700023, - 9.459295966000127 - ], - [ - 125.44068444100006, - 9.515936591000127 - ], - [ - 125.43816165500002, - 9.52582428600013 - ], - [ - 125.43555748800023, - 9.546047268000152 - ], - [ - 125.39869225400017, - 9.681057033000116 - ], - [ - 125.39747155000023, - 9.699408270000077 - ], - [ - 125.40040123800006, - 9.717433986000103 - ], - [ - 125.40707441500004, - 9.733710028000132 - ], - [ - 125.45573978000007, - 9.812811591000127 - ], - [ - 125.45948326900012, - 9.822943427000084 - ], - [ - 125.47136478000007, - 9.808905341000127 - ], - [ - 125.4884546230002, - 9.792914130000128 - ], - [ - 125.50709069100017, - 9.779933986000131 - ], - [ - 125.5403751960001, - 9.771063544000171 - ], - [ - 125.56902103000007, - 9.756659247000115 - ], - [ - 125.5892033210001, - 9.754624742000175 - ], - [ - 125.58464603000002, - 9.730780341000113 - ], - [ - 125.59262128999998, - 9.702337958000086 - ], - [ - 125.60450280000023, - 9.673325914000188 - ], - [ - 125.61036217500006, - 9.647894598000093 - ], - [ - 125.62012780000012, - 9.629787502000084 - ], - [ - 125.64356530000012, - 9.61127350500007 - ] - ] - ], - [ - [ - [ - 126.14283287900017, - 9.850043036000102 - ], - [ - 126.15349368600019, - 9.841986395000077 - ], - [ - 126.16586347700004, - 9.829169012000136 - ], - [ - 126.17408287900005, - 9.817206122000101 - ], - [ - 126.18018639400012, - 9.801499742000132 - ], - [ - 126.17823326900017, - 9.787827867000189 - ], - [ - 126.15544681100002, - 9.779201565000108 - ], - [ - 126.13884524800008, - 9.765611070000148 - ], - [ - 126.13038170700023, - 9.760891018000137 - ], - [ - 126.12012780000012, - 9.758937893000095 - ], - [ - 126.09327233200023, - 9.760891018000137 - ], - [ - 126.054453972, - 9.775091864000146 - ], - [ - 126.04167728000007, - 9.775132554000137 - ], - [ - 126.04859459700018, - 9.754624742000175 - ], - [ - 126.03394616000017, - 9.766343492000175 - ], - [ - 126.01921634200008, - 9.78168366100013 - ], - [ - 125.993907097, - 9.81610748900006 - ], - [ - 125.99341881600006, - 9.820298570000176 - ], - [ - 125.99537194100017, - 9.824652411000088 - ], - [ - 125.99659264400012, - 9.829779364000103 - ], - [ - 125.993907097, - 9.836615302000112 - ], - [ - 125.98796634200019, - 9.839992580000128 - ], - [ - 125.98031660200016, - 9.839789130000085 - ], - [ - 125.97266686300023, - 9.841498114000089 - ], - [ - 125.96599368600019, - 9.85024648600016 - ], - [ - 125.9798283210001, - 9.8491885440001 - ], - [ - 125.99293053500006, - 9.85024648600016 - ], - [ - 126.00473066500004, - 9.854885158000087 - ], - [ - 126.01441491000017, - 9.864488023000163 - ], - [ - 126.00326582100016, - 9.869289455000143 - ], - [ - 125.98910566500004, - 9.877142645000134 - ], - [ - 125.9798283210001, - 9.888006903000118 - ], - [ - 125.98340905000023, - 9.901800848000121 - ], - [ - 126.04468834700018, - 9.998724677000098 - ], - [ - 126.04859459700018, - 10.007961330000157 - ], - [ - 126.04851321700019, - 10.01748281500015 - ], - [ - 126.04566491000006, - 10.026190497000144 - ], - [ - 126.04525800900015, - 10.035142320000162 - ], - [ - 126.05225670700023, - 10.045477606000176 - ], - [ - 126.07146243600008, - 10.059068101000136 - ], - [ - 126.08073978000002, - 10.055650132000125 - ], - [ - 126.12671959700018, - 9.956040757000082 - ], - [ - 126.13795006600017, - 9.9019229190001 - ], - [ - 126.13786868600019, - 9.891180731000176 - ], - [ - 126.13314863400004, - 9.88068268400012 - ], - [ - 126.11784915500007, - 9.866888739000103 - ], - [ - 126.110606316, - 9.857082424000083 - ], - [ - 126.12989342500023, - 9.85455963700015 - ], - [ - 126.14283287900017, - 9.850043036000102 - ] - ] - ], - [ - [ - [ - 124.60694420700011, - 10.140326239000132 - ], - [ - 124.59571373800011, - 10.123521226000122 - ], - [ - 124.59538821700008, - 10.10854726800008 - ], - [ - 124.59766686300023, - 10.094183661000102 - ], - [ - 124.58887780000006, - 10.086249091000141 - ], - [ - 124.57569420700023, - 10.090236721000124 - ], - [ - 124.56104576900012, - 10.085842190000136 - ], - [ - 124.55005944100017, - 10.069037177000126 - ], - [ - 124.54037519600004, - 10.060858466000113 - ], - [ - 124.529551629, - 10.068548895000134 - ], - [ - 124.52540123800006, - 10.07880280200007 - ], - [ - 124.52540123800006, - 10.087225653000118 - ], - [ - 124.52279707100016, - 10.098456122000115 - ], - [ - 124.52182050900004, - 10.11204661700016 - ], - [ - 124.52759850400017, - 10.117336330000143 - ], - [ - 124.53565514400012, - 10.11469147300015 - ], - [ - 124.54224694100017, - 10.11595286700016 - ], - [ - 124.54688561300011, - 10.122056382000068 - ], - [ - 124.55176842500018, - 10.126776434000163 - ], - [ - 124.55762780000012, - 10.126044012000136 - ], - [ - 124.56723066499998, - 10.127671617000146 - ], - [ - 124.58008873800011, - 10.136704820000162 - ], - [ - 124.58627363399998, - 10.142238674000083 - ], - [ - 124.59278405000006, - 10.145168361000103 - ], - [ - 124.60621178500017, - 10.147609768000137 - ], - [ - 124.60694420700011, - 10.140326239000132 - ] - ] - ], - [ - [ - [ - 124.34961998800023, - 10.151027736000145 - ], - [ - 124.35596764400006, - 10.110296942000076 - ], - [ - 124.36695397200006, - 10.1192894550001 - ], - [ - 124.38249759200002, - 10.14378489800012 - ], - [ - 124.39682050900004, - 10.151922919000143 - ], - [ - 124.40023847700004, - 10.138373114000089 - ], - [ - 124.40821373800011, - 10.119696356000105 - ], - [ - 124.41911868600008, - 10.106756903000104 - ], - [ - 124.43083743600008, - 10.110174872000101 - ], - [ - 124.47632897200006, - 10.070013739000103 - ], - [ - 124.48975670700023, - 10.062567450000117 - ], - [ - 124.52003014400012, - 10.064195054000137 - ], - [ - 124.53028405000023, - 10.06053294500019 - ], - [ - 124.54835045700017, - 10.048895575000174 - ], - [ - 124.57764733200005, - 10.033921617000146 - ], - [ - 124.58863366000006, - 10.023871161000088 - ], - [ - 124.58399498800011, - 9.999009507000125 - ], - [ - 124.58423912900017, - 9.980943101000108 - ], - [ - 124.58090254000004, - 9.972154039000145 - ], - [ - 124.56869550900015, - 9.987453518000109 - ], - [ - 124.56617272200006, - 9.968329169000128 - ], - [ - 124.56617272200006, - 9.952785549000126 - ], - [ - 124.56446373800023, - 9.94399648600016 - ], - [ - 124.55616295700023, - 9.925685940000108 - ], - [ - 124.57146243600019, - 9.912298895000106 - ], - [ - 124.58375084700018, - 9.893947658000144 - ], - [ - 124.58464603000007, - 9.877671617000118 - ], - [ - 124.56527754000015, - 9.870754299000112 - ], - [ - 124.54981530000012, - 9.86155833500014 - ], - [ - 124.57016035200004, - 9.840521552000112 - ], - [ - 124.62403405000023, - 9.801825262000165 - ], - [ - 124.59896894600016, - 9.749701239000132 - ], - [ - 124.59620201900006, - 9.737290757000096 - ], - [ - 124.58521569100006, - 9.732082424000112 - ], - [ - 124.56055748800023, - 9.732611395000092 - ], - [ - 124.53484134200019, - 9.736273505000128 - ], - [ - 124.52035566500015, - 9.740383205000086 - ], - [ - 124.51685631600006, - 9.748765367000146 - ], - [ - 124.51742597700004, - 9.759100653000147 - ], - [ - 124.51441491, - 9.767035223000121 - ], - [ - 124.4998478520001, - 9.768296617000118 - ], - [ - 124.49293053500017, - 9.762762762000108 - ], - [ - 124.46241295700023, - 9.730780341000113 - ], - [ - 124.45281009200008, - 9.725775458000072 - ], - [ - 124.44027754000015, - 9.721584377000127 - ], - [ - 124.42945397200018, - 9.715033270000148 - ], - [ - 124.42481530000023, - 9.702826239000075 - ], - [ - 124.42416425900004, - 9.689601955000128 - ], - [ - 124.4220483730002, - 9.678697007000068 - ], - [ - 124.41749108200023, - 9.668890692000133 - ], - [ - 124.41049238400015, - 9.65843333500014 - ], - [ - 124.38184655000012, - 9.636704820000176 - ], - [ - 124.3387150400001, - 9.618597723000079 - ], - [ - 124.29420006600017, - 9.606756903000104 - ], - [ - 124.26042728000019, - 9.603827216000084 - ], - [ - 124.22144616, - 9.605780341000127 - ], - [ - 124.06519616000017, - 9.595404364000132 - ], - [ - 123.93751061300023, - 9.617499091000127 - ], - [ - 123.89234459700018, - 9.632147528000132 - ], - [ - 123.87175540500007, - 9.645005601000065 - ], - [ - 123.86304772200006, - 9.661851304000066 - ], - [ - 123.86670983200011, - 9.683539130000142 - ], - [ - 123.87273196700019, - 9.70380280200014 - ], - [ - 123.87387129000015, - 9.72113678600013 - ], - [ - 123.86304772200006, - 9.73419830900012 - ], - [ - 123.84489993600008, - 9.737250067000105 - ], - [ - 123.82447350400017, - 9.736151434000163 - ], - [ - 123.80787194100006, - 9.73997630400008 - ], - [ - 123.801036004, - 9.75775788000007 - ], - [ - 123.80323326900012, - 9.781195380000142 - ], - [ - 123.80909264400023, - 9.80267975500007 - ], - [ - 123.82837975400017, - 9.842840887000165 - ], - [ - 123.84131920700011, - 9.857367255000113 - ], - [ - 123.87582441499998, - 9.886948960000069 - ], - [ - 123.88298587300002, - 9.901800848000121 - ], - [ - 123.88607832100004, - 9.914862372000101 - ], - [ - 123.89340254000004, - 9.916937567000119 - ], - [ - 123.90723717500023, - 9.911688544000143 - ], - [ - 123.91667728000007, - 9.91510651200015 - ], - [ - 123.92212975400017, - 9.923000393000123 - ], - [ - 123.92603600400017, - 9.932074286000116 - ], - [ - 123.93140709700006, - 9.939032294000114 - ], - [ - 123.96387780000012, - 9.9507510440001 - ], - [ - 124.00977623800011, - 9.961615302000084 - ], - [ - 124.05079186300011, - 9.979315497000087 - ], - [ - 124.0685327480002, - 10.0116641300001 - ], - [ - 124.06999759200008, - 10.032212632000139 - ], - [ - 124.07520592500023, - 10.048325914000117 - ], - [ - 124.08659915500002, - 10.058783270000106 - ], - [ - 124.11589603000007, - 10.065252997000101 - ], - [ - 124.11597741000006, - 10.07208893400012 - ], - [ - 124.11361738400015, - 10.080959377000156 - ], - [ - 124.11622155000018, - 10.08982982000012 - ], - [ - 124.12387128999998, - 10.096665757000125 - ], - [ - 124.13697350400017, - 10.10488515800013 - ], - [ - 124.14307701900023, - 10.110296942000076 - ], - [ - 124.15870201900023, - 10.131170966000141 - ], - [ - 124.16716556100008, - 10.137437242000189 - ], - [ - 124.18458092500023, - 10.14447663000007 - ], - [ - 124.22266686300023, - 10.151922919000143 - ], - [ - 124.26343834700018, - 10.151922919000143 - ], - [ - 124.33130944100017, - 10.161525783000116 - ], - [ - 124.34961998800023, - 10.151027736000145 - ] - ] - ], - [ - [ - [ - 125.29135175900004, - 9.922186591000113 - ], - [ - 125.28516686300023, - 9.916937567000119 - ], - [ - 125.27393639400023, - 9.919134833000115 - ], - [ - 125.26742597700016, - 9.924505927000084 - ], - [ - 125.26514733200005, - 9.930894273000192 - ], - [ - 125.26384524800008, - 9.938218492000189 - ], - [ - 125.26026451900012, - 9.946478583000086 - ], - [ - 125.23633873800023, - 9.974351304000137 - ], - [ - 125.19874108200023, - 10.035834052000112 - ], - [ - 125.16480553500011, - 10.055975653000147 - ], - [ - 125.145762566, - 10.070705471000139 - ], - [ - 125.13746178500006, - 10.08673737200013 - ], - [ - 125.12582441500004, - 10.129828192000147 - ], - [ - 125.12452233200023, - 10.151800848000079 - ], - [ - 125.13746178500006, - 10.165513414000188 - ], - [ - 125.14909915500002, - 10.1659610050001 - ], - [ - 125.15845787900017, - 10.16058991100013 - ], - [ - 125.17546634200002, - 10.145493882000125 - ], - [ - 125.21648196700002, - 10.129624742000189 - ], - [ - 125.22925866000017, - 10.12116120000016 - ], - [ - 125.23926842500018, - 10.103908596000153 - ], - [ - 125.25342858200011, - 10.035834052000112 - ], - [ - 125.26303144600016, - 10.023138739000146 - ], - [ - 125.277110222, - 10.00885651200015 - ], - [ - 125.28956139400023, - 9.99168528900013 - ], - [ - 125.29509524800002, - 9.9706485050001 - ], - [ - 125.30616295700011, - 9.937445380000085 - ], - [ - 125.30494225400017, - 9.932806708000143 - ], - [ - 125.29639733200023, - 9.929266669000171 - ], - [ - 125.29135175900004, - 9.922186591000113 - ] - ] - ], - [ - [ - [ - 125.68482506600006, - 10.39988841400016 - ], - [ - 125.68384850400017, - 10.36440664300008 - ], - [ - 125.66488691500015, - 10.295884507000125 - ], - [ - 125.66138756600017, - 10.270575262000179 - ], - [ - 125.65805097700016, - 10.261704820000134 - ], - [ - 125.65463300900015, - 10.264227606000148 - ], - [ - 125.64625084700018, - 10.265366929000095 - ], - [ - 125.63868248800023, - 10.261379299000112 - ], - [ - 125.63770592500023, - 10.248114325000174 - ], - [ - 125.64584394600016, - 10.239691473000136 - ], - [ - 125.66016686300017, - 10.22825755400008 - ], - [ - 125.6681421230002, - 10.21466705900012 - ], - [ - 125.65805097700016, - 10.199693101000094 - ], - [ - 125.66488691500015, - 10.19285716400016 - ], - [ - 125.65381920700023, - 10.186590887000122 - ], - [ - 125.656504754, - 10.176336981000091 - ], - [ - 125.66846764400023, - 10.169256903000132 - ], - [ - 125.68531334700006, - 10.172349351000122 - ], - [ - 125.67758222700004, - 10.14484284100017 - ], - [ - 125.67676842500012, - 10.127671617000146 - ], - [ - 125.68197675900004, - 10.113999742000118 - ], - [ - 125.69849694100017, - 10.093939520000063 - ], - [ - 125.70476321700002, - 10.08177317900008 - ], - [ - 125.70655358200023, - 10.069322007000068 - ], - [ - 125.70313561300011, - 10.056708075000174 - ], - [ - 125.69646243600008, - 10.040920315000136 - ], - [ - 125.68864993600008, - 10.027289130000085 - ], - [ - 125.68197675900004, - 10.021551825000117 - ], - [ - 125.68506920700011, - 10.01463450700011 - ], - [ - 125.69288170700011, - 9.974351304000137 - ], - [ - 125.68148847700004, - 9.958075262000108 - ], - [ - 125.69060306100013, - 9.941839911000073 - ], - [ - 125.70728600400017, - 9.926214911000088 - ], - [ - 125.71957441500004, - 9.911688544000143 - ], - [ - 125.72169030000012, - 9.89435455900015 - ], - [ - 125.71452884200008, - 9.880845445000176 - ], - [ - 125.69947350400017, - 9.874253648000192 - ], - [ - 125.67855879000004, - 9.877590236000131 - ], - [ - 125.66358483200005, - 9.889146226000065 - ], - [ - 125.66081790500019, - 9.903998114000117 - ], - [ - 125.66187584700018, - 9.920965887000179 - ], - [ - 125.65805097700016, - 9.939032294000114 - ], - [ - 125.64861087300002, - 9.946966864000075 - ], - [ - 125.62061608200011, - 9.955226955000157 - ], - [ - 125.61036217500006, - 9.966945705000143 - ], - [ - 125.62029056100019, - 9.966538804000137 - ], - [ - 125.62330162900011, - 9.966945705000143 - ], - [ - 125.615000847, - 9.972479559000163 - ], - [ - 125.61133873800017, - 9.97728099200016 - ], - [ - 125.61231530000023, - 9.982001044000157 - ], - [ - 125.61719811300011, - 9.987453518000109 - ], - [ - 125.61719811300011, - 9.993597723000093 - ], - [ - 125.59302819100012, - 9.99298737200013 - ], - [ - 125.58318118600008, - 10.009711005000057 - ], - [ - 125.585215691, - 10.03388092700007 - ], - [ - 125.59669030000023, - 10.055650132000125 - ], - [ - 125.60141035200016, - 10.04743073100012 - ], - [ - 125.60840905000023, - 10.043605861000117 - ], - [ - 125.61451256600006, - 10.046616929000109 - ], - [ - 125.61719811300011, - 10.059068101000136 - ], - [ - 125.61451256600006, - 10.064154364000146 - ], - [ - 125.60132897200018, - 10.08026764500012 - ], - [ - 125.59669030000023, - 10.08982982000012 - ], - [ - 125.5892033210001, - 10.08982982000012 - ], - [ - 125.58448326900006, - 10.077541408000158 - ], - [ - 125.57789147200012, - 10.076646226000065 - ], - [ - 125.56934655000006, - 10.080796617000189 - ], - [ - 125.558848504, - 10.08364492400014 - ], - [ - 125.55250084700018, - 10.078680731000091 - ], - [ - 125.54525800900015, - 10.068752346000096 - ], - [ - 125.53541100400005, - 10.060858466000113 - ], - [ - 125.52100670700005, - 10.062567450000117 - ], - [ - 125.513438347, - 10.072984117000118 - ], - [ - 125.51319420700005, - 10.08661530200007 - ], - [ - 125.51075280000023, - 10.098456122000115 - ], - [ - 125.49708092500012, - 10.10346100500007 - ], - [ - 125.49529056100013, - 10.108710028000147 - ], - [ - 125.49594160200016, - 10.13458893400015 - ], - [ - 125.49366295700011, - 10.14447663000007 - ], - [ - 125.50896243600008, - 10.15131256700009 - ], - [ - 125.51758873800023, - 10.169378973000107 - ], - [ - 125.51937910200004, - 10.190619208000086 - ], - [ - 125.51417076900023, - 10.207098700000174 - ], - [ - 125.52198326900023, - 10.210394598000107 - ], - [ - 125.52898196700014, - 10.209784247000144 - ], - [ - 125.53549238400004, - 10.206000067000133 - ], - [ - 125.54200280000012, - 10.199693101000094 - ], - [ - 125.53882897200006, - 10.215155341000113 - ], - [ - 125.53199303500006, - 10.228989976000108 - ], - [ - 125.53028405000012, - 10.241888739000117 - ], - [ - 125.54200280000012, - 10.254339911000145 - ], - [ - 125.53695722700016, - 10.25714752800009 - ], - [ - 125.53484134200008, - 10.260077216000113 - ], - [ - 125.53288821700019, - 10.263657945000176 - ], - [ - 125.52784264400006, - 10.268622137000136 - ], - [ - 125.53223717500018, - 10.283921617000189 - ], - [ - 125.52393639400006, - 10.301906643000137 - ], - [ - 125.52214603000019, - 10.316961981000148 - ], - [ - 125.54542076900012, - 10.323187567000105 - ], - [ - 125.55779056100008, - 10.325100002000156 - ], - [ - 125.56251061300017, - 10.330796617000146 - ], - [ - 125.56251061300017, - 10.353949286000088 - ], - [ - 125.56039472700016, - 10.361314195000176 - ], - [ - 125.55689537900017, - 10.366034247000101 - ], - [ - 125.55616295700023, - 10.370754299000097 - ], - [ - 125.56251061300017, - 10.378485419000114 - ], - [ - 125.56788170700011, - 10.380926825000145 - ], - [ - 125.57471764400023, - 10.381170966000099 - ], - [ - 125.58041425900004, - 10.379136460000069 - ], - [ - 125.58643639400012, - 10.367417710000083 - ], - [ - 125.59441165500019, - 10.3651797550001 - ], - [ - 125.60336347699999, - 10.366766669000128 - ], - [ - 125.61036217500006, - 10.370998440000136 - ], - [ - 125.61475670700005, - 10.38104889500012 - ], - [ - 125.61719811300011, - 10.41941966400013 - ], - [ - 125.62419681100019, - 10.443670966000127 - ], - [ - 125.62964928500006, - 10.454046942000119 - ], - [ - 125.63770592500023, - 10.46039459800015 - ], - [ - 125.64966881600017, - 10.46190013200011 - ], - [ - 125.65739993600019, - 10.456447658000158 - ], - [ - 125.6717228520001, - 10.433050848000093 - ], - [ - 125.68482506600006, - 10.39988841400016 - ] - ] - ], - [ - [ - [ - 119.99057050900015, - 10.555975653000132 - ], - [ - 119.99057050900015, - 10.549139716000113 - ], - [ - 119.99317467500023, - 10.539984442000133 - ], - [ - 119.984141472, - 10.531317450000145 - ], - [ - 119.96827233200011, - 10.528143622000172 - ], - [ - 119.95020592500006, - 10.53546784100017 - ], - [ - 119.94947350400005, - 10.52879466400013 - ], - [ - 119.94727623800017, - 10.524155992000189 - ], - [ - 119.94467207100016, - 10.520086981000134 - ], - [ - 119.94271894600004, - 10.515041408000116 - ], - [ - 119.91879316500015, - 10.548041083000072 - ], - [ - 119.90870201900006, - 10.555975653000132 - ], - [ - 119.91187584700006, - 10.536281643000095 - ], - [ - 119.91765384200019, - 10.516180731000148 - ], - [ - 119.92025800900004, - 10.497259833000129 - ], - [ - 119.91488691500015, - 10.480861721000124 - ], - [ - 119.90674889400023, - 10.478745835000112 - ], - [ - 119.89527428500011, - 10.480658270000077 - ], - [ - 119.88526451900012, - 10.47996653900013 - ], - [ - 119.88070722700016, - 10.47036367400014 - ], - [ - 119.8771264980002, - 10.464667059000163 - ], - [ - 119.868418816, - 10.461737372000144 - ], - [ - 119.85035241000017, - 10.46039459800015 - ], - [ - 119.83562259200019, - 10.456040757000068 - ], - [ - 119.82162519600004, - 10.448553778000104 - ], - [ - 119.80648847700004, - 10.446112372000158 - ], - [ - 119.78858483200005, - 10.456976630000142 - ], - [ - 119.78093509200008, - 10.472235419000114 - ], - [ - 119.778086785, - 10.493597723000079 - ], - [ - 119.77833092500023, - 10.53546784100017 - ], - [ - 119.76612389400006, - 10.530747789000173 - ], - [ - 119.75709069100017, - 10.534002997000115 - ], - [ - 119.75261478000019, - 10.539780992000175 - ], - [ - 119.75416100400005, - 10.542954820000148 - ], - [ - 119.79542076900012, - 10.573391018000109 - ], - [ - 119.80543053500017, - 10.585150458000086 - ], - [ - 119.82894941500015, - 10.626410223000136 - ], - [ - 119.83790123800006, - 10.637518622000158 - ], - [ - 119.84351647200018, - 10.642238674000083 - ], - [ - 119.849864129, - 10.644761460000097 - ], - [ - 119.85962975400005, - 10.643296617000132 - ], - [ - 119.890879754, - 10.62518952000012 - ], - [ - 119.92009524800002, - 10.612738348000107 - ], - [ - 119.95020592500006, - 10.603745835000083 - ], - [ - 119.97413170700023, - 10.595363674000126 - ], - [ - 120.00001061300023, - 10.580471096000068 - ], - [ - 120.01124108200017, - 10.565252997000087 - ], - [ - 119.99057050900015, - 10.555975653000132 - ] - ] - ], - [ - [ - [ - 124.37842858200011, - 10.628322658000101 - ], - [ - 124.30062910199999, - 10.59007396000014 - ], - [ - 124.28435306100008, - 10.603827216000155 - ], - [ - 124.288828972, - 10.616929429000123 - ], - [ - 124.3011173840001, - 10.631170966000127 - ], - [ - 124.30811608200017, - 10.648423570000134 - ], - [ - 124.30958092500012, - 10.662339585000126 - ], - [ - 124.31373131600006, - 10.677801825000145 - ], - [ - 124.31983483200023, - 10.692368882000082 - ], - [ - 124.32764733200023, - 10.704006252000084 - ], - [ - 124.34099368600008, - 10.71181875200007 - ], - [ - 124.35547936300011, - 10.710638739000146 - ], - [ - 124.36915123800023, - 10.7030703800001 - ], - [ - 124.37973066499998, - 10.691310940000122 - ], - [ - 124.38526451900012, - 10.679754950000088 - ], - [ - 124.38835696700019, - 10.667141018000109 - ], - [ - 124.38998457100004, - 10.641302802000098 - ], - [ - 124.37842858200011, - 10.628322658000101 - ] - ] - ], - [ - [ - [ - 124.50879967500012, - 10.641546942000133 - ], - [ - 124.46241295700023, - 10.631048895000063 - ], - [ - 124.40919030000018, - 10.648260809000178 - ], - [ - 124.40845787900005, - 10.68382396000014 - ], - [ - 124.43555748800017, - 10.713609117000146 - ], - [ - 124.46583092500023, - 10.713609117000146 - ], - [ - 124.50391686300023, - 10.693304755000057 - ], - [ - 124.52068118600008, - 10.665757554000123 - ], - [ - 124.50879967500012, - 10.641546942000133 - ] - ] - ], - [ - [ - [ - 122.72152754000004, - 10.585191148000163 - ], - [ - 122.68685957100016, - 10.5060082050001 - ], - [ - 122.66431725400017, - 10.470851955000128 - ], - [ - 122.63445071700019, - 10.444240627000099 - ], - [ - 122.594981316, - 10.433050848000093 - ], - [ - 122.60523522200006, - 10.460516669000128 - ], - [ - 122.59449303500006, - 10.459702867000118 - ], - [ - 122.57797285200016, - 10.447088934000135 - ], - [ - 122.57081139400012, - 10.439276434000135 - ], - [ - 122.56519616, - 10.43618398600016 - ], - [ - 122.54761803500017, - 10.422512111000117 - ], - [ - 122.53663170700023, - 10.41941966400013 - ], - [ - 122.53052819100006, - 10.423244533000144 - ], - [ - 122.52637780000012, - 10.432359117000146 - ], - [ - 122.51929772200006, - 10.45355866100013 - ], - [ - 122.51872806100008, - 10.458197333000072 - ], - [ - 122.520274285, - 10.469875393000152 - ], - [ - 122.51929772200006, - 10.474066473000093 - ], - [ - 122.51433353000019, - 10.477036851000108 - ], - [ - 122.50196373800023, - 10.4796817080001 - ], - [ - 122.49878991000017, - 10.480861721000124 - ], - [ - 122.49480228000019, - 10.483465887000122 - ], - [ - 122.48585045700005, - 10.493068752000099 - ], - [ - 122.48243248800017, - 10.503363348000107 - ], - [ - 122.49512780000012, - 10.508205471000096 - ], - [ - 122.50700931100008, - 10.508002020000134 - ], - [ - 122.51685631600012, - 10.509100653000175 - ], - [ - 122.52361087300002, - 10.51410553600013 - ], - [ - 122.52613366000006, - 10.525580145000077 - ], - [ - 122.52930748800011, - 10.533270575000088 - ], - [ - 122.54590905000006, - 10.540716864000075 - ], - [ - 122.55347741000006, - 10.549139716000113 - ], - [ - 122.53500410199999, - 10.553290106000148 - ], - [ - 122.52735436300006, - 10.57013580900015 - ], - [ - 122.52857506600017, - 10.591213283000087 - ], - [ - 122.53663170700023, - 10.607489325000117 - ], - [ - 122.54786217500012, - 10.622015692000147 - ], - [ - 122.56413821700008, - 10.652573960000083 - ], - [ - 122.57455488400015, - 10.665838934000107 - ], - [ - 122.59058678500006, - 10.673773505000085 - ], - [ - 122.60857181100008, - 10.67739492400014 - ], - [ - 122.62322024800008, - 10.684475002000099 - ], - [ - 122.63379967500023, - 10.722601630000085 - ], - [ - 122.6448673840001, - 10.736273505000113 - ], - [ - 122.65845787900005, - 10.748032945000176 - ], - [ - 122.670176629, - 10.762030341000141 - ], - [ - 122.69971764400006, - 10.740383205000157 - ], - [ - 122.71111087300002, - 10.73468659100017 - ], - [ - 122.73796634200002, - 10.694159247000158 - ], - [ - 122.73707116000006, - 10.640041408000087 - ], - [ - 122.72152754000004, - 10.585191148000163 - ] - ] - ], - [ - [ - [ - 125.76050866000006, - 10.740952867000132 - ], - [ - 125.77621504000004, - 10.738918361000103 - ], - [ - 125.80836022200018, - 10.740423895000148 - ], - [ - 125.82203209700012, - 10.73468659100017 - ], - [ - 125.83179772200006, - 10.720119533000144 - ], - [ - 125.82691491000017, - 10.708929755000142 - ], - [ - 125.81364993600002, - 10.701849677000084 - ], - [ - 125.79835045700005, - 10.699367580000143 - ], - [ - 125.77979576900006, - 10.6991641300001 - ], - [ - 125.7693791020001, - 10.700384833000115 - ], - [ - 125.76140384200002, - 10.705552476000122 - ], - [ - 125.750254754, - 10.717352606000176 - ], - [ - 125.74000084700018, - 10.72443268400015 - ], - [ - 125.70289147200018, - 10.740952867000132 - ], - [ - 125.68409264400012, - 10.752752997000101 - ], - [ - 125.678965691, - 10.778876044000143 - ], - [ - 125.68726647200018, - 10.80516185100008 - ], - [ - 125.70915774800014, - 10.81769440300016 - ], - [ - 125.73145592500023, - 10.808050848000107 - ], - [ - 125.74415123800023, - 10.758368231000105 - ], - [ - 125.76050866000006, - 10.740952867000132 - ] - ] - ], - [ - [ - [ - 121.08716881600006, - 10.823472398000135 - ], - [ - 121.062266472, - 10.8175723330001 - ], - [ - 121.03467858200011, - 10.819810289000173 - ], - [ - 121.01758873800017, - 10.834133205000157 - ], - [ - 121.025157097, - 10.864447333000143 - ], - [ - 121.03207441500004, - 10.870510158000144 - ], - [ - 121.066661004, - 10.89109935100008 - ], - [ - 121.0857853520001, - 10.90888092700007 - ], - [ - 121.09327233200023, - 10.910386460000112 - ], - [ - 121.09449303500017, - 10.895819403000175 - ], - [ - 121.09449303500017, - 10.87348053600006 - ], - [ - 121.08073978000007, - 10.8417422550001 - ], - [ - 121.08716881600006, - 10.823472398000135 - ] - ] - ], - [ - [ - [ - 123.26978600400005, - 10.977362372000115 - ], - [ - 123.27686608200011, - 10.974310614000117 - ], - [ - 123.29566491000017, - 10.975327867000175 - ], - [ - 123.30079186300006, - 10.974310614000117 - ], - [ - 123.31185957100004, - 10.96698639500012 - ], - [ - 123.32960045700011, - 10.951402085000126 - ], - [ - 123.34180748800006, - 10.946356512000179 - ], - [ - 123.353770379, - 10.947577216000113 - ], - [ - 123.37924238400004, - 10.958807684000107 - ], - [ - 123.39014733200011, - 10.960028387000122 - ], - [ - 123.40357506600017, - 10.953192450000117 - ], - [ - 123.40137780000012, - 10.945298570000134 - ], - [ - 123.39503014400017, - 10.93622467700014 - ], - [ - 123.39625084700018, - 10.925930080000114 - ], - [ - 123.40544681100008, - 10.919826565000136 - ], - [ - 123.41293379000004, - 10.924058335000055 - ], - [ - 123.42066491000006, - 10.93268463700015 - ], - [ - 123.43100019600016, - 10.939601955000157 - ], - [ - 123.44564863400015, - 10.942287502000127 - ], - [ - 123.45687910200016, - 10.94049713700015 - ], - [ - 123.467051629, - 10.936509507000082 - ], - [ - 123.50261478000007, - 10.92772044500019 - ], - [ - 123.52182050900004, - 10.91990794500012 - ], - [ - 123.53500410200016, - 10.904852606000105 - ], - [ - 123.54175866, - 10.865464585000112 - ], - [ - 123.54664147200018, - 10.856105861000088 - ], - [ - 123.560801629, - 10.837144273000163 - ], - [ - 123.56364993600008, - 10.835353908000087 - ], - [ - 123.56739342500006, - 10.835394598000079 - ], - [ - 123.57105553500006, - 10.834784247000115 - ], - [ - 123.57447350400005, - 10.830959377000099 - ], - [ - 123.57553144599999, - 10.825588283000144 - ], - [ - 123.57081139400006, - 10.77924225500007 - ], - [ - 123.56153405000023, - 10.760077216000099 - ], - [ - 123.53345787900005, - 10.721096096000124 - ], - [ - 123.51685631600017, - 10.680975653000104 - ], - [ - 123.48568769599999, - 10.549139716000113 - ], - [ - 123.47364342500006, - 10.526760158000101 - ], - [ - 123.38965905000012, - 10.437160549000126 - ], - [ - 123.37940514400006, - 10.42153554900014 - ], - [ - 123.36573326900023, - 10.39252350500007 - ], - [ - 123.34473717500012, - 10.34796784100017 - ], - [ - 123.34180748800006, - 10.326605536000116 - ], - [ - 123.34034264400012, - 10.260687567000076 - ], - [ - 123.33545983200023, - 10.240668036000102 - ], - [ - 123.30469811300006, - 10.178534247000172 - ], - [ - 123.30079186300006, - 10.15534088700015 - ], - [ - 123.29981530000012, - 10.131415106000176 - ], - [ - 123.29664147200006, - 10.1114769550001 - ], - [ - 123.29037519599999, - 10.09357330900015 - ], - [ - 123.24415123800006, - 10.02635325700011 - ], - [ - 123.23552493600019, - 10.00189850500007 - ], - [ - 123.22852623800011, - 9.994696356000134 - ], - [ - 123.22136478000007, - 9.98908112200013 - ], - [ - 123.21810957100004, - 9.984035549000097 - ], - [ - 123.20443769600016, - 9.939032294000114 - ], - [ - 123.17595462300008, - 9.90810781500008 - ], - [ - 123.162364129, - 9.890204169000114 - ], - [ - 123.15674889400012, - 9.86762116100013 - ], - [ - 123.17042076900023, - 9.69599030200007 - ], - [ - 123.16456139400012, - 9.672186591000155 - ], - [ - 123.16358483200023, - 9.661851304000066 - ], - [ - 123.16041100400017, - 9.647406317000105 - ], - [ - 123.15308678500017, - 9.646633205000086 - ], - [ - 123.14405358200023, - 9.649237372000172 - ], - [ - 123.13624108200017, - 9.644842841000099 - ], - [ - 123.13542728000007, - 9.618353583000129 - ], - [ - 123.17741946700002, - 9.589911200000103 - ], - [ - 123.17042076900023, - 9.562892971000153 - ], - [ - 123.16114342500012, - 9.58380768400012 - ], - [ - 123.143809441, - 9.573675848000065 - ], - [ - 123.13550866000006, - 9.552679755000128 - ], - [ - 123.15333092500012, - 9.541164455000086 - ], - [ - 123.180918816, - 9.537420966000155 - ], - [ - 123.18995201900023, - 9.526800848000107 - ], - [ - 123.19166100400005, - 9.509833075000131 - ], - [ - 123.19760175900015, - 9.487127997000101 - ], - [ - 123.21168053500011, - 9.472723700000131 - ], - [ - 123.23259524800008, - 9.45966217700014 - ], - [ - 123.25147545700011, - 9.443996486000074 - ], - [ - 123.26726321700002, - 9.398342190000136 - ], - [ - 123.28484134200008, - 9.379706122000144 - ], - [ - 123.30518639400023, - 9.362494208000129 - ], - [ - 123.32113691500015, - 9.343166408000116 - ], - [ - 123.3282983730002, - 9.302557684000107 - ], - [ - 123.31763756600017, - 9.256903387000165 - ], - [ - 123.29859459700018, - 9.215033270000063 - ], - [ - 123.24341881600006, - 9.136460679000137 - ], - [ - 123.23878014400023, - 9.120306708000086 - ], - [ - 123.23015384200014, - 9.10761139500012 - ], - [ - 123.16098066500004, - 9.065659898000135 - ], - [ - 123.14771569100012, - 9.061835028000118 - ], - [ - 123.11207116000006, - 9.061957098000093 - ], - [ - 123.09994550900015, - 9.059963283000144 - ], - [ - 123.07992597699999, - 9.050970770000134 - ], - [ - 123.05787194100017, - 9.0468203800001 - ], - [ - 123.04265384200019, - 9.037339585000083 - ], - [ - 123.03321373800011, - 9.035305080000157 - ], - [ - 122.99048912900017, - 9.048773505000142 - ], - [ - 122.95769290500019, - 9.081244208000129 - ], - [ - 122.93360436300023, - 9.12148672100011 - ], - [ - 122.89258873800023, - 9.22101471600017 - ], - [ - 122.88672936300011, - 9.287990627000084 - ], - [ - 122.88054446700002, - 9.305853583000143 - ], - [ - 122.869395379, - 9.322658596000153 - ], - [ - 122.84489993600019, - 9.347072658000101 - ], - [ - 122.827891472, - 9.358710028000118 - ], - [ - 122.81104576900012, - 9.36359284100017 - ], - [ - 122.74512780000018, - 9.366603908000087 - ], - [ - 122.72478274800008, - 9.371079820000148 - ], - [ - 122.68067467500006, - 9.394354559000163 - ], - [ - 122.66675866, - 9.39777252800016 - ], - [ - 122.65723717500012, - 9.401434637000122 - ], - [ - 122.64926191500015, - 9.409898179000066 - ], - [ - 122.64242597700004, - 9.419256903000104 - ], - [ - 122.63599694100006, - 9.4257266300001 - ], - [ - 122.62354576900012, - 9.428900458000072 - ], - [ - 122.610118035, - 9.4296328800001 - ], - [ - 122.5994572270001, - 9.432684637000179 - ], - [ - 122.59709720100014, - 9.437648830000143 - ], - [ - 122.59066816500004, - 9.45099518400015 - ], - [ - 122.57016035200016, - 9.475246486000145 - ], - [ - 122.55176842500012, - 9.490952867000104 - ], - [ - 122.52979576900012, - 9.537909247000144 - ], - [ - 122.51587975400005, - 9.54857005400008 - ], - [ - 122.50521894599999, - 9.552394924000097 - ], - [ - 122.49659264400006, - 9.561712958000129 - ], - [ - 122.46680748800006, - 9.623846747000144 - ], - [ - 122.45728600400017, - 9.637925523000192 - ], - [ - 122.46436608200023, - 9.646958726000108 - ], - [ - 122.46143639400012, - 9.655259507000082 - ], - [ - 122.44361412900005, - 9.672756252000127 - ], - [ - 122.43824303500017, - 9.668402411000145 - ], - [ - 122.42823326900012, - 9.66278717700014 - ], - [ - 122.42310631600017, - 9.65843333500014 - ], - [ - 122.42481530000012, - 9.672796942000119 - ], - [ - 122.43083743600019, - 9.698797919000114 - ], - [ - 122.43043053500011, - 9.713690497000158 - ], - [ - 122.42457116000006, - 9.710150458000086 - ], - [ - 122.40870201900023, - 9.703070380000113 - ], - [ - 122.40259850400005, - 9.699408270000077 - ], - [ - 122.403575066, - 9.738959052000112 - ], - [ - 122.40935306100008, - 9.775702216000113 - ], - [ - 122.40984134200008, - 9.808539130000113 - ], - [ - 122.39519290500007, - 9.836615302000112 - ], - [ - 122.39519290500007, - 9.842840887000165 - ], - [ - 122.40593509200008, - 9.853461005000113 - ], - [ - 122.44410241000006, - 9.921535549000154 - ], - [ - 122.46159915500019, - 9.96580638200011 - ], - [ - 122.47461998800006, - 9.974351304000137 - ], - [ - 122.49537194100017, - 9.97699616100013 - ], - [ - 122.53777103000007, - 9.987046617000189 - ], - [ - 122.56031334700006, - 9.987453518000109 - ], - [ - 122.62598717500023, - 9.97467682500016 - ], - [ - 122.64283287900005, - 9.966945705000143 - ], - [ - 122.65699303500017, - 9.975816148000192 - ], - [ - 122.707774285, - 9.986395575000145 - ], - [ - 122.72852623800011, - 9.997381903000104 - ], - [ - 122.78223717500006, - 10.05296458500014 - ], - [ - 122.80738366000017, - 10.069322007000068 - ], - [ - 122.82691491000006, - 10.05809153900016 - ], - [ - 122.84489993600019, - 10.067287502000127 - ], - [ - 122.872813347, - 10.100409247000158 - ], - [ - 122.87891686300011, - 10.118068752000084 - ], - [ - 122.87582441500004, - 10.143011786000102 - ], - [ - 122.86255944100017, - 10.185451565000093 - ], - [ - 122.85531660200016, - 10.22801341400013 - ], - [ - 122.869395379, - 10.35053131700009 - ], - [ - 122.85938561300023, - 10.394476630000113 - ], - [ - 122.82178795700023, - 10.47247955900015 - ], - [ - 122.81470787900017, - 10.515041408000116 - ], - [ - 122.82390384200002, - 10.532863674000083 - ], - [ - 122.84253991000006, - 10.54140859600011 - ], - [ - 122.86101321700008, - 10.546210028000104 - ], - [ - 122.869395379, - 10.55255768400012 - ], - [ - 122.87484785200016, - 10.561835028000175 - ], - [ - 122.91041100400005, - 10.597560940000108 - ], - [ - 122.93384850400011, - 10.648830471000139 - ], - [ - 122.93458092500012, - 10.658392645000134 - ], - [ - 122.97169030000023, - 10.721096096000124 - ], - [ - 122.97584069100017, - 10.742417710000097 - ], - [ - 122.97169030000023, - 10.80609772300015 - ], - [ - 122.96851647200018, - 10.811102606000091 - ], - [ - 122.95394941500015, - 10.82200755400008 - ], - [ - 122.95069420700011, - 10.827215887000165 - ], - [ - 122.95215905000023, - 10.847723700000117 - ], - [ - 122.95435631600006, - 10.855780341000155 - ], - [ - 122.95818118600008, - 10.864447333000143 - ], - [ - 122.96631920700005, - 10.876369533000087 - ], - [ - 122.99382571700019, - 10.906724351000065 - ], - [ - 123.00261478000019, - 10.912827867000146 - ], - [ - 123.04802493600008, - 10.914862372000172 - ], - [ - 123.06771894600004, - 10.918850002000156 - ], - [ - 123.0877384770001, - 10.925930080000114 - ], - [ - 123.17009524800014, - 10.977199611000145 - ], - [ - 123.21355228000007, - 10.996405341000113 - ], - [ - 123.25977623800006, - 10.994818427000084 - ], - [ - 123.26221764400012, - 10.991156317000119 - ], - [ - 123.26514733200023, - 10.984116929000066 - ], - [ - 123.26978600400005, - 10.977362372000115 - ] - ] - ], - [ - [ - [ - 119.64869225400017, - 11.029608466000127 - ], - [ - 119.64795983200023, - 11.01528554900014 - ], - [ - 119.64128665500007, - 11.01528554900014 - ], - [ - 119.63575280000023, - 11.019517320000162 - ], - [ - 119.6290796230002, - 11.018866278000118 - ], - [ - 119.62142988400015, - 11.014634507000096 - ], - [ - 119.61312910199999, - 11.008449611000117 - ], - [ - 119.60857181100002, - 11.024562893000095 - ], - [ - 119.59693444100006, - 11.034735419000143 - ], - [ - 119.58521569100006, - 11.041205145000134 - ], - [ - 119.57976321700019, - 11.045965887000136 - ], - [ - 119.57667076900012, - 11.084051825000131 - ], - [ - 119.57976321700019, - 11.097845770000134 - ], - [ - 119.620371941, - 11.081244208000086 - ], - [ - 119.63209069100012, - 11.0698916690001 - ], - [ - 119.63982181100019, - 11.057766018000109 - ], - [ - 119.64551842500006, - 11.04409414300008 - ], - [ - 119.64869225400017, - 11.029608466000127 - ] - ] - ], - [ - [ - [ - 119.63233483200023, - 11.181626695000148 - ], - [ - 119.62769616, - 11.173041083000129 - ], - [ - 119.60987389400023, - 11.156724351000108 - ], - [ - 119.58952884200008, - 11.141791083000072 - ], - [ - 119.5833439460001, - 11.138820705000143 - ], - [ - 119.57007897200006, - 11.144354559000163 - ], - [ - 119.56714928500006, - 11.15704987200013 - ], - [ - 119.56959069100017, - 11.170721747000158 - ], - [ - 119.57292728000019, - 11.179144598000121 - ], - [ - 119.57553144599999, - 11.178371486000103 - ], - [ - 119.59343509200002, - 11.186590887000094 - ], - [ - 119.59766686300006, - 11.190822658000116 - ], - [ - 119.60035241000006, - 11.19513580900012 - ], - [ - 119.60434004000004, - 11.198635158000116 - ], - [ - 119.61312910199999, - 11.200262762000136 - ], - [ - 119.62842858200023, - 11.19017161700016 - ], - [ - 119.63233483200023, - 11.181626695000148 - ] - ] - ], - [ - [ - [ - 123.99952233200005, - 11.077337958000086 - ], - [ - 124.00912519600016, - 11.073391018000095 - ], - [ - 124.01254316500015, - 11.06622955900015 - ], - [ - 124.01392662900005, - 11.059312242000146 - ], - [ - 124.01710045700011, - 11.056219794000157 - ], - [ - 124.03728274800002, - 11.057521877000156 - ], - [ - 124.04615319100017, - 11.059759833000143 - ], - [ - 124.05494225400005, - 11.063666083000143 - ], - [ - 124.05193118600008, - 11.043158270000092 - ], - [ - 124.06177819100017, - 10.984279690000122 - ], - [ - 124.05974368600002, - 10.962307033000101 - ], - [ - 124.05347741000017, - 10.930568752000141 - ], - [ - 124.05494225400005, - 10.912827867000146 - ], - [ - 124.06690514400006, - 10.889064846000153 - ], - [ - 124.0685327480002, - 10.878119208000086 - ], - [ - 124.06495201900023, - 10.867905992000146 - ], - [ - 124.05062910200016, - 10.845038153000132 - ], - [ - 124.04737389400012, - 10.834051825000174 - ], - [ - 124.04379316500004, - 10.80947500200007 - ], - [ - 124.02662194100012, - 10.769598700000103 - ], - [ - 124.02076256600006, - 10.747748114000146 - ], - [ - 124.02393639400012, - 10.70844147300015 - ], - [ - 124.05079186300011, - 10.627386786000116 - ], - [ - 124.05494225400005, - 10.59007396000014 - ], - [ - 124.05176842500006, - 10.589504299000083 - ], - [ - 124.044688347, - 10.586004950000174 - ], - [ - 124.037364129, - 10.581122137000122 - ], - [ - 124.03386478000002, - 10.576483466000099 - ], - [ - 124.03443444100017, - 10.571437893000152 - ], - [ - 124.04037519600004, - 10.56854889500012 - ], - [ - 124.041270379, - 10.562811591000155 - ], - [ - 124.04004967500012, - 10.484361070000105 - ], - [ - 124.03589928500006, - 10.466782945000176 - ], - [ - 124.00977623800011, - 10.404038804000095 - ], - [ - 124.01010175900004, - 10.39492422100011 - ], - [ - 124.01872806100002, - 10.380804755000085 - ], - [ - 124.014903191, - 10.372463283000101 - ], - [ - 123.99284915500013, - 10.3573672550001 - ], - [ - 123.99048912900017, - 10.368841864000146 - ], - [ - 123.98585045700023, - 10.375962632000096 - ], - [ - 123.97966556100008, - 10.377183335000112 - ], - [ - 123.97291100400005, - 10.370998440000136 - ], - [ - 123.9708764980002, - 10.362209377000084 - ], - [ - 123.97291100400005, - 10.326605536000116 - ], - [ - 123.96111087300008, - 10.323309637000179 - ], - [ - 123.90626061300023, - 10.294501044000143 - ], - [ - 123.88965905000012, - 10.282212632000096 - ], - [ - 123.86866295700017, - 10.248195705000157 - ], - [ - 123.85710696700002, - 10.24213288000007 - ], - [ - 123.83179772200018, - 10.240668036000102 - ], - [ - 123.80811608200005, - 10.236639716000141 - ], - [ - 123.79363040500002, - 10.226467190000093 - ], - [ - 123.77369225400005, - 10.199693101000094 - ], - [ - 123.71949303500017, - 10.15680573100012 - ], - [ - 123.71168053500017, - 10.141343492000189 - ], - [ - 123.70997155000006, - 10.120591539000188 - ], - [ - 123.70484459700018, - 10.10545482000019 - ], - [ - 123.69613691499998, - 10.093898830000072 - ], - [ - 123.68376712300002, - 10.08364492400014 - ], - [ - 123.67554772200006, - 10.079006252000113 - ], - [ - 123.66342207100016, - 10.07465241100013 - ], - [ - 123.65699303500006, - 10.069322007000068 - ], - [ - 123.65259850400017, - 10.06362539300008 - ], - [ - 123.64820397200018, - 10.055650132000125 - ], - [ - 123.64478600400017, - 10.047023830000114 - ], - [ - 123.64332116, - 10.038967190000093 - ], - [ - 123.64332116, - 9.960109768000137 - ], - [ - 123.63086998800011, - 9.907619533000087 - ], - [ - 123.6290796230002, - 9.88751862200013 - ], - [ - 123.62476647200012, - 9.87933991100013 - ], - [ - 123.61548912900005, - 9.87445709800015 - ], - [ - 123.60596764400023, - 9.871161200000117 - ], - [ - 123.601817254, - 9.86762116100013 - ], - [ - 123.50945071700019, - 9.653509833000086 - ], - [ - 123.50342858200005, - 9.615301825000131 - ], - [ - 123.48829186300006, - 9.566473700000131 - ], - [ - 123.47950280000012, - 9.54857005400008 - ], - [ - 123.4710392590001, - 9.538967190000093 - ], - [ - 123.45329837300008, - 9.528062242000118 - ], - [ - 123.4446720710001, - 9.521307684000178 - ], - [ - 123.43588300900004, - 9.509955145000106 - ], - [ - 123.42269941500015, - 9.487697658000158 - ], - [ - 123.36963951900023, - 9.4257266300001 - ], - [ - 123.35857181100019, - 9.415757554000109 - ], - [ - 123.34245853000002, - 9.406805731000176 - ], - [ - 123.32764733200017, - 9.40814850500007 - ], - [ - 123.32113691500015, - 9.429144598000107 - ], - [ - 123.31421959700018, - 9.485541083000072 - ], - [ - 123.31430097700016, - 9.50763580900015 - ], - [ - 123.36524498800017, - 9.785345770000077 - ], - [ - 123.40495853000007, - 9.878404039000145 - ], - [ - 123.40919030000006, - 9.897691148000177 - ], - [ - 123.41065514400023, - 9.922552802000126 - ], - [ - 123.40642337300002, - 9.927557684000163 - ], - [ - 123.38754316499998, - 9.937079169000157 - ], - [ - 123.38331139400006, - 9.94269440300016 - ], - [ - 123.38705488400004, - 9.97378164300008 - ], - [ - 123.39014733200011, - 9.980617580000086 - ], - [ - 123.39844811300006, - 9.984808661000116 - ], - [ - 123.40406334700018, - 9.98126862200013 - ], - [ - 123.40772545700023, - 9.975816148000192 - ], - [ - 123.41065514400023, - 9.974351304000137 - ], - [ - 123.41521243600019, - 9.981350002000113 - ], - [ - 123.41716556100008, - 9.989650783000101 - ], - [ - 123.41732832100004, - 10.0116641300001 - ], - [ - 123.42253665500019, - 10.037502346000124 - ], - [ - 123.43539472700004, - 10.055080471000153 - ], - [ - 123.47201582100016, - 10.08364492400014 - ], - [ - 123.50798587300014, - 10.122219143000123 - ], - [ - 123.52133222700004, - 10.145249742000175 - ], - [ - 123.53345787900005, - 10.190375067000147 - ], - [ - 123.58130944100006, - 10.254339911000145 - ], - [ - 123.59685306100008, - 10.317775783000158 - ], - [ - 123.60547936300017, - 10.333156643000109 - ], - [ - 123.62273196700008, - 10.35053131700009 - ], - [ - 123.706797722, - 10.461981512000179 - ], - [ - 123.71168053500017, - 10.477443752000113 - ], - [ - 123.71387780000006, - 10.48232656500008 - ], - [ - 123.71851647200012, - 10.487290757000125 - ], - [ - 123.72315514400023, - 10.494208075000131 - ], - [ - 123.72535241000006, - 10.504787502000084 - ], - [ - 123.718028191, - 10.537054755000113 - ], - [ - 123.7190861340001, - 10.549139716000113 - ], - [ - 123.72925866, - 10.569240627000156 - ], - [ - 123.75440514400012, - 10.599432684000178 - ], - [ - 123.76498457100016, - 10.640041408000087 - ], - [ - 123.77784264400006, - 10.662583726000065 - ], - [ - 123.79273522200006, - 10.683254299000083 - ], - [ - 123.83155358200023, - 10.725083726000108 - ], - [ - 123.84929446700002, - 10.752630927000126 - ], - [ - 123.91578209700006, - 10.939764716000113 - ], - [ - 123.93458092500012, - 10.970445054000123 - ], - [ - 123.93002363400015, - 10.99359772300015 - ], - [ - 123.91773522200012, - 11.028957424000083 - ], - [ - 123.92408287900005, - 11.04633209800015 - ], - [ - 123.93523196700008, - 11.05923086100016 - ], - [ - 123.94434655000023, - 11.074164130000113 - ], - [ - 123.94507897200018, - 11.097845770000134 - ], - [ - 123.95191491000017, - 11.097845770000134 - ], - [ - 123.95541425899998, - 11.090236721000096 - ], - [ - 123.95964603000019, - 11.085516669000086 - ], - [ - 123.97291100400005, - 11.077337958000086 - ], - [ - 123.96070397200006, - 11.130764065000122 - ], - [ - 123.9552514980002, - 11.142238674000154 - ], - [ - 123.95191491000017, - 11.156724351000108 - ], - [ - 123.958750847, - 11.175930080000157 - ], - [ - 123.96973717500018, - 11.194525458000072 - ], - [ - 124.01832116000006, - 11.25849030200007 - ], - [ - 124.04566491000011, - 11.277167059000135 - ], - [ - 124.07471764400006, - 11.2691104190001 - ], - [ - 124.07276451900012, - 11.262030341000141 - ], - [ - 124.06812584700018, - 11.233343817000076 - ], - [ - 124.05567467500006, - 11.205023505000128 - ], - [ - 124.05128014400012, - 11.185492255000142 - ], - [ - 124.04737389400012, - 11.148749091000155 - ], - [ - 124.041270379, - 11.130113023000163 - ], - [ - 124.01075280000006, - 11.094549872000101 - ], - [ - 123.99952233200005, - 11.077337958000086 - ] - ] - ], - [ - [ - [ - 123.74968509200019, - 11.14134349200016 - ], - [ - 123.74577884200019, - 11.138820705000143 - ], - [ - 123.73365319100012, - 11.154282945000162 - ], - [ - 123.70866946700019, - 11.217840887000165 - ], - [ - 123.70484459700018, - 11.241197007000068 - ], - [ - 123.70850670700023, - 11.252427476000065 - ], - [ - 123.71583092500012, - 11.26414622600005 - ], - [ - 123.73275800900004, - 11.283758856000105 - ], - [ - 123.74577884200019, - 11.292466539000188 - ], - [ - 123.75464928500006, - 11.28953685100008 - ], - [ - 123.76091556100019, - 11.278876044000143 - ], - [ - 123.78931725400005, - 11.198919989000146 - ], - [ - 123.801036004, - 11.179144598000121 - ], - [ - 123.81153405000006, - 11.165269273000135 - ], - [ - 123.81804446700008, - 11.154730536000073 - ], - [ - 123.81495201900006, - 11.148016669000128 - ], - [ - 123.74968509200019, - 11.14134349200016 - ] - ] - ], - [ - [ - [ - 119.52295983200017, - 11.339911200000117 - ], - [ - 119.52955162900005, - 11.33055247600008 - ], - [ - 119.53882897200018, - 11.32371653900016 - ], - [ - 119.54151451900017, - 11.328070380000057 - ], - [ - 119.54769941500004, - 11.332668361000088 - ], - [ - 119.55241946700002, - 11.337388414000188 - ], - [ - 119.56706790500007, - 11.301418361000117 - ], - [ - 119.56902103000019, - 11.261664130000128 - ], - [ - 119.56104576900023, - 11.2202822940001 - ], - [ - 119.54566491, - 11.179144598000121 - ], - [ - 119.52051842500012, - 11.138413804000137 - ], - [ - 119.51636803500017, - 11.117499091000084 - ], - [ - 119.52857506600006, - 11.094142971000096 - ], - [ - 119.55339603000013, - 11.07221100500007 - ], - [ - 119.56177819100017, - 11.059027411000116 - ], - [ - 119.5724389980002, - 11.015326239000132 - ], - [ - 119.57056725400005, - 11.007513739000132 - ], - [ - 119.55925540500007, - 11.000962632000068 - ], - [ - 119.53834069100012, - 11.012762762000122 - ], - [ - 119.52418053500017, - 11.01732005400008 - ], - [ - 119.51758873800011, - 11.011867580000128 - ], - [ - 119.50660241000006, - 10.983587958000086 - ], - [ - 119.50456790500013, - 10.97089264500012 - ], - [ - 119.50570722700016, - 10.95864492400014 - ], - [ - 119.51042728000007, - 10.937323309000178 - ], - [ - 119.51140384200002, - 10.925930080000114 - ], - [ - 119.51010175900004, - 10.916327216000141 - ], - [ - 119.50505618600019, - 10.896470445000134 - ], - [ - 119.50456790500013, - 10.884955145000106 - ], - [ - 119.50733483200005, - 10.874945380000113 - ], - [ - 119.51587975400011, - 10.859279690000136 - ], - [ - 119.51929772200012, - 10.837713934000135 - ], - [ - 119.52393639400023, - 10.82762278900016 - ], - [ - 119.53158613400015, - 10.819810289000173 - ], - [ - 119.54224694100017, - 10.816636460000112 - ], - [ - 119.55494225400005, - 10.818670966000141 - ], - [ - 119.56275475400005, - 10.823187567000105 - ], - [ - 119.56804446700014, - 10.82807038000007 - ], - [ - 119.57292728000019, - 10.830959377000099 - ], - [ - 119.58521569100006, - 10.833441473000121 - ], - [ - 119.58912194100006, - 10.834702867000132 - ], - [ - 119.59343509200002, - 10.837144273000163 - ], - [ - 119.60271243600019, - 10.82440827000012 - ], - [ - 119.60157311300017, - 10.810858466000141 - ], - [ - 119.59644616000006, - 10.797552802000126 - ], - [ - 119.59343509200002, - 10.785589911000102 - ], - [ - 119.60010826900012, - 10.754584052000084 - ], - [ - 119.60010826900012, - 10.717352606000176 - ], - [ - 119.59636478000007, - 10.697088934000178 - ], - [ - 119.59050540500002, - 10.682440497000158 - ], - [ - 119.59083092500023, - 10.672430731000176 - ], - [ - 119.60629316500015, - 10.665838934000107 - ], - [ - 119.62720787900005, - 10.668117580000086 - ], - [ - 119.64136803500006, - 10.675848700000103 - ], - [ - 119.65357506600006, - 10.67511627800016 - ], - [ - 119.66846764400006, - 10.652167059000163 - ], - [ - 119.65919030000012, - 10.655096747000101 - ], - [ - 119.650645379, - 10.656195380000142 - ], - [ - 119.64242597699999, - 10.655259507000068 - ], - [ - 119.63445071700008, - 10.652167059000163 - ], - [ - 119.63990319100017, - 10.643947658000087 - ], - [ - 119.64258873800006, - 10.637884833000086 - ], - [ - 119.64275149800002, - 10.63206614800012 - ], - [ - 119.64128665500007, - 10.624904690000093 - ], - [ - 119.65512129000015, - 10.61229075700011 - ], - [ - 119.66277103000019, - 10.57099030200007 - ], - [ - 119.67188561300011, - 10.55255768400012 - ], - [ - 119.714121941, - 10.532660223000136 - ], - [ - 119.72535241, - 10.518622137000179 - ], - [ - 119.70997155000006, - 10.494533596000153 - ], - [ - 119.70199629000004, - 10.490871486000103 - ], - [ - 119.67847741000017, - 10.485663153000104 - ], - [ - 119.66846764400006, - 10.480861721000124 - ], - [ - 119.64795983200023, - 10.449855861000103 - ], - [ - 119.63965905000023, - 10.444728908000087 - ], - [ - 119.59343509200002, - 10.405178127000127 - ], - [ - 119.57585696700019, - 10.38051992400014 - ], - [ - 119.56324303500006, - 10.373480536000073 - ], - [ - 119.54224694100017, - 10.370998440000136 - ], - [ - 119.5008244150001, - 10.370998440000136 - ], - [ - 119.489024285, - 10.372463283000101 - ], - [ - 119.47266686300011, - 10.3781192080001 - ], - [ - 119.4630639980002, - 10.378485419000114 - ], - [ - 119.44922936300011, - 10.373032945000162 - ], - [ - 119.41871178500017, - 10.35455963700015 - ], - [ - 119.39812259200002, - 10.35053131700009 - ], - [ - 119.37826582100004, - 10.344142971000153 - ], - [ - 119.35596764400012, - 10.328843492000189 - ], - [ - 119.28598066499998, - 10.261379299000112 - ], - [ - 119.25733483200023, - 10.221991278000132 - ], - [ - 119.23715253999998, - 10.179348049000097 - ], - [ - 119.22071373800011, - 10.08417389500012 - ], - [ - 119.19629967500023, - 10.056341864000075 - ], - [ - 119.15943444100017, - 10.041245835000069 - ], - [ - 119.113536004, - 10.028998114000089 - ], - [ - 119.10254967500023, - 10.024400132000068 - ], - [ - 119.08253014400006, - 10.012518622000101 - ], - [ - 119.072032097, - 10.007961330000157 - ], - [ - 119.06055748800006, - 10.006659247000158 - ], - [ - 119.03614342500012, - 10.00901927300012 - ], - [ - 119.02475019600016, - 10.007961330000157 - ], - [ - 119.01498457100004, - 10.003729559000135 - ], - [ - 118.99496504000015, - 9.99201080900015 - ], - [ - 118.98389733200011, - 9.987453518000109 - ], - [ - 118.97291100400005, - 9.984523830000086 - ], - [ - 118.95142662900005, - 9.981024481000091 - ], - [ - 118.90300540500002, - 9.978664455000143 - ], - [ - 118.87476647200006, - 9.971869208000115 - ], - [ - 118.84880618600008, - 9.959133205000157 - ], - [ - 118.81934655000006, - 9.939032294000114 - ], - [ - 118.79656009200008, - 9.94521719000008 - ], - [ - 118.77418053500006, - 9.934149481000134 - ], - [ - 118.7571720710001, - 9.91266510600012 - ], - [ - 118.75049889400012, - 9.88751862200013 - ], - [ - 118.75456790500019, - 9.855943101000136 - ], - [ - 118.775645379, - 9.814032294000143 - ], - [ - 118.78467858200011, - 9.788234768000109 - ], - [ - 118.77784264400012, - 9.73419830900012 - ], - [ - 118.76490319100017, - 9.728745835000083 - ], - [ - 118.74903405000023, - 9.732814846000139 - ], - [ - 118.73560631600017, - 9.74347565300016 - ], - [ - 118.72999108200005, - 9.75775788000007 - ], - [ - 118.73389733200005, - 9.775702216000113 - ], - [ - 118.72966556100002, - 9.780422268000123 - ], - [ - 118.71290123800011, - 9.78196849200016 - ], - [ - 118.70093834700018, - 9.775539455000143 - ], - [ - 118.70191491000017, - 9.760239976000094 - ], - [ - 118.70557701900012, - 9.742173570000162 - ], - [ - 118.70199629000015, - 9.727362372000101 - ], - [ - 118.71314537900017, - 9.721625067000119 - ], - [ - 118.71973717500023, - 9.713812567000133 - ], - [ - 118.72095787900017, - 9.70404694200009 - ], - [ - 118.71631920700023, - 9.692572333000143 - ], - [ - 118.74293053500017, - 9.696844794000157 - ], - [ - 118.75831139400012, - 9.683335679000095 - ], - [ - 118.75635826900017, - 9.667669989000117 - ], - [ - 118.72999108200005, - 9.665269273000163 - ], - [ - 118.73161868600019, - 9.65037669500012 - ], - [ - 118.72535241000006, - 9.63129303600013 - ], - [ - 118.71550540500002, - 9.612779039000117 - ], - [ - 118.70582116000017, - 9.600083726000065 - ], - [ - 118.70053144599999, - 9.591498114000132 - ], - [ - 118.69890384200008, - 9.583726304000137 - ], - [ - 118.69532311300011, - 9.578070380000142 - ], - [ - 118.67481530000023, - 9.5743675800001 - ], - [ - 118.66920006600006, - 9.569973049000126 - ], - [ - 118.5921330090001, - 9.446193752000156 - ], - [ - 118.55730228000002, - 9.411688544000143 - ], - [ - 118.55193118600008, - 9.401190497000172 - ], - [ - 118.54737389400023, - 9.383002020000092 - ], - [ - 118.53646894600016, - 9.364325262000108 - ], - [ - 118.4978947270001, - 9.313666083000129 - ], - [ - 118.49219811300011, - 9.308823960000069 - ], - [ - 118.45508873800006, - 9.284369208000115 - ], - [ - 118.4456486340001, - 9.28168366100013 - ], - [ - 118.43083743600019, - 9.273179429000109 - ], - [ - 118.38054446700002, - 9.220282294000143 - ], - [ - 118.36500084700006, - 9.193060614000146 - ], - [ - 118.35377037900005, - 9.183172919000128 - ], - [ - 118.33578535199999, - 9.179266669000143 - ], - [ - 118.29493248800023, - 9.179266669000143 - ], - [ - 118.28435306100019, - 9.176418361000103 - ], - [ - 118.26140384200019, - 9.162787177000055 - ], - [ - 118.2501733730002, - 9.158148505000128 - ], - [ - 118.18913821700002, - 9.155991929000123 - ], - [ - 118.1712345710001, - 9.14826080900012 - ], - [ - 118.16342207099999, - 9.142808335000083 - ], - [ - 118.136973504, - 9.130845445000148 - ], - [ - 118.13209069100006, - 9.126654364000117 - ], - [ - 118.12671959700018, - 9.096136786000088 - ], - [ - 118.11304772200006, - 9.069403387000165 - ], - [ - 118.11207116000017, - 9.064927476000108 - ], - [ - 118.11345462300002, - 9.053778387000179 - ], - [ - 118.11304772200006, - 9.0489769550001 - ], - [ - 118.10914147200006, - 9.047593492000118 - ], - [ - 118.10222415500007, - 9.047796942000076 - ], - [ - 118.095469597, - 9.045965887000179 - ], - [ - 118.09253991000017, - 9.038397528000132 - ], - [ - 118.08912194100017, - 9.019761460000055 - ], - [ - 118.08041425899998, - 8.996283270000092 - ], - [ - 118.05836022200012, - 8.952093817000119 - ], - [ - 118.01368248800023, - 8.887600002000141 - ], - [ - 118.00066165500007, - 8.877386786000102 - ], - [ - 117.91041100400005, - 8.829738674000126 - ], - [ - 117.840098504, - 8.774481512000122 - ], - [ - 117.77369225400017, - 8.703070380000142 - ], - [ - 117.75538170700011, - 8.690171617000132 - ], - [ - 117.73292076900012, - 8.685207424000083 - ], - [ - 117.71127363400004, - 8.682928778000104 - ], - [ - 117.69800866000011, - 8.677435614000075 - ], - [ - 117.685801629, - 8.670640367000146 - ], - [ - 117.66732832099999, - 8.664740302000112 - ], - [ - 117.64673912900017, - 8.663275458000143 - ], - [ - 117.58887780000023, - 8.670965887000165 - ], - [ - 117.56560306100002, - 8.661078192000062 - ], - [ - 117.55738366000006, - 8.638413804000109 - ], - [ - 117.55811608200005, - 8.596421617000118 - ], - [ - 117.55014082100004, - 8.575628973000136 - ], - [ - 117.52312259200008, - 8.539699611000145 - ], - [ - 117.51726321700014, - 8.517645575000145 - ], - [ - 117.51286868600002, - 8.506781317000076 - ], - [ - 117.50318444100017, - 8.50071849200016 - ], - [ - 117.49350019600004, - 8.499660549000112 - ], - [ - 117.48910566500004, - 8.503648179000095 - ], - [ - 117.48414147200018, - 8.513006903000132 - ], - [ - 117.47217858200017, - 8.513820705000143 - ], - [ - 117.37891686300023, - 8.48631419500019 - ], - [ - 117.34498131600017, - 8.471258856000176 - ], - [ - 117.31861412900011, - 8.451849677000084 - ], - [ - 117.31519616000017, - 8.446112372000115 - ], - [ - 117.30762780000023, - 8.429388739000089 - ], - [ - 117.30437259200019, - 8.424505927000112 - ], - [ - 117.27003014400023, - 8.414292710000083 - ], - [ - 117.26384524800008, - 8.397609768000137 - ], - [ - 117.24927819100006, - 8.383530992000189 - ], - [ - 117.22234134200008, - 8.363714911000088 - ], - [ - 117.19800866, - 8.334784247000172 - ], - [ - 117.1907658210001, - 8.338324286000145 - ], - [ - 117.18824303500017, - 8.366522528000132 - ], - [ - 117.19044030000023, - 8.378159898000135 - ], - [ - 117.19971764400012, - 8.398016669000143 - ], - [ - 117.20476321700002, - 8.41864655200007 - ], - [ - 117.21143639400012, - 8.427069403000118 - ], - [ - 117.21843509200008, - 8.43341705900015 - ], - [ - 117.22234134200008, - 8.43817780200014 - ], - [ - 117.22339928500006, - 8.448065497000158 - ], - [ - 117.22193444100017, - 8.469061591000099 - ], - [ - 117.22250410200004, - 8.48432038000007 - ], - [ - 117.22193444100017, - 8.49506256700009 - ], - [ - 117.22234134200008, - 8.500230210000083 - ], - [ - 117.22535241000017, - 8.505316473000107 - ], - [ - 117.23414147200006, - 8.511297919000128 - ], - [ - 117.2395939460001, - 8.535793361000145 - ], - [ - 117.24854576900012, - 8.555080471000096 - ], - [ - 117.27003014400023, - 8.589016018000137 - ], - [ - 117.26775149800008, - 8.590318101000136 - ], - [ - 117.26392662900005, - 8.61009349200016 - ], - [ - 117.27995853000002, - 8.604966539000145 - ], - [ - 117.28679446700008, - 8.620347398000177 - ], - [ - 117.29151451900017, - 8.640814520000148 - ], - [ - 117.30111738400015, - 8.651068427000084 - ], - [ - 117.31218509200008, - 8.6561953800001 - ], - [ - 117.32715905000012, - 8.668646552000112 - ], - [ - 117.34205162900017, - 8.684271552000098 - ], - [ - 117.35271243600019, - 8.698879299000112 - ], - [ - 117.33904056100008, - 8.698879299000112 - ], - [ - 117.359629754, - 8.731268622000115 - ], - [ - 117.37598717500012, - 8.746812242000118 - ], - [ - 117.41773522200006, - 8.759100653000175 - ], - [ - 117.43555748800023, - 8.773138739000132 - ], - [ - 117.45036868600019, - 8.791164455000157 - ], - [ - 117.51978600400005, - 8.899725653000132 - ], - [ - 117.54379316499998, - 8.925441799000083 - ], - [ - 117.62273196700019, - 8.991848049000112 - ], - [ - 117.64014733200005, - 9.02098216400016 - ], - [ - 117.64771569100006, - 9.0429141300001 - ], - [ - 117.655528191, - 9.057928778000118 - ], - [ - 117.66863040500019, - 9.066636460000112 - ], - [ - 117.69190514400012, - 9.069403387000165 - ], - [ - 117.70443769599999, - 9.07949453300013 - ], - [ - 117.71225019599999, - 9.081610419000143 - ], - [ - 117.71566816500004, - 9.07249583500014 - ], - [ - 117.71973717500018, - 9.065822658000101 - ], - [ - 117.72950280000012, - 9.064154364000089 - ], - [ - 117.74073326900012, - 9.065904039000173 - ], - [ - 117.75001061300017, - 9.069403387000165 - ], - [ - 117.7618921230002, - 9.077948309000178 - ], - [ - 117.76807701900006, - 9.086411851000122 - ], - [ - 117.78052819100012, - 9.120266018000095 - ], - [ - 117.78239993600008, - 9.12254466400016 - ], - [ - 117.78785241, - 9.127427476000136 - ], - [ - 117.791270379, - 9.134833075000117 - ], - [ - 117.78931725400017, - 9.142320054000095 - ], - [ - 117.78402753999998, - 9.151353257000096 - ], - [ - 117.79656009200019, - 9.163275458000143 - ], - [ - 117.836680535, - 9.18821849200016 - ], - [ - 117.84986412900005, - 9.192938544000171 - ], - [ - 117.866465691, - 9.203599351000108 - ], - [ - 117.88998457100016, - 9.250555731000134 - ], - [ - 117.9044702480002, - 9.261216539000173 - ], - [ - 117.94499759200002, - 9.256089585000069 - ], - [ - 117.96631920700011, - 9.257269598000093 - ], - [ - 117.98951256600006, - 9.267401434000135 - ], - [ - 117.98804772200018, - 9.255926825000103 - ], - [ - 117.98959394600004, - 9.246242580000143 - ], - [ - 117.99447675899998, - 9.238592841000113 - ], - [ - 118.00318444100017, - 9.233303127000127 - ], - [ - 118.016368035, - 9.243231512000136 - ], - [ - 118.02588951900012, - 9.253810940000093 - ], - [ - 118.04468834700006, - 9.28168366100013 - ], - [ - 118.05437259200014, - 9.291449286000088 - ], - [ - 118.12696373800011, - 9.337836005000142 - ], - [ - 118.13355553500011, - 9.343166408000116 - ], - [ - 118.13526451900012, - 9.351874091000099 - ], - [ - 118.13103274800008, - 9.373195705000157 - ], - [ - 118.13355553500011, - 9.3847110050001 - ], - [ - 118.148203972, - 9.396714585000112 - ], - [ - 118.17156009200019, - 9.40786367400014 - ], - [ - 118.19288170700005, - 9.421820380000113 - ], - [ - 118.21631920700023, - 9.477972723000107 - ], - [ - 118.27719160200016, - 9.519720770000148 - ], - [ - 118.29769941500004, - 9.55487702000012 - ], - [ - 118.32618248800011, - 9.579046942000119 - ], - [ - 118.33277428500011, - 9.586411851000122 - ], - [ - 118.33497155000006, - 9.591620184000107 - ], - [ - 118.339610222, - 9.596584377000156 - ], - [ - 118.34424889400023, - 9.603216864000132 - ], - [ - 118.34644616000006, - 9.613755601000094 - ], - [ - 118.34546959700006, - 9.636175848000107 - ], - [ - 118.34913170700011, - 9.645738023000177 - ], - [ - 118.36011803500017, - 9.65843333500014 - ], - [ - 118.37175540500007, - 9.654364325000088 - ], - [ - 118.38233483200023, - 9.6577822940001 - ], - [ - 118.40113366000017, - 9.672756252000127 - ], - [ - 118.40845787900017, - 9.676336981000105 - ], - [ - 118.41529381600012, - 9.677720445000176 - ], - [ - 118.42025800900015, - 9.680731512000179 - ], - [ - 118.42432701900012, - 9.697902736000117 - ], - [ - 118.429453972, - 9.700628973000093 - ], - [ - 118.43620853000007, - 9.701890367000189 - ], - [ - 118.44263756600017, - 9.706244208000086 - ], - [ - 118.45085696700008, - 9.71576569200009 - ], - [ - 118.53052819100006, - 9.774237372000144 - ], - [ - 118.53760826900006, - 9.785101630000128 - ], - [ - 118.54835045700011, - 9.812404690000122 - ], - [ - 118.59571373800023, - 9.857367255000113 - ], - [ - 118.60645592500023, - 9.874172268000123 - ], - [ - 118.60824629000015, - 9.885321356000134 - ], - [ - 118.61312910200004, - 9.90094635600012 - ], - [ - 118.62061608200005, - 9.916896877000127 - ], - [ - 118.65723717500012, - 9.965236721000139 - ], - [ - 118.66797936300011, - 9.974351304000137 - ], - [ - 118.65650475400017, - 9.996161200000088 - ], - [ - 118.673594597, - 10.011786200000174 - ], - [ - 118.72250410199999, - 10.035834052000112 - ], - [ - 118.72885175900004, - 10.045803127000099 - ], - [ - 118.76368248800006, - 10.120754299000154 - ], - [ - 118.77165774800014, - 10.130804755000128 - ], - [ - 118.77662194100017, - 10.099066473000079 - ], - [ - 118.77662194100017, - 10.083075262000165 - ], - [ - 118.767832879, - 10.076157945000176 - ], - [ - 118.76295006600006, - 10.069240627000084 - ], - [ - 118.7794702480002, - 10.056301174000083 - ], - [ - 118.80111738400004, - 10.049017645000148 - ], - [ - 118.81185957100004, - 10.059068101000136 - ], - [ - 118.81478925900015, - 10.067287502000127 - ], - [ - 118.82129967500023, - 10.073879299000112 - ], - [ - 118.8282983730002, - 10.079250393000152 - ], - [ - 118.8323673840001, - 10.08364492400014 - ], - [ - 118.83765709700006, - 10.095689195000148 - ], - [ - 118.83863366000006, - 10.09992096600017 - ], - [ - 118.83643639400023, - 10.102728583000129 - ], - [ - 118.81771894600016, - 10.136704820000162 - ], - [ - 118.81234785199999, - 10.152085679000109 - ], - [ - 118.81185957100004, - 10.172349351000122 - ], - [ - 118.81576582100004, - 10.188910223000093 - ], - [ - 118.82227623800011, - 10.194525458000086 - ], - [ - 118.84294681100002, - 10.19285716400016 - ], - [ - 118.85515384200019, - 10.196030992000132 - ], - [ - 118.87533613400004, - 10.210150458000072 - ], - [ - 118.89112389400006, - 10.21332428600013 - ], - [ - 118.91846764400023, - 10.20831940300009 - ], - [ - 118.93360436300023, - 10.209662177000084 - ], - [ - 118.94971764400012, - 10.22016022300015 - ], - [ - 118.95834394600004, - 10.235256252000156 - ], - [ - 118.96013431100019, - 10.252508856000162 - ], - [ - 118.95671634200019, - 10.269191799000112 - ], - [ - 118.94971764400012, - 10.282212632000096 - ], - [ - 118.95655358200023, - 10.284816799000097 - ], - [ - 118.95948326900023, - 10.286810614000132 - ], - [ - 118.962657097, - 10.286444403000118 - ], - [ - 118.97022545700005, - 10.282212632000096 - ], - [ - 118.97925866000017, - 10.292303778000147 - ], - [ - 118.993418816, - 10.300279039000117 - ], - [ - 119.00945071700019, - 10.306097723000065 - ], - [ - 119.02475019600016, - 10.309556382000068 - ], - [ - 119.02173912900005, - 10.325181382000139 - ], - [ - 119.03003991000006, - 10.33856842700014 - ], - [ - 119.03394616000006, - 10.349351304000066 - ], - [ - 119.01791425900004, - 10.3573672550001 - ], - [ - 119.00814863399998, - 10.353705145000148 - ], - [ - 118.99594160200004, - 10.34609609600011 - ], - [ - 118.98438561300011, - 10.34406159100017 - ], - [ - 118.97641035200004, - 10.3573672550001 - ], - [ - 118.97974694100017, - 10.368109442000119 - ], - [ - 118.98975670700023, - 10.383286851000108 - ], - [ - 119.00196373800023, - 10.397528387000108 - ], - [ - 119.01172936300006, - 10.405178127000127 - ], - [ - 119.0275171230002, - 10.407171942000076 - ], - [ - 119.04395592500012, - 10.40420156500015 - ], - [ - 119.05933678500006, - 10.398260809000135 - ], - [ - 119.072032097, - 10.391506252000099 - ], - [ - 119.07911217500006, - 10.404689846000139 - ], - [ - 119.07911217500006, - 10.41547272300015 - ], - [ - 119.08432050900015, - 10.422796942000147 - ], - [ - 119.10670006600017, - 10.425604559000107 - ], - [ - 119.09961998800023, - 10.438706773000163 - ], - [ - 119.090586785, - 10.44562409100017 - ], - [ - 119.08448326900023, - 10.452785549000112 - ], - [ - 119.08570397200006, - 10.46662018400012 - ], - [ - 119.09131920700023, - 10.473089911000116 - ], - [ - 119.11109459700018, - 10.480658270000077 - ], - [ - 119.120371941, - 10.487738348000121 - ], - [ - 119.11850019600016, - 10.476792710000069 - ], - [ - 119.11703535199999, - 10.47239817900008 - ], - [ - 119.113536004, - 10.46662018400012 - ], - [ - 119.11882571700008, - 10.454291083000072 - ], - [ - 119.12720787900005, - 10.39492422100011 - ], - [ - 119.13526451900006, - 10.388128973000079 - ], - [ - 119.15284264400012, - 10.398504950000174 - ], - [ - 119.1818139980002, - 10.425604559000107 - ], - [ - 119.19206790500002, - 10.447984117000132 - ], - [ - 119.19556725400005, - 10.45355866100013 - ], - [ - 119.20264733200005, - 10.4571800800001 - ], - [ - 119.21192467500023, - 10.459702867000118 - ], - [ - 119.21998131600017, - 10.46336497600008 - ], - [ - 119.22999108200017, - 10.485419012000165 - ], - [ - 119.263926629, - 10.494126695000148 - ], - [ - 119.27808678500006, - 10.508205471000096 - ], - [ - 119.26840254000015, - 10.519517320000162 - ], - [ - 119.255625847, - 10.530951239000132 - ], - [ - 119.24724368600008, - 10.542954820000148 - ], - [ - 119.25074303500006, - 10.555975653000132 - ], - [ - 119.26954186300011, - 10.54852936400006 - ], - [ - 119.29078209700018, - 10.557684637000136 - ], - [ - 119.30909264400023, - 10.574530341000141 - ], - [ - 119.31910241000006, - 10.59007396000014 - ], - [ - 119.34498131600006, - 10.723578192000147 - ], - [ - 119.34205162900005, - 10.736151434000135 - ], - [ - 119.32960045700011, - 10.751166083000072 - ], - [ - 119.32545006600017, - 10.757513739000103 - ], - [ - 119.32178795700011, - 10.76561107000012 - ], - [ - 119.31690514400023, - 10.772691148000177 - ], - [ - 119.30909264400023, - 10.775702216000084 - ], - [ - 119.30201256600017, - 10.772853908000144 - ], - [ - 119.29167728000019, - 10.762111721000124 - ], - [ - 119.28484134200008, - 10.762030341000141 - ], - [ - 119.27393639400006, - 10.77167389500012 - ], - [ - 119.27027428500006, - 10.784898179000066 - ], - [ - 119.271250847, - 10.812933661000073 - ], - [ - 119.26612389400012, - 10.826605536000102 - ], - [ - 119.25359134200019, - 10.8374697940001 - ], - [ - 119.23780358200023, - 10.845404364000146 - ], - [ - 119.22339928500017, - 10.850816148000192 - ], - [ - 119.25261478000002, - 10.887274481000162 - ], - [ - 119.25757897200018, - 10.89109935100008 - ], - [ - 119.24927819100017, - 10.902329820000176 - ], - [ - 119.23633873800006, - 10.908433335000069 - ], - [ - 119.22877037900005, - 10.916245835000069 - ], - [ - 119.23707116, - 10.93268463700015 - ], - [ - 119.22250410199999, - 10.941717841000155 - ], - [ - 119.23194420700011, - 10.951157945000176 - ], - [ - 119.24724368600008, - 10.949774481000105 - ], - [ - 119.25074303500006, - 10.925930080000114 - ], - [ - 119.25757897200018, - 10.925930080000114 - ], - [ - 119.25896243600008, - 10.930080471000153 - ], - [ - 119.26441491000017, - 10.939601955000157 - ], - [ - 119.26832116000017, - 10.931789455000157 - ], - [ - 119.27312259200008, - 10.927476304000066 - ], - [ - 119.278575066, - 10.927557684000135 - ], - [ - 119.28484134200008, - 10.93268463700015 - ], - [ - 119.29167728000019, - 10.93268463700015 - ], - [ - 119.28785241000017, - 10.92055898600016 - ], - [ - 119.28516686300006, - 10.917466539000173 - ], - [ - 119.27808678500006, - 10.912827867000146 - ], - [ - 119.29167728000019, - 10.884955145000106 - ], - [ - 119.271250847, - 10.884955145000106 - ], - [ - 119.27808678500006, - 10.874945380000113 - ], - [ - 119.28858483200011, - 10.871527411000116 - ], - [ - 119.30079186300006, - 10.873114325000145 - ], - [ - 119.31283613399998, - 10.878119208000086 - ], - [ - 119.30583743600019, - 10.857123114000146 - ], - [ - 119.30982506600017, - 10.847316799000112 - ], - [ - 119.32032311300023, - 10.839260158000087 - ], - [ - 119.33326256600006, - 10.823472398000135 - ], - [ - 119.33952884200019, - 10.823472398000135 - ], - [ - 119.33952884200019, - 10.830959377000099 - ], - [ - 119.34693444100017, - 10.830959377000099 - ], - [ - 119.35157311300011, - 10.810736395000077 - ], - [ - 119.36817467500006, - 10.801336981000148 - ], - [ - 119.38640384200008, - 10.793687242000118 - ], - [ - 119.39470462300002, - 10.77879466400016 - ], - [ - 119.39795983200005, - 10.768215236000117 - ], - [ - 119.40495853000007, - 10.762355861000074 - ], - [ - 119.41211998800011, - 10.761379299000097 - ], - [ - 119.41871178500017, - 10.769924221000124 - ], - [ - 119.42611738400015, - 10.762640692000105 - ], - [ - 119.43327884200019, - 10.752346096000096 - ], - [ - 119.43946373800006, - 10.740423895000148 - ], - [ - 119.44109134200019, - 10.732733466000127 - ], - [ - 119.44507897200018, - 10.727484442000147 - ], - [ - 119.45679772200018, - 10.727280992000189 - ], - [ - 119.46753991000017, - 10.73265208500014 - ], - [ - 119.46949303500006, - 10.741034247000115 - ], - [ - 119.46566816500004, - 10.750230210000083 - ], - [ - 119.45997155000023, - 10.758286851000122 - ], - [ - 119.44597415500007, - 10.789374091000127 - ], - [ - 119.43970787900005, - 10.79604726800008 - ], - [ - 119.44418378999998, - 10.810614325000103 - ], - [ - 119.45240319100017, - 10.824937242000189 - ], - [ - 119.45679772200018, - 10.830959377000099 - ], - [ - 119.44988040500007, - 10.841294664000102 - ], - [ - 119.43506920700011, - 10.852240302000084 - ], - [ - 119.41822350400011, - 10.860907294000157 - ], - [ - 119.40495853000007, - 10.864447333000143 - ], - [ - 119.38795006600012, - 10.864691473000093 - ], - [ - 119.37012780000012, - 10.867743231000176 - ], - [ - 119.35523522200018, - 10.877752997000158 - ], - [ - 119.34693444100017, - 10.898586330000143 - ], - [ - 119.34864342500012, - 10.908026434000163 - ], - [ - 119.35906009200019, - 10.927679755000113 - ], - [ - 119.36060631600006, - 10.93268463700015 - ], - [ - 119.35173587300008, - 10.934759833000086 - ], - [ - 119.33773847700004, - 10.932928778000104 - ], - [ - 119.32471764400023, - 10.93349844000008 - ], - [ - 119.31910241000006, - 10.943019924000154 - ], - [ - 119.31999759200002, - 11.000881252000084 - ], - [ - 119.32593834700006, - 11.01528554900014 - ], - [ - 119.32593834700006, - 11.022772528000104 - ], - [ - 119.33326256600006, - 11.022772528000104 - ], - [ - 119.335215691, - 11.011542059000107 - ], - [ - 119.34058678500017, - 11.004055080000143 - ], - [ - 119.34888756600006, - 11.000433661000088 - ], - [ - 119.36060631600006, - 11.000962632000068 - ], - [ - 119.35279381600006, - 11.023586330000114 - ], - [ - 119.327403191, - 11.064439195000162 - ], - [ - 119.32593834700006, - 11.090399481000148 - ], - [ - 119.33497155000023, - 11.102932033000158 - ], - [ - 119.34791100400017, - 11.089178778000132 - ], - [ - 119.36264082100016, - 11.067572333000143 - ], - [ - 119.37728925900015, - 11.056219794000157 - ], - [ - 119.38754316499998, - 11.054022528000175 - ], - [ - 119.39714603000007, - 11.050279039000145 - ], - [ - 119.40609785199999, - 11.049546617000118 - ], - [ - 119.41529381600017, - 11.056219794000157 - ], - [ - 119.41879316500015, - 11.067857164000173 - ], - [ - 119.41871178500017, - 11.09560781500015 - ], - [ - 119.43213951900006, - 11.122219143000095 - ], - [ - 119.42611738400015, - 11.13393789300008 - ], - [ - 119.41716556100002, - 11.140326239000103 - ], - [ - 119.41529381600017, - 11.138820705000143 - ], - [ - 119.39877363399998, - 11.159247137000122 - ], - [ - 119.39210045700023, - 11.171372789000117 - ], - [ - 119.38795006600012, - 11.186590887000094 - ], - [ - 119.40072675900015, - 11.185370184000178 - ], - [ - 119.413340691, - 11.196682033000158 - ], - [ - 119.42359459700006, - 11.213202216000141 - ], - [ - 119.428965691, - 11.227525132000125 - ], - [ - 119.42839603000002, - 11.249823309000163 - ], - [ - 119.42058353000007, - 11.297552802000112 - ], - [ - 119.42554772200012, - 11.313544012000122 - ], - [ - 119.43018639400012, - 11.318426825000174 - ], - [ - 119.43344160200016, - 11.32265859600011 - ], - [ - 119.43506920700011, - 11.32737864800012 - ], - [ - 119.43580162900005, - 11.333970445000176 - ], - [ - 119.43873131600006, - 11.33795807500016 - ], - [ - 119.44483483200023, - 11.3378360050001 - ], - [ - 119.44988040500007, - 11.334906317000076 - ], - [ - 119.44939212300008, - 11.330633856000162 - ], - [ - 119.46550540500007, - 11.346828518000109 - ], - [ - 119.47380618600002, - 11.357855536000073 - ], - [ - 119.477305535, - 11.368475653000104 - ], - [ - 119.47999108200011, - 11.396185614000089 - ], - [ - 119.48438561300006, - 11.410549221000068 - ], - [ - 119.49105879000004, - 11.420884507000082 - ], - [ - 119.50196373800011, - 11.423325914000117 - ], - [ - 119.50904381600017, - 11.413072007000082 - ], - [ - 119.51295006600017, - 11.397772528000118 - ], - [ - 119.51441491000006, - 11.385443427000084 - ], - [ - 119.51449629000004, - 11.367661851000094 - ], - [ - 119.515391472, - 11.36176178600006 - ], - [ - 119.51856530000006, - 11.3507754580001 - ], - [ - 119.52295983200017, - 11.339911200000117 - ] - ] - ], - [ - [ - [ - 119.87614993600013, - 11.47964101800008 - ], - [ - 119.86980228000019, - 11.440619208000115 - ], - [ - 119.85352623800023, - 11.404730536000116 - ], - [ - 119.83285566500004, - 11.378363348000121 - ], - [ - 119.82203209700006, - 11.387396552000126 - ], - [ - 119.82056725400017, - 11.3996035830001 - ], - [ - 119.82545006600006, - 11.413153387000165 - ], - [ - 119.83285566500004, - 11.426174221000153 - ], - [ - 119.82064863400015, - 11.426418361000103 - ], - [ - 119.803965691, - 11.431626695000176 - ], - [ - 119.79542076900012, - 11.433010158000158 - ], - [ - 119.78907311300006, - 11.420355536000102 - ], - [ - 119.78207441499998, - 11.411322333000086 - ], - [ - 119.77084394599999, - 11.406317450000145 - ], - [ - 119.77003014400006, - 11.41063060100005 - ], - [ - 119.76368248800023, - 11.419826565000122 - ], - [ - 119.755137566, - 11.428900458000115 - ], - [ - 119.74732506600006, - 11.433010158000158 - ], - [ - 119.73609459700006, - 11.43740469000015 - ], - [ - 119.73023522200018, - 11.456447658000144 - ], - [ - 119.71615644600016, - 11.460353908000144 - ], - [ - 119.72868899800002, - 11.478013414000145 - ], - [ - 119.74138431100019, - 11.469061591000127 - ], - [ - 119.755137566, - 11.45083242400014 - ], - [ - 119.77084394599999, - 11.440415757000068 - ], - [ - 119.78101647200006, - 11.447699286000073 - ], - [ - 119.78419030000012, - 11.464789130000113 - ], - [ - 119.78516686300006, - 11.494452216000141 - ], - [ - 119.792735222, - 11.484808661000088 - ], - [ - 119.80298912900005, - 11.468003648000163 - ], - [ - 119.81251061300023, - 11.460353908000144 - ], - [ - 119.81788170700011, - 11.470038153000104 - ], - [ - 119.82357832099999, - 11.472560940000122 - ], - [ - 119.82886803500017, - 11.468898830000157 - ], - [ - 119.83285566500004, - 11.460353908000144 - ], - [ - 119.84009850400017, - 11.475653387000108 - ], - [ - 119.84449303500006, - 11.49066803600013 - ], - [ - 119.84148196700002, - 11.50259023600016 - ], - [ - 119.82601972700004, - 11.508734442000147 - ], - [ - 119.83725019600004, - 11.515611070000148 - ], - [ - 119.84839928500006, - 11.520656643000095 - ], - [ - 119.85840905000012, - 11.521429755000113 - ], - [ - 119.86719811300011, - 11.51557038000007 - ], - [ - 119.87614993600013, - 11.47964101800008 - ] - ] - ], - [ - [ - [ - 124.443125847, - 11.44692617400014 - ], - [ - 124.48015384200002, - 11.38519928600013 - ], - [ - 124.48365319100006, - 11.4276797550001 - ], - [ - 124.48959394600016, - 11.446682033000101 - ], - [ - 124.50326582099999, - 11.443833726000065 - ], - [ - 124.53370201900023, - 11.421698309000178 - ], - [ - 124.5452580090001, - 11.40900299700013 - ], - [ - 124.56967207100004, - 11.346828518000109 - ], - [ - 124.59424889400023, - 11.319525458000129 - ], - [ - 124.62989342500006, - 11.304429429000123 - ], - [ - 124.67798912900017, - 11.302679755000128 - ], - [ - 124.71338951900017, - 11.311590887000165 - ], - [ - 124.74439537900011, - 11.328558661000145 - ], - [ - 124.79411868600019, - 11.371527411000102 - ], - [ - 124.83277428500006, - 11.42450592700014 - ], - [ - 124.84571373800023, - 11.433010158000158 - ], - [ - 124.85466556100008, - 11.430975653000132 - ], - [ - 124.87484785199999, - 11.422023830000114 - ], - [ - 124.8868921230002, - 11.419989325000174 - ], - [ - 124.89063561300023, - 11.422023830000114 - ], - [ - 124.89014733200017, - 11.430975653000132 - ], - [ - 124.89372806100002, - 11.433010158000158 - ], - [ - 124.90015709700006, - 11.430975653000132 - ], - [ - 124.90333092500012, - 11.426459052000084 - ], - [ - 124.90430748800006, - 11.422023830000114 - ], - [ - 124.90398196700008, - 11.419989325000174 - ], - [ - 124.92969811300011, - 11.421291408000087 - ], - [ - 124.93816165500007, - 11.419989325000174 - ], - [ - 124.94800866000017, - 11.41396719000008 - ], - [ - 124.96973717500023, - 11.395819403000175 - ], - [ - 124.976328972, - 11.39203522300015 - ], - [ - 124.984141472, - 11.381333726000122 - ], - [ - 124.98218834700006, - 11.357896226000065 - ], - [ - 124.97559655000006, - 11.334418036000088 - ], - [ - 124.96631920700023, - 11.318304755000113 - ], - [ - 124.96517988399998, - 11.30638255400008 - ], - [ - 124.96631920700023, - 11.294419664000145 - ], - [ - 124.96949303500011, - 11.2890078800001 - ], - [ - 124.97217858200005, - 11.287095445000134 - ], - [ - 124.97396894600016, - 11.277085679000066 - ], - [ - 124.976328972, - 11.272609768000095 - ], - [ - 124.98145592500023, - 11.267971096000153 - ], - [ - 124.9845483730002, - 11.266180731000176 - ], - [ - 124.98780358200017, - 11.264878648000177 - ], - [ - 124.99333743600019, - 11.261664130000128 - ], - [ - 125.00521894600004, - 11.25714752800016 - ], - [ - 125.013926629, - 11.256659247000172 - ], - [ - 125.01937910200016, - 11.252590236000117 - ], - [ - 125.02344811300011, - 11.22793203300013 - ], - [ - 125.02808678500006, - 11.22850169500019 - ], - [ - 125.03256269599999, - 11.2362735050001 - ], - [ - 125.03443444100017, - 11.248032945000176 - ], - [ - 125.04175866000017, - 11.248032945000176 - ], - [ - 125.04273522200006, - 11.217027085000055 - ], - [ - 125.04175866000017, - 11.207098700000145 - ], - [ - 125.03874759200008, - 11.19794342700007 - ], - [ - 125.0294702480002, - 11.182074286000145 - ], - [ - 125.02759850400005, - 11.17601146000014 - ], - [ - 125.02963300899998, - 11.164455471000124 - ], - [ - 125.03956139400006, - 11.144761460000083 - ], - [ - 125.04175866000017, - 11.135402736000145 - ], - [ - 125.03980553500006, - 11.103461005000128 - ], - [ - 125.05445397200006, - 11.010646877000113 - ], - [ - 125.05307050900015, - 10.968207098000136 - ], - [ - 125.01286868600008, - 10.844671942000119 - ], - [ - 125.00611412900005, - 10.79734935100008 - ], - [ - 125.01384524800002, - 10.754584052000084 - ], - [ - 125.02719160200016, - 10.742905992000175 - ], - [ - 125.08725019600016, - 10.714789130000085 - ], - [ - 125.11198978000002, - 10.707464911000088 - ], - [ - 125.12029056100019, - 10.7030703800001 - ], - [ - 125.12403405000023, - 10.695135809000135 - ], - [ - 125.13054446700002, - 10.665838934000107 - ], - [ - 125.16993248800011, - 10.619614976000108 - ], - [ - 125.17457116000006, - 10.61123281500015 - ], - [ - 125.19410241, - 10.60297272300015 - ], - [ - 125.19581139400012, - 10.582586981000176 - ], - [ - 125.18523196700008, - 10.532375393000095 - ], - [ - 125.18726647200012, - 10.519680080000128 - ], - [ - 125.19662519600004, - 10.49754466400016 - ], - [ - 125.19874108200023, - 10.484279690000122 - ], - [ - 125.19654381600006, - 10.4468447940001 - ], - [ - 125.19874108200023, - 10.433050848000093 - ], - [ - 125.20573978000002, - 10.418605861000131 - ], - [ - 125.21892337300008, - 10.398382880000113 - ], - [ - 125.23218834700012, - 10.386867580000072 - ], - [ - 125.23975670700023, - 10.398342190000122 - ], - [ - 125.24659264400006, - 10.398342190000122 - ], - [ - 125.25912519600016, - 10.383205471000124 - ], - [ - 125.26661217500023, - 10.368394273000149 - ], - [ - 125.27100670700023, - 10.34983958500014 - ], - [ - 125.27393639400023, - 10.323187567000105 - ], - [ - 125.27588951900012, - 10.3003604190001 - ], - [ - 125.27328535199999, - 10.27798086100016 - ], - [ - 125.26002037900017, - 10.261053778000175 - ], - [ - 125.22925866000017, - 10.254339911000145 - ], - [ - 125.15935306100008, - 10.281805731000176 - ], - [ - 125.14087975400005, - 10.278794664000173 - ], - [ - 125.134043816, - 10.2579613300001 - ], - [ - 125.13672936300011, - 10.228583075000103 - ], - [ - 125.14405358200011, - 10.200995184000178 - ], - [ - 125.15105228000019, - 10.185451565000093 - ], - [ - 125.11703535200016, - 10.197495835000097 - ], - [ - 125.08855228000007, - 10.228989976000108 - ], - [ - 125.06885826900012, - 10.267238674000154 - ], - [ - 125.06169681100008, - 10.299302476000136 - ], - [ - 125.04664147200006, - 10.31932200700011 - ], - [ - 125.04493248800023, - 10.323187567000105 - ], - [ - 125.04151451900023, - 10.328599351000065 - ], - [ - 125.04175866000017, - 10.364203192000119 - ], - [ - 125.03003991000017, - 10.375392971000124 - ], - [ - 125.01042728000002, - 10.383042710000069 - ], - [ - 124.99097741000006, - 10.381333726000065 - ], - [ - 124.97974694100006, - 10.364203192000119 - ], - [ - 124.99301191500015, - 10.334906317000105 - ], - [ - 125.0001733730002, - 10.199693101000094 - ], - [ - 125.02426191500004, - 10.136053778000118 - ], - [ - 125.03060957100016, - 10.093939520000063 - ], - [ - 125.04224694100017, - 10.049017645000148 - ], - [ - 125.04175866000017, - 10.028998114000089 - ], - [ - 125.03174889400012, - 10.020249742000118 - ], - [ - 125.01531009200019, - 10.02610911700016 - ], - [ - 124.96216881600017, - 10.067328192000119 - ], - [ - 124.95923912900017, - 10.07273997600008 - ], - [ - 124.95411217500023, - 10.086127020000077 - ], - [ - 124.94206790500007, - 10.09170156500008 - ], - [ - 124.92823326900023, - 10.093898830000072 - ], - [ - 124.91773522200018, - 10.097316799000083 - ], - [ - 124.90211022200018, - 10.113023179000137 - ], - [ - 124.89389082099999, - 10.126044012000136 - ], - [ - 124.88282311300023, - 10.134955145000077 - ], - [ - 124.85962975400005, - 10.138251044000114 - ], - [ - 124.81519616, - 10.139390367000146 - ], - [ - 124.79517662900005, - 10.143377997000115 - ], - [ - 124.78044681100008, - 10.151922919000143 - ], - [ - 124.76579837300002, - 10.185939846000082 - ], - [ - 124.77198326900012, - 10.225165106000091 - ], - [ - 124.78565514400023, - 10.26552969000015 - ], - [ - 124.79411868600019, - 10.302720445000148 - ], - [ - 124.792246941, - 10.32566966400013 - ], - [ - 124.78484134200002, - 10.352728583000072 - ], - [ - 124.77100670700023, - 10.375311591000141 - ], - [ - 124.74976647200006, - 10.38467031500008 - ], - [ - 124.73894290500007, - 10.39545319200009 - ], - [ - 124.73560631600006, - 10.420314846000124 - ], - [ - 124.73682701900023, - 10.447739976000094 - ], - [ - 124.7439884770001, - 10.493719794000143 - ], - [ - 124.74634850400005, - 10.501369533000073 - ], - [ - 124.75147545700023, - 10.509955145000092 - ], - [ - 124.76482181100008, - 10.525864976000108 - ], - [ - 124.76734459700018, - 10.532375393000095 - ], - [ - 124.76856530000012, - 10.5773379580001 - ], - [ - 124.77230879000004, - 10.59735748900006 - ], - [ - 124.79810631600017, - 10.659125067000076 - ], - [ - 124.8009546230002, - 10.678290106000134 - ], - [ - 124.80054772200018, - 10.724514065000136 - ], - [ - 124.77881920700023, - 10.821437893000109 - ], - [ - 124.77361087300002, - 10.830959377000099 - ], - [ - 124.73812910200004, - 10.86151764500012 - ], - [ - 124.732676629, - 10.868150132000096 - ], - [ - 124.72836347699999, - 10.886419989000075 - ], - [ - 124.71802819100017, - 10.905585028000132 - ], - [ - 124.6917423840001, - 10.939601955000157 - ], - [ - 124.65015709700012, - 10.97089264500012 - ], - [ - 124.64332116000017, - 10.977443752000099 - ], - [ - 124.63721764400012, - 10.994208075000117 - ], - [ - 124.62232506600006, - 11.002020575000117 - ], - [ - 124.60238691500015, - 11.003485419000171 - ], - [ - 124.58253014400023, - 11.000962632000068 - ], - [ - 124.56267337300002, - 10.994330145000092 - ], - [ - 124.54957116000017, - 10.983303127000141 - ], - [ - 124.54688561300011, - 10.968329169000114 - ], - [ - 124.55827884200008, - 10.950140692000119 - ], - [ - 124.56275475400005, - 10.931463934000135 - ], - [ - 124.55355879000015, - 10.908596096000124 - ], - [ - 124.53923587300008, - 10.888373114000117 - ], - [ - 124.52784264400012, - 10.878119208000086 - ], - [ - 124.51449628999998, - 10.873683986000117 - ], - [ - 124.50733483200023, - 10.874416408000144 - ], - [ - 124.47071373800023, - 10.90241120000016 - ], - [ - 124.46924889400017, - 10.905462958000058 - ], - [ - 124.45264733200011, - 10.900783596000139 - ], - [ - 124.44695071700002, - 10.903143622000101 - ], - [ - 124.44239342500006, - 10.9312197940001 - ], - [ - 124.43685957100016, - 10.935207424000083 - ], - [ - 124.42481530000023, - 10.93268463700015 - ], - [ - 124.41260826900006, - 10.93231842700014 - ], - [ - 124.40211022200012, - 10.929836330000114 - ], - [ - 124.39600670700011, - 10.934068101000136 - ], - [ - 124.39682050900004, - 10.95380280200007 - ], - [ - 124.401621941, - 10.966538804000123 - ], - [ - 124.41488691500015, - 10.984849351000094 - ], - [ - 124.41797936300023, - 11.000962632000068 - ], - [ - 124.41537519600004, - 11.01996491100006 - ], - [ - 124.40821373800011, - 11.0288760440001 - ], - [ - 124.3987736340001, - 11.036078192000133 - ], - [ - 124.38998457100004, - 11.049465236000131 - ], - [ - 124.38843834700018, - 11.065863348000136 - ], - [ - 124.39380944100006, - 11.080511786000145 - ], - [ - 124.40072675900004, - 11.092596747000144 - ], - [ - 124.40650475400017, - 11.108303127000113 - ], - [ - 124.41578209700006, - 11.121812242000175 - ], - [ - 124.41797936300023, - 11.128566799000126 - ], - [ - 124.41675866, - 11.136175848000065 - ], - [ - 124.41163170700011, - 11.148016669000128 - ], - [ - 124.40430748800011, - 11.210760809000107 - ], - [ - 124.40430748800011, - 11.302679755000128 - ], - [ - 124.38705488399998, - 11.300726630000085 - ], - [ - 124.36915123800023, - 11.311224677000055 - ], - [ - 124.35474694100017, - 11.32868073100012 - ], - [ - 124.34913170700005, - 11.347357489000089 - ], - [ - 124.35230553500006, - 11.355902411000116 - ], - [ - 124.36695397200006, - 11.365871486000103 - ], - [ - 124.37029056100008, - 11.374945380000113 - ], - [ - 124.35425866000017, - 11.379828192000076 - ], - [ - 124.34229576900023, - 11.384955145000092 - ], - [ - 124.33472741000011, - 11.39203522300015 - ], - [ - 124.34848066500004, - 11.399115302000112 - ], - [ - 124.34498131600006, - 11.407375393000109 - ], - [ - 124.33497155000023, - 11.417385158000087 - ], - [ - 124.32911217500012, - 11.42959219000015 - ], - [ - 124.32593834700006, - 11.444403387000136 - ], - [ - 124.31137129000004, - 11.466782945000148 - ], - [ - 124.29753665500019, - 11.526800848000065 - ], - [ - 124.30062910199999, - 11.542873440000136 - ], - [ - 124.30518639400023, - 11.544256903000118 - ], - [ - 124.32601972700004, - 11.554388739000089 - ], - [ - 124.32911217500012, - 11.55711497600005 - ], - [ - 124.34009850400017, - 11.551011460000069 - ], - [ - 124.36589603000019, - 11.51593659100017 - ], - [ - 124.42481530000023, - 11.467759507000125 - ], - [ - 124.443125847, - 11.44692617400014 - ] - ] - ], - [ - [ - [ - 124.43091881600006, - 11.695054429000123 - ], - [ - 124.46908613400004, - 11.692816473000136 - ], - [ - 124.495860222, - 11.694769598000093 - ], - [ - 124.50538170700011, - 11.693060614000089 - ], - [ - 124.52320397200018, - 11.68626536700016 - ], - [ - 124.54167728000019, - 11.675197658000116 - ], - [ - 124.55600019599999, - 11.660223700000174 - ], - [ - 124.567149285, - 11.625230210000083 - ], - [ - 124.59164472700004, - 11.574123440000108 - ], - [ - 124.59961998800011, - 11.563381252000099 - ], - [ - 124.62142988400015, - 11.5539004580001 - ], - [ - 124.62501061300011, - 11.532700914000188 - ], - [ - 124.61597741, - 11.498195705000086 - ], - [ - 124.60914147200018, - 11.486558335000083 - ], - [ - 124.59245853000007, - 11.481634833000115 - ], - [ - 124.53239993600008, - 11.4825707050001 - ], - [ - 124.507090691, - 11.488836981000148 - ], - [ - 124.48633873800011, - 11.4882266300001 - ], - [ - 124.48357181100008, - 11.479681708000072 - ], - [ - 124.47974694100006, - 11.474676825000131 - ], - [ - 124.47266686300006, - 11.473944403000104 - ], - [ - 124.46713300900015, - 11.477728583000115 - ], - [ - 124.46371504000015, - 11.483872789000188 - ], - [ - 124.46143639400006, - 11.490179755000142 - ], - [ - 124.45883222700016, - 11.494452216000141 - ], - [ - 124.42481530000023, - 11.5292422550001 - ], - [ - 124.41325931100002, - 11.546454169000114 - ], - [ - 124.386485222, - 11.614488023000163 - ], - [ - 124.38062584700018, - 11.636704820000134 - ], - [ - 124.37647545700023, - 11.645900783000101 - ], - [ - 124.35499108200011, - 11.671210028000147 - ], - [ - 124.34913170700005, - 11.680080471000096 - ], - [ - 124.36866295700023, - 11.678941148000149 - ], - [ - 124.41797936300023, - 11.693670966000141 - ], - [ - 124.43091881600006, - 11.695054429000123 - ] - ] - ], - [ - [ - [ - 124.856211785, - 11.604925848000093 - ], - [ - 124.85222415500002, - 11.594427802000112 - ], - [ - 124.85010826900023, - 11.583726304000095 - ], - [ - 124.84937584700018, - 11.560248114000117 - ], - [ - 124.84603925900015, - 11.548773505000085 - ], - [ - 124.83887780000012, - 11.54002513200011 - ], - [ - 124.83155358200023, - 11.536322333000072 - ], - [ - 124.80787194100012, - 11.563381252000099 - ], - [ - 124.80990644600004, - 11.566839911000102 - ], - [ - 124.8087671230002, - 11.577337958000072 - ], - [ - 124.80201256600006, - 11.582464911000088 - ], - [ - 124.78785241000006, - 11.570217190000122 - ], - [ - 124.77361087300002, - 11.604925848000093 - ], - [ - 124.78077233200005, - 11.602240302000112 - ], - [ - 124.78785241000006, - 11.598089911000073 - ], - [ - 124.785411004, - 11.614325262000108 - ], - [ - 124.77605228000007, - 11.629828192000119 - ], - [ - 124.76295006600012, - 11.641343492000146 - ], - [ - 124.74976647200006, - 11.645900783000101 - ], - [ - 124.7405705090001, - 11.650620835000112 - ], - [ - 124.73617597699999, - 11.661688544000143 - ], - [ - 124.73340905000023, - 11.674302476000122 - ], - [ - 124.72925866000011, - 11.68341705900012 - ], - [ - 124.72242272200018, - 11.693264065000136 - ], - [ - 124.72266686300011, - 11.701564846000124 - ], - [ - 124.732676629, - 11.721625067000076 - ], - [ - 124.739512566, - 11.721625067000076 - ], - [ - 124.74089603000019, - 11.719712632000125 - ], - [ - 124.751231316, - 11.708889065000122 - ], - [ - 124.78484134200002, - 11.688706773000192 - ], - [ - 124.7893986340001, - 11.684881903000175 - ], - [ - 124.79297936300023, - 11.680365302000126 - ], - [ - 124.79476972700004, - 11.674709377000127 - ], - [ - 124.79623457099999, - 11.667792059000135 - ], - [ - 124.79908287900005, - 11.66201406500008 - ], - [ - 124.81373131600006, - 11.655340887000122 - ], - [ - 124.8165796230002, - 11.646063544000157 - ], - [ - 124.81519616, - 11.63226959800015 - ], - [ - 124.82178795700005, - 11.621486721000153 - ], - [ - 124.82862389400012, - 11.613430080000114 - ], - [ - 124.83887780000012, - 11.607855536000102 - ], - [ - 124.856211785, - 11.604925848000093 - ] - ] - ], - [ - [ - [ - 121.52605228000019, - 11.846584377000156 - ], - [ - 121.51742597699999, - 11.837713934000107 - ], - [ - 121.49537194100017, - 11.827826239000103 - ], - [ - 121.47291100400011, - 11.827378648000192 - ], - [ - 121.45582116000006, - 11.831732489000103 - ], - [ - 121.44548587300002, - 11.836127020000077 - ], - [ - 121.43995201900012, - 11.83673737200013 - ], - [ - 121.43506920700023, - 11.8390567080001 - ], - [ - 121.430918816, - 11.843451239000089 - ], - [ - 121.42628014400006, - 11.842433986000117 - ], - [ - 121.41797936300011, - 11.837795315000093 - ], - [ - 121.41260826900023, - 11.840277411000116 - ], - [ - 121.41570071700002, - 11.84951406500008 - ], - [ - 121.42562910200004, - 11.86123281500008 - ], - [ - 121.44288170700023, - 11.867987372000101 - ], - [ - 121.45297285199999, - 11.868312893000123 - ], - [ - 121.47413170700011, - 11.866848049000069 - ], - [ - 121.51050866000017, - 11.855943101000094 - ], - [ - 121.52605228000019, - 11.846584377000156 - ] - ] - ], - [ - [ - [ - 122.30014082100016, - 11.76194896000014 - ], - [ - 122.32211347700016, - 11.742254950000103 - ], - [ - 122.33611087300014, - 11.736639716000099 - ], - [ - 122.377207879, - 11.733221747000101 - ], - [ - 122.38795006600006, - 11.727443752000127 - ], - [ - 122.42798912900017, - 11.668768622000115 - ], - [ - 122.44076582100004, - 11.65745677300012 - ], - [ - 122.45411217500012, - 11.652736721000124 - ], - [ - 122.46534264400012, - 11.645249742000146 - ], - [ - 122.512461785, - 11.598089911000073 - ], - [ - 122.57227623800006, - 11.574937242000118 - ], - [ - 122.588145379, - 11.563381252000099 - ], - [ - 122.59221438900025, - 11.554266669000114 - ], - [ - 122.59473717500006, - 11.548570054000123 - ], - [ - 122.59750410200004, - 11.531805731000105 - ], - [ - 122.60417728000019, - 11.517075914000117 - ], - [ - 122.62232506600017, - 11.508734442000147 - ], - [ - 122.62842858200005, - 11.51040273600016 - ], - [ - 122.64128665500019, - 11.52008698100012 - ], - [ - 122.65447024800008, - 11.526068427000126 - ], - [ - 122.65430748800011, - 11.534409898000192 - ], - [ - 122.65088951900006, - 11.543605861000074 - ], - [ - 122.64966881600017, - 11.549709377000156 - ], - [ - 122.65414472700004, - 11.5659854190001 - ], - [ - 122.66041100400017, - 11.568752346000153 - ], - [ - 122.673594597, - 11.560248114000117 - ], - [ - 122.68604576900023, - 11.545843817000147 - ], - [ - 122.692637566, - 11.54246653900013 - ], - [ - 122.70427493600002, - 11.542873440000136 - ], - [ - 122.69410241000017, - 11.55532461100016 - ], - [ - 122.69564863400004, - 11.561346747000158 - ], - [ - 122.70313561300011, - 11.56500885600012 - ], - [ - 122.71111087300002, - 11.570217190000122 - ], - [ - 122.73080488399998, - 11.592230536000116 - ], - [ - 122.73340905000006, - 11.601304429000123 - ], - [ - 122.73031660199999, - 11.604437567000105 - ], - [ - 122.72803795700023, - 11.607855536000102 - ], - [ - 122.72478274800008, - 11.611761786000102 - ], - [ - 122.75538170700011, - 11.61383698100012 - ], - [ - 122.79395592500018, - 11.612290757000082 - ], - [ - 122.83033287900005, - 11.605292059000107 - ], - [ - 122.85499108200023, - 11.59125397300015 - ], - [ - 122.8634546230002, - 11.576157945000134 - ], - [ - 122.86866295700005, - 11.56045156500008 - ], - [ - 122.87484785200016, - 11.547919012000165 - ], - [ - 122.88640384200008, - 11.542873440000136 - ], - [ - 122.90015709700018, - 11.540676174000154 - ], - [ - 122.94450931100002, - 11.52240631700009 - ], - [ - 122.89429772200006, - 11.487209377000127 - ], - [ - 122.87582441500004, - 11.465643622000115 - ], - [ - 122.87614993600008, - 11.447251695000162 - ], - [ - 122.90072675900015, - 11.43793366100013 - ], - [ - 122.92774498800011, - 11.451117255000085 - ], - [ - 122.95541425900004, - 11.470689195000148 - ], - [ - 122.981700066, - 11.480780341000113 - ], - [ - 123.00806725400005, - 11.48729075700011 - ], - [ - 123.04420006600006, - 11.515855210000097 - ], - [ - 123.08961022200006, - 11.529689846000096 - ], - [ - 123.11784915500013, - 11.548163153000118 - ], - [ - 123.14234459700006, - 11.572699286000145 - ], - [ - 123.15674889400012, - 11.598089911000073 - ], - [ - 123.16358483200023, - 11.598089911000073 - ], - [ - 123.16439863400015, - 11.537990627000084 - ], - [ - 123.15674889400012, - 11.52240631700009 - ], - [ - 123.14909915500019, - 11.519354559000178 - ], - [ - 123.13786868600019, - 11.518011786000102 - ], - [ - 123.12728925900004, - 11.515448309000178 - ], - [ - 123.12208092500023, - 11.508734442000147 - ], - [ - 123.12322024800008, - 11.49872467700007 - ], - [ - 123.1292423840001, - 11.493801174000097 - ], - [ - 123.13884524800008, - 11.492743231000148 - ], - [ - 123.14991295700011, - 11.494452216000141 - ], - [ - 123.14039147200018, - 11.479315497000144 - ], - [ - 123.14812259200019, - 11.476955471000096 - ], - [ - 123.17042076900023, - 11.480780341000113 - ], - [ - 123.17481530000023, - 11.467474677000098 - ], - [ - 123.16928144600004, - 11.453599351000108 - ], - [ - 123.16114342500012, - 11.438950914000188 - ], - [ - 123.15674889400012, - 11.423081773000163 - ], - [ - 123.16089928500006, - 11.39435455900012 - ], - [ - 123.16041100400017, - 11.380438544000128 - ], - [ - 123.14942467500012, - 11.361883856000134 - ], - [ - 123.14926191500015, - 11.356350002000113 - ], - [ - 123.14771569100012, - 11.352484442000105 - ], - [ - 123.12916100400011, - 11.349351304000123 - ], - [ - 123.12566165500019, - 11.344875393000066 - ], - [ - 123.124766472, - 11.338324286000088 - ], - [ - 123.12208092500023, - 11.330633856000162 - ], - [ - 123.12387129000004, - 11.329291083000072 - ], - [ - 123.12208092500023, - 11.302679755000128 - ], - [ - 123.121348504, - 11.301581122000172 - ], - [ - 123.11589603000007, - 11.282171942000076 - ], - [ - 123.113536004, - 11.266669012000165 - ], - [ - 123.11589603000007, - 11.230658270000106 - ], - [ - 123.11890709700018, - 11.221502997000115 - ], - [ - 123.12598717500023, - 11.216782945000105 - ], - [ - 123.13306725400011, - 11.210435289000173 - ], - [ - 123.13624108200017, - 11.196519273000192 - ], - [ - 123.13135826900006, - 11.182684637000108 - ], - [ - 123.11133873800011, - 11.168036200000088 - ], - [ - 123.10824629000004, - 11.15180084800015 - ], - [ - 123.08562259200008, - 11.162543036000073 - ], - [ - 123.06088300899998, - 11.16941966400016 - ], - [ - 123.04127037900005, - 11.16339752800016 - ], - [ - 123.02833092500023, - 11.109849351000065 - ], - [ - 123.01490319100006, - 11.091620184000163 - ], - [ - 122.99537194100006, - 11.07880280200014 - ], - [ - 122.97169030000023, - 11.0698916690001 - ], - [ - 122.97706139400012, - 11.057033596000082 - ], - [ - 122.97242272200018, - 11.049017645000134 - ], - [ - 122.95069420700011, - 11.035793361000103 - ], - [ - 122.95240319100012, - 11.046087958000115 - ], - [ - 122.95167076900006, - 11.055731512000179 - ], - [ - 122.94727623800011, - 11.06232330900015 - ], - [ - 122.93824303500017, - 11.063666083000143 - ], - [ - 122.933360222, - 11.05841705900015 - ], - [ - 122.93034915500019, - 11.036851304000052 - ], - [ - 122.92457116000006, - 11.028957424000083 - ], - [ - 122.91407311300006, - 11.026271877000099 - ], - [ - 122.90739993600013, - 11.029730536000102 - ], - [ - 122.90040123800023, - 11.034491278000104 - ], - [ - 122.88990319100017, - 11.035793361000103 - ], - [ - 122.88502037900011, - 11.03318919500019 - ], - [ - 122.86255944100017, - 11.01528554900014 - ], - [ - 122.86255944100017, - 11.028957424000083 - ], - [ - 122.839121941, - 11.018052476000108 - ], - [ - 122.81202233200011, - 10.99848053600013 - ], - [ - 122.78931725400005, - 10.976060289000117 - ], - [ - 122.78003991000017, - 10.956935940000136 - ], - [ - 122.78516686300011, - 10.92568594000008 - ], - [ - 122.79428144599999, - 10.9005394550001 - ], - [ - 122.79802493600002, - 10.875433661000102 - ], - [ - 122.786875847, - 10.844549872000144 - ], - [ - 122.76148522200018, - 10.810736395000077 - ], - [ - 122.74480228000007, - 10.79564036700016 - ], - [ - 122.72852623800011, - 10.789374091000127 - ], - [ - 122.719004754, - 10.791489976000136 - ], - [ - 122.70240319100006, - 10.80084870000016 - ], - [ - 122.69410241000017, - 10.802964585000083 - ], - [ - 122.68653405000023, - 10.80084870000016 - ], - [ - 122.66675866, - 10.789374091000127 - ], - [ - 122.655528191, - 10.78701406500008 - ], - [ - 122.64275149800008, - 10.78123607000019 - ], - [ - 122.63062584700018, - 10.774359442000105 - ], - [ - 122.61475670700023, - 10.76146067900008 - ], - [ - 122.61003665500002, - 10.756089585000126 - ], - [ - 122.60124759200008, - 10.740952867000132 - ], - [ - 122.60303795700023, - 10.738755601000136 - ], - [ - 122.60596764400006, - 10.734035549000126 - ], - [ - 122.60499108200011, - 10.727728583000086 - ], - [ - 122.594981316, - 10.721096096000124 - ], - [ - 122.58985436300011, - 10.698716539000188 - ], - [ - 122.54468834700006, - 10.689846096000153 - ], - [ - 122.45101972700004, - 10.686346747000158 - ], - [ - 122.36540774800002, - 10.67267487200013 - ], - [ - 122.35718834700006, - 10.670396226000065 - ], - [ - 122.34359785199999, - 10.660630601000122 - ], - [ - 122.33838951900012, - 10.658392645000134 - ], - [ - 122.30404707100016, - 10.659735419000128 - ], - [ - 122.29330488400004, - 10.658392645000134 - ], - [ - 122.28239993600008, - 10.654038804000137 - ], - [ - 122.26856530000023, - 10.642726955000157 - ], - [ - 122.25928795700011, - 10.637884833000086 - ], - [ - 122.24854576900006, - 10.637925523000163 - ], - [ - 122.23755944100006, - 10.641424872000158 - ], - [ - 122.22657311300006, - 10.642238674000083 - ], - [ - 122.21452884200008, - 10.634466864000075 - ], - [ - 122.17359459700006, - 10.600653387000094 - ], - [ - 122.16195722700004, - 10.59373607000019 - ], - [ - 122.15202884200002, - 10.59235260600012 - ], - [ - 122.14161217500023, - 10.592433986000103 - ], - [ - 122.12891686300006, - 10.59007396000014 - ], - [ - 122.10181725400005, - 10.569322007000139 - ], - [ - 122.03956139400023, - 10.46662018400012 - ], - [ - 122.03321373800011, - 10.460923570000134 - ], - [ - 122.01579837300008, - 10.445461330000114 - ], - [ - 121.98210696700008, - 10.430243231000134 - ], - [ - 121.94971764400023, - 10.433172919000157 - ], - [ - 121.92969811300006, - 10.46662018400012 - ], - [ - 121.93246504000004, - 10.508693752000084 - ], - [ - 121.97217858200023, - 10.582098700000088 - ], - [ - 121.98487389400012, - 10.624904690000093 - ], - [ - 121.98487389400012, - 10.647284247000101 - ], - [ - 121.97803795700011, - 10.710191148000149 - ], - [ - 121.97185306100002, - 10.725002346000124 - ], - [ - 121.94410241000006, - 10.753566799000112 - ], - [ - 121.93702233200005, - 10.775702216000084 - ], - [ - 121.93970787900017, - 10.793605861000145 - ], - [ - 121.95411217500012, - 10.823228257000096 - ], - [ - 121.95997155000006, - 10.853908596000096 - ], - [ - 121.97803795700011, - 10.905462958000058 - ], - [ - 122.04509524800008, - 11.01740143400015 - ], - [ - 122.05307050900004, - 11.063666083000143 - ], - [ - 122.05307050900004, - 11.233791408000073 - ], - [ - 122.05062910199999, - 11.25470612200013 - ], - [ - 122.04428144600016, - 11.277777411000102 - ], - [ - 122.04175866000006, - 11.30044179900014 - ], - [ - 122.050059441, - 11.320298570000148 - ], - [ - 122.06137129000004, - 11.339056708000115 - ], - [ - 122.06609134200019, - 11.36017487200013 - ], - [ - 122.0735783210001, - 11.477362372000101 - ], - [ - 122.07593834700006, - 11.4825707050001 - ], - [ - 122.08082116, - 11.487616278000132 - ], - [ - 122.08570397200018, - 11.494574286000116 - ], - [ - 122.10718834700012, - 11.657945054000109 - ], - [ - 122.10157311300011, - 11.693670966000141 - ], - [ - 122.08448326900023, - 11.72467682500016 - ], - [ - 122.06023196700008, - 11.733710028000175 - ], - [ - 122.02906334700018, - 11.734686591000155 - ], - [ - 121.99170983200023, - 11.741441148000177 - ], - [ - 121.95785566500015, - 11.75535716400016 - ], - [ - 121.941172722, - 11.76007721600017 - ], - [ - 121.91968834700018, - 11.76194896000014 - ], - [ - 121.8821720710001, - 11.760728257000125 - ], - [ - 121.86475670700011, - 11.76264069200009 - ], - [ - 121.85385175900004, - 11.769435940000108 - ], - [ - 121.85442142000008, - 11.771836656000147 - ], - [ - 121.85613040500019, - 11.779771226000122 - ], - [ - 121.86622155000018, - 11.793443101000065 - ], - [ - 121.87810306100013, - 11.805324611000103 - ], - [ - 121.88526451900017, - 11.810370184000135 - ], - [ - 121.88900800899998, - 11.819281317000076 - ], - [ - 121.89144941500004, - 11.839260158000144 - ], - [ - 121.89177493600008, - 11.859930731000162 - ], - [ - 121.88868248800006, - 11.871242580000143 - ], - [ - 121.89185631600006, - 11.885239976000108 - ], - [ - 121.89682050899998, - 11.893784898000135 - ], - [ - 121.90552819100017, - 11.898016669000157 - ], - [ - 121.91968834700018, - 11.899115302000098 - ], - [ - 121.926524285, - 11.903387762000108 - ], - [ - 121.93970787900017, - 11.922186591000155 - ], - [ - 121.94662519600016, - 11.926459052000084 - ], - [ - 121.953379754, - 11.92780182500016 - ], - [ - 121.95899498800011, - 11.933172919000114 - ], - [ - 121.96371504000004, - 11.933905341000141 - ], - [ - 121.97217858200023, - 11.93036530200007 - ], - [ - 121.97730553500017, - 11.924017645000134 - ], - [ - 121.98096764400012, - 11.917466539000145 - ], - [ - 121.98487389400012, - 11.913397528000104 - ], - [ - 122.02003014400006, - 11.903143622000158 - ], - [ - 122.03028405000012, - 11.89630768400015 - ], - [ - 122.05323326900006, - 11.866685289000102 - ], - [ - 122.07260175900004, - 11.849310614000132 - ], - [ - 122.09441165500007, - 11.834662177000112 - ], - [ - 122.117930535, - 11.823553778000175 - ], - [ - 122.22868899800008, - 11.799750067000105 - ], - [ - 122.26539147200018, - 11.785549221000082 - ], - [ - 122.30014082100016, - 11.76194896000014 - ] - ] - ], - [ - [ - [ - 120.27833092500023, - 11.824042059000163 - ], - [ - 120.26791425900015, - 11.816229559000178 - ], - [ - 120.25554446700014, - 11.836249091000141 - ], - [ - 120.23747806100019, - 11.88544342700007 - ], - [ - 120.2032983730002, - 11.947577216000084 - ], - [ - 120.21314537900005, - 11.949530341000127 - ], - [ - 120.25879967500018, - 11.967596747000144 - ], - [ - 120.26791425900015, - 11.968085028000132 - ], - [ - 120.27637780000012, - 11.964911200000174 - ], - [ - 120.28199303500011, - 11.957993882000082 - ], - [ - 120.28451582100004, - 11.94904205900015 - ], - [ - 120.28516686300017, - 11.930161851000122 - ], - [ - 120.28321373800011, - 11.926988023000149 - ], - [ - 120.27279707100004, - 11.925360419000128 - ], - [ - 120.26783287900017, - 11.923325914000188 - ], - [ - 120.26343834700018, - 11.916164455000157 - ], - [ - 120.26547285200004, - 11.909735419000143 - ], - [ - 120.26978600400005, - 11.904201565000122 - ], - [ - 120.27149498800023, - 11.899115302000098 - ], - [ - 120.26465905000012, - 11.872015692000076 - ], - [ - 120.26417076900012, - 11.861558335000097 - ], - [ - 120.26677493600013, - 11.851548570000105 - ], - [ - 120.27719160199999, - 11.831773179000095 - ], - [ - 120.27833092500023, - 11.824042059000163 - ] - ] - ], - [ - [ - [ - 119.96387780000012, - 11.940130927000112 - ], - [ - 119.9593205090001, - 11.929999091000155 - ], - [ - 119.97706139400017, - 11.926174221000139 - ], - [ - 120.02165774800002, - 11.926459052000084 - ], - [ - 120.03142337300008, - 11.924465236000131 - ], - [ - 120.03199303500006, - 11.919907945000176 - ], - [ - 120.02588951900017, - 11.915472723000121 - ], - [ - 120.00310306100002, - 11.91006094000008 - ], - [ - 120.00806725400011, - 11.902736721000153 - ], - [ - 120.01921634200019, - 11.895575262000122 - ], - [ - 120.02475019600004, - 11.892971096000124 - ], - [ - 120.05258222699999, - 11.871242580000143 - ], - [ - 120.07325280000012, - 11.865301825000131 - ], - [ - 120.08326256600017, - 11.86041901200015 - ], - [ - 120.07650800900015, - 11.858140367000175 - ], - [ - 120.05005944100017, - 11.854315497000158 - ], - [ - 120.048594597, - 11.84442780200007 - ], - [ - 120.05176842500006, - 11.831000067000076 - ], - [ - 120.03907311300011, - 11.816595770000106 - ], - [ - 120.03907311300011, - 11.810370184000135 - ], - [ - 120.04297936300011, - 11.808986721000153 - ], - [ - 120.05258222699999, - 11.803615627000099 - ], - [ - 120.05258222699999, - 11.810370184000135 - ], - [ - 120.06218509200008, - 11.806301174000083 - ], - [ - 120.06999759200008, - 11.801092841000084 - ], - [ - 120.07593834700018, - 11.795233466000141 - ], - [ - 120.07992597700016, - 11.78925202000012 - ], - [ - 120.06006920700017, - 11.767482815000065 - ], - [ - 120.05258222699999, - 11.76194896000014 - ], - [ - 120.06706790500002, - 11.741766669000114 - ], - [ - 120.04704837300008, - 11.708929755000113 - ], - [ - 120.01417076900006, - 11.682114976000122 - ], - [ - 119.98438561300006, - 11.680080471000096 - ], - [ - 119.9669702480002, - 11.664374091000127 - ], - [ - 119.95460045700005, - 11.680121161000088 - ], - [ - 119.95020592500006, - 11.70937734600011 - ], - [ - 119.95639082100016, - 11.734686591000155 - ], - [ - 119.96989993600002, - 11.725531317000076 - ], - [ - 119.9739689460001, - 11.720770575000174 - ], - [ - 119.97706139400017, - 11.714178778000104 - ], - [ - 119.98438561300006, - 11.714178778000104 - ], - [ - 119.98259524800008, - 11.72858307500016 - ], - [ - 119.98096764400017, - 11.734198309000163 - ], - [ - 119.97706139400017, - 11.741441148000177 - ], - [ - 119.99048912900017, - 11.754787502000099 - ], - [ - 120.00114993600019, - 11.768622137000108 - ], - [ - 120.00489342500012, - 11.782538153000175 - ], - [ - 119.99805748800011, - 11.796087958000143 - ], - [ - 119.99024498800011, - 11.790269273000177 - ], - [ - 119.985118035, - 11.789740302000112 - ], - [ - 119.97706139400017, - 11.796087958000143 - ], - [ - 119.97169030000012, - 11.774807033000158 - ], - [ - 119.95923912900011, - 11.76585521000014 - ], - [ - 119.94369550899998, - 11.767035223000079 - ], - [ - 119.92920983200023, - 11.775580145000092 - ], - [ - 119.921153191, - 11.788316148000135 - ], - [ - 119.91187584700006, - 11.816392320000148 - ], - [ - 119.90186608200005, - 11.824042059000163 - ], - [ - 119.90748131600017, - 11.827948309000163 - ], - [ - 119.91618899800008, - 11.835191148000192 - ], - [ - 119.92237389400012, - 11.837713934000107 - ], - [ - 119.91187584700006, - 11.853949286000145 - ], - [ - 119.88607832100004, - 11.878648179000137 - ], - [ - 119.87452233200011, - 11.892971096000124 - ], - [ - 119.86801191499998, - 11.90656159100017 - ], - [ - 119.85401451900023, - 11.954413153000104 - ], - [ - 119.86231530000012, - 11.9527041690001 - ], - [ - 119.86719811300011, - 11.949693101000094 - ], - [ - 119.87240644599999, - 11.947333075000145 - ], - [ - 119.88070722700016, - 11.947577216000084 - ], - [ - 119.87916100400005, - 11.945868231000176 - ], - [ - 119.88233483200011, - 11.943345445000162 - ], - [ - 119.887461785, - 11.941107489000089 - ], - [ - 119.89161217500023, - 11.940130927000112 - ], - [ - 119.894786004, - 11.942328192000105 - ], - [ - 119.89576256600017, - 11.947251695000162 - ], - [ - 119.894786004, - 11.952134507000125 - ], - [ - 119.89161217500023, - 11.954413153000104 - ], - [ - 119.89283287900017, - 11.962591864000117 - ], - [ - 119.90479576900006, - 11.976874091000113 - ], - [ - 119.91968834700006, - 11.981512762000136 - ], - [ - 119.92920983200023, - 11.96116771000014 - ], - [ - 119.96387780000012, - 11.940130927000112 - ] - ] - ], - [ - [ - [ - 124.17847741000017, - 12.039618231000176 - ], - [ - 124.16431725400005, - 12.037746486000117 - ], - [ - 124.15023847699999, - 12.043850002000113 - ], - [ - 124.146250847, - 12.05304596600017 - ], - [ - 124.15333092500006, - 12.065130927000084 - ], - [ - 124.16537519599999, - 12.075425523000192 - ], - [ - 124.18197675900015, - 12.080145575000103 - ], - [ - 124.20622806100002, - 12.081244208000143 - ], - [ - 124.22803795700011, - 12.073675848000107 - ], - [ - 124.22925866, - 12.063625393000123 - ], - [ - 124.20932050900004, - 12.060939846000153 - ], - [ - 124.19857832100004, - 12.05263906500008 - ], - [ - 124.17847741000017, - 12.039618231000176 - ] - ] - ], - [ - [ - [ - 121.40186608200023, - 12.002834377000099 - ], - [ - 121.38428795700011, - 12.000921942000133 - ], - [ - 121.37183678500017, - 12.011135158000087 - ], - [ - 121.36426842500023, - 12.027329820000134 - ], - [ - 121.36085045700023, - 12.043158270000077 - ], - [ - 121.36158287900005, - 12.050604559000135 - ], - [ - 121.36768639400023, - 12.071030992000118 - ], - [ - 121.36459394600016, - 12.081447658000101 - ], - [ - 121.35865319100006, - 12.087836005000128 - ], - [ - 121.35564212300002, - 12.09418366100006 - ], - [ - 121.36085045700023, - 12.10455963700015 - ], - [ - 121.35857181100008, - 12.112005927000126 - ], - [ - 121.35865319100006, - 12.114691473000107 - ], - [ - 121.36768639400023, - 12.110419012000108 - ], - [ - 121.40642337300008, - 12.0624453800001 - ], - [ - 121.41285241000017, - 12.047105210000055 - ], - [ - 121.41667728000019, - 12.030218817000062 - ], - [ - 121.41382897200006, - 12.014553127000084 - ], - [ - 121.40186608200023, - 12.002834377000099 - ] - ] - ], - [ - [ - [ - 121.12769616000017, - 12.15985748900006 - ], - [ - 121.118907097, - 12.158107815000065 - ], - [ - 121.10865319100017, - 12.162502346000139 - ], - [ - 121.09937584700006, - 12.169419664000145 - ], - [ - 121.09009850400017, - 12.17426178600013 - ], - [ - 121.08366946700008, - 12.183498440000093 - ], - [ - 121.07960045700011, - 12.197699286000102 - ], - [ - 121.06959069100006, - 12.21137116100013 - ], - [ - 121.05160566499998, - 12.220933335000126 - ], - [ - 121.03956139400006, - 12.251532294000143 - ], - [ - 121.05990644600016, - 12.278387762000122 - ], - [ - 121.08814537900005, - 12.267075914000145 - ], - [ - 121.09791100400017, - 12.24469635600012 - ], - [ - 121.10523522200018, - 12.211167710000083 - ], - [ - 121.11011803500006, - 12.203111070000148 - ], - [ - 121.11410566500004, - 12.19916413000007 - ], - [ - 121.11597741000011, - 12.196763414000117 - ], - [ - 121.12826582100016, - 12.174994208000058 - ], - [ - 121.1310327480002, - 12.164374091000113 - ], - [ - 121.12769616000017, - 12.15985748900006 - ] - ] - ], - [ - [ - [ - 119.93458092500012, - 12.285142320000162 - ], - [ - 119.93588300899998, - 12.276516018000152 - ], - [ - 119.95020592500006, - 12.271551825000117 - ], - [ - 119.98902428500011, - 12.267157294000128 - ], - [ - 120.00489342500012, - 12.262884833000115 - ], - [ - 120.02149498800006, - 12.253119208000086 - ], - [ - 120.04883873800023, - 12.23114655200007 - ], - [ - 120.07276451900012, - 12.206040757000082 - ], - [ - 120.07992597700016, - 12.200832424000083 - ], - [ - 120.08814537900017, - 12.198228257000082 - ], - [ - 120.1053166020001, - 12.19765859600011 - ], - [ - 120.11410566500015, - 12.19399648600016 - ], - [ - 120.10368899800008, - 12.191473700000145 - ], - [ - 120.09685306100002, - 12.186021226000108 - ], - [ - 120.093516472, - 12.17772044500012 - ], - [ - 120.09424889400023, - 12.166652736000088 - ], - [ - 120.11695397200018, - 12.16644928600013 - ], - [ - 120.17017662900017, - 12.12543366100013 - ], - [ - 120.19605553500017, - 12.112005927000126 - ], - [ - 120.19841556100002, - 12.122788804000137 - ], - [ - 120.20435631600017, - 12.12836334800015 - ], - [ - 120.21314537900005, - 12.129095770000077 - ], - [ - 120.22396894600004, - 12.12567780200007 - ], - [ - 120.22413170700011, - 12.21918366100013 - ], - [ - 120.22974694100017, - 12.21865469000015 - ], - [ - 120.243907097, - 12.200832424000083 - ], - [ - 120.25074303500006, - 12.185492255000128 - ], - [ - 120.25277754000015, - 12.169623114000103 - ], - [ - 120.25196373800023, - 12.14248281500008 - ], - [ - 120.25831139400006, - 12.131781317000147 - ], - [ - 120.27247155000012, - 12.134711005000085 - ], - [ - 120.28638756600017, - 12.135443427000112 - ], - [ - 120.292246941, - 12.118231512000179 - ], - [ - 120.29590905000006, - 12.120184637000136 - ], - [ - 120.2970483730002, - 12.120103257000068 - ], - [ - 120.29753665500019, - 12.12099844000015 - ], - [ - 120.29908287900005, - 12.12567780200007 - ], - [ - 120.32911217500006, - 12.097479559000092 - ], - [ - 120.34213300899998, - 12.08075592700007 - ], - [ - 120.34750410200004, - 12.067328192000076 - ], - [ - 120.34489993600002, - 12.05329010600012 - ], - [ - 120.33790123800017, - 12.048488674000126 - ], - [ - 120.32886803500006, - 12.04535553600006 - ], - [ - 120.31959069100012, - 12.036322333000143 - ], - [ - 120.31519616, - 12.023179429000095 - ], - [ - 120.31959069100012, - 12.017889716000113 - ], - [ - 120.32740319100017, - 12.020086981000105 - ], - [ - 120.33383222699999, - 12.029486395000134 - ], - [ - 120.33838951900023, - 12.029282945000176 - ], - [ - 120.33936608200011, - 12.028143622000144 - ], - [ - 120.33920332100016, - 12.025824286000088 - ], - [ - 120.34009850400005, - 12.022040106000148 - ], - [ - 120.34750410200004, - 12.029486395000134 - ], - [ - 120.35287519599999, - 12.016180731000105 - ], - [ - 120.34913170700017, - 12.007025458000129 - ], - [ - 120.33952884200008, - 12.00055573100012 - ], - [ - 120.326426629, - 11.995306708000143 - ], - [ - 120.31275475400017, - 11.992010809000107 - ], - [ - 120.30616295700011, - 11.99396393400015 - ], - [ - 120.30128014400023, - 11.998480536000102 - ], - [ - 120.292246941, - 12.002834377000099 - ], - [ - 120.27491295700023, - 12.00340403900016 - ], - [ - 120.26286868600002, - 11.997748114000075 - ], - [ - 120.2518009770001, - 11.99087148600016 - ], - [ - 120.23764082100016, - 11.98794179900014 - ], - [ - 120.22437584700006, - 11.993068752000156 - ], - [ - 120.21338951900006, - 12.002264716000127 - ], - [ - 120.202403191, - 12.008002020000106 - ], - [ - 120.18921959700018, - 12.002834377000099 - ], - [ - 120.18702233200005, - 12.018255927000126 - ], - [ - 120.17457116000006, - 12.022691148000192 - ], - [ - 120.157481316, - 12.023911851000122 - ], - [ - 120.14210045700005, - 12.029486395000134 - ], - [ - 120.13461347699999, - 12.022040106000148 - ], - [ - 120.14136803500006, - 12.009670315000122 - ], - [ - 120.14063561300011, - 11.99925364800012 - ], - [ - 120.13689212300008, - 11.98847077000012 - ], - [ - 120.13461347699999, - 11.974839585000083 - ], - [ - 120.12598717500012, - 11.979396877000127 - ], - [ - 120.12134850400017, - 11.979396877000127 - ], - [ - 120.11833743600008, - 11.975287177000084 - ], - [ - 120.11410566500015, - 11.967433986000088 - ], - [ - 120.10792076900006, - 11.967433986000088 - ], - [ - 120.093516472, - 11.994370835000069 - ], - [ - 120.082286004, - 12.0015322940001 - ], - [ - 120.03907311300011, - 11.995306708000143 - ], - [ - 120.02149498800006, - 11.999823309000092 - ], - [ - 120.00114993600019, - 12.011175848000079 - ], - [ - 119.98406009200002, - 12.025702216000113 - ], - [ - 119.97055097700016, - 12.054754950000174 - ], - [ - 119.94239342500006, - 12.087144273000177 - ], - [ - 119.93588300899998, - 12.108303127000099 - ], - [ - 119.935801629, - 12.123032945000176 - ], - [ - 119.93409264400012, - 12.134833075000145 - ], - [ - 119.92896569100012, - 12.145331122000115 - ], - [ - 119.91863040500019, - 12.156073309000135 - ], - [ - 119.91236412900005, - 12.166896877000127 - ], - [ - 119.91041100400011, - 12.180568752000156 - ], - [ - 119.90650475400011, - 12.194891669000143 - ], - [ - 119.89503014400023, - 12.207668361000103 - ], - [ - 119.88347415500002, - 12.198919989000117 - ], - [ - 119.87305748800023, - 12.187404690000093 - ], - [ - 119.86500084700012, - 12.173814195000134 - ], - [ - 119.86036217500006, - 12.159165757000125 - ], - [ - 119.84766686300011, - 12.16673411700016 - ], - [ - 119.85035241000017, - 12.174465236000088 - ], - [ - 119.85962975400005, - 12.18325429900014 - ], - [ - 119.86719811300011, - 12.19399648600016 - ], - [ - 119.86963951900012, - 12.206610419000143 - ], - [ - 119.8693139980002, - 12.216701565000108 - ], - [ - 119.86719811300011, - 12.231838283000101 - ], - [ - 119.872325066, - 12.251695054000109 - ], - [ - 119.88550866000006, - 12.259507554000095 - ], - [ - 119.90349368600019, - 12.264593817000119 - ], - [ - 119.92237389400012, - 12.276516018000152 - ], - [ - 119.89763431100008, - 12.277044989000132 - ], - [ - 119.88754316499998, - 12.275051174000097 - ], - [ - 119.88070722700016, - 12.269029039000188 - ], - [ - 119.87794030000012, - 12.308091539000145 - ], - [ - 119.88502037900017, - 12.322699286000073 - ], - [ - 119.90870201900006, - 12.32367584800015 - ], - [ - 119.92693118600008, - 12.316473700000117 - ], - [ - 119.93344160200016, - 12.30109284100017 - ], - [ - 119.93458092500012, - 12.285142320000162 - ] - ] - ], - [ - [ - [ - 124.18197675900015, - 12.406927802000084 - ], - [ - 124.16863040500002, - 12.398138739000117 - ], - [ - 124.14909915500007, - 12.414699611000088 - ], - [ - 124.13746178500006, - 12.437567450000088 - ], - [ - 124.13379967500012, - 12.45941803600013 - ], - [ - 124.13355553500006, - 12.470770575000103 - ], - [ - 124.14258873800017, - 12.468695380000085 - ], - [ - 124.16049238400004, - 12.45604075700011 - ], - [ - 124.17660566499998, - 12.432684637000122 - ], - [ - 124.18197675900015, - 12.406927802000084 - ] - ] - ], - [ - [ - [ - 122.62533613399998, - 12.280991929000123 - ], - [ - 122.61182701900012, - 12.276516018000152 - ], - [ - 122.60718834700018, - 12.279445705000086 - ], - [ - 122.591563347, - 12.300116278000104 - ], - [ - 122.58301842500006, - 12.305650132000125 - ], - [ - 122.56251061300023, - 12.311102606000148 - ], - [ - 122.55347741000006, - 12.31753164300008 - ], - [ - 122.52881920700023, - 12.358465887000094 - ], - [ - 122.51197350400005, - 12.37763092700007 - ], - [ - 122.48829186300011, - 12.385728257000096 - ], - [ - 122.46509850400017, - 12.388576565000122 - ], - [ - 122.44605553500017, - 12.396673895000148 - ], - [ - 122.43189537900017, - 12.409735419000128 - ], - [ - 122.42310631600017, - 12.42739492400014 - ], - [ - 122.42302493600019, - 12.462876695000134 - ], - [ - 122.444590691, - 12.483710028000118 - ], - [ - 122.48113040500007, - 12.493353583000086 - ], - [ - 122.59424889400006, - 12.492621161000145 - ], - [ - 122.63209069100006, - 12.484523830000128 - ], - [ - 122.64372806100002, - 12.479478257000096 - ], - [ - 122.64918053500017, - 12.473211981000134 - ], - [ - 122.65544681100002, - 12.452460028000147 - ], - [ - 122.66138756600006, - 12.43935781500008 - ], - [ - 122.66920006600006, - 12.426214911000116 - ], - [ - 122.68751061300011, - 12.402818101000136 - ], - [ - 122.68677819100017, - 12.388983466000127 - ], - [ - 122.670176629, - 12.31753164300008 - ], - [ - 122.65919030000023, - 12.305405992000175 - ], - [ - 122.64283287900005, - 12.29193756700009 - ], - [ - 122.62533613399998, - 12.280991929000123 - ] - ] - ], - [ - [ - [ - 124.91895592500012, - 12.562241929000137 - ], - [ - 124.92823326900023, - 12.55707428600013 - ], - [ - 124.94141686300011, - 12.56297435100008 - ], - [ - 124.95850670700023, - 12.573228257000096 - ], - [ - 124.97339928500011, - 12.576320705000086 - ], - [ - 124.97974694100006, - 12.560777085000083 - ], - [ - 124.98951256600017, - 12.561997789000188 - ], - [ - 125.01042728000002, - 12.553412177000084 - ], - [ - 125.02857506600006, - 12.5425479190001 - ], - [ - 125.03101647200006, - 12.537258205000114 - ], - [ - 125.03687584700012, - 12.53554922100011 - ], - [ - 125.04224694100017, - 12.532131252000113 - ], - [ - 125.04957116000017, - 12.529364325000145 - ], - [ - 125.06169681100008, - 12.529730536000073 - ], - [ - 125.06983483200005, - 12.533026434000107 - ], - [ - 125.08139082099999, - 12.539699611000145 - ], - [ - 125.09180748800011, - 12.547349351000094 - ], - [ - 125.09644616, - 12.553656317000119 - ], - [ - 125.09978274800002, - 12.574652411000073 - ], - [ - 125.10914147200018, - 12.5792910830001 - ], - [ - 125.13746178500006, - 12.570746161000073 - ], - [ - 125.14722741000017, - 12.571966864000089 - ], - [ - 125.156993035, - 12.57599518400015 - ], - [ - 125.16627037900017, - 12.578111070000162 - ], - [ - 125.17457116000006, - 12.574164130000085 - ], - [ - 125.19874108200023, - 12.550238348000121 - ], - [ - 125.24838300900015, - 12.519476630000128 - ], - [ - 125.27214603000007, - 12.499009507000082 - ], - [ - 125.27393639400023, - 12.482001044000114 - ], - [ - 125.28484134200014, - 12.47044505400008 - ], - [ - 125.30616295700011, - 12.458319403000175 - ], - [ - 125.31478925899998, - 12.44721100500007 - ], - [ - 125.3263452480002, - 12.42133209800015 - ], - [ - 125.33366946700014, - 12.412665106000148 - ], - [ - 125.34961998800023, - 12.399400132000125 - ], - [ - 125.33090254000015, - 12.388902085000055 - ], - [ - 125.31283613400015, - 12.366685289000188 - ], - [ - 125.30787194100017, - 12.341864325000131 - ], - [ - 125.32911217500006, - 12.32367584800015 - ], - [ - 125.32227623800023, - 12.319322007000068 - ], - [ - 125.31853274800014, - 12.313666083000072 - ], - [ - 125.31600996200021, - 12.302069403000147 - ], - [ - 125.31478925899998, - 12.29637278900016 - ], - [ - 125.34555097700016, - 12.313706773000149 - ], - [ - 125.35645592500023, - 12.31753164300008 - ], - [ - 125.35466556100008, - 12.30792877800009 - ], - [ - 125.35482832100004, - 12.30133698100012 - ], - [ - 125.35417728000007, - 12.295884507000082 - ], - [ - 125.34961998800023, - 12.28953685100005 - ], - [ - 125.36068769600016, - 12.285142320000162 - ], - [ - 125.37045332100004, - 12.28896719000008 - ], - [ - 125.39063561300023, - 12.303859768000137 - ], - [ - 125.38445071700008, - 12.284979559000107 - ], - [ - 125.39421634200019, - 12.280503648000135 - ], - [ - 125.43213951900023, - 12.28270091400013 - ], - [ - 125.45069420700023, - 12.273627020000134 - ], - [ - 125.48601321700008, - 12.247381903000104 - ], - [ - 125.50049889400012, - 12.24860260600012 - ], - [ - 125.50603274800002, - 12.237738348000136 - ], - [ - 125.52784264400006, - 12.211004950000117 - ], - [ - 125.53825931100008, - 12.183498440000093 - ], - [ - 125.53760826900012, - 12.172430731000148 - ], - [ - 125.52100670700005, - 12.180324611000117 - ], - [ - 125.51295006600006, - 12.174465236000088 - ], - [ - 125.48926842500012, - 12.170233466000155 - ], - [ - 125.47934004000004, - 12.166652736000088 - ], - [ - 125.4884546230002, - 12.163031317000119 - ], - [ - 125.4954533210001, - 12.158840236000103 - ], - [ - 125.50147545700011, - 12.15338776200015 - ], - [ - 125.50733483200023, - 12.146185614000117 - ], - [ - 125.479746941, - 12.1398379580001 - ], - [ - 125.46713300900004, - 12.134914455000128 - ], - [ - 125.45948326900012, - 12.12567780200007 - ], - [ - 125.45736738399998, - 12.107082424000083 - ], - [ - 125.46794681100008, - 12.101996161000145 - ], - [ - 125.50049889400012, - 12.10455963700015 - ], - [ - 125.49830162900005, - 12.101304429000109 - ], - [ - 125.49561608200023, - 12.09422435100005 - ], - [ - 125.49366295700011, - 12.090969143000109 - ], - [ - 125.50269616, - 12.083685614000089 - ], - [ - 125.51563561300011, - 12.070868231000148 - ], - [ - 125.52515709700012, - 12.05695221600017 - ], - [ - 125.52442467500006, - 12.04621002800016 - ], - [ - 125.49048912900005, - 12.018947658000158 - ], - [ - 125.48226972700004, - 12.008530992000175 - ], - [ - 125.46998131600017, - 11.986761786000116 - ], - [ - 125.45199629000004, - 11.964056708000072 - ], - [ - 125.44581139400017, - 11.947333075000145 - ], - [ - 125.44385826900012, - 11.927883205000143 - ], - [ - 125.44516035200004, - 11.905951239000117 - ], - [ - 125.44703209700018, - 11.900091864000075 - ], - [ - 125.45948326900012, - 11.871242580000143 - ], - [ - 125.457286004, - 11.84052155200007 - ], - [ - 125.45948326900012, - 11.830267645000134 - ], - [ - 125.465098504, - 11.823228257000068 - ], - [ - 125.49048912900005, - 11.799790757000096 - ], - [ - 125.49366295700011, - 11.7902285830001 - ], - [ - 125.49048912900005, - 11.78107330900012 - ], - [ - 125.48373457099999, - 11.776190497000144 - ], - [ - 125.45720462300002, - 11.785711981000148 - ], - [ - 125.44727623800023, - 11.767767645000106 - ], - [ - 125.45020592500023, - 11.750433661000116 - ], - [ - 125.46973717500023, - 11.758530992000132 - ], - [ - 125.48161868600019, - 11.757310289000117 - ], - [ - 125.49122155000023, - 11.737982489000089 - ], - [ - 125.50049889400012, - 11.701117255000128 - ], - [ - 125.49903405000023, - 11.67584870000016 - ], - [ - 125.48926842500012, - 11.670803127000141 - ], - [ - 125.47681725400011, - 11.668768622000115 - ], - [ - 125.46631920700023, - 11.652736721000124 - ], - [ - 125.47901451900006, - 11.647528387000122 - ], - [ - 125.47632897200012, - 11.638006903000132 - ], - [ - 125.46859785199999, - 11.625474351000122 - ], - [ - 125.46631920700023, - 11.611761786000102 - ], - [ - 125.47087649800008, - 11.602606512000122 - ], - [ - 125.47657311300023, - 11.600165106000176 - ], - [ - 125.48316491000006, - 11.599310614000089 - ], - [ - 125.49048912900005, - 11.594671942000147 - ], - [ - 125.49366295700011, - 11.58779531500015 - ], - [ - 125.49366295700011, - 11.563381252000099 - ], - [ - 125.49789472700004, - 11.548325914000173 - ], - [ - 125.50196373800006, - 11.539129950000117 - ], - [ - 125.52418053500006, - 11.507310289000173 - ], - [ - 125.53093509200008, - 11.491603908000116 - ], - [ - 125.53101647200006, - 11.475653387000108 - ], - [ - 125.52100670700005, - 11.460353908000144 - ], - [ - 125.52906334700012, - 11.45945872600005 - ], - [ - 125.53451582100004, - 11.458156643000152 - ], - [ - 125.5403751960001, - 11.457912502000113 - ], - [ - 125.54883873800023, - 11.460353908000144 - ], - [ - 125.55420983200005, - 11.436265367000118 - ], - [ - 125.55860436300017, - 11.424790757000082 - ], - [ - 125.56592858200005, - 11.419989325000174 - ], - [ - 125.57618248800011, - 11.41669342700014 - ], - [ - 125.59424889400012, - 11.402167059000107 - ], - [ - 125.60694420700005, - 11.398871161000073 - ], - [ - 125.60906009200019, - 11.393133856000105 - ], - [ - 125.61988366000017, - 11.381089585000083 - ], - [ - 125.63184655000012, - 11.370306708000086 - ], - [ - 125.63770592500023, - 11.368475653000104 - ], - [ - 125.63795006600012, - 11.342352606000148 - ], - [ - 125.63502037900017, - 11.326483466000127 - ], - [ - 125.6271264980002, - 11.313544012000122 - ], - [ - 125.566172722, - 11.26813385600012 - ], - [ - 125.55502363399998, - 11.248032945000176 - ], - [ - 125.55502363399998, - 11.211859442000147 - ], - [ - 125.57178795700011, - 11.192572333000115 - ], - [ - 125.59913170700011, - 11.189113674000112 - ], - [ - 125.63086998800023, - 11.200262762000136 - ], - [ - 125.61605879000015, - 11.218939520000106 - ], - [ - 125.61573326900023, - 11.233872789000145 - ], - [ - 125.62891686300011, - 11.236314195000176 - ], - [ - 125.67497806100002, - 11.203070380000085 - ], - [ - 125.69361412900005, - 11.192572333000115 - ], - [ - 125.70736738400015, - 11.177435614000117 - ], - [ - 125.71273847699999, - 11.148749091000155 - ], - [ - 125.72901451900023, - 11.11737702000012 - ], - [ - 125.76026451900012, - 11.084621486000103 - ], - [ - 125.77963300900004, - 11.052394924000154 - ], - [ - 125.76050866000006, - 11.022772528000104 - ], - [ - 125.75220787900017, - 11.030422268000137 - ], - [ - 125.72877037900017, - 11.042792059000163 - ], - [ - 125.71957441500004, - 11.049465236000131 - ], - [ - 125.71070397200018, - 11.082831122000115 - ], - [ - 125.708750847, - 11.085760809000135 - ], - [ - 125.70720462300008, - 11.088568427000084 - ], - [ - 125.70655358200023, - 11.094142971000096 - ], - [ - 125.70704186300011, - 11.11200592700007 - ], - [ - 125.70606530000023, - 11.116766669000157 - ], - [ - 125.70004316500004, - 11.117865302000098 - ], - [ - 125.68531334700006, - 11.125148830000114 - ], - [ - 125.68100019600004, - 11.129868882000125 - ], - [ - 125.66667728000007, - 11.141669012000179 - ], - [ - 125.65154056100008, - 11.14940013200011 - ], - [ - 125.64437910200004, - 11.142238674000154 - ], - [ - 125.61036217500006, - 11.122015692000133 - ], - [ - 125.60010826900023, - 11.118312893000095 - ], - [ - 125.58806399800002, - 11.122259833000086 - ], - [ - 125.58383222700004, - 11.131740627000099 - ], - [ - 125.58155358200023, - 11.142767645000134 - ], - [ - 125.57545006600017, - 11.15180084800015 - ], - [ - 125.56381269600016, - 11.156805731000176 - ], - [ - 125.55713951900012, - 11.154038804000123 - ], - [ - 125.55014082100004, - 11.148627020000092 - ], - [ - 125.53834069100006, - 11.14565664300008 - ], - [ - 125.53598066499998, - 11.138128973000107 - ], - [ - 125.53109785200004, - 11.102280992000104 - ], - [ - 125.52784264400006, - 11.090399481000148 - ], - [ - 125.50082441500004, - 11.11505768400015 - ], - [ - 125.48243248800011, - 11.12763092700014 - ], - [ - 125.46973717500023, - 11.128566799000126 - ], - [ - 125.45093834700018, - 11.106675523000177 - ], - [ - 125.44019616000017, - 11.097560940000108 - ], - [ - 125.42465254000015, - 11.090399481000148 - ], - [ - 125.4240014980002, - 11.106512762000122 - ], - [ - 125.41651451900023, - 11.116603908000101 - ], - [ - 125.40626061300011, - 11.11713288000007 - ], - [ - 125.39747155000023, - 11.104681708000143 - ], - [ - 125.37378991000006, - 11.125962632000125 - ], - [ - 125.36329186300017, - 11.131984768000137 - ], - [ - 125.32715905000012, - 11.137518622000144 - ], - [ - 125.32162519600004, - 11.142238674000154 - ], - [ - 125.31706790500007, - 11.149562893000066 - ], - [ - 125.30600019600004, - 11.147447007000068 - ], - [ - 125.27572675900004, - 11.135646877000084 - ], - [ - 125.27051842500023, - 11.128078518000137 - ], - [ - 125.26612389400023, - 11.118882554000066 - ], - [ - 125.25456790500002, - 11.101996161000073 - ], - [ - 125.25196373800023, - 11.094671942000076 - ], - [ - 125.246836785, - 11.092189846000139 - ], - [ - 125.24138431100008, - 11.094387111000131 - ], - [ - 125.23292076900023, - 11.097845770000134 - ], - [ - 125.22543379000015, - 11.105536200000145 - ], - [ - 125.21892337300008, - 11.118068752000156 - ], - [ - 125.21412194100017, - 11.13153717700014 - ], - [ - 125.20866946700008, - 11.185044664000145 - ], - [ - 125.19874108200023, - 11.227525132000125 - ], - [ - 125.17237389400023, - 11.2652041690001 - ], - [ - 125.13282311300011, - 11.282131252000084 - ], - [ - 125.08708743600019, - 11.285345770000134 - ], - [ - 125.04175866000017, - 11.282171942000076 - ], - [ - 125.00098717500012, - 11.289780992000118 - ], - [ - 124.99170983200017, - 11.318019924000083 - ], - [ - 125.0001733730002, - 11.398871161000073 - ], - [ - 124.99984785200016, - 11.407131252000156 - ], - [ - 125.00074303500017, - 11.413723049000126 - ], - [ - 125.00294030000023, - 11.419745184000135 - ], - [ - 125.00700931100013, - 11.426174221000153 - ], - [ - 124.999278191, - 11.430324611000088 - ], - [ - 124.97974694100006, - 11.447251695000162 - ], - [ - 124.972422722, - 11.450140692000105 - ], - [ - 124.9583439460001, - 11.45136139500012 - ], - [ - 124.95183353000019, - 11.453517971000124 - ], - [ - 124.93799889400006, - 11.46279531500008 - ], - [ - 124.92644290500007, - 11.473944403000104 - ], - [ - 124.91732832100016, - 11.48704661700016 - ], - [ - 124.91146894600004, - 11.501898505000128 - ], - [ - 124.89649498800011, - 11.470119533000087 - ], - [ - 124.88746178500017, - 11.46552155200014 - ], - [ - 124.86988366000006, - 11.467759507000125 - ], - [ - 124.85613040500002, - 11.47304922100011 - ], - [ - 124.84506269599999, - 11.481756903000175 - ], - [ - 124.83619225400005, - 11.49363841400013 - ], - [ - 124.82829837300008, - 11.508734442000147 - ], - [ - 124.84376061300011, - 11.515773830000114 - ], - [ - 124.85238691499998, - 11.524969794000086 - ], - [ - 124.85954837300002, - 11.53461334800015 - ], - [ - 124.86988366000006, - 11.542873440000136 - ], - [ - 124.88640384200002, - 11.547186591000141 - ], - [ - 124.90007571700008, - 11.548773505000085 - ], - [ - 124.90365644600004, - 11.554266669000114 - ], - [ - 124.89031009200014, - 11.570217190000122 - ], - [ - 124.94874108200011, - 11.570217190000122 - ], - [ - 124.96143639400017, - 11.576971747000144 - ], - [ - 124.97779381600017, - 11.592759507000096 - ], - [ - 124.99244225400017, - 11.611029364000075 - ], - [ - 125.0001733730002, - 11.624823309000178 - ], - [ - 124.99952233200023, - 11.640285549000097 - ], - [ - 124.99439537900005, - 11.655666408000144 - ], - [ - 124.99122155000018, - 11.670314846000153 - ], - [ - 124.99675540500019, - 11.68341705900012 - ], - [ - 125.0184025400001, - 11.706366278000104 - ], - [ - 125.03443444100017, - 11.727850653000132 - ], - [ - 125.03939863400004, - 11.722967841000155 - ], - [ - 125.055430535, - 11.714178778000104 - ], - [ - 125.05420983200011, - 11.738226630000128 - ], - [ - 125.04371178500006, - 11.757757880000113 - ], - [ - 125.02637780000023, - 11.770900783000073 - ], - [ - 125.00359134200019, - 11.775580145000092 - ], - [ - 124.98666425900004, - 11.770249742000118 - ], - [ - 124.94532311300011, - 11.746812242000146 - ], - [ - 124.92823326900023, - 11.741441148000177 - ], - [ - 124.89242597700004, - 11.761460679000066 - ], - [ - 124.83350670700005, - 11.84536367400014 - ], - [ - 124.79411868600019, - 11.858140367000175 - ], - [ - 124.79411868600019, - 11.864976304000109 - ], - [ - 124.80103600400017, - 11.864569403000104 - ], - [ - 124.80787194100012, - 11.864976304000109 - ], - [ - 124.79818769600016, - 11.869818427000084 - ], - [ - 124.79411868600019, - 11.871242580000143 - ], - [ - 124.80787194100012, - 11.899115302000098 - ], - [ - 124.8126733730002, - 11.896144924000097 - ], - [ - 124.81755618600008, - 11.893947658000101 - ], - [ - 124.82276451900023, - 11.890936591000099 - ], - [ - 124.82829837300008, - 11.88544342700007 - ], - [ - 124.82398522200018, - 11.905829169000143 - ], - [ - 124.80982506600006, - 11.915676174000069 - ], - [ - 124.79493248800011, - 11.916449286000088 - ], - [ - 124.77857506600017, - 11.899155992000189 - ], - [ - 124.76107832100004, - 11.90131256700009 - ], - [ - 124.75196373800023, - 11.910305080000114 - ], - [ - 124.76734459700018, - 11.920233466000113 - ], - [ - 124.76205488400004, - 11.929022528000175 - ], - [ - 124.75570722700016, - 11.933294989000089 - ], - [ - 124.7482202480002, - 11.932562567000062 - ], - [ - 124.739512566, - 11.926459052000084 - ], - [ - 124.73747806100019, - 11.953314520000148 - ], - [ - 124.73422285200016, - 11.968207098000107 - ], - [ - 124.72925866000011, - 11.97797272300015 - ], - [ - 124.67986087300014, - 12.029730536000073 - ], - [ - 124.64014733200011, - 12.04535553600006 - ], - [ - 124.60043379000004, - 12.054632880000113 - ], - [ - 124.56934655000012, - 12.050848700000174 - ], - [ - 124.54037519600004, - 12.065741278000132 - ], - [ - 124.49317467500023, - 12.097805080000114 - ], - [ - 124.44646243600002, - 12.153062242000132 - ], - [ - 124.42481530000023, - 12.172837632000068 - ], - [ - 124.42750084700006, - 12.175034898000149 - ], - [ - 124.42823326900023, - 12.17584870000016 - ], - [ - 124.43091881600006, - 12.180324611000117 - ], - [ - 124.40723717500012, - 12.193793036000102 - ], - [ - 124.39079837300014, - 12.221869208000115 - ], - [ - 124.34213300899998, - 12.385728257000096 - ], - [ - 124.27621504000015, - 12.533270575000145 - ], - [ - 124.27393639400017, - 12.546820380000113 - ], - [ - 124.27662194100006, - 12.5585391300001 - ], - [ - 124.28345787900017, - 12.570624091000099 - ], - [ - 124.29346764400023, - 12.579982815000136 - ], - [ - 124.3050236340001, - 12.582993882000139 - ], - [ - 124.31275475400017, - 12.579494533000144 - ], - [ - 124.35840905000012, - 12.544907945000148 - ], - [ - 124.36304772200006, - 12.543605861000145 - ], - [ - 124.37330162900017, - 12.543402411000102 - ], - [ - 124.3986108730002, - 12.554917710000126 - ], - [ - 124.40748131600017, - 12.55707428600013 - ], - [ - 124.41325931100002, - 12.555243231000148 - ], - [ - 124.43848717500006, - 12.543402411000102 - ], - [ - 124.45427493600002, - 12.538397528000147 - ], - [ - 124.51734459700006, - 12.537258205000114 - ], - [ - 124.52149498800006, - 12.53579336100016 - ], - [ - 124.53248131600006, - 12.528794664000173 - ], - [ - 124.53467858200023, - 12.526312567000147 - ], - [ - 124.53679446700002, - 12.522528387000122 - ], - [ - 124.54151451900023, - 12.524155992000146 - ], - [ - 124.54712975400005, - 12.527777411000116 - ], - [ - 124.55144290500007, - 12.529730536000073 - ], - [ - 124.574473504, - 12.527533270000077 - ], - [ - 124.59620201900006, - 12.52293528900013 - ], - [ - 124.67920983200005, - 12.515936591000155 - ], - [ - 124.867930535, - 12.530340887000122 - ], - [ - 124.87720787900017, - 12.53339264500012 - ], - [ - 124.8868921230002, - 12.540350653000104 - ], - [ - 124.89551842500012, - 12.554266669000171 - ], - [ - 124.889903191, - 12.563625393000123 - ], - [ - 124.88021894600016, - 12.572211005000128 - ], - [ - 124.87671959700018, - 12.583726304000066 - ], - [ - 124.87671959700018, - 12.591253973000121 - ], - [ - 124.89478600400017, - 12.58543528900016 - ], - [ - 124.90821373800006, - 12.573716539000173 - ], - [ - 124.91895592500012, - 12.562241929000137 - ] - ] - ], - [ - [ - [ - 123.35531660200016, - 12.547674872000115 - ], - [ - 123.35596764400012, - 12.543402411000102 - ], - [ - 123.33838951900006, - 12.546942450000174 - ], - [ - 123.34034264400012, - 12.531683661000116 - ], - [ - 123.35596764400012, - 12.49559153900016 - ], - [ - 123.35043378999998, - 12.48777903900016 - ], - [ - 123.33855228000002, - 12.479437567000105 - ], - [ - 123.32667076900006, - 12.467922268000066 - ], - [ - 123.32113691500015, - 12.450913804000109 - ], - [ - 123.32642662900005, - 12.438055731000176 - ], - [ - 123.33822675900004, - 12.44529857000019 - ], - [ - 123.35596764400012, - 12.468329169000171 - ], - [ - 123.35865319100017, - 12.469183661000073 - ], - [ - 123.368907097, - 12.469794012000136 - ], - [ - 123.372813347, - 12.47138092700007 - ], - [ - 123.37476647200006, - 12.475775458000143 - ], - [ - 123.37452233200011, - 12.485174872000172 - ], - [ - 123.37582441500004, - 12.488755601000136 - ], - [ - 123.37378991000017, - 12.48965078300013 - ], - [ - 123.37916100400005, - 12.501206773000163 - ], - [ - 123.38648522200006, - 12.512518622000144 - ], - [ - 123.39014733200011, - 12.512396552000084 - ], - [ - 123.39763431100008, - 12.51902903900013 - ], - [ - 123.41472415500019, - 12.520941473000093 - ], - [ - 123.43409264400023, - 12.518622137000136 - ], - [ - 123.44809003999998, - 12.512396552000084 - ], - [ - 123.47982832100016, - 12.481024481000134 - ], - [ - 123.49561608200011, - 12.46857330900012 - ], - [ - 123.51295006600017, - 12.4608828800001 - ], - [ - 123.54712975400017, - 12.4608828800001 - ], - [ - 123.55241946700002, - 12.456610419000171 - ], - [ - 123.564219597, - 12.440375067000133 - ], - [ - 123.57227623800023, - 12.43183014500012 - ], - [ - 123.58139082100004, - 12.413072007000068 - ], - [ - 123.59343509200008, - 12.394354559000178 - ], - [ - 123.60922285199999, - 12.385728257000096 - ], - [ - 123.60922285199999, - 12.378892320000162 - ], - [ - 123.59750410200004, - 12.377875067000105 - ], - [ - 123.59009850400005, - 12.372300523000192 - ], - [ - 123.58716881600012, - 12.36310455900012 - ], - [ - 123.58814537900017, - 12.351019598000121 - ], - [ - 123.62191816500015, - 12.368353583000115 - ], - [ - 123.63697350400017, - 12.370266018000066 - ], - [ - 123.64332116, - 12.354722398000163 - ], - [ - 123.64771569100017, - 12.348293361000145 - ], - [ - 123.65756269600004, - 12.346421617000175 - ], - [ - 123.66895592500006, - 12.34625885600012 - ], - [ - 123.67750084700018, - 12.34479401200015 - ], - [ - 123.688243035, - 12.33779531500008 - ], - [ - 123.69678795700023, - 12.329901434000107 - ], - [ - 123.70435631600017, - 12.32074616100013 - ], - [ - 123.76734459700012, - 12.214056708000115 - ], - [ - 123.79363040500002, - 12.18716054900014 - ], - [ - 123.78842207100004, - 12.23126862200013 - ], - [ - 123.79493248800011, - 12.246893622000115 - ], - [ - 123.81812584700006, - 12.231838283000101 - ], - [ - 123.84880618600008, - 12.200832424000083 - ], - [ - 123.86264082100016, - 12.202866929000109 - ], - [ - 123.87354576900023, - 12.210191148000106 - ], - [ - 123.88233483200011, - 12.212795315000108 - ], - [ - 123.88965905000012, - 12.200832424000083 - ], - [ - 123.88965905000012, - 12.207668361000103 - ], - [ - 123.89942467500023, - 12.187730210000112 - ], - [ - 123.95191491000017, - 12.10455963700015 - ], - [ - 123.958262566, - 12.100572007000082 - ], - [ - 123.97315514400006, - 12.095648505000113 - ], - [ - 123.97917728000019, - 12.090969143000109 - ], - [ - 123.98324629000015, - 12.082342841000099 - ], - [ - 123.99284915500013, - 12.049302476000136 - ], - [ - 123.99830162900017, - 12.03974030200007 - ], - [ - 124.04029381600006, - 11.988104559000107 - ], - [ - 124.05030358200023, - 11.97113678600013 - ], - [ - 124.05494225400005, - 11.954413153000104 - ], - [ - 124.03842207100016, - 11.96454498900006 - ], - [ - 124.01791425900004, - 11.995550848000093 - ], - [ - 123.99952233200005, - 12.00836823100012 - ], - [ - 124.00294030000006, - 11.997788804000066 - ], - [ - 124.00717207099999, - 11.990708726000108 - ], - [ - 124.02076256600006, - 11.974839585000083 - ], - [ - 124.00953209700006, - 11.965765692000076 - ], - [ - 124.01295006600017, - 11.954250393000137 - ], - [ - 124.03386478000002, - 11.926459052000084 - ], - [ - 124.05827884200008, - 11.875189520000134 - ], - [ - 124.06177819100017, - 11.861558335000097 - ], - [ - 124.06177819100017, - 11.837713934000107 - ], - [ - 124.05567467500006, - 11.81053294500019 - ], - [ - 124.05494225400005, - 11.799790757000096 - ], - [ - 124.05909264400006, - 11.78392161700016 - ], - [ - 124.06714928500006, - 11.764105536000145 - ], - [ - 124.07252037900017, - 11.744086005000085 - ], - [ - 124.0685327480002, - 11.727850653000132 - ], - [ - 124.05486087300008, - 11.725572007000068 - ], - [ - 124.04151451900023, - 11.74298737200013 - ], - [ - 124.02076256600006, - 11.78310781500015 - ], - [ - 124.0079858730002, - 11.796698309000107 - ], - [ - 123.97437584700018, - 11.82493724200016 - ], - [ - 123.94564863400015, - 11.83567942900008 - ], - [ - 123.92408287900005, - 11.859564520000148 - ], - [ - 123.89031009200008, - 11.870794989000146 - ], - [ - 123.87517337300008, - 11.88450755400008 - ], - [ - 123.85564212300008, - 11.913397528000104 - ], - [ - 123.84253991, - 11.90615469000008 - ], - [ - 123.8243921230002, - 11.91006094000008 - ], - [ - 123.78736412900017, - 11.926459052000084 - ], - [ - 123.7640080090001, - 11.915676174000069 - ], - [ - 123.74293053500006, - 11.926947333000072 - ], - [ - 123.72510826900006, - 11.944891669000114 - ], - [ - 123.71168053500017, - 11.954413153000104 - ], - [ - 123.71607506600017, - 11.966742255000142 - ], - [ - 123.72242272200012, - 11.975816148000149 - ], - [ - 123.73194420700011, - 11.980902411000073 - ], - [ - 123.74577884200019, - 11.981105861000131 - ], - [ - 123.73267662900005, - 12.00836823100012 - ], - [ - 123.72689863400015, - 11.999335028000104 - ], - [ - 123.72535241000006, - 11.995306708000143 - ], - [ - 123.7190861340001, - 11.995306708000143 - ], - [ - 123.71062259200002, - 12.007391669000143 - ], - [ - 123.69849694100006, - 12.020819403000132 - ], - [ - 123.68539472700016, - 12.031805731000091 - ], - [ - 123.65943444100017, - 12.04295482000012 - ], - [ - 123.65072675899998, - 12.05695221600017 - ], - [ - 123.65300540500007, - 12.069281317000119 - ], - [ - 123.67066491000017, - 12.071030992000118 - ], - [ - 123.64893639400012, - 12.077582098000107 - ], - [ - 123.6290796230002, - 12.075873114000103 - ], - [ - 123.61475670700011, - 12.079331773000192 - ], - [ - 123.60385175900015, - 12.118719794000171 - ], - [ - 123.59099368600013, - 12.135484117000189 - ], - [ - 123.560801629, - 12.166652736000088 - ], - [ - 123.54639733200023, - 12.188055731000134 - ], - [ - 123.53972415500019, - 12.19399648600016 - ], - [ - 123.51075280000006, - 12.20600006700009 - ], - [ - 123.50310306100008, - 12.211004950000117 - ], - [ - 123.48536217500023, - 12.218085028000175 - ], - [ - 123.46159915500007, - 12.215725002000127 - ], - [ - 123.43864993600008, - 12.20840078300013 - ], - [ - 123.42416425900004, - 12.200832424000083 - ], - [ - 123.41236412900017, - 12.188177802000112 - ], - [ - 123.38200931100019, - 12.145086981000176 - ], - [ - 123.37273196700002, - 12.118638414000188 - ], - [ - 123.36475670700005, - 12.10602448100012 - ], - [ - 123.35474694100017, - 12.095404364000075 - ], - [ - 123.34522545700011, - 12.090969143000109 - ], - [ - 123.33375084700006, - 12.08950429900014 - ], - [ - 123.32837975400011, - 12.085272528000118 - ], - [ - 123.32113691500015, - 12.071030992000118 - ], - [ - 123.26596113400015, - 12.007513739000117 - ], - [ - 123.18140709700012, - 11.930853583000058 - ], - [ - 123.15967858200023, - 11.917792059000178 - ], - [ - 123.14991295700011, - 11.930161851000122 - ], - [ - 123.15186608200023, - 11.950384833000129 - ], - [ - 123.15699303500006, - 11.974310614000103 - ], - [ - 123.16472415500007, - 11.994370835000069 - ], - [ - 123.17383873800023, - 12.002834377000099 - ], - [ - 123.18523196700014, - 12.005113023000163 - ], - [ - 123.19011478000019, - 12.011664130000057 - ], - [ - 123.19109134200008, - 12.021185614000146 - ], - [ - 123.19092858200011, - 12.032904364000132 - ], - [ - 123.19320722700016, - 12.046332098000136 - ], - [ - 123.19898522200006, - 12.05658600500007 - ], - [ - 123.20557701900012, - 12.066107489000146 - ], - [ - 123.21127363399998, - 12.077297268000066 - ], - [ - 123.21021569100006, - 12.114976304000137 - ], - [ - 123.21599368600019, - 12.13349030200007 - ], - [ - 123.23194420700011, - 12.12567780200007 - ], - [ - 123.23731530000018, - 12.139227606000134 - ], - [ - 123.24431399800002, - 12.149847723000079 - ], - [ - 123.25464928500006, - 12.156805731000162 - ], - [ - 123.27003014400012, - 12.159165757000125 - ], - [ - 123.27719160200004, - 12.164292710000126 - ], - [ - 123.27344811300011, - 12.17584870000016 - ], - [ - 123.25977623800006, - 12.19399648600016 - ], - [ - 123.27369225400005, - 12.202948309000178 - ], - [ - 123.28663170700023, - 12.208482164000102 - ], - [ - 123.29460696700019, - 12.217230536000088 - ], - [ - 123.29395592500023, - 12.235541083000143 - ], - [ - 123.259532097, - 12.236883856000134 - ], - [ - 123.23698978000007, - 12.23517487200013 - ], - [ - 123.21810957100004, - 12.228094794000157 - ], - [ - 123.21876061300017, - 12.234849351000108 - ], - [ - 123.21778405000006, - 12.26544830900012 - ], - [ - 123.21876061300017, - 12.26801178600013 - ], - [ - 123.22120201900012, - 12.269720770000134 - ], - [ - 123.24878991, - 12.30711497600008 - ], - [ - 123.25228925900004, - 12.320624091000155 - ], - [ - 123.25562584700006, - 12.350287177000098 - ], - [ - 123.27019290500007, - 12.400539455000157 - ], - [ - 123.27344811300011, - 12.423651434000107 - ], - [ - 123.27149498800023, - 12.439439195000148 - ], - [ - 123.26563561300011, - 12.447333075000131 - ], - [ - 123.25586998800006, - 12.453680731000162 - ], - [ - 123.24244225400017, - 12.464585679000137 - ], - [ - 123.23194420700011, - 12.580633856000176 - ], - [ - 123.23471113400015, - 12.592759507000082 - ], - [ - 123.24219811300023, - 12.595363674000083 - ], - [ - 123.25212649800002, - 12.59202708500014 - ], - [ - 123.26221764400012, - 12.586127020000106 - ], - [ - 123.27711022200006, - 12.579535223000136 - ], - [ - 123.30583743600019, - 12.574937242000189 - ], - [ - 123.32113691500015, - 12.570746161000073 - ], - [ - 123.33073978000007, - 12.56435781500015 - ], - [ - 123.33814537900005, - 12.556626695000134 - ], - [ - 123.34734134200019, - 12.550930080000157 - ], - [ - 123.35645592500012, - 12.549261786000145 - ], - [ - 123.35531660200016, - 12.547674872000115 - ] - ] - ], - [ - [ - [ - 122.309825066, - 12.50112539300008 - ], - [ - 122.27963300899998, - 12.474514065000136 - ], - [ - 122.26368248800006, - 12.493231512000108 - ], - [ - 122.25464928500017, - 12.51117584800015 - ], - [ - 122.25114993600019, - 12.529689846000082 - ], - [ - 122.25171959700006, - 12.550238348000121 - ], - [ - 122.25074303500017, - 12.554185289000188 - ], - [ - 122.24822024800008, - 12.559027411000088 - ], - [ - 122.245860222, - 12.5646019550001 - ], - [ - 122.24561608200005, - 12.570746161000073 - ], - [ - 122.24822024800008, - 12.575873114000089 - ], - [ - 122.25570722700004, - 12.578843492000189 - ], - [ - 122.25928795700011, - 12.583726304000066 - ], - [ - 122.26587975400017, - 12.604803778000175 - ], - [ - 122.27100670700011, - 12.613104559000163 - ], - [ - 122.27963300899998, - 12.619126695000162 - ], - [ - 122.27963300899998, - 12.605454820000134 - ], - [ - 122.29688561300011, - 12.573919989000132 - ], - [ - 122.31128991000017, - 12.536688544000143 - ], - [ - 122.309825066, - 12.50112539300008 - ] - ] - ], - [ - [ - [ - 122.15626061300023, - 12.63214752800016 - ], - [ - 122.15137780000006, - 12.6281192080001 - ], - [ - 122.13591556100008, - 12.630275783000101 - ], - [ - 122.12891686300006, - 12.625392971000124 - ], - [ - 122.12867272200006, - 12.6164004580001 - ], - [ - 122.13575280000006, - 12.560777085000083 - ], - [ - 122.13038170700023, - 12.528387762000165 - ], - [ - 122.10694420700017, - 12.459784247000144 - ], - [ - 122.098887566, - 12.38637929900014 - ], - [ - 122.08082116, - 12.315497137000136 - ], - [ - 122.051036004, - 12.242987372000115 - ], - [ - 122.043223504, - 12.231838283000101 - ], - [ - 122.03646894600016, - 12.214056708000115 - ], - [ - 122.04802493600019, - 12.200628973000121 - ], - [ - 122.06120853000007, - 12.188055731000134 - ], - [ - 122.05990644600016, - 12.172837632000068 - ], - [ - 122.04688561300017, - 12.18716054900014 - ], - [ - 122.04102623800011, - 12.17934804900014 - ], - [ - 122.02279707100004, - 12.16282786700016 - ], - [ - 122.01905358200011, - 12.156073309000135 - ], - [ - 122.01905358200011, - 12.10455963700015 - ], - [ - 122.01221764400006, - 12.10455963700015 - ], - [ - 121.9910587900001, - 12.128485419000114 - ], - [ - 121.98617597699999, - 12.142564195000162 - ], - [ - 121.99170983200023, - 12.159165757000125 - ], - [ - 121.9650171230002, - 12.16144440300009 - ], - [ - 121.95899498800011, - 12.177801825000103 - ], - [ - 121.96371504000004, - 12.228094794000157 - ], - [ - 121.97331790500019, - 12.20449453300013 - ], - [ - 121.98715253999998, - 12.200100002000141 - ], - [ - 121.99976647200006, - 12.210638739000103 - ], - [ - 122.00538170700005, - 12.231838283000101 - ], - [ - 122.0021264980002, - 12.244370835000097 - ], - [ - 121.99366295700005, - 12.249212958000086 - ], - [ - 121.982676629, - 12.251410223000079 - ], - [ - 121.97120201900006, - 12.256048895000106 - ], - [ - 121.92969811300006, - 12.29637278900016 - ], - [ - 121.92074629000015, - 12.302883205000157 - ], - [ - 121.92408287900017, - 12.339341539000117 - ], - [ - 121.93441816499998, - 12.3800723330001 - ], - [ - 121.94662519600016, - 12.399400132000125 - ], - [ - 121.97828209700006, - 12.411810614000146 - ], - [ - 121.99317467500006, - 12.44179922100011 - ], - [ - 121.997813347, - 12.478908596000124 - ], - [ - 121.99789472699999, - 12.512396552000084 - ], - [ - 121.99089603000013, - 12.571193752000156 - ], - [ - 121.99586022200018, - 12.59271881700009 - ], - [ - 122.01905358200011, - 12.611721096000096 - ], - [ - 122.07634524800002, - 12.627346096000082 - ], - [ - 122.10499108200011, - 12.641791083000129 - ], - [ - 122.11524498800023, - 12.666327216000141 - ], - [ - 122.14568118600019, - 12.657456773000192 - ], - [ - 122.15601647200012, - 12.648342190000108 - ], - [ - 122.15626061300023, - 12.63214752800016 - ] - ] - ], - [ - [ - [ - 123.646739129, - 12.657131252000084 - ], - [ - 123.69629967500023, - 12.628363348000136 - ], - [ - 123.70484459700018, - 12.625392971000124 - ], - [ - 123.70386803500011, - 12.618841864000132 - ], - [ - 123.70093834700018, - 12.615423895000134 - ], - [ - 123.69117272200006, - 12.611721096000096 - ], - [ - 123.70492597700016, - 12.611721096000096 - ], - [ - 123.71656334700006, - 12.608303127000084 - ], - [ - 123.725840691, - 12.60146719000015 - ], - [ - 123.73267662900005, - 12.591253973000121 - ], - [ - 123.72787519600004, - 12.573635158000101 - ], - [ - 123.73568769600004, - 12.55369700700011 - ], - [ - 123.74732506600006, - 12.53449127800016 - ], - [ - 123.75318444100017, - 12.519232489000089 - ], - [ - 123.75635826900023, - 12.503485419000128 - ], - [ - 123.77051842500018, - 12.471096096000124 - ], - [ - 123.78158613400004, - 12.41868724200016 - ], - [ - 123.78394616000017, - 12.413723049000112 - ], - [ - 123.78939863400004, - 12.409125067000076 - ], - [ - 123.79004967500023, - 12.39834219000008 - ], - [ - 123.78736412900017, - 12.375555731000134 - ], - [ - 123.79330488399998, - 12.35545482000019 - ], - [ - 123.79476972700016, - 12.3433291690001 - ], - [ - 123.79053795700023, - 12.337958075000145 - ], - [ - 123.78248131600012, - 12.341131903000104 - ], - [ - 123.77491295700023, - 12.349025783000087 - ], - [ - 123.76921634200008, - 12.358954169000171 - ], - [ - 123.766856316, - 12.368719794000128 - ], - [ - 123.76254316500004, - 12.378078518000152 - ], - [ - 123.73267662900005, - 12.406236070000134 - ], - [ - 123.58318118600002, - 12.623928127000156 - ], - [ - 123.5802514980002, - 12.63344961100016 - ], - [ - 123.58130944100006, - 12.646429755000057 - ], - [ - 123.58814537900017, - 12.646429755000057 - ], - [ - 123.59734134200008, - 12.641343492000132 - ], - [ - 123.601817254, - 12.654608466000155 - ], - [ - 123.60474694100006, - 12.674017645000077 - ], - [ - 123.60922285199999, - 12.68744538000007 - ], - [ - 123.61833743600019, - 12.687323309000178 - ], - [ - 123.62956790500019, - 12.677639065000136 - ], - [ - 123.646739129, - 12.657131252000084 - ] - ] - ], - [ - [ - [ - 121.70045006600006, - 12.950140692000076 - ], - [ - 121.71412194100017, - 12.947333075000117 - ], - [ - 121.71827233200011, - 12.947333075000117 - ], - [ - 121.72575931100008, - 12.939886786000145 - ], - [ - 121.73170006600012, - 12.928778387000108 - ], - [ - 121.72917728000019, - 12.919134833000143 - ], - [ - 121.72396894599999, - 12.913967190000136 - ], - [ - 121.72046959700012, - 12.913234768000109 - ], - [ - 121.71745853000019, - 12.911078192000105 - ], - [ - 121.71924889400006, - 12.907294012000179 - ], - [ - 121.72217858200011, - 12.903631903000132 - ], - [ - 121.71778405000012, - 12.899603583000072 - ], - [ - 121.71119225400005, - 12.900376695000176 - ], - [ - 121.70671634200008, - 12.905096747000101 - ], - [ - 121.70329837300008, - 12.90412018400012 - ], - [ - 121.69906660200016, - 12.905340887000136 - ], - [ - 121.69166100400017, - 12.914455471000124 - ], - [ - 121.68474368600008, - 12.920152085000112 - ], - [ - 121.68279056100013, - 12.924383856000134 - ], - [ - 121.68181399800002, - 12.935532945000148 - ], - [ - 121.68864993600008, - 12.94717031500015 - ], - [ - 121.70045006600006, - 12.950140692000076 - ] - ] - ], - [ - [ - [ - 123.20142662900017, - 12.906439520000092 - ], - [ - 123.22657311300023, - 12.89834219000015 - ], - [ - 123.24610436300023, - 12.906480210000083 - ], - [ - 123.26197350400017, - 12.897853908000158 - ], - [ - 123.26856530000023, - 12.888169664000117 - ], - [ - 123.27263431100019, - 12.877386786000102 - ], - [ - 123.28028405000012, - 12.864935614000089 - ], - [ - 123.28663170700023, - 12.815008856000134 - ], - [ - 123.36085045700005, - 12.736517645000106 - ], - [ - 123.37582441500004, - 12.69358958500014 - ], - [ - 123.34107506600006, - 12.718207098000136 - ], - [ - 123.27344811300011, - 12.810939846000082 - ], - [ - 123.25196373800006, - 12.83270905200014 - ], - [ - 123.2384546230002, - 12.841498114000117 - ], - [ - 123.20101972700016, - 12.848822333000115 - ], - [ - 123.18531334700012, - 12.858465887000179 - ], - [ - 123.10987389400023, - 12.923895575000145 - ], - [ - 123.10206139400017, - 12.937567450000174 - ], - [ - 123.09791100400005, - 12.938910223000079 - ], - [ - 123.08033287900011, - 12.957220770000134 - ], - [ - 123.07789147200006, - 12.961737372000172 - ], - [ - 123.06967207100016, - 12.964789130000085 - ], - [ - 123.06609134200019, - 12.971991278000118 - ], - [ - 123.06381269600004, - 12.980861721000153 - ], - [ - 123.06055748800006, - 12.988470770000106 - ], - [ - 123.0354923840001, - 13.004380601000122 - ], - [ - 122.97388756600006, - 13.018703518000109 - ], - [ - 122.95069420700011, - 13.043687242000118 - ], - [ - 122.94410241000006, - 13.0995547550001 - ], - [ - 122.94450931100002, - 13.111314195000162 - ], - [ - 122.95826256600006, - 13.120021877000156 - ], - [ - 122.97543379000015, - 13.121893622000115 - ], - [ - 122.98894290500007, - 13.128973700000174 - ], - [ - 122.99219811300011, - 13.153550523000192 - ], - [ - 123.00391686300006, - 13.150213934000163 - ], - [ - 123.01710045700023, - 13.143622137000179 - ], - [ - 123.03980553500017, - 13.128078518000095 - ], - [ - 123.04981530000023, - 13.118475653000118 - ], - [ - 123.05884850400017, - 13.107855536000073 - ], - [ - 123.07422936300011, - 13.08466217700014 - ], - [ - 123.09457441499998, - 13.043687242000118 - ], - [ - 123.11833743600019, - 13.024603583000129 - ], - [ - 123.12208092500023, - 13.019761460000069 - ], - [ - 123.1251733730002, - 13.008042710000069 - ], - [ - 123.13933353000007, - 12.983384507000082 - ], - [ - 123.14242597700004, - 12.971380927000055 - ], - [ - 123.14503014400012, - 12.968736070000162 - ], - [ - 123.16016686300011, - 12.937567450000174 - ], - [ - 123.177012566, - 12.922308661000116 - ], - [ - 123.20142662900017, - 12.906439520000092 - ] - ] - ], - [ - [ - [ - 124.20915774800008, - 13.178208726000094 - ], - [ - 124.19678795700023, - 13.173325914000117 - ], - [ - 124.16236412900017, - 13.180812893000095 - ], - [ - 124.14861087300008, - 13.18577708500014 - ], - [ - 124.13624108200023, - 13.188544012000094 - ], - [ - 124.11378014400023, - 13.189032294000171 - ], - [ - 124.097911004, - 13.192450262000179 - ], - [ - 124.06902103000019, - 13.203762111000074 - ], - [ - 124.06560306100019, - 13.21076080900015 - ], - [ - 124.08472741000006, - 13.21698639500012 - ], - [ - 124.11410566500015, - 13.227728583000129 - ], - [ - 124.12378991, - 13.233140367000175 - ], - [ - 124.13884524800002, - 13.234198309000135 - ], - [ - 124.17872155000012, - 13.222967841000127 - ], - [ - 124.19792728000007, - 13.213039455000128 - ], - [ - 124.20964603000007, - 13.195786851000122 - ], - [ - 124.20915774800008, - 13.178208726000094 - ] - ] - ], - [ - [ - [ - 123.96257571700014, - 13.287339585000126 - ], - [ - 123.98682701900012, - 13.276027736000145 - ], - [ - 123.99537194100006, - 13.278794664000117 - ], - [ - 124.00245201900012, - 13.281073309000178 - ], - [ - 124.0157983730002, - 13.280422268000137 - ], - [ - 124.01693769600016, - 13.28034088700015 - ], - [ - 124.01807701900006, - 13.278998114000075 - ], - [ - 124.02556399800002, - 13.270168361000103 - ], - [ - 124.03256269600004, - 13.266750393000095 - ], - [ - 124.03825931100019, - 13.269680080000114 - ], - [ - 124.03858483200023, - 13.27399323100012 - ], - [ - 124.03956139400012, - 13.278509833000086 - ], - [ - 124.04769941500004, - 13.278957424000083 - ], - [ - 124.056407097, - 13.27606842700014 - ], - [ - 124.06918379000015, - 13.273016669000143 - ], - [ - 124.08448326900012, - 13.26740143400015 - ], - [ - 124.08562259200008, - 13.262925523000177 - ], - [ - 124.08627363399998, - 13.26044342700007 - ], - [ - 124.07309004000015, - 13.254055080000128 - ], - [ - 124.06755618600002, - 13.25141022300015 - ], - [ - 124.06226647200006, - 13.245428778000132 - ], - [ - 124.056407097, - 13.235988674000112 - ], - [ - 124.04615319100017, - 13.226385809000135 - ], - [ - 124.03948001400013, - 13.224961656000161 - ], - [ - 124.02540123800006, - 13.221991278000147 - ], - [ - 124.01742597700004, - 13.223781643000137 - ], - [ - 123.99789472700016, - 13.228216864000117 - ], - [ - 123.97673587300002, - 13.235581773000106 - ], - [ - 123.95834394599999, - 13.23704661700016 - ], - [ - 123.93930097700004, - 13.244452216000155 - ], - [ - 123.92188561300023, - 13.258693752000156 - ], - [ - 123.9139103520001, - 13.271307684000135 - ], - [ - 123.91480553500017, - 13.279608466000127 - ], - [ - 123.91285241000006, - 13.285142320000134 - ], - [ - 123.91244550900004, - 13.288641669000128 - ], - [ - 123.9139103520001, - 13.289455471000139 - ], - [ - 123.91472415500019, - 13.289943752000127 - ], - [ - 123.96257571700014, - 13.287339585000126 - ] - ] - ], - [ - [ - [ - 123.88428795700023, - 13.229925848000121 - ], - [ - 123.87354576900023, - 13.229641018000095 - ], - [ - 123.86361738400004, - 13.244777736000088 - ], - [ - 123.85775800899998, - 13.250148830000143 - ], - [ - 123.845957879, - 13.270249742000175 - ], - [ - 123.84449303500006, - 13.282416083000072 - ], - [ - 123.849375847, - 13.299139716000099 - ], - [ - 123.85108483200023, - 13.317572333000129 - ], - [ - 123.84717858200023, - 13.330877997000158 - ], - [ - 123.83676191500015, - 13.344671942000076 - ], - [ - 123.84009850400017, - 13.34853750200007 - ], - [ - 123.84888756600006, - 13.35415273600016 - ], - [ - 123.85889733200011, - 13.353827216000141 - ], - [ - 123.90007571700019, - 13.340521552000126 - ], - [ - 123.90609785199999, - 13.335598049000154 - ], - [ - 123.91342207099999, - 13.332220770000148 - ], - [ - 123.92212975400017, - 13.329982815000065 - ], - [ - 123.92212975400017, - 13.320013739000075 - ], - [ - 123.89527428500011, - 13.29287344000015 - ], - [ - 123.89031009200008, - 13.274074611000103 - ], - [ - 123.89665774800008, - 13.258490302000112 - ], - [ - 123.90357506600017, - 13.246486721000096 - ], - [ - 123.90186608200005, - 13.23834870000016 - ], - [ - 123.88428795700023, - 13.229925848000121 - ] - ] - ], - [ - [ - [ - 123.8204858730002, - 13.38027578300013 - ], - [ - 123.82748457099999, - 13.373114325000174 - ], - [ - 123.83301842500012, - 13.373236395000148 - ], - [ - 123.84294681100019, - 13.371812242000175 - ], - [ - 123.84555097699999, - 13.367824611000103 - ], - [ - 123.83472741, - 13.355902411000073 - ], - [ - 123.82309004000004, - 13.351955471000082 - ], - [ - 123.80152428500011, - 13.366034247000115 - ], - [ - 123.77515709700018, - 13.39158763200011 - ], - [ - 123.7716577480002, - 13.403509833000143 - ], - [ - 123.78736412900017, - 13.399074611000074 - ], - [ - 123.80420983200005, - 13.391546942000119 - ], - [ - 123.8204858730002, - 13.38027578300013 - ] - ] - ], - [ - [ - [ - 120.97868899800008, - 13.52651601800008 - ], - [ - 120.98438561300023, - 13.522894598000121 - ], - [ - 120.97966556100002, - 13.514146226000136 - ], - [ - 120.97388756600017, - 13.507757880000128 - ], - [ - 120.96656334700018, - 13.503973700000103 - ], - [ - 120.95704186300006, - 13.502997137000122 - ], - [ - 120.96306399800008, - 13.494330145000134 - ], - [ - 120.97315514400023, - 13.482733466000113 - ], - [ - 120.98462975400011, - 13.47260163000007 - ], - [ - 120.99488366, - 13.46824778900016 - ], - [ - 121.00391686300023, - 13.459662177000055 - ], - [ - 121.02686608200011, - 13.421576239000075 - ], - [ - 121.04273522200006, - 13.413031317000147 - ], - [ - 121.10865319100017, - 13.41596100500007 - ], - [ - 121.12525475400005, - 13.404771226000065 - ], - [ - 121.12159264400012, - 13.372015692000133 - ], - [ - 121.12826582100016, - 13.372015692000133 - ], - [ - 121.130137566, - 13.378363348000079 - ], - [ - 121.13282311300011, - 13.393622137000136 - ], - [ - 121.13510175900015, - 13.399359442000105 - ], - [ - 121.13933353000019, - 13.405422268000109 - ], - [ - 121.14112389400006, - 13.407416083000143 - ], - [ - 121.14877363400004, - 13.413031317000147 - ], - [ - 121.15886478000007, - 13.4175479190001 - ], - [ - 121.171641472, - 13.4214541690001 - ], - [ - 121.18336022200012, - 13.428127346000153 - ], - [ - 121.19027753999998, - 13.440904039000188 - ], - [ - 121.19711347700004, - 13.440904039000188 - ], - [ - 121.21778405000023, - 13.404120184000107 - ], - [ - 121.33375084700018, - 13.310614325000145 - ], - [ - 121.37623131600017, - 13.24510325700011 - ], - [ - 121.39210045700011, - 13.235500393000123 - ], - [ - 121.41391035200004, - 13.23273346600017 - ], - [ - 121.43051191499998, - 13.224269924000126 - ], - [ - 121.44076582100004, - 13.209418036000073 - ], - [ - 121.44361412900017, - 13.187689520000092 - ], - [ - 121.44068444100006, - 13.177435614000075 - ], - [ - 121.43555748800023, - 13.166693427000055 - ], - [ - 121.43262780000012, - 13.156073309000107 - ], - [ - 121.43628991000017, - 13.146063544000128 - ], - [ - 121.44752037900017, - 13.138983466000155 - ], - [ - 121.45899498800011, - 13.139715887000094 - ], - [ - 121.47022545700011, - 13.143744208000072 - ], - [ - 121.48121178500017, - 13.146063544000128 - ], - [ - 121.50464928500006, - 13.145168361000131 - ], - [ - 121.52702884200008, - 13.140773830000143 - ], - [ - 121.54444420700023, - 13.130316473000079 - ], - [ - 121.55298912900017, - 13.111314195000162 - ], - [ - 121.54916425900015, - 13.090643622000144 - ], - [ - 121.535899285, - 13.07684967700014 - ], - [ - 121.501719597, - 13.054266669000171 - ], - [ - 121.48951256600006, - 13.036769924000126 - ], - [ - 121.48316491, - 13.014715887000122 - ], - [ - 121.48194420700011, - 12.990871486000145 - ], - [ - 121.49244225400017, - 12.929510809000135 - ], - [ - 121.49203535200016, - 12.913316148000177 - ], - [ - 121.48308353000002, - 12.872137762000122 - ], - [ - 121.48462975400017, - 12.858710028000132 - ], - [ - 121.47779381600006, - 12.858710028000132 - ], - [ - 121.48340905000023, - 12.831122137000108 - ], - [ - 121.48560631600006, - 12.768459377000113 - ], - [ - 121.49512780000023, - 12.745428778000147 - ], - [ - 121.52247155000012, - 12.711493231000105 - ], - [ - 121.52613366000017, - 12.704494533000116 - ], - [ - 121.52735436300011, - 12.692206122000158 - ], - [ - 121.53093509200008, - 12.676011460000112 - ], - [ - 121.53638756600012, - 12.660345770000134 - ], - [ - 121.54639733200005, - 12.6441104190001 - ], - [ - 121.54737389400023, - 12.636908270000148 - ], - [ - 121.54566491000006, - 12.611232815000108 - ], - [ - 121.54273522200006, - 12.609035549000112 - ], - [ - 121.53825931100008, - 12.609198309000163 - ], - [ - 121.53239993600002, - 12.605454820000134 - ], - [ - 121.49341881600006, - 12.549261786000145 - ], - [ - 121.48145592500012, - 12.539007880000113 - ], - [ - 121.45671634200002, - 12.52293528900013 - ], - [ - 121.448985222, - 12.520819403000118 - ], - [ - 121.44239342500023, - 12.522406317000147 - ], - [ - 121.43783613400004, - 12.521633205000128 - ], - [ - 121.43628991000017, - 12.512396552000084 - ], - [ - 121.43677819100006, - 12.495917059000178 - ], - [ - 121.43897545700023, - 12.489243882000125 - ], - [ - 121.44361412900017, - 12.482001044000114 - ], - [ - 121.43628991000017, - 12.474514065000136 - ], - [ - 121.43002363400004, - 12.482001044000114 - ], - [ - 121.42628014400006, - 12.475083726000108 - ], - [ - 121.42465254000015, - 12.470038153000175 - ], - [ - 121.42562910200004, - 12.464097398000149 - ], - [ - 121.43002363400004, - 12.454657294000128 - ], - [ - 121.411875847, - 12.443182684000178 - ], - [ - 121.41244550899998, - 12.414984442000119 - ], - [ - 121.42530358200011, - 12.384222723000136 - ], - [ - 121.44361412900017, - 12.365301825000117 - ], - [ - 121.44361412900017, - 12.358465887000094 - ], - [ - 121.40333092500006, - 12.36981842700007 - ], - [ - 121.38428795700011, - 12.36859772300015 - ], - [ - 121.38160241, - 12.351019598000121 - ], - [ - 121.38721764400012, - 12.344712632000082 - ], - [ - 121.38892662900005, - 12.336371161000116 - ], - [ - 121.38697350400017, - 12.326890367000189 - ], - [ - 121.38160241, - 12.31753164300008 - ], - [ - 121.39039147200018, - 12.313055731000105 - ], - [ - 121.39454186300023, - 12.30768463700015 - ], - [ - 121.39584394600004, - 12.300238348000079 - ], - [ - 121.39576256600006, - 12.28953685100005 - ], - [ - 121.36573326900012, - 12.307766018000123 - ], - [ - 121.35474694100006, - 12.324123440000136 - ], - [ - 121.34017988400004, - 12.316636460000083 - ], - [ - 121.31641686300011, - 12.29637278900016 - ], - [ - 121.30339603000002, - 12.293402411000145 - ], - [ - 121.29127037900005, - 12.286200262000122 - ], - [ - 121.27295983200005, - 12.269029039000188 - ], - [ - 121.24781334700018, - 12.219916083000072 - ], - [ - 121.24496504000015, - 12.214422919000128 - ], - [ - 121.23015384200008, - 12.214341539000145 - ], - [ - 121.20777428500006, - 12.236029364000132 - ], - [ - 121.19369550900004, - 12.2417666690001 - ], - [ - 121.13168379000015, - 12.2417666690001 - ], - [ - 121.11361738400015, - 12.251288153000104 - ], - [ - 121.09913170700011, - 12.274644273000192 - ], - [ - 121.09327233200023, - 12.303697007000082 - ], - [ - 121.10108483200023, - 12.330511786000073 - ], - [ - 121.10694420700005, - 12.314357815000108 - ], - [ - 121.11597741000011, - 12.30524323100012 - ], - [ - 121.12818444100017, - 12.30365631700009 - ], - [ - 121.14258873800023, - 12.310044664000188 - ], - [ - 121.1349389980002, - 12.31346263200011 - ], - [ - 121.12818444100017, - 12.31293366100013 - ], - [ - 121.12159264400012, - 12.310044664000188 - ], - [ - 121.11540774800014, - 12.327541408000144 - ], - [ - 121.11475670700005, - 12.330511786000073 - ], - [ - 121.09441165500019, - 12.345404364000117 - ], - [ - 121.08725019600004, - 12.343247789000117 - ], - [ - 121.08725019600004, - 12.32367584800015 - ], - [ - 121.07113691500015, - 12.332505601000108 - ], - [ - 121.05062910200004, - 12.349432684000178 - ], - [ - 121.03288821700014, - 12.368109442000076 - ], - [ - 121.02051842500006, - 12.389797268000137 - ], - [ - 120.99488366, - 12.413723049000112 - ], - [ - 120.98682701900006, - 12.416205145000134 - ], - [ - 120.98113040500019, - 12.42267487200013 - ], - [ - 120.93897545700017, - 12.493963934000135 - ], - [ - 120.92603600400005, - 12.501857815000108 - ], - [ - 120.91635175899998, - 12.512396552000084 - ], - [ - 120.91846764400012, - 12.536281643000137 - ], - [ - 120.92904707100016, - 12.577582098000093 - ], - [ - 120.9279077480002, - 12.597601630000057 - ], - [ - 120.92212975400005, - 12.617092190000136 - ], - [ - 120.91244550899998, - 12.63471100500007 - ], - [ - 120.88591556100002, - 12.664984442000062 - ], - [ - 120.86866295700023, - 12.69965241100013 - ], - [ - 120.85450280000012, - 12.715318101000108 - ], - [ - 120.83220462300008, - 12.724025783000101 - ], - [ - 120.81226647200018, - 12.72426992400014 - ], - [ - 120.79786217500012, - 12.729437567000147 - ], - [ - 120.79249108200017, - 12.752590236000088 - ], - [ - 120.79135175900004, - 12.763861395000077 - ], - [ - 120.78630618600019, - 12.78261953300013 - ], - [ - 120.78516686300023, - 12.793850002000141 - ], - [ - 120.78199303500017, - 12.805568752000127 - ], - [ - 120.76531009200002, - 12.83144765800013 - ], - [ - 120.76644941499998, - 12.84052155200014 - ], - [ - 120.77084394600016, - 12.847113348000107 - ], - [ - 120.77588951900012, - 12.852728583000115 - ], - [ - 120.77898196700008, - 12.858710028000132 - ], - [ - 120.77963300900004, - 12.867905992000189 - ], - [ - 120.77670332100004, - 12.916083075000145 - ], - [ - 120.76742597700016, - 12.946844794000128 - ], - [ - 120.75831139400017, - 13.002386786000088 - ], - [ - 120.74097741000017, - 13.033270575000131 - ], - [ - 120.69695071700008, - 13.092108466000113 - ], - [ - 120.66488691499998, - 13.15591054900014 - ], - [ - 120.64234459700012, - 13.183254299000126 - ], - [ - 120.59457441500015, - 13.199204820000134 - ], - [ - 120.57634524800008, - 13.221421617000175 - ], - [ - 120.55982506600012, - 13.228664455000114 - ], - [ - 120.525157097, - 13.225653387000108 - ], - [ - 120.51482181100013, - 13.230536200000174 - ], - [ - 120.5262150400001, - 13.249172268000066 - ], - [ - 120.49976647200012, - 13.27334219000008 - ], - [ - 120.47999108200005, - 13.301499742000146 - ], - [ - 120.46778405000012, - 13.333482164000145 - ], - [ - 120.45972741000017, - 13.403713283000101 - ], - [ - 120.45248457100004, - 13.42023346600017 - ], - [ - 120.43995201900023, - 13.42723216400016 - ], - [ - 120.43262780000023, - 13.42670319200009 - ], - [ - 120.41504967500012, - 13.423000393000137 - ], - [ - 120.40821373800006, - 13.42047760600012 - ], - [ - 120.40015709700006, - 13.415025132000082 - ], - [ - 120.39576256600017, - 13.40949127800016 - ], - [ - 120.39242597700004, - 13.404201565000093 - ], - [ - 120.38786868600019, - 13.399359442000105 - ], - [ - 120.36817467500023, - 13.383368231000105 - ], - [ - 120.35596764400006, - 13.380519924000069 - ], - [ - 120.34009850400005, - 13.386297919000128 - ], - [ - 120.32764733200023, - 13.396877346000082 - ], - [ - 120.31690514400012, - 13.411200262000165 - ], - [ - 120.30933678500017, - 13.427639065000065 - ], - [ - 120.30665123800011, - 13.44432200700011 - ], - [ - 120.31055748800006, - 13.466986395000148 - ], - [ - 120.32154381600006, - 13.487779039000145 - ], - [ - 120.337657097, - 13.505316473000093 - ], - [ - 120.35661868600002, - 13.518377997000158 - ], - [ - 120.38013756600017, - 13.526353257000125 - ], - [ - 120.40316816500015, - 13.52732982000019 - ], - [ - 120.47169030000012, - 13.51154205900015 - ], - [ - 120.53191165500007, - 13.509222723000093 - ], - [ - 120.54468834700012, - 13.510931708000086 - ], - [ - 120.55518639400006, - 13.513495184000092 - ], - [ - 120.56544030000012, - 13.513128973000079 - ], - [ - 120.58472741000006, - 13.501857815000093 - ], - [ - 120.59538821700008, - 13.498928127000156 - ], - [ - 120.61443118600008, - 13.496161200000103 - ], - [ - 120.65333092500023, - 13.496568101000108 - ], - [ - 120.67652428500011, - 13.492987372000144 - ], - [ - 120.69019616000006, - 13.481878973000107 - ], - [ - 120.7063908210001, - 13.490383205000143 - ], - [ - 120.71924889400012, - 13.485174872000144 - ], - [ - 120.73731530000012, - 13.46824778900016 - ], - [ - 120.75456790500002, - 13.466742255000113 - ], - [ - 120.77003014400023, - 13.47068919500019 - ], - [ - 120.79932701900006, - 13.481878973000107 - ], - [ - 120.88819420700011, - 13.501857815000093 - ], - [ - 120.91537519600004, - 13.51666901200015 - ], - [ - 120.92839603000019, - 13.504950262000165 - ], - [ - 120.93677819100017, - 13.507513739000089 - ], - [ - 120.94483483200011, - 13.512844143000137 - ], - [ - 120.95020592500023, - 13.530340887000094 - ], - [ - 120.96436608200005, - 13.526353257000125 - ], - [ - 120.969004754, - 13.527167059000135 - ], - [ - 120.97738691500015, - 13.530340887000094 - ], - [ - 120.97868899800008, - 13.52651601800008 - ] - ] - ], - [ - [ - [ - 121.88754316500004, - 13.554754950000145 - ], - [ - 121.90919030000012, - 13.522894598000121 - ], - [ - 121.91374759200008, - 13.52863190300009 - ], - [ - 121.92505944100006, - 13.538641669000171 - ], - [ - 121.92969811300006, - 13.544623114000089 - ], - [ - 121.94499759200002, - 13.528998114000103 - ], - [ - 121.968028191, - 13.523749091000127 - ], - [ - 121.98902428500006, - 13.530462958000072 - ], - [ - 121.99789472699999, - 13.550767320000162 - ], - [ - 122.01099694100017, - 13.542141018000066 - ], - [ - 122.02019290500002, - 13.53363678600013 - ], - [ - 122.02344811300006, - 13.523179429000066 - ], - [ - 122.01905358200011, - 13.509222723000093 - ], - [ - 122.03394616000006, - 13.514634507000125 - ], - [ - 122.04517662900005, - 13.509222723000093 - ], - [ - 122.04867597700004, - 13.498765367000189 - ], - [ - 122.03956139400023, - 13.489325262000179 - ], - [ - 122.0437931650001, - 13.48533763200011 - ], - [ - 122.05469811300023, - 13.478094794000086 - ], - [ - 122.05990644600016, - 13.475734768000137 - ], - [ - 122.07520592500012, - 13.485419012000179 - ], - [ - 122.09669030000023, - 13.479681708000115 - ], - [ - 122.11524498800023, - 13.464992580000114 - ], - [ - 122.12208092500023, - 13.447739976000108 - ], - [ - 122.118418816, - 13.443101304000095 - ], - [ - 122.11133873800023, - 13.441392320000176 - ], - [ - 122.10157311300011, - 13.440904039000188 - ], - [ - 122.10084069100017, - 13.433905341000113 - ], - [ - 122.10157311300011, - 13.416693427000098 - ], - [ - 122.10547936300011, - 13.408433335000112 - ], - [ - 122.12370853000019, - 13.39520905200007 - ], - [ - 122.12891686300006, - 13.386297919000128 - ], - [ - 122.12029056100008, - 13.3566348330001 - ], - [ - 122.06202233200017, - 13.298570054000137 - ], - [ - 122.03956139400023, - 13.269598700000131 - ], - [ - 122.04908287900005, - 13.248358466000155 - ], - [ - 122.04029381600017, - 13.23069896000014 - ], - [ - 122.00879967500006, - 13.204779364000132 - ], - [ - 121.99317467500006, - 13.201605536000073 - ], - [ - 121.9767358730002, - 13.21308014500012 - ], - [ - 121.96257571700008, - 13.22801341400016 - ], - [ - 121.95386803500017, - 13.235500393000123 - ], - [ - 121.94288170700023, - 13.240179755000142 - ], - [ - 121.90919030000012, - 13.269598700000131 - ], - [ - 121.90072675899998, - 13.271958726000094 - ], - [ - 121.88347415500007, - 13.273179429000109 - ], - [ - 121.87501061300023, - 13.27643463700015 - ], - [ - 121.86491946700008, - 13.284369208000115 - ], - [ - 121.84766686300017, - 13.310614325000145 - ], - [ - 121.81723066500004, - 13.3419457050001 - ], - [ - 121.813731316, - 13.352240302000112 - ], - [ - 121.81788170700017, - 13.375799872000158 - ], - [ - 121.81723066500004, - 13.382879950000117 - ], - [ - 121.81413821700014, - 13.397528387000136 - ], - [ - 121.8143009770001, - 13.45050690300016 - ], - [ - 121.81723066500004, - 13.464829820000148 - ], - [ - 121.82439212300002, - 13.474066473000121 - ], - [ - 121.85075931100008, - 13.520941473000079 - ], - [ - 121.85385175900004, - 13.530340887000094 - ], - [ - 121.8556421230002, - 13.558417059000107 - ], - [ - 121.858653191, - 13.56549713700015 - ], - [ - 121.87305748800006, - 13.568508205000157 - ], - [ - 121.88754316500004, - 13.554754950000145 - ] - ] - ], - [ - [ - [ - 121.0857853520001, - 13.57062409100017 - ], - [ - 121.09131920700011, - 13.562323309000092 - ], - [ - 121.09424889400012, - 13.537054755000142 - ], - [ - 121.08863366, - 13.530340887000094 - ], - [ - 121.07211347700004, - 13.535834052000126 - ], - [ - 121.04346764400006, - 13.56122467700014 - ], - [ - 121.04346764400006, - 13.567572333000086 - ], - [ - 121.05128014400017, - 13.56777578300013 - ], - [ - 121.05811608200005, - 13.565090236000145 - ], - [ - 121.06690514400023, - 13.567206122000158 - ], - [ - 121.07748457099999, - 13.57225169500019 - ], - [ - 121.0857853520001, - 13.57062409100017 - ] - ] - ], - [ - [ - [ - 120.16407311300006, - 13.834906317000119 - ], - [ - 120.168711785, - 13.824530341000113 - ], - [ - 120.183360222, - 13.828802802000126 - ], - [ - 120.20264733200017, - 13.824611721000096 - ], - [ - 120.22217858200023, - 13.815415757000125 - ], - [ - 120.23764082100016, - 13.804632880000113 - ], - [ - 120.27173912900017, - 13.752508856000176 - ], - [ - 120.26677493600013, - 13.741278387000179 - ], - [ - 120.25733483200011, - 13.733099677000084 - ], - [ - 120.25269616000017, - 13.724432684000178 - ], - [ - 120.26091556100008, - 13.711574611000145 - ], - [ - 120.26929772200006, - 13.707342841000127 - ], - [ - 120.27719160199999, - 13.706040757000139 - ], - [ - 120.28305097700016, - 13.70246002800016 - ], - [ - 120.285411004, - 13.69139232000012 - ], - [ - 120.26856530000012, - 13.678697007000068 - ], - [ - 120.26433353000019, - 13.673732815000108 - ], - [ - 120.25782311300011, - 13.68211497600008 - ], - [ - 120.25082441500004, - 13.693793036000073 - ], - [ - 120.24317467500006, - 13.704046942000105 - ], - [ - 120.23389733200023, - 13.708441473000079 - ], - [ - 120.21949303500017, - 13.711249091000127 - ], - [ - 120.21363366, - 13.718247789000117 - ], - [ - 120.210215691, - 13.727199611000131 - ], - [ - 120.2034611340001, - 13.73578522300015 - ], - [ - 120.19288170700011, - 13.742580471000082 - ], - [ - 120.18279056100008, - 13.746730861000117 - ], - [ - 120.17188561300006, - 13.74884674700013 - ], - [ - 120.15886478000019, - 13.749416408000101 - ], - [ - 120.15251712300008, - 13.752630927000055 - ], - [ - 120.14112389400012, - 13.766750393000095 - ], - [ - 120.10824629000004, - 13.776841539000145 - ], - [ - 120.09229576900012, - 13.794501044000157 - ], - [ - 120.08285566499998, - 13.817938544000143 - ], - [ - 120.07992597700016, - 13.842230536000116 - ], - [ - 120.08130944100006, - 13.852932033000144 - ], - [ - 120.085703972, - 13.860785223000121 - ], - [ - 120.09302819100006, - 13.865301825000174 - ], - [ - 120.10368899800008, - 13.86627838700015 - ], - [ - 120.11833743600008, - 13.860825914000117 - ], - [ - 120.142832879, - 13.848700262000122 - ], - [ - 120.16407311300006, - 13.834906317000119 - ] - ] - ], - [ - [ - [ - 124.23585045700005, - 14.068060614000146 - ], - [ - 124.25261478000019, - 14.046698309000107 - ], - [ - 124.26563561300011, - 14.022691148000149 - ], - [ - 124.27393639400017, - 13.996486721000124 - ], - [ - 124.27735436300006, - 13.955511786000102 - ], - [ - 124.28687584700018, - 13.952582098000079 - ], - [ - 124.29542076900012, - 13.94550202000012 - ], - [ - 124.30811608200017, - 13.92816803600013 - ], - [ - 124.30062910199999, - 13.920721747000144 - ], - [ - 124.30543053500017, - 13.91404857000019 - ], - [ - 124.30689537900005, - 13.91120026200015 - ], - [ - 124.30811608200017, - 13.906439520000148 - ], - [ - 124.31495201900006, - 13.906439520000148 - ], - [ - 124.32976321700008, - 13.933091539000188 - ], - [ - 124.35775800900015, - 13.920599677000084 - ], - [ - 124.41797936300023, - 13.872951565000108 - ], - [ - 124.41797936300023, - 13.86546458500014 - ], - [ - 124.40349368600019, - 13.85683828300013 - ], - [ - 124.38998457100004, - 13.845648505000128 - ], - [ - 124.40357506600017, - 13.838812567000105 - ], - [ - 124.40984134200019, - 13.826402085000083 - ], - [ - 124.41293378999998, - 13.811672268000095 - ], - [ - 124.41797936300023, - 13.797796942000105 - ], - [ - 124.3987736340001, - 13.790432033000101 - ], - [ - 124.38998457100004, - 13.790350653000118 - ], - [ - 124.39722741000006, - 13.779608466000113 - ], - [ - 124.3987736340001, - 13.77118561400006 - ], - [ - 124.39576256600017, - 13.74237702000012 - ], - [ - 124.39112389400023, - 13.721869208000072 - ], - [ - 124.38998457100004, - 13.711574611000145 - ], - [ - 124.40748131600017, - 13.6837425800001 - ], - [ - 124.40870201900006, - 13.667303778000104 - ], - [ - 124.38656660199999, - 13.66006094000008 - ], - [ - 124.36605879000015, - 13.66071198100012 - ], - [ - 124.35531660200004, - 13.659613348000079 - ], - [ - 124.35084069100017, - 13.651800848000093 - ], - [ - 124.34913170700005, - 13.6327578800001 - ], - [ - 124.33334394600004, - 13.572455145000148 - ], - [ - 124.33472741000011, - 13.557603257000096 - ], - [ - 124.31983483200023, - 13.56777578300013 - ], - [ - 124.30640709700006, - 13.588527736000131 - ], - [ - 124.29346764400023, - 13.604071356000134 - ], - [ - 124.28077233200011, - 13.598578192000105 - ], - [ - 124.26807701900012, - 13.60219961100016 - ], - [ - 124.25163821700002, - 13.599188544000157 - ], - [ - 124.23519941500004, - 13.591538804000137 - ], - [ - 124.22266686300023, - 13.581854559000163 - ], - [ - 124.21534264400023, - 13.567531643000095 - ], - [ - 124.20801842500012, - 13.547796942000147 - ], - [ - 124.1993921230002, - 13.53042226800008 - ], - [ - 124.187754754, - 13.522894598000121 - ], - [ - 124.17017662900017, - 13.529771226000122 - ], - [ - 124.11622155000018, - 13.578111070000134 - ], - [ - 124.08594811300006, - 13.600043036000073 - ], - [ - 124.06869550900015, - 13.60610586100016 - ], - [ - 124.04737389400012, - 13.606024481000176 - ], - [ - 124.05128014400012, - 13.619533596000153 - ], - [ - 124.04810631600006, - 13.633368231000148 - ], - [ - 124.04004967500012, - 13.64630768400015 - ], - [ - 124.03044681100013, - 13.656927802000098 - ], - [ - 124.02605228000002, - 13.669623114000075 - ], - [ - 124.03589928500006, - 13.68081289300008 - ], - [ - 124.06177819100017, - 13.694769598000136 - ], - [ - 124.08716881600017, - 13.716131903000104 - ], - [ - 124.10743248800011, - 13.745103257000096 - ], - [ - 124.12183678500017, - 13.77977122600008 - ], - [ - 124.12940514400012, - 13.818304755000057 - ], - [ - 124.12077884200019, - 13.875921942000119 - ], - [ - 124.12598717500012, - 13.890326239000089 - ], - [ - 124.13591556100019, - 13.90729401200015 - ], - [ - 124.13453209700006, - 13.925034898000149 - ], - [ - 124.12029056100002, - 13.963527736000145 - ], - [ - 124.11622155000018, - 13.980698960000083 - ], - [ - 124.11622155000018, - 13.98895905200007 - ], - [ - 124.12110436300023, - 13.994126695000162 - ], - [ - 124.12964928500017, - 14.001695054000109 - ], - [ - 124.13591556100019, - 14.010646877000141 - ], - [ - 124.13306725400017, - 14.019720770000134 - ], - [ - 124.12452233200023, - 14.033840236000074 - ], - [ - 124.12452233200023, - 14.049383856000176 - ], - [ - 124.12964928500017, - 14.064846096000096 - ], - [ - 124.13689212300008, - 14.078355210000083 - ], - [ - 124.14966881600006, - 14.062241929000109 - ], - [ - 124.16391035200004, - 14.065578518000123 - ], - [ - 124.18458092500023, - 14.085191148000177 - ], - [ - 124.19361412900017, - 14.090033270000077 - ], - [ - 124.20093834700006, - 14.092230536000073 - ], - [ - 124.20777428500017, - 14.091253973000093 - ], - [ - 124.21566816500015, - 14.086493231000176 - ], - [ - 124.23585045700005, - 14.068060614000146 - ] - ] - ], - [ - [ - [ - 122.17701256600006, - 14.007066148000163 - ], - [ - 122.15837649800008, - 14.006781317000133 - ], - [ - 122.13607832100004, - 14.019232489000146 - ], - [ - 122.09896894599999, - 14.050360419000143 - ], - [ - 122.03337649800008, - 14.092027085000112 - ], - [ - 121.99317467500006, - 14.12763092700007 - ], - [ - 121.98145592500012, - 14.13300202000012 - ], - [ - 121.96517988400015, - 14.142971096000124 - ], - [ - 121.94581139400023, - 14.165757554000137 - ], - [ - 121.92986087300002, - 14.19114817900008 - ], - [ - 121.92351321700019, - 14.208685614000117 - ], - [ - 121.92660566499998, - 14.221258856000105 - ], - [ - 121.934336785, - 14.229437567000105 - ], - [ - 121.945078972, - 14.232611395000077 - ], - [ - 121.95777428500017, - 14.229966539000173 - ], - [ - 121.96404056100002, - 14.226141669000171 - ], - [ - 121.96810957099999, - 14.221380927000084 - ], - [ - 121.97584069100012, - 14.210435289000102 - ], - [ - 122.10474694100017, - 14.10260651200015 - ], - [ - 122.14975019600016, - 14.072699286000088 - ], - [ - 122.17269941500015, - 14.053534247000115 - ], - [ - 122.18344160200016, - 14.030585028000132 - ], - [ - 122.17701256600006, - 14.007066148000163 - ] - ] - ], - [ - [ - [ - 122.37484785200016, - 14.681463934000107 - ], - [ - 122.35401451900006, - 14.67951080900015 - ], - [ - 122.31934655000012, - 14.683498440000122 - ], - [ - 122.31641686300006, - 14.69891998900006 - ], - [ - 122.34156334700018, - 14.712591864000103 - ], - [ - 122.36426842500012, - 14.720607815000136 - ], - [ - 122.380625847, - 14.728705145000077 - ], - [ - 122.39698326900023, - 14.73224518400015 - ], - [ - 122.41179446700019, - 14.725816148000135 - ], - [ - 122.41846764400017, - 14.719956773000177 - ], - [ - 122.41960696700019, - 14.705145575000117 - ], - [ - 122.39779707100016, - 14.68585846600017 - ], - [ - 122.37484785200016, - 14.681463934000107 - ] - ] - ], - [ - [ - [ - 122.13843834700018, - 14.83893463700015 - ], - [ - 122.14600670700011, - 14.833644924000083 - ], - [ - 122.15707441500015, - 14.834295966000127 - ], - [ - 122.16976972700004, - 14.838771877000099 - ], - [ - 122.20386803500006, - 14.838771877000099 - ], - [ - 122.19695071700002, - 14.832912502000141 - ], - [ - 122.19263756600006, - 14.824774481000134 - ], - [ - 122.19239342500006, - 14.814927476000108 - ], - [ - 122.19711347699999, - 14.803941148000149 - ], - [ - 122.20630944100017, - 14.796616929000052 - ], - [ - 122.2169702480002, - 14.795152085000097 - ], - [ - 122.23536217500023, - 14.797756252000084 - ], - [ - 122.24822024800008, - 14.788153387000108 - ], - [ - 122.25700931100002, - 14.767035223000093 - ], - [ - 122.25660241000006, - 14.745917059000178 - ], - [ - 122.24219811300017, - 14.73631419500019 - ], - [ - 122.24154707100004, - 14.741115627000099 - ], - [ - 122.16293378999998, - 14.797756252000084 - ], - [ - 122.13550866000006, - 14.802557684000163 - ], - [ - 122.12126712300002, - 14.806870835000083 - ], - [ - 122.11524498800023, - 14.814846096000124 - ], - [ - 122.1111759770001, - 14.826117255000128 - ], - [ - 122.10499108200011, - 14.837836005000113 - ], - [ - 122.10572350400005, - 14.843939520000106 - ], - [ - 122.12208092500023, - 14.838771877000099 - ], - [ - 122.12484785200004, - 14.84247467700014 - ], - [ - 122.13575280000006, - 14.852362372000144 - ], - [ - 122.13843834700018, - 14.83893463700015 - ] - ] - ], - [ - [ - [ - 121.96941165500019, - 15.047186591000155 - ], - [ - 121.98487389400012, - 15.037990627000099 - ], - [ - 121.99382571700002, - 15.042914130000142 - ], - [ - 122.005137566, - 15.038641669000143 - ], - [ - 122.01124108200011, - 15.027167059000092 - ], - [ - 122.00538170700005, - 15.010687567000105 - ], - [ - 122.02906334700018, - 15.009182033000158 - ], - [ - 122.04818769600016, - 14.999457098000107 - ], - [ - 122.057871941, - 14.983303127000141 - ], - [ - 122.05307050900004, - 14.962225653000118 - ], - [ - 122.031504754, - 14.987738348000121 - ], - [ - 122.02035566499998, - 14.993719794000128 - ], - [ - 122.00538170700005, - 14.990179755000057 - ], - [ - 121.99512780000023, - 14.980129299000083 - ], - [ - 121.99268639400012, - 14.969183661000116 - ], - [ - 121.99634850400005, - 14.963527736000117 - ], - [ - 122.00538170700005, - 14.969061591000141 - ], - [ - 122.01319420700017, - 14.944810289000145 - ], - [ - 122.01286868600002, - 14.932928778000104 - ], - [ - 122.00359134200008, - 14.925238348000093 - ], - [ - 121.97169030000023, - 14.905585028000132 - ], - [ - 121.96810957099999, - 14.902573960000126 - ], - [ - 121.96957441500015, - 14.897772528000132 - ], - [ - 121.97152753999998, - 14.862046617000104 - ], - [ - 121.97364342500012, - 14.852118231000105 - ], - [ - 121.97803795700011, - 14.838771877000099 - ], - [ - 121.99659264400012, - 14.8413760440001 - ], - [ - 122.00879967500006, - 14.824611721000082 - ], - [ - 122.01587975400005, - 14.799465236000088 - ], - [ - 122.02588951900012, - 14.73631419500019 - ], - [ - 122.02369225400005, - 14.722601630000085 - ], - [ - 122.00416100400005, - 14.673651434000107 - ], - [ - 121.98487389400012, - 14.656927802000084 - ], - [ - 121.96119225400011, - 14.644761460000097 - ], - [ - 121.94019616000006, - 14.640082098000079 - ], - [ - 121.91667728000019, - 14.649074611000103 - ], - [ - 121.90870201900023, - 14.670965887000122 - ], - [ - 121.91032962300008, - 14.69782135600012 - ], - [ - 121.91602623800023, - 14.722072658000101 - ], - [ - 121.93490644600016, - 14.725775458000143 - ], - [ - 121.933848504, - 14.764960028000175 - ], - [ - 121.91944420700023, - 14.810248114000103 - ], - [ - 121.89893639400012, - 14.831854559000092 - ], - [ - 121.88363691500004, - 14.836411851000136 - ], - [ - 121.87916100400017, - 14.848334052000084 - ], - [ - 121.88184655000023, - 14.883693752000099 - ], - [ - 121.87745201900006, - 14.894435940000108 - ], - [ - 121.855723504, - 14.926947333000086 - ], - [ - 121.84766686300017, - 14.93553294500019 - ], - [ - 121.83139082100004, - 14.940578518000137 - ], - [ - 121.82178795700023, - 14.940334377000099 - ], - [ - 121.81836998800023, - 14.94603099200016 - ], - [ - 121.82642662900017, - 15.012152411000073 - ], - [ - 121.83326256600012, - 15.035305080000114 - ], - [ - 121.84424889400023, - 15.04539622600008 - ], - [ - 121.874278191, - 15.027777411000145 - ], - [ - 121.89372806100019, - 15.024562893000095 - ], - [ - 121.90235436300011, - 15.041693427000126 - ], - [ - 121.90992272200006, - 15.050197658000158 - ], - [ - 121.92798912900017, - 15.052232164000188 - ], - [ - 121.96941165500019, - 15.047186591000155 - ] - ] - ], - [ - [ - [ - 120.00554446700008, - 16.232082424000154 - ], - [ - 119.99293053500011, - 16.230169989 - ], - [ - 119.98096764400017, - 16.239447333000143 - ], - [ - 119.97632897200006, - 16.247259833000143 - ], - [ - 119.95671634200008, - 16.262437242000132 - ], - [ - 119.93677819100017, - 16.28815338700018 - ], - [ - 119.92554772200018, - 16.29535553600003 - ], - [ - 119.92237389400012, - 16.30377838700015 - ], - [ - 119.92750084700006, - 16.313137111000103 - ], - [ - 119.94304446700002, - 16.329291083000058 - ], - [ - 119.95346113400004, - 16.331976630000142 - ], - [ - 119.96119225400005, - 16.334784247000087 - ], - [ - 119.96257571700014, - 16.33885325700014 - ], - [ - 119.96501712300008, - 16.34438711100016 - ], - [ - 119.97315514400006, - 16.35057200700014 - ], - [ - 119.98406009200002, - 16.34870026200015 - ], - [ - 119.99122155000006, - 16.34357330900015 - ], - [ - 119.99488366000006, - 16.337551174000126 - ], - [ - 119.99708092500023, - 16.330755927000112 - ], - [ - 120.00562584700006, - 16.311753648000106 - ], - [ - 120.00505618600019, - 16.268622137000094 - ], - [ - 120.01075280000018, - 16.254624742000132 - ], - [ - 120.01221764400023, - 16.241522528000147 - ], - [ - 120.00554446700008, - 16.232082424000154 - ] - ] - ], - [ - [ - [ - 120.90919030000023, - 18.567206122000144 - ], - [ - 120.92693118600002, - 18.566229559000178 - ], - [ - 120.94703209700018, - 18.572007554000137 - ], - [ - 120.96387780000006, - 18.581366278000175 - ], - [ - 120.97055097700016, - 18.590765692 - ], - [ - 120.97877037900005, - 18.59829336100016 - ], - [ - 121.01832116000011, - 18.61709219 - ], - [ - 121.03272545700017, - 18.621812242000104 - ], - [ - 121.04249108200011, - 18.62230052300019 - ], - [ - 121.0633244150001, - 18.62067291900017 - ], - [ - 121.07300866000006, - 18.621812242000104 - ], - [ - 121.08334394600016, - 18.62799713700018 - ], - [ - 121.09498131600006, - 18.637030341000084 - ], - [ - 121.10678144600004, - 18.64272695500007 - ], - [ - 121.11817467500006, - 18.638861395000063 - ], - [ - 121.12614993600002, - 18.634100653000147 - ], - [ - 121.13705488400004, - 18.63092682500009 - ], - [ - 121.15935306100008, - 18.628648179000137 - ], - [ - 121.17066491000006, - 18.62547435100008 - ], - [ - 121.17741946700008, - 18.61782461100013 - ], - [ - 121.18262780000018, - 18.608832098000036 - ], - [ - 121.19027753999998, - 18.601304429000052 - ], - [ - 121.23991946700019, - 18.57770416900003 - ], - [ - 121.26628665500019, - 18.55487702 - ], - [ - 121.36402428500017, - 18.50641510600012 - ], - [ - 121.378184441, - 18.49485911700019 - ], - [ - 121.39185631600006, - 18.486314195000162 - ], - [ - 121.42408287900011, - 18.477240302000084 - ], - [ - 121.498301629, - 18.429388739000146 - ], - [ - 121.506114129, - 18.42666250200007 - ], - [ - 121.51978600400005, - 18.425116278000033 - ], - [ - 121.52613366000017, - 18.422552802000112 - ], - [ - 121.53256269599999, - 18.415961005000057 - ], - [ - 121.53882897200006, - 18.407049872000115 - ], - [ - 121.54656009200002, - 18.39923737200003 - ], - [ - 121.592051629, - 18.384711005 - ], - [ - 121.61329186300011, - 18.359320380000057 - ], - [ - 121.629649285, - 18.331691799000154 - ], - [ - 121.64966881600017, - 18.313950914000074 - ], - [ - 121.64966881600017, - 18.32021719 - ], - [ - 121.63461347700016, - 18.33454010600009 - ], - [ - 121.6349389980002, - 18.355129299000126 - ], - [ - 121.64503014400023, - 18.369452216000028 - ], - [ - 121.65967858200005, - 18.364813544000086 - ], - [ - 121.67286217500012, - 18.35496653900016 - ], - [ - 121.85279381600017, - 18.28799062700007 - ], - [ - 121.89551842500006, - 18.279201565 - ], - [ - 121.91732832100004, - 18.278631903000033 - ], - [ - 121.97461998800006, - 18.286037502000013 - ], - [ - 121.98682701900023, - 18.2904320330001 - ], - [ - 122.03956139400023, - 18.32021719 - ], - [ - 122.07862389400012, - 18.37946198100009 - ], - [ - 122.09131920700005, - 18.389064846000068 - ], - [ - 122.11158287900017, - 18.39276764500012 - ], - [ - 122.1193139980002, - 18.403021552000055 - ], - [ - 122.12208092500023, - 18.436835028000033 - ], - [ - 122.14576256600017, - 18.507391669000086 - ], - [ - 122.15284264400023, - 18.51878489800005 - ], - [ - 122.19939212300008, - 18.522853908000016 - ], - [ - 122.22022545700023, - 18.52240631700012 - ], - [ - 122.23536217500023, - 18.515366929000052 - ], - [ - 122.24317467500023, - 18.499823309000035 - ], - [ - 122.24708092500012, - 18.459784247000115 - ], - [ - 122.25171959700006, - 18.44306061400009 - ], - [ - 122.26050866, - 18.432277736000074 - ], - [ - 122.28809655000023, - 18.409247137000094 - ], - [ - 122.29721113400004, - 18.403876044000143 - ], - [ - 122.317149285, - 18.37742747600008 - ], - [ - 122.324961785, - 18.336615302000112 - ], - [ - 122.32016035200004, - 18.292547919000114 - ], - [ - 122.30697675900015, - 18.251288153000147 - ], - [ - 122.28858483200023, - 18.218207098000036 - ], - [ - 122.26270592500012, - 18.186102606000063 - ], - [ - 122.24675540500019, - 18.17194245000003 - ], - [ - 122.21371504000015, - 18.149969794000114 - ], - [ - 122.18002363400015, - 18.12075429900007 - ], - [ - 122.17432701900017, - 18.11347077000015 - ], - [ - 122.16976972700004, - 18.100490627000156 - ], - [ - 122.16911868600008, - 18.08812083500011 - ], - [ - 122.17188561300023, - 18.079413153000033 - ], - [ - 122.17554772200018, - 18.071844794000086 - ], - [ - 122.17725670700011, - 18.063177802 - ], - [ - 122.17725670700011, - 18.029038804 - ], - [ - 122.18311608200023, - 17.996486721000124 - ], - [ - 122.18344160200016, - 17.984361070000134 - ], - [ - 122.14014733200005, - 17.798285223 - ], - [ - 122.13990319100006, - 17.787909247000087 - ], - [ - 122.14323978000007, - 17.765285549000126 - ], - [ - 122.14234459700018, - 17.757066148000135 - ], - [ - 122.13607832100004, - 17.7442894550001 - ], - [ - 122.13575280000006, - 17.73729075700011 - ], - [ - 122.13982181100008, - 17.730047919000086 - ], - [ - 122.15316816500015, - 17.715521552000055 - ], - [ - 122.15626061300023, - 17.706935940000122 - ], - [ - 122.1565861340001, - 17.619289455000015 - ], - [ - 122.16293378999998, - 17.59332916900003 - ], - [ - 122.19385826900023, - 17.519191799000097 - ], - [ - 122.19711347699999, - 17.49461497600008 - ], - [ - 122.20606530000012, - 17.47528717700014 - ], - [ - 122.22445722700016, - 17.451890367000075 - ], - [ - 122.23959394600016, - 17.42682526200015 - ], - [ - 122.23878014400023, - 17.40216705900015 - ], - [ - 122.24366295700011, - 17.391099351000136 - ], - [ - 122.246348504, - 17.374904690000065 - ], - [ - 122.25114993600019, - 17.360174872000087 - ], - [ - 122.26270592500012, - 17.353745835000083 - ], - [ - 122.26644941500015, - 17.35537344 - ], - [ - 122.27149498800006, - 17.35862864800005 - ], - [ - 122.27833092500012, - 17.361232815000122 - ], - [ - 122.28711998800017, - 17.36058177300019 - ], - [ - 122.30534915500007, - 17.344183661000088 - ], - [ - 122.313731316, - 17.34007396000014 - ], - [ - 122.32601972700016, - 17.340887762000065 - ], - [ - 122.35287519600016, - 17.35114166900017 - ], - [ - 122.36540774800002, - 17.353745835000083 - ], - [ - 122.38160241000011, - 17.347398179000137 - ], - [ - 122.39014733200023, - 17.316880601000108 - ], - [ - 122.40259850400005, - 17.305975653000033 - ], - [ - 122.39779707100016, - 17.329087632000082 - ], - [ - 122.41456139400006, - 17.31907786700019 - ], - [ - 122.43539472700016, - 17.292425848000065 - ], - [ - 122.44361412900005, - 17.265611070000162 - ], - [ - 122.42514082100004, - 17.279527085000055 - ], - [ - 122.41431725400005, - 17.283636786 - ], - [ - 122.40943444100006, - 17.275213934000064 - ], - [ - 122.41163170700023, - 17.260443427000055 - ], - [ - 122.42090905000012, - 17.232326565000065 - ], - [ - 122.42310631600017, - 17.220607815000093 - ], - [ - 122.42058353000019, - 17.205877997000087 - ], - [ - 122.41041100400005, - 17.17552317900011 - ], - [ - 122.40943444100006, - 17.16193268400015 - ], - [ - 122.41684004000015, - 17.14581940300009 - ], - [ - 122.44141686300023, - 17.127997137000122 - ], - [ - 122.45101972700004, - 17.114162502000013 - ], - [ - 122.45443769600016, - 17.118719794000143 - ], - [ - 122.46094811300023, - 17.12348053600006 - ], - [ - 122.46469160200016, - 17.127834377000156 - ], - [ - 122.48047936300011, - 17.12348053600006 - ], - [ - 122.49024498800023, - 17.13287995000009 - ], - [ - 122.50098717500018, - 17.139797268000095 - ], - [ - 122.51929772200006, - 17.127834377000156 - ], - [ - 122.52914472700016, - 17.109605210000083 - ], - [ - 122.52906334700018, - 17.090521552 - ], - [ - 122.52149498800023, - 17.07200755400008 - ], - [ - 122.50879967500023, - 17.055853583000115 - ], - [ - 122.50391686300011, - 17.04653554900007 - ], - [ - 122.50049889400006, - 17.034125067000147 - ], - [ - 122.49610436300011, - 17.02326080900015 - ], - [ - 122.48829186300011, - 17.018540757000054 - ], - [ - 122.48357181100019, - 17.013657945000162 - ], - [ - 122.47291100400017, - 16.98969147300012 - ], - [ - 122.45972741, - 16.912014065 - ], - [ - 122.46469160200016, - 16.89508698100012 - ], - [ - 122.44898522200012, - 16.864976304 - ], - [ - 122.42269941499998, - 16.79433828300013 - ], - [ - 122.37338300900004, - 16.71352773600013 - ], - [ - 122.36500084700006, - 16.685126044000114 - ], - [ - 122.34546959700006, - 16.642523505000057 - ], - [ - 122.33838951900012, - 16.63129303600006 - ], - [ - 122.32520592500023, - 16.616156317000062 - ], - [ - 122.30014082100016, - 16.565497137000094 - ], - [ - 122.28638756600006, - 16.546820380000113 - ], - [ - 122.253184441, - 16.519964911000116 - ], - [ - 122.24463951900012, - 16.510565497000115 - ], - [ - 122.23878014400023, - 16.504055080000015 - ], - [ - 122.23422285199999, - 16.495103257 - ], - [ - 122.23218834700018, - 16.486517645000063 - ], - [ - 122.23194420700023, - 16.466498114 - ], - [ - 122.22917728000007, - 16.46161530200014 - ], - [ - 122.21143639400006, - 16.449408270000063 - ], - [ - 122.20427493600002, - 16.434759833000143 - ], - [ - 122.20533287900011, - 16.423895575000145 - ], - [ - 122.21762129000015, - 16.394761460000026 - ], - [ - 122.22413170700023, - 16.408514716000028 - ], - [ - 122.22510826900012, - 16.41526927300005 - ], - [ - 122.23194420700023, - 16.41526927300005 - ], - [ - 122.22494550900015, - 16.38076406500015 - ], - [ - 122.19190514400012, - 16.31736888200011 - ], - [ - 122.19711347699999, - 16.291693427000055 - ], - [ - 122.21452884200008, - 16.307074286 - ], - [ - 122.23194420700023, - 16.319037177000112 - ], - [ - 122.22868899800008, - 16.304632880000057 - ], - [ - 122.20386803500006, - 16.263820705000015 - ], - [ - 122.20337975400005, - 16.25747304900007 - ], - [ - 122.20533287900011, - 16.24249909100014 - ], - [ - 122.20386803500006, - 16.23651764500012 - ], - [ - 122.19874108200011, - 16.233710028000175 - ], - [ - 122.18246503999998, - 16.23200104400017 - ], - [ - 122.17725670700011, - 16.23029205900015 - ], - [ - 122.14942467500012, - 16.19554271000011 - ], - [ - 122.11524498800023, - 16.16889069200009 - ], - [ - 122.08399498800006, - 16.137355861000074 - ], - [ - 122.08041425899998, - 16.135321356000063 - ], - [ - 122.07699628999998, - 16.13271719000015 - ], - [ - 122.0735783210001, - 16.127264716000113 - ], - [ - 122.07178795700011, - 16.11933014500015 - ], - [ - 122.07243899800002, - 16.11155833500014 - ], - [ - 122.0735783210001, - 16.104925848000093 - ], - [ - 122.0735783210001, - 16.099920966000056 - ], - [ - 122.05925540500019, - 16.077785549000154 - ], - [ - 122.01612389400006, - 16.051459052000055 - ], - [ - 121.99789472699999, - 16.03107330900015 - ], - [ - 121.99170983200023, - 16.03851959800015 - ], - [ - 122.01156660200004, - 16.065741278000147 - ], - [ - 122.0216577480002, - 16.083929755000142 - ], - [ - 122.02588951900012, - 16.103705145000063 - ], - [ - 122.03345787900017, - 16.117132880000057 - ], - [ - 122.08106530000023, - 16.148382880000113 - ], - [ - 122.08757571700002, - 16.16445547100001 - ], - [ - 122.09278405000023, - 16.18732330900012 - ], - [ - 122.10157311300011, - 16.20774974200016 - ], - [ - 122.132578972, - 16.22549062700007 - ], - [ - 122.140879754, - 16.244086005000085 - ], - [ - 122.13526451900012, - 16.26072825700011 - ], - [ - 122.1077580090001, - 16.263820705000015 - ], - [ - 122.08741295700005, - 16.255316473000065 - ], - [ - 122.07740319100012, - 16.241278387000122 - ], - [ - 122.07398522200018, - 16.224025783000016 - ], - [ - 122.0735783210001, - 16.20575592700014 - ], - [ - 122.06690514400012, - 16.190130927000055 - ], - [ - 122.050547722, - 16.18085358300003 - ], - [ - 122.01221764400006, - 16.16889069200009 - ], - [ - 121.95476321700008, - 16.13914622600005 - ], - [ - 121.94019616000006, - 16.134711005 - ], - [ - 121.90398196700002, - 16.12982819200012 - ], - [ - 121.86817467500012, - 16.12042877800009 - ], - [ - 121.85596764400023, - 16.11131419500019 - ], - [ - 121.84408613399998, - 16.10000234600004 - ], - [ - 121.82992597700016, - 16.090399481000034 - ], - [ - 121.79997806100019, - 16.08323802300019 - ], - [ - 121.78842207100016, - 16.077215887000094 - ], - [ - 121.77767988400015, - 16.07318756700012 - ], - [ - 121.76954186300023, - 16.07575104400003 - ], - [ - 121.76107832099999, - 16.07998281500015 - ], - [ - 121.75228925900004, - 16.07689036700016 - ], - [ - 121.68441816500015, - 16.02114492400007 - ], - [ - 121.67872155000023, - 16.010728257000082 - ], - [ - 121.64226321700019, - 15.969631252000099 - ], - [ - 121.59327233200023, - 15.944891669000114 - ], - [ - 121.57781009200019, - 15.932074286000088 - ], - [ - 121.56739342500012, - 15.91571686400006 - ], - [ - 121.56006920700011, - 15.895209052000112 - ], - [ - 121.55298912900017, - 15.852932033000101 - ], - [ - 121.55486087300014, - 15.828924872000144 - ], - [ - 121.5706486340001, - 15.793768622000087 - ], - [ - 121.57455488400015, - 15.77435944200009 - ], - [ - 121.58521569100012, - 15.765448309000035 - ], - [ - 121.60865319100017, - 15.763088283000101 - ], - [ - 121.63184655000012, - 15.757025458 - ], - [ - 121.64226321700019, - 15.736883856000148 - ], - [ - 121.63656660200004, - 15.722479559000178 - ], - [ - 121.59449303500006, - 15.674750067000119 - ], - [ - 121.611094597, - 15.671087958000086 - ], - [ - 121.61980228000019, - 15.667466539000102 - ], - [ - 121.62916100400005, - 15.661118882 - ], - [ - 121.59099368600008, - 15.64044830900015 - ], - [ - 121.57374108200017, - 15.627264716000028 - ], - [ - 121.5665796230002, - 15.610256252000156 - ], - [ - 121.56153405000006, - 15.591376044000029 - ], - [ - 121.54900149800008, - 15.576402085 - ], - [ - 121.49561608200023, - 15.532456773000078 - ], - [ - 121.48755944100012, - 15.520412502000156 - ], - [ - 121.47925866, - 15.456203518 - ], - [ - 121.47291100400011, - 15.43768952 - ], - [ - 121.464121941, - 15.421535549000126 - ], - [ - 121.42628014400006, - 15.373765367000175 - ], - [ - 121.40886478000013, - 15.377752997000158 - ], - [ - 121.39771569100017, - 15.382717190000108 - ], - [ - 121.38990319100012, - 15.377875067000133 - ], - [ - 121.38160241, - 15.352687893000152 - ], - [ - 121.37916100400017, - 15.308172919000157 - ], - [ - 121.39112389400012, - 15.26626211100016 - ], - [ - 121.41374759200008, - 15.231634833000086 - ], - [ - 121.44361412900017, - 15.209295966000141 - ], - [ - 121.46843509200002, - 15.196112372000101 - ], - [ - 121.48145592500012, - 15.182521877000141 - ], - [ - 121.48755944100012, - 15.163316148000177 - ], - [ - 121.50814863400004, - 15.062811591000141 - ], - [ - 121.51531009200008, - 15.051662502000127 - ], - [ - 121.52784264400006, - 15.040757554000052 - ], - [ - 121.56006920700011, - 14.989650783000087 - ], - [ - 121.5665796230002, - 14.972805080000086 - ], - [ - 121.5706486340001, - 14.945990302000084 - ], - [ - 121.58179772200018, - 14.91966380400008 - ], - [ - 121.59734134200019, - 14.894842841000113 - ], - [ - 121.615000847, - 14.872870184000107 - ], - [ - 121.60962975400005, - 14.869940497000172 - ], - [ - 121.59961998800006, - 14.862005927000112 - ], - [ - 121.59449303500006, - 14.859198309000163 - ], - [ - 121.63575280000012, - 14.811590887000179 - ], - [ - 121.64226321700019, - 14.80084870000016 - ], - [ - 121.64991295700023, - 14.792181708000086 - ], - [ - 121.712657097, - 14.74437083500014 - ], - [ - 121.72494550900015, - 14.730780341000084 - ], - [ - 121.72608483200011, - 14.720160223000136 - ], - [ - 121.70736738400004, - 14.715806382000054 - ], - [ - 121.67090905000018, - 14.714341539000188 - ], - [ - 121.64918053500011, - 14.710516669000171 - ], - [ - 121.62916100400005, - 14.702826239000146 - ], - [ - 121.61394290500007, - 14.689886786000145 - ], - [ - 121.60808353000019, - 14.674261786000073 - ], - [ - 121.60816491000017, - 14.63019440300016 - ], - [ - 121.61068769599999, - 14.612616278000132 - ], - [ - 121.64722741000006, - 14.492254950000174 - ], - [ - 121.65137780000006, - 14.45612213700015 - ], - [ - 121.66244550900004, - 14.417385158000116 - ], - [ - 121.67017662900005, - 14.401109117000175 - ], - [ - 121.68238366, - 14.385443427000112 - ], - [ - 121.72486412900017, - 14.345892645000148 - ], - [ - 121.73471113400004, - 14.328680731000134 - ], - [ - 121.73609459700018, - 14.31488678600013 - ], - [ - 121.73161868600013, - 14.280422268000109 - ], - [ - 121.73585045700023, - 14.273138739000103 - ], - [ - 121.75464928500017, - 14.255764065000122 - ], - [ - 121.75896243600019, - 14.246568101000136 - ], - [ - 121.75717207099999, - 14.230617580000128 - ], - [ - 121.75212649800008, - 14.215725002000084 - ], - [ - 121.74366295700023, - 14.203436591000127 - ], - [ - 121.73161868600013, - 14.195054429000066 - ], - [ - 121.73161868600013, - 14.188218492000146 - ], - [ - 121.74488366000006, - 14.177150783000116 - ], - [ - 121.78003991, - 14.126166083000115 - ], - [ - 121.84766686300017, - 14.078355210000083 - ], - [ - 121.91724694100006, - 14.009507554000109 - ], - [ - 121.93628991000006, - 13.995184637000122 - ], - [ - 122.08790123800006, - 13.937811591000099 - ], - [ - 122.23194420700023, - 13.906439520000148 - ], - [ - 122.23316491000006, - 13.933050848000107 - ], - [ - 122.22201582100004, - 13.95209381700009 - ], - [ - 122.18344160200016, - 13.98895905200007 - ], - [ - 122.20240319100017, - 13.994574286000073 - ], - [ - 122.29330488400004, - 13.970119533000116 - ], - [ - 122.29851321700002, - 13.97256094000015 - ], - [ - 122.30014082100016, - 13.985581773000135 - ], - [ - 122.29639733200011, - 14.002752997000158 - ], - [ - 122.29981530000012, - 14.007554429000066 - ], - [ - 122.313731316, - 14.01007721600017 - ], - [ - 122.313731316, - 14.016302802000126 - ], - [ - 122.290782097, - 14.023098049000154 - ], - [ - 122.25196373800011, - 14.067694403000132 - ], - [ - 122.23536217500023, - 14.078355210000083 - ], - [ - 122.20866946700014, - 14.087632554000123 - ], - [ - 122.18620853000013, - 14.110541083000129 - ], - [ - 122.17017662900005, - 14.139634507000096 - ], - [ - 122.16293378999998, - 14.167792059000163 - ], - [ - 122.17318769600004, - 14.160223700000131 - ], - [ - 122.17554772200018, - 14.155951239000117 - ], - [ - 122.17725670700011, - 14.146673895000063 - ], - [ - 122.18344160200016, - 14.146673895000063 - ], - [ - 122.18409264400012, - 14.1698672550001 - ], - [ - 122.19556725400005, - 14.183783270000077 - ], - [ - 122.23194420700023, - 14.201849677000098 - ], - [ - 122.24439537900005, - 14.196030992000132 - ], - [ - 122.24756920700011, - 14.21279531500015 - ], - [ - 122.24781334700006, - 14.23615143400015 - ], - [ - 122.25171959700006, - 14.25031159100017 - ], - [ - 122.26368248800006, - 14.247381903000147 - ], - [ - 122.26661217500012, - 14.227606512000136 - ], - [ - 122.26400800900004, - 14.203680731000162 - ], - [ - 122.25928795700011, - 14.188218492000146 - ], - [ - 122.26685631600006, - 14.178859768000109 - ], - [ - 122.2688908210001, - 14.167303778000175 - ], - [ - 122.26954186300023, - 14.154242255000113 - ], - [ - 122.2727970710001, - 14.140448309000107 - ], - [ - 122.27149498800006, - 14.136664130000085 - ], - [ - 122.27320397200018, - 14.132513739000132 - ], - [ - 122.27963300899998, - 14.126166083000115 - ], - [ - 122.28435306100019, - 14.125881252000084 - ], - [ - 122.28858483200023, - 14.130194403000175 - ], - [ - 122.29175866000017, - 14.136053778000118 - ], - [ - 122.29330488400004, - 14.140448309000107 - ], - [ - 122.29851321700002, - 14.129339911000073 - ], - [ - 122.30030358200011, - 14.117580471000096 - ], - [ - 122.30014082100016, - 14.092027085000112 - ], - [ - 122.31869550900015, - 14.100043036000145 - ], - [ - 122.33497155000006, - 14.1132266300001 - ], - [ - 122.34571373800011, - 14.131333726000108 - ], - [ - 122.3479923840001, - 14.154120184000135 - ], - [ - 122.34424889400023, - 14.160589911000145 - ], - [ - 122.33008873800011, - 14.180568752000113 - ], - [ - 122.32748457100004, - 14.188218492000146 - ], - [ - 122.33130944100006, - 14.20026276200015 - ], - [ - 122.33765709700018, - 14.207586981000162 - ], - [ - 122.344004754, - 14.206935940000122 - ], - [ - 122.3479923840001, - 14.195054429000066 - ], - [ - 122.35547936300023, - 14.195054429000066 - ], - [ - 122.35670006600017, - 14.204657294000143 - ], - [ - 122.35572350400017, - 14.21222565300009 - ], - [ - 122.35279381600017, - 14.218085028000132 - ], - [ - 122.3479923840001, - 14.222357489000146 - ], - [ - 122.36695397200018, - 14.222154039000188 - ], - [ - 122.37680097700004, - 14.22850169500012 - ], - [ - 122.37671959700006, - 14.239650783000144 - ], - [ - 122.36540774800002, - 14.25340403900016 - ], - [ - 122.36622155000023, - 14.261460679000095 - ], - [ - 122.38135826900023, - 14.293280341000127 - ], - [ - 122.388926629, - 14.30491771000014 - ], - [ - 122.39454186300011, - 14.29148997600005 - ], - [ - 122.40365644599999, - 14.295396226000136 - ], - [ - 122.41244550900015, - 14.309027411000088 - ], - [ - 122.41627037900017, - 14.324774481000148 - ], - [ - 122.43116295700023, - 14.318060614000103 - ], - [ - 122.444590691, - 14.324652411000073 - ], - [ - 122.45753014400023, - 14.336615302000112 - ], - [ - 122.47095787900005, - 14.345892645000148 - ], - [ - 122.48316491000011, - 14.346665757000082 - ], - [ - 122.49463951900023, - 14.3413760440001 - ], - [ - 122.51929772200006, - 14.324774481000148 - ], - [ - 122.51490319100006, - 14.32990143400015 - ], - [ - 122.50505618600002, - 14.345892645000148 - ], - [ - 122.52784264400023, - 14.348700262000108 - ], - [ - 122.57536868600008, - 14.3292910830001 - ], - [ - 122.60124759200008, - 14.324774481000148 - ], - [ - 122.598887566, - 14.311224677000084 - ], - [ - 122.60466556100008, - 14.301255601000094 - ], - [ - 122.61378014400017, - 14.299709377000141 - ], - [ - 122.62232506600017, - 14.311183986000088 - ], - [ - 122.62566165500013, - 14.296535549000083 - ], - [ - 122.63461347700016, - 14.286037502000113 - ], - [ - 122.64429772200012, - 14.284735419000114 - ], - [ - 122.64966881600017, - 14.297512111000145 - ], - [ - 122.677989129, - 14.294663804000109 - ], - [ - 122.69068444100017, - 14.291245835000112 - ], - [ - 122.67432701900023, - 14.316107489000146 - ], - [ - 122.67139733200023, - 14.339422919000157 - ], - [ - 122.67986087300008, - 14.35053131700009 - ], - [ - 122.69752037900017, - 14.338446356000176 - ], - [ - 122.70427493600002, - 14.345892645000148 - ], - [ - 122.711680535, - 14.329535223000136 - ], - [ - 122.72169030000012, - 14.315741278000132 - ], - [ - 122.73511803500017, - 14.313544012000136 - ], - [ - 122.75269616, - 14.33222077000012 - ], - [ - 122.75749759200019, - 14.325832424000097 - ], - [ - 122.76270592500012, - 14.321356512000136 - ], - [ - 122.76889082100016, - 14.31879303600013 - ], - [ - 122.78443444100017, - 14.316961981000148 - ], - [ - 122.78541100400005, - 14.314154364000103 - ], - [ - 122.78443444100017, - 14.310044664000145 - ], - [ - 122.786875847, - 14.30491771000014 - ], - [ - 122.80258222700016, - 14.287176825000145 - ], - [ - 122.80982506600012, - 14.284409898000177 - ], - [ - 122.82471764400023, - 14.283840236000117 - ], - [ - 122.85328209700006, - 14.278550523000135 - ], - [ - 122.873301629, - 14.265204169000128 - ], - [ - 122.90357506600012, - 14.22919342700007 - ], - [ - 122.90455162900017, - 14.224025783000158 - ], - [ - 122.90333092500023, - 14.217189846000139 - ], - [ - 122.903086785, - 14.211249091000113 - ], - [ - 122.906993035, - 14.208685614000117 - ], - [ - 122.91993248800011, - 14.208156643000137 - ], - [ - 122.92505944100006, - 14.206122137000108 - ], - [ - 122.93083743600019, - 14.201849677000098 - ], - [ - 122.95435631600006, - 14.167792059000163 - ], - [ - 122.96550540500007, - 14.15924713700015 - ], - [ - 123.00269616000017, - 14.118882554000095 - ], - [ - 123.01221764400023, - 14.10569896000014 - ], - [ - 123.02173912900017, - 14.111395575000131 - ], - [ - 123.03272545700011, - 14.107814846000153 - ], - [ - 123.042246941, - 14.09804922100011 - ], - [ - 123.04688561300023, - 14.085191148000177 - ], - [ - 123.04395592500012, - 14.06976959800015 - ], - [ - 123.03638756600017, - 14.057440497000115 - ], - [ - 123.030528191, - 14.043443101000065 - ], - [ - 123.03321373800011, - 14.023138739000146 - ], - [ - 123.05372155000023, - 14.002630927000098 - ], - [ - 123.07813561300011, - 13.98810455900015 - ], - [ - 123.08155358200011, - 13.98895905200007 - ], - [ - 123.08423912900011, - 13.974269924000154 - ], - [ - 123.08155358200011, - 13.92816803600013 - ], - [ - 123.08838951900023, - 13.901434637000122 - ], - [ - 123.0877384770001, - 13.893459377000156 - ], - [ - 123.08204186300011, - 13.884426174000154 - ], - [ - 123.07496178500006, - 13.881659247000101 - ], - [ - 123.06763756600006, - 13.879584052000084 - ], - [ - 123.06055748800006, - 13.872951565000108 - ], - [ - 123.05591881600006, - 13.86131419500019 - ], - [ - 123.04883873800006, - 13.821966864000103 - ], - [ - 123.04688561300023, - 13.81085846600017 - ], - [ - 123.04981530000023, - 13.775824286000088 - ], - [ - 123.06666100400017, - 13.756089585000055 - ], - [ - 123.08871504000015, - 13.741644598000093 - ], - [ - 123.10824629000004, - 13.722113348000121 - ], - [ - 123.11589603000007, - 13.722113348000121 - ], - [ - 123.13672936300023, - 13.732814846000139 - ], - [ - 123.16089928500006, - 13.734076239000146 - ], - [ - 123.21469160199999, - 13.72894928600013 - ], - [ - 123.22494550900004, - 13.731146552000126 - ], - [ - 123.25562584700006, - 13.743312893000109 - ], - [ - 123.26661217500006, - 13.749416408000101 - ], - [ - 123.30176842500023, - 13.789455471000124 - ], - [ - 123.30746504000004, - 13.801255601000108 - ], - [ - 123.30958092500023, - 13.807928778000147 - ], - [ - 123.31316165500013, - 13.814113674000126 - ], - [ - 123.31495201900012, - 13.82054271000014 - ], - [ - 123.30827884200002, - 13.833319403000175 - ], - [ - 123.29664147200006, - 13.869818427000126 - ], - [ - 123.28093509200008, - 13.891831773000135 - ], - [ - 123.28028405000012, - 13.906439520000148 - ], - [ - 123.31348717500023, - 13.930080471000096 - ], - [ - 123.31771894600016, - 13.934393622000087 - ], - [ - 123.32553144600016, - 13.940008856000176 - ], - [ - 123.33139082099999, - 13.953355210000097 - ], - [ - 123.33480879000004, - 13.96918366100013 - ], - [ - 123.33545983200023, - 13.982163804000137 - ], - [ - 123.32488040500019, - 13.971502997000101 - ], - [ - 123.31251061300017, - 13.940822658000101 - ], - [ - 123.30404707100004, - 13.934393622000087 - ], - [ - 123.29004967500023, - 13.934556382000054 - ], - [ - 123.28060957100016, - 13.936102606000091 - ], - [ - 123.23462975400017, - 13.96381256700009 - ], - [ - 123.22299238399998, - 13.975816148000192 - ], - [ - 123.21810957100004, - 13.992743231000176 - ], - [ - 123.22771243600019, - 14.000433661000102 - ], - [ - 123.24529056100013, - 14.006781317000133 - ], - [ - 123.25424238400015, - 14.013739325000131 - ], - [ - 123.23878014400023, - 14.023138739000146 - ], - [ - 123.25904381600006, - 14.031195380000085 - ], - [ - 123.26172936300011, - 14.042303778000118 - ], - [ - 123.25228925900004, - 14.068101304000137 - ], - [ - 123.26148522200018, - 14.072902736000131 - ], - [ - 123.28207441500004, - 14.066473700000117 - ], - [ - 123.31430097700016, - 14.05109284100017 - ], - [ - 123.31430097700016, - 14.057277736000145 - ], - [ - 123.31031334700018, - 14.060248114000075 - ], - [ - 123.30079186300006, - 14.071519273000149 - ], - [ - 123.32960045700011, - 14.070298570000134 - ], - [ - 123.33545983200023, - 14.071519273000149 - ], - [ - 123.33529707099999, - 14.078762111000088 - ], - [ - 123.32715905000006, - 14.096014716000084 - ], - [ - 123.33179772200012, - 14.09951406500008 - ], - [ - 123.34506269600004, - 14.093695380000128 - ], - [ - 123.35328209700006, - 14.079413153000132 - ], - [ - 123.3621525400001, - 14.043605861000117 - ], - [ - 123.34538821700008, - 14.039536851000065 - ], - [ - 123.34205162900005, - 14.027777411000088 - ], - [ - 123.34644616, - 14.016302802000126 - ], - [ - 123.35230553500006, - 14.01316966400016 - ], - [ - 123.37012780000023, - 14.029852606000105 - ], - [ - 123.37867272200006, - 14.035101630000085 - ], - [ - 123.39014733200011, - 14.037339585000069 - ], - [ - 123.38510175900015, - 14.030910549000154 - ], - [ - 123.37582441500004, - 14.01007721600017 - ], - [ - 123.38624108200011, - 14.014105536000145 - ], - [ - 123.39014733200011, - 14.016302802000126 - ], - [ - 123.39625084700018, - 14.01007721600017 - ], - [ - 123.39234459700018, - 13.991848049000097 - ], - [ - 123.41179446700019, - 13.964260158000087 - ], - [ - 123.40381920700023, - 13.948675848000093 - ], - [ - 123.41065514400023, - 13.93943919500012 - ], - [ - 123.41521243600019, - 13.929388739000146 - ], - [ - 123.41732832100004, - 13.91844310100008 - ], - [ - 123.41732832100004, - 13.906439520000148 - ], - [ - 123.42416425900004, - 13.906439520000148 - ], - [ - 123.42945397200012, - 13.919378973000065 - ], - [ - 123.43726647200018, - 13.929144598000107 - ], - [ - 123.44369550900004, - 13.941351630000085 - ], - [ - 123.4446720710001, - 13.961655992000175 - ], - [ - 123.46469160200016, - 13.956447658000087 - ], - [ - 123.477793816, - 13.95050690300016 - ], - [ - 123.48633873800023, - 13.940008856000176 - ], - [ - 123.49252363400004, - 13.920721747000144 - ], - [ - 123.53882897200018, - 13.92495351800008 - ], - [ - 123.61280358200005, - 13.897162177000112 - ], - [ - 123.68140709700018, - 13.884670315000093 - ], - [ - 123.71168053500017, - 13.934393622000087 - ], - [ - 123.73406009200019, - 13.897121486000117 - ], - [ - 123.76531009200008, - 13.864325262000108 - ], - [ - 123.80404707100004, - 13.83763255400008 - ], - [ - 123.87631269599999, - 13.807318427000098 - ], - [ - 123.87891686300006, - 13.803900458000086 - ], - [ - 123.88005618600013, - 13.800726630000128 - ], - [ - 123.88298587300002, - 13.797796942000105 - ], - [ - 123.89527428500011, - 13.794094143000152 - ], - [ - 123.91944420700011, - 13.79376862200013 - ], - [ - 123.93140709700006, - 13.790350653000118 - ], - [ - 123.93775475400017, - 13.784002997000101 - ], - [ - 123.95191491000017, - 13.755601304000066 - ], - [ - 123.96876061300011, - 13.740057684000163 - ], - [ - 123.97266686300011, - 13.729315497000144 - ], - [ - 123.96550540500007, - 13.714667059000135 - ], - [ - 123.94857832100016, - 13.728176174000112 - ], - [ - 123.94271894600004, - 13.734564520000134 - ], - [ - 123.93751061300023, - 13.742621161000073 - ], - [ - 123.93140709700006, - 13.742621161000073 - ], - [ - 123.92994225400017, - 13.738430080000143 - ], - [ - 123.92457116, - 13.72894928600013 - ], - [ - 123.909922722, - 13.735988674000112 - ], - [ - 123.89258873800011, - 13.740057684000163 - ], - [ - 123.85938561300011, - 13.742621161000073 - ], - [ - 123.85027103000013, - 13.734076239000146 - ], - [ - 123.83627363400015, - 13.715277411000102 - ], - [ - 123.81836998800011, - 13.696478583000143 - ], - [ - 123.79737389400023, - 13.687974351000122 - ], - [ - 123.77930748800023, - 13.692124742000146 - ], - [ - 123.74293053500006, - 13.710435289000117 - ], - [ - 123.68816165500002, - 13.718695380000113 - ], - [ - 123.66667728000019, - 13.7183291690001 - ], - [ - 123.65699303500006, - 13.711574611000145 - ], - [ - 123.64795983200023, - 13.703558661000116 - ], - [ - 123.62696373800011, - 13.710842190000122 - ], - [ - 123.60385175900015, - 13.72288646000014 - ], - [ - 123.58814537900017, - 13.72894928600013 - ], - [ - 123.57048587300008, - 13.722967841000113 - ], - [ - 123.56006920700005, - 13.709621486000103 - ], - [ - 123.52849368600019, - 13.626776434000178 - ], - [ - 123.526621941, - 13.606024481000176 - ], - [ - 123.53500410200016, - 13.603949286000073 - ], - [ - 123.53891035200016, - 13.600978908000144 - ], - [ - 123.53663170700011, - 13.595160223000093 - ], - [ - 123.53402753999998, - 13.590643622000144 - ], - [ - 123.53321373800011, - 13.585598049000112 - ], - [ - 123.53345787900005, - 13.574693101000136 - ], - [ - 123.53630618600008, - 13.563299872000158 - ], - [ - 123.54297936300023, - 13.560248114000075 - ], - [ - 123.55176842500012, - 13.563625393000095 - ], - [ - 123.560801629, - 13.571234442000133 - ], - [ - 123.59359785200004, - 13.5294457050001 - ], - [ - 123.59831790500002, - 13.523586330000157 - ], - [ - 123.60547936300017, - 13.51666901200015 - ], - [ - 123.66724694100017, - 13.485581773000149 - ], - [ - 123.68002363400004, - 13.469956773000163 - ], - [ - 123.70484459700018, - 13.42723216400016 - ], - [ - 123.70923912900005, - 13.423529364000117 - ], - [ - 123.7225041020001, - 13.415187893000137 - ], - [ - 123.72535241000006, - 13.40989817900008 - ], - [ - 123.72527103000007, - 13.399074611000074 - ], - [ - 123.72632897200018, - 13.390855210000083 - ], - [ - 123.73145592500012, - 13.362534898000135 - ], - [ - 123.74341881600006, - 13.34031810100008 - ], - [ - 123.75928795700005, - 13.323879299000083 - ], - [ - 123.77711022200006, - 13.317368882000082 - ], - [ - 123.79460696700019, - 13.30841705900015 - ], - [ - 123.80567467500023, - 13.287095445000176 - ], - [ - 123.82154381600017, - 13.242905992000118 - ], - [ - 123.82545006600006, - 13.260158596000124 - ], - [ - 123.83619225400017, - 13.256089585000069 - ], - [ - 123.84815514400012, - 13.241888739000146 - ], - [ - 123.85564212300008, - 13.228664455000114 - ], - [ - 123.78931725400005, - 13.232407945000148 - ], - [ - 123.76758873800023, - 13.224310614000117 - ], - [ - 123.75945071700002, - 13.197943427000126 - ], - [ - 123.75684655000023, - 13.180975653000147 - ], - [ - 123.752207879, - 13.16762929900014 - ], - [ - 123.74952233200023, - 13.154730536000116 - ], - [ - 123.75318444100017, - 13.139308986000088 - ], - [ - 123.77019290500007, - 13.110785223000093 - ], - [ - 123.76807701900023, - 13.098537502000127 - ], - [ - 123.74577884200019, - 13.092108466000113 - ], - [ - 123.74577884200019, - 13.08466217700014 - ], - [ - 123.75001061300011, - 13.07762278900016 - ], - [ - 123.74984785200016, - 13.07265859600011 - ], - [ - 123.74577884200019, - 13.064154364000089 - ], - [ - 123.76710045700017, - 13.053371486000088 - ], - [ - 123.77540123800023, - 13.050767320000176 - ], - [ - 123.78736412900017, - 13.051174221000096 - ], - [ - 123.7976994150001, - 13.055161851000065 - ], - [ - 123.81275475400011, - 13.06818268400015 - ], - [ - 123.81812584700006, - 13.070990302000098 - ], - [ - 123.85564212300008, - 13.11880117400014 - ], - [ - 123.861094597, - 13.127875067000133 - ], - [ - 123.86500084700012, - 13.136379299000069 - ], - [ - 123.87094160200004, - 13.142889716000155 - ], - [ - 123.88298587300002, - 13.146063544000128 - ], - [ - 123.89454186300006, - 13.143500067000119 - ], - [ - 123.90528405000006, - 13.129055080000157 - ], - [ - 123.91431725400011, - 13.125637111000145 - ], - [ - 123.92432701900006, - 13.125067450000174 - ], - [ - 123.93165123800006, - 13.122707424000126 - ], - [ - 123.93620853000002, - 13.117580471000124 - ], - [ - 123.93751061300023, - 13.1085879580001 - ], - [ - 123.943614129, - 13.107896226000065 - ], - [ - 123.97917728000019, - 13.098334052000084 - ], - [ - 123.99236087300002, - 13.09162018400012 - ], - [ - 124.0081486340001, - 13.080023505000113 - ], - [ - 124.02133222700004, - 13.06659577000012 - ], - [ - 124.02702884200019, - 13.054266669000171 - ], - [ - 124.07113691499998, - 13.016099351000108 - ], - [ - 124.08155358200011, - 13.009507554000123 - ], - [ - 124.09131920700023, - 13.0187442080001 - ], - [ - 124.11231530000018, - 13.060492255000128 - ], - [ - 124.11622155000018, - 13.074408270000106 - ], - [ - 124.12671959700006, - 13.07868073100012 - ], - [ - 124.14991295700005, - 13.07290273600016 - ], - [ - 124.1731876960001, - 13.063544012000122 - ], - [ - 124.18458092500023, - 13.05731842700007 - ], - [ - 124.18824303500011, - 13.03953685100008 - ], - [ - 124.18580162900017, - 13.020819403000118 - ], - [ - 124.17750084700018, - 13.009995835000112 - ], - [ - 124.16480553500006, - 13.016343492000146 - ], - [ - 124.15300540500007, - 13.001288153000132 - ], - [ - 124.14649498800017, - 12.98993561400006 - ], - [ - 124.13689212300008, - 12.961737372000172 - ], - [ - 124.11882571700008, - 12.925482489000075 - ], - [ - 124.11622155000018, - 12.916449286000073 - ], - [ - 124.11947675900004, - 12.900824286000088 - ], - [ - 124.13363691500004, - 12.878485419000143 - ], - [ - 124.142832879, - 12.814398505000085 - ], - [ - 124.14307701900023, - 12.79730866100013 - ], - [ - 124.12940514400012, - 12.677191473000136 - ], - [ - 124.12305748800006, - 12.662298895000092 - ], - [ - 124.09473717500023, - 12.643540757000125 - ], - [ - 124.08838951900012, - 12.628810940000136 - ], - [ - 124.09148196700019, - 12.611883856000148 - ], - [ - 124.09620201900012, - 12.601629950000117 - ], - [ - 124.09506269600016, - 12.59365469000008 - ], - [ - 124.08155358200011, - 12.583726304000066 - ], - [ - 124.08659915500002, - 12.577378648000135 - ], - [ - 124.09522545700023, - 12.55707428600013 - ], - [ - 124.08334394600016, - 12.553412177000084 - ], - [ - 124.06674238400004, - 12.541449286000145 - ], - [ - 124.05494225400005, - 12.537258205000114 - ], - [ - 124.04224694100017, - 12.53583405200014 - ], - [ - 124.01010175900004, - 12.537258205000114 - ], - [ - 123.98316491000017, - 12.546779690000122 - ], - [ - 123.95997155000012, - 12.568915106000091 - ], - [ - 123.93140709700006, - 12.611721096000096 - ], - [ - 123.93336022200018, - 12.622219143000152 - ], - [ - 123.92994225400017, - 12.623683986000117 - ], - [ - 123.92302493600008, - 12.62107982000012 - ], - [ - 123.91431725400011, - 12.619126695000162 - ], - [ - 123.89918053500011, - 12.635891018000095 - ], - [ - 123.87859134200008, - 12.64520905200014 - ], - [ - 123.87012780000012, - 12.660345770000134 - ], - [ - 123.86296634200008, - 12.679429429000123 - ], - [ - 123.84253991, - 12.716213283000101 - ], - [ - 123.84302819100017, - 12.735785223000079 - ], - [ - 123.84717858200023, - 12.755804755000142 - ], - [ - 123.84880618600008, - 12.77619049700013 - ], - [ - 123.842051629, - 12.80121491100013 - ], - [ - 123.82984459700006, - 12.81199778900013 - ], - [ - 123.81316165500019, - 12.818670966000099 - ], - [ - 123.79363040500002, - 12.83144765800013 - ], - [ - 123.81910241000006, - 12.831854559000135 - ], - [ - 123.83871503999998, - 12.839300848000121 - ], - [ - 123.85320071700002, - 12.853094794000128 - ], - [ - 123.86304772200006, - 12.87238190300016 - ], - [ - 123.87387129000015, - 12.866929429000123 - ], - [ - 123.88998457100004, - 12.85073476800008 - ], - [ - 123.89722741000006, - 12.845119533000073 - ], - [ - 123.90674889400023, - 12.841620184000178 - ], - [ - 123.91228274800008, - 12.842027085000097 - ], - [ - 123.91797936300023, - 12.843939520000148 - ], - [ - 123.92798912900005, - 12.845119533000073 - ], - [ - 123.94044030000023, - 12.848293361000131 - ], - [ - 123.94353274800002, - 12.856146552000126 - ], - [ - 123.94385826900023, - 12.866115627000113 - ], - [ - 123.94849694100017, - 12.87547435100005 - ], - [ - 123.95883222699999, - 12.880031643000095 - ], - [ - 123.96957441500004, - 12.878078518000137 - ], - [ - 123.97901451900012, - 12.874009507000096 - ], - [ - 123.98601321700019, - 12.87238190300016 - ], - [ - 124.00245201900012, - 12.879706122000158 - ], - [ - 124.01783287900005, - 12.893784898000106 - ], - [ - 124.02930748800006, - 12.91176992400014 - ], - [ - 124.03386478000002, - 12.930405992000132 - ], - [ - 124.02515709700006, - 12.955308335000083 - ], - [ - 124.00489342500023, - 12.961330471000082 - ], - [ - 123.95866946700002, - 12.954291083000115 - ], - [ - 123.94092858200023, - 12.957261460000126 - ], - [ - 123.91016686300023, - 12.97150299700013 - ], - [ - 123.89340254000004, - 12.974798895000063 - ], - [ - 123.88160241000017, - 12.966498114000089 - ], - [ - 123.87387129000015, - 12.947495835000083 - ], - [ - 123.86850019599999, - 12.926825262000165 - ], - [ - 123.86304772200006, - 12.913316148000177 - ], - [ - 123.83936608200023, - 12.888169664000117 - ], - [ - 123.82300866000006, - 12.877020575000088 - ], - [ - 123.79932701900012, - 12.871242580000128 - ], - [ - 123.79004967500023, - 12.866115627000113 - ], - [ - 123.78394616000017, - 12.864935614000089 - ], - [ - 123.77833092500023, - 12.867092190000093 - ], - [ - 123.76921634200008, - 12.876450914000117 - ], - [ - 123.76319420700005, - 12.878607489000117 - ], - [ - 123.75831139400012, - 12.87490469000008 - ], - [ - 123.74756920700005, - 12.857489325000117 - ], - [ - 123.73894290500019, - 12.851874091000113 - ], - [ - 123.73536217500012, - 12.85032786700016 - ], - [ - 123.729746941, - 12.846258856000105 - ], - [ - 123.72535241000006, - 12.845119533000073 - ], - [ - 123.72006269600016, - 12.859076239000146 - ], - [ - 123.71168053500017, - 12.87238190300016 - ], - [ - 123.72266686300023, - 12.876369533000144 - ], - [ - 123.73129316500015, - 12.883286851000136 - ], - [ - 123.73267662900005, - 12.88987864800012 - ], - [ - 123.72217858200017, - 12.892889716000113 - ], - [ - 123.69629967500023, - 12.891546942000133 - ], - [ - 123.69011478000019, - 12.888739325000174 - ], - [ - 123.69483483200011, - 12.882798570000148 - ], - [ - 123.69752037900017, - 12.87494538000007 - ], - [ - 123.69800866000006, - 12.864935614000089 - ], - [ - 123.67725670700023, - 12.88418203300013 - ], - [ - 123.68653405000012, - 12.905422268000123 - ], - [ - 123.70329837300014, - 12.927191473000079 - ], - [ - 123.69825280000012, - 12.93089427300012 - ], - [ - 123.69092858200011, - 12.927801825000131 - ], - [ - 123.68067467500023, - 12.92698802300012 - ], - [ - 123.66846764400006, - 12.924139716000084 - ], - [ - 123.66342207100016, - 12.917141018000109 - ], - [ - 123.66138756600006, - 12.908351955000143 - ], - [ - 123.65699303500006, - 12.900295315000108 - ], - [ - 123.64966881600006, - 12.890326239000117 - ], - [ - 123.64893639400012, - 12.886297919000143 - ], - [ - 123.64600670700011, - 12.88568756700009 - ], - [ - 123.63249759200019, - 12.886053778000104 - ], - [ - 123.61573326900012, - 12.889471747000115 - ], - [ - 123.60515384200002, - 12.892889716000113 - ], - [ - 123.598399285, - 12.89655182500016 - ], - [ - 123.57113691500004, - 12.927964585000097 - ], - [ - 123.55909264400012, - 12.93789297100011 - ], - [ - 123.53972415500019, - 12.948065497000144 - ], - [ - 123.52930748800011, - 12.951646226000122 - ], - [ - 123.52100670700011, - 12.953436591000113 - ], - [ - 123.51303144600016, - 12.956691799000154 - ], - [ - 123.50310306100008, - 12.964829820000162 - ], - [ - 123.48804772200006, - 12.985581773000163 - ], - [ - 123.46810957100016, - 12.99599844000015 - ], - [ - 123.45020592500012, - 13.029282945000148 - ], - [ - 123.44125410200016, - 13.036851304000109 - ], - [ - 123.41879316500015, - 13.039252020000148 - ], - [ - 123.40202884200008, - 13.043280341000113 - ], - [ - 123.38502037900017, - 13.044094143000123 - ], - [ - 123.3621525400001, - 13.036851304000109 - ], - [ - 123.33041425900004, - 13.01902903900013 - ], - [ - 123.31006920700023, - 13.01235586100016 - ], - [ - 123.30079186300006, - 13.019761460000069 - ], - [ - 123.29615319100006, - 13.03607819200009 - ], - [ - 123.28785241000017, - 13.054348049000154 - ], - [ - 123.28443444100017, - 13.071519273000177 - ], - [ - 123.29395592500023, - 13.08466217700014 - ], - [ - 123.27898196700014, - 13.120184637000122 - ], - [ - 123.30518639400023, - 13.198635158000158 - ], - [ - 123.30079186300006, - 13.235500393000123 - ], - [ - 123.28443444100017, - 13.253607489000132 - ], - [ - 123.24732506600006, - 13.279201565000122 - ], - [ - 123.23194420700011, - 13.29755280200007 - ], - [ - 123.22779381600017, - 13.30630117400014 - ], - [ - 123.222422722, - 13.322007554000109 - ], - [ - 123.21810957100004, - 13.331040757000125 - ], - [ - 123.19092858200011, - 13.35903554900014 - ], - [ - 123.19703209700018, - 13.386542059000163 - ], - [ - 123.18775475400005, - 13.42047760600012 - ], - [ - 123.16879316500004, - 13.449204820000162 - ], - [ - 123.14625084700006, - 13.46137116100006 - ], - [ - 123.11793053500011, - 13.468898830000114 - ], - [ - 123.06519616000011, - 13.501776434000107 - ], - [ - 123.03663170700011, - 13.509222723000093 - ], - [ - 123.01970462300014, - 13.511379299000083 - ], - [ - 122.99708092500023, - 13.520697333000129 - ], - [ - 122.981700066, - 13.522894598000121 - ], - [ - 122.97201582100016, - 13.527533270000148 - ], - [ - 122.94776451900006, - 13.549994208000143 - ], - [ - 122.88550866000017, - 13.593329169000114 - ], - [ - 122.872813347, - 13.598578192000105 - ], - [ - 122.85914147200018, - 13.60610586100016 - ], - [ - 122.82894941500015, - 13.641750393000109 - ], - [ - 122.81470787900017, - 13.65379466400013 - ], - [ - 122.86255944100017, - 13.694769598000136 - ], - [ - 122.81373131600017, - 13.748439846000124 - ], - [ - 122.78931725400005, - 13.768540757000082 - ], - [ - 122.75879967500012, - 13.783596096000096 - ], - [ - 122.75879967500012, - 13.777329820000134 - ], - [ - 122.75269616, - 13.783596096000096 - ], - [ - 122.75879967500012, - 13.790350653000118 - ], - [ - 122.77149498800006, - 13.790961005000085 - ], - [ - 122.76685631600006, - 13.799546617000189 - ], - [ - 122.75310306100002, - 13.81049225500007 - ], - [ - 122.73902428500017, - 13.818304755000057 - ], - [ - 122.69996178500006, - 13.825832424000112 - ], - [ - 122.69068444100017, - 13.8319766300001 - ], - [ - 122.67872155000023, - 13.82078685100008 - ], - [ - 122.66578209700006, - 13.81948476800008 - ], - [ - 122.65316816500015, - 13.82607656500015 - ], - [ - 122.64283287900005, - 13.838812567000105 - ], - [ - 122.6448673840001, - 13.843003648000135 - ], - [ - 122.65170332099999, - 13.848089911000073 - ], - [ - 122.65658613400015, - 13.854315497000115 - ], - [ - 122.65300540500019, - 13.86237213700015 - ], - [ - 122.62273196700019, - 13.891994533000101 - ], - [ - 122.61036217500023, - 13.899318752000113 - ], - [ - 122.59693444100017, - 13.904486395000106 - ], - [ - 122.58448326900023, - 13.906439520000148 - ], - [ - 122.580332879, - 13.913275458000086 - ], - [ - 122.57764733200023, - 13.926459052000126 - ], - [ - 122.57211347700004, - 13.93504466400013 - ], - [ - 122.56031334700006, - 13.92816803600013 - ], - [ - 122.55591881600006, - 13.937892971000082 - ], - [ - 122.54297936300023, - 13.952582098000079 - ], - [ - 122.54029381600017, - 13.9585635440001 - ], - [ - 122.53687584700018, - 13.961127020000106 - ], - [ - 122.51587975400005, - 13.934393622000087 - ], - [ - 122.45948326900006, - 13.937892971000082 - ], - [ - 122.43490644600016, - 13.945990302000112 - ], - [ - 122.41627037900017, - 13.961655992000175 - ], - [ - 122.41309655000012, - 13.94806549700013 - ], - [ - 122.42066491000017, - 13.932277736000088 - ], - [ - 122.433848504, - 13.919338283000073 - ], - [ - 122.44727623800011, - 13.913885809000135 - ], - [ - 122.45085696700008, - 13.906195380000113 - ], - [ - 122.49976647200006, - 13.837795315000136 - ], - [ - 122.50961347700016, - 13.82001373900006 - ], - [ - 122.50879967500023, - 13.807766018000095 - ], - [ - 122.50269616000017, - 13.793158270000077 - ], - [ - 122.50391686300011, - 13.771918036000088 - ], - [ - 122.512461785, - 13.73578522300015 - ], - [ - 122.49057050899998, - 13.740627346000124 - ], - [ - 122.48552493600008, - 13.721625067000133 - ], - [ - 122.49138431100019, - 13.677069403000132 - ], - [ - 122.49756920700017, - 13.652044989000132 - ], - [ - 122.51295006600012, - 13.630438544000128 - ], - [ - 122.54997806100002, - 13.595160223000093 - ], - [ - 122.62175540500002, - 13.55272044500012 - ], - [ - 122.63599694100006, - 13.537095445000134 - ], - [ - 122.63233483200005, - 13.520697333000129 - ], - [ - 122.60954837300002, - 13.531968492000118 - ], - [ - 122.56714928500017, - 13.56386953300013 - ], - [ - 122.57292728000002, - 13.5480410830001 - ], - [ - 122.598887566, - 13.508286851000108 - ], - [ - 122.64283287900005, - 13.457586981000134 - ], - [ - 122.65430748800011, - 13.44041575700011 - ], - [ - 122.66325931100013, - 13.42047760600012 - ], - [ - 122.67269941500004, - 13.379299221000153 - ], - [ - 122.67701256600006, - 13.3419457050001 - ], - [ - 122.67701256600006, - 13.300970770000077 - ], - [ - 122.67888431100019, - 13.289862372000144 - ], - [ - 122.68295332100016, - 13.282294012000108 - ], - [ - 122.68767337300008, - 13.276109117000132 - ], - [ - 122.69068444100017, - 13.269598700000131 - ], - [ - 122.69255618600002, - 13.24876536700016 - ], - [ - 122.69223066500004, - 13.236802476000122 - ], - [ - 122.69068444100017, - 13.228664455000114 - ], - [ - 122.68523196700002, - 13.225246486000103 - ], - [ - 122.67579186300011, - 13.222113348000121 - ], - [ - 122.66716556100019, - 13.21808502800016 - ], - [ - 122.66325931100013, - 13.21161530200007 - ], - [ - 122.65316816500015, - 13.20099518400012 - ], - [ - 122.63013756600017, - 13.188055731000105 - ], - [ - 122.60482832100004, - 13.177557684000135 - ], - [ - 122.588145379, - 13.174017645000148 - ], - [ - 122.57097415500007, - 13.184556382000125 - ], - [ - 122.50505618600002, - 13.239203192000076 - ], - [ - 122.50757897200006, - 13.259466864000089 - ], - [ - 122.51807701900012, - 13.2948672550001 - ], - [ - 122.51929772200006, - 13.310614325000145 - ], - [ - 122.50114993600002, - 13.368068752000141 - ], - [ - 122.40259850400005, - 13.496161200000103 - ], - [ - 122.4002384770001, - 13.502875067000147 - ], - [ - 122.39844811300011, - 13.515814520000148 - ], - [ - 122.39519290500007, - 13.522894598000121 - ], - [ - 122.37598717500012, - 13.540838934000163 - ], - [ - 122.36947675900004, - 13.549790757000096 - ], - [ - 122.34131920700023, - 13.561102606000176 - ], - [ - 122.33497155000006, - 13.574693101000136 - ], - [ - 122.31902103000019, - 13.592230536000073 - ], - [ - 122.25855553500017, - 13.592027085000126 - ], - [ - 122.25928795700011, - 13.606024481000176 - ], - [ - 122.24154707100004, - 13.611965236000103 - ], - [ - 122.20753014400006, - 13.61432526200015 - ], - [ - 122.19402103000019, - 13.622788804000109 - ], - [ - 122.18995201900023, - 13.631048895000092 - ], - [ - 122.1863712900001, - 13.648016669000157 - ], - [ - 122.18043053500006, - 13.656927802000098 - ], - [ - 122.17221113400015, - 13.66669342700014 - ], - [ - 122.118418816, - 13.752101955000086 - ], - [ - 122.09310957100016, - 13.780585028000175 - ], - [ - 122.05990644600016, - 13.804632880000113 - ], - [ - 122.05372155000006, - 13.785142320000134 - ], - [ - 122.03891035199999, - 13.789618231000091 - ], - [ - 122.02198326900012, - 13.803127346000068 - ], - [ - 122.00879967500006, - 13.81085846600017 - ], - [ - 121.98943118600008, - 13.81004466400016 - ], - [ - 121.98585045700005, - 13.8120791690001 - ], - [ - 121.94988040500019, - 13.844549872000172 - ], - [ - 121.93702233200005, - 13.851792710000112 - ], - [ - 121.92481530000012, - 13.85537344000008 - ], - [ - 121.91358483200011, - 13.857123114000075 - ], - [ - 121.90300540500007, - 13.860541083000086 - ], - [ - 121.88233483200023, - 13.877997137000136 - ], - [ - 121.87086022200018, - 13.885728257000054 - ], - [ - 121.85962975400011, - 13.89130280200007 - ], - [ - 121.82715905000012, - 13.899725653000118 - ], - [ - 121.81299889400006, - 13.914943752000099 - ], - [ - 121.80176842500006, - 13.933091539000188 - ], - [ - 121.78630618600008, - 13.948675848000093 - ], - [ - 121.77800540500019, - 13.949042059000107 - ], - [ - 121.74024498800011, - 13.961900132000125 - ], - [ - 121.72486412900017, - 13.969142971000139 - ], - [ - 121.71843509200008, - 13.95530833500014 - ], - [ - 121.70101972699999, - 13.944769598000093 - ], - [ - 121.697520379, - 13.931301174000112 - ], - [ - 121.68995201900017, - 13.925970770000134 - ], - [ - 121.64226321700019, - 13.913885809000135 - ], - [ - 121.63689212300002, - 13.909613348000121 - ], - [ - 121.62175540500007, - 13.893459377000156 - ], - [ - 121.61312910200004, - 13.893052476000065 - ], - [ - 121.595957879, - 13.897406317000147 - ], - [ - 121.59107506600006, - 13.896795966000099 - ], - [ - 121.57789147200018, - 13.888006903000118 - ], - [ - 121.54932701900012, - 13.878159898000192 - ], - [ - 121.53052819100006, - 13.864976304000066 - ], - [ - 121.52328535200004, - 13.861883856000162 - ], - [ - 121.51587975400005, - 13.860012111000103 - ], - [ - 121.49903405000023, - 13.859076239000117 - ], - [ - 121.494395379, - 13.85809967700014 - ], - [ - 121.48462975400017, - 13.851792710000112 - ], - [ - 121.45460045700023, - 13.819240627000141 - ], - [ - 121.43344160200004, - 13.79637278900013 - ], - [ - 121.44076582100004, - 13.72638580900012 - ], - [ - 121.43628991000017, - 13.700995184000107 - ], - [ - 121.44581139400017, - 13.700913804000123 - ], - [ - 121.45232181100008, - 13.699448960000069 - ], - [ - 121.464121941, - 13.694769598000136 - ], - [ - 121.434336785, - 13.66356028900016 - ], - [ - 121.43002363400004, - 13.656927802000098 - ], - [ - 121.38884524800002, - 13.666734117000132 - ], - [ - 121.37476647200012, - 13.66746653900016 - ], - [ - 121.35564212300002, - 13.657131252000156 - ], - [ - 121.29810631600006, - 13.614894924000126 - ], - [ - 121.27881920700011, - 13.595038153000118 - ], - [ - 121.26351972700016, - 13.600043036000073 - ], - [ - 121.24919681100008, - 13.608628648000177 - ], - [ - 121.24496504000015, - 13.612250067000133 - ], - [ - 121.21778405000023, - 13.623236395000106 - ], - [ - 121.20460045700005, - 13.625718492000118 - ], - [ - 121.18669681100002, - 13.626532294000128 - ], - [ - 121.17798912900005, - 13.629095770000134 - ], - [ - 121.16944420700011, - 13.634588934000163 - ], - [ - 121.15870201900012, - 13.639471747000144 - ], - [ - 121.14258873800023, - 13.640204169000171 - ], - [ - 121.11011803500006, - 13.632961330000143 - ], - [ - 121.09449303500017, - 13.626898505000142 - ], - [ - 121.08041425900004, - 13.61908600500007 - ], - [ - 121.07048587300014, - 13.622503973000079 - ], - [ - 121.04753665500002, - 13.627264716000155 - ], - [ - 121.03891035200004, - 13.6327578800001 - ], - [ - 121.03394616000017, - 13.641831773000192 - ], - [ - 121.03736412900017, - 13.64712148600016 - ], - [ - 121.04322350400005, - 13.652980861000117 - ], - [ - 121.04639733200011, - 13.663763739000117 - ], - [ - 121.04883873800023, - 13.688299872000144 - ], - [ - 121.05274498800023, - 13.705877997000172 - ], - [ - 121.05347741000006, - 13.722113348000121 - ], - [ - 121.039805535, - 13.758693752000141 - ], - [ - 121.03589928500006, - 13.762600002000141 - ], - [ - 121.01628665500007, - 13.775295315000108 - ], - [ - 121.00375410200016, - 13.780910549000112 - ], - [ - 120.99097741, - 13.783636786000088 - ], - [ - 120.98096764400023, - 13.780462958000115 - ], - [ - 120.90308678500017, - 13.692938544000157 - ], - [ - 120.89503014400012, - 13.687974351000122 - ], - [ - 120.88746178500017, - 13.693508205000128 - ], - [ - 120.88233483200005, - 13.705226955000128 - ], - [ - 120.88070722700004, - 13.716864325000131 - ], - [ - 120.88502037900005, - 13.722113348000121 - ], - [ - 120.89323978000002, - 13.727280992000118 - ], - [ - 120.89820397200018, - 13.738836981000148 - ], - [ - 120.90186608200023, - 13.750392971000082 - ], - [ - 120.90577233200023, - 13.755601304000066 - ], - [ - 120.91871178500006, - 13.757025458000129 - ], - [ - 120.92603600400005, - 13.76166413000007 - ], - [ - 120.92896569100017, - 13.770249742000175 - ], - [ - 120.92904707100016, - 13.783596096000096 - ], - [ - 120.91260826900023, - 13.800034898000177 - ], - [ - 120.90919030000023, - 13.804632880000113 - ], - [ - 120.90870201900017, - 13.816107489000075 - ], - [ - 120.91391035200016, - 13.83734772300015 - ], - [ - 120.91537519600004, - 13.848700262000122 - ], - [ - 120.91488691500004, - 13.864935614000075 - ], - [ - 120.912364129, - 13.881781317000076 - ], - [ - 120.90626061300023, - 13.896470445000162 - ], - [ - 120.89503014400012, - 13.906439520000148 - ], - [ - 120.87671959700006, - 13.912258205000114 - ], - [ - 120.78687584700006, - 13.923325914000145 - ], - [ - 120.74594160200004, - 13.933783270000134 - ], - [ - 120.72364342500006, - 13.934393622000087 - ], - [ - 120.70484459700006, - 13.927435614000103 - ], - [ - 120.69743899800008, - 13.913885809000135 - ], - [ - 120.70093834700006, - 13.89614492400014 - ], - [ - 120.71436608200023, - 13.876369533000116 - ], - [ - 120.72291100400017, - 13.85541413000007 - ], - [ - 120.70337975400017, - 13.851711330000128 - ], - [ - 120.6622827480002, - 13.85927969000008 - ], - [ - 120.65259850400005, - 13.84552643400015 - ], - [ - 120.65626061300006, - 13.827093817000119 - ], - [ - 120.66488691499998, - 13.806626695000148 - ], - [ - 120.66968834700018, - 13.78693268400012 - ], - [ - 120.66342207100004, - 13.775376695000176 - ], - [ - 120.649668816, - 13.784247137000136 - ], - [ - 120.62810306100019, - 13.81085846600017 - ], - [ - 120.62012780000023, - 13.846625067000105 - ], - [ - 120.61841881600006, - 13.931626695000134 - ], - [ - 120.60132897200018, - 13.969142971000139 - ], - [ - 120.61687259200019, - 13.971665757000068 - ], - [ - 120.62891686300011, - 13.981268622000144 - ], - [ - 120.63477623800023, - 13.991603908000144 - ], - [ - 120.63168379000015, - 13.996486721000124 - ], - [ - 120.61988366, - 14.002915757000125 - ], - [ - 120.61744225400017, - 14.017889716000155 - ], - [ - 120.62183678500006, - 14.076564846000096 - ], - [ - 120.61947675899998, - 14.104234117000175 - ], - [ - 120.60775800900004, - 14.124904690000108 - ], - [ - 120.58033287900005, - 14.13300202000012 - ], - [ - 120.58033287900005, - 14.140448309000107 - ], - [ - 120.59571373800011, - 14.14793528900016 - ], - [ - 120.59742272200012, - 14.156927802000098 - ], - [ - 120.58887780000006, - 14.166164455000143 - ], - [ - 120.57349694100006, - 14.174546617000118 - ], - [ - 120.58301842500023, - 14.174465236000131 - ], - [ - 120.589610222, - 14.176011460000083 - ], - [ - 120.60132897200018, - 14.181382554000123 - ], - [ - 120.60132897200018, - 14.188218492000146 - ], - [ - 120.58725019600016, - 14.20026276200015 - ], - [ - 120.59595787900005, - 14.217962958000072 - ], - [ - 120.61247806100013, - 14.237046617000146 - ], - [ - 120.62126712300008, - 14.25340403900016 - ], - [ - 120.62745201900023, - 14.269598700000117 - ], - [ - 120.64332116000017, - 14.27708567900008 - ], - [ - 120.683360222, - 14.283840236000117 - ], - [ - 120.69760175900004, - 14.289496161000116 - ], - [ - 120.713145379, - 14.298529364000117 - ], - [ - 120.72535241000011, - 14.309556382000068 - ], - [ - 120.73047936300011, - 14.321356512000136 - ], - [ - 120.735606316, - 14.327215887000179 - ], - [ - 120.76002037900017, - 14.337144273000177 - ], - [ - 120.76832116000006, - 14.34218984600011 - ], - [ - 120.78956139400023, - 14.375311591000141 - ], - [ - 120.87794030000006, - 14.458889065000108 - ], - [ - 120.88607832099999, - 14.462388414000188 - ], - [ - 120.89747155000023, - 14.463120835000126 - ], - [ - 120.91920006600006, - 14.461981512000179 - ], - [ - 120.92611738400004, - 14.464667059000163 - ], - [ - 120.94336998800023, - 14.483099677000112 - ], - [ - 120.97038821700019, - 14.501898505000057 - ], - [ - 120.98031660199999, - 14.51544830900012 - ], - [ - 120.98438561300023, - 14.53400299700013 - ], - [ - 120.98015384200002, - 14.557440497000101 - ], - [ - 120.95883222700016, - 14.591782945000148 - ], - [ - 120.95020592500023, - 14.612779039000188 - ], - [ - 120.94312584700018, - 14.653509833000072 - ], - [ - 120.93653405000012, - 14.66742584800015 - ], - [ - 120.90691165500007, - 14.706732489000146 - ], - [ - 120.90235436300023, - 14.71893952000012 - ], - [ - 120.89429772200018, - 14.725083726000108 - ], - [ - 120.84717858200011, - 14.7437197940001 - ], - [ - 120.84392337300008, - 14.74909088700015 - ], - [ - 120.84343509200008, - 14.75568268400012 - ], - [ - 120.84058678500006, - 14.761216539000145 - ], - [ - 120.83008873800023, - 14.763617255000085 - ], - [ - 120.73161868600002, - 14.766669012000179 - ], - [ - 120.66968834700018, - 14.777289130000128 - ], - [ - 120.66382897200006, - 14.77895742400014 - ], - [ - 120.65577233200011, - 14.781236070000105 - ], - [ - 120.64210045700017, - 14.78701406500008 - ], - [ - 120.63209069100017, - 14.79547760600012 - ], - [ - 120.62810306100019, - 14.807684637000179 - ], - [ - 120.62891686300011, - 14.84202708500014 - ], - [ - 120.627207879, - 14.858710028000175 - ], - [ - 120.62126712300008, - 14.872870184000107 - ], - [ - 120.61988366, - 14.840480861000103 - ], - [ - 120.62126712300008, - 14.831854559000092 - ], - [ - 120.61833743600008, - 14.82831452000012 - ], - [ - 120.60759524800002, - 14.818264065000136 - ], - [ - 120.60385175900004, - 14.824937242000189 - ], - [ - 120.60092207099999, - 14.825628973000136 - ], - [ - 120.5939233730002, - 14.818264065000136 - ], - [ - 120.60572350400017, - 14.884833075000131 - ], - [ - 120.60132897200018, - 14.90082428600013 - ], - [ - 120.585703972, - 14.90281810100008 - ], - [ - 120.57732181100008, - 14.88349030200014 - ], - [ - 120.57349694100006, - 14.838771877000099 - ], - [ - 120.55274498800023, - 14.849920966000113 - ], - [ - 120.54517662900011, - 14.836859442000133 - ], - [ - 120.54542076900023, - 14.827093817000105 - ], - [ - 120.54615319100017, - 14.787827867000175 - ], - [ - 120.53646894599999, - 14.723211981000134 - ], - [ - 120.53931725400005, - 14.702826239000146 - ], - [ - 120.578379754, - 14.659409898000192 - ], - [ - 120.58220462300014, - 14.648260809000178 - ], - [ - 120.57691491000006, - 14.636948960000097 - ], - [ - 120.57496178500011, - 14.621649481000134 - ], - [ - 120.5939233730002, - 14.550726630000057 - ], - [ - 120.59791100400017, - 14.505601304000095 - ], - [ - 120.58838951900006, - 14.466986395000134 - ], - [ - 120.5646264980002, - 14.441229559000092 - ], - [ - 120.5262150400001, - 14.434637762000122 - ], - [ - 120.51685631600006, - 14.437201239000132 - ], - [ - 120.50977623800006, - 14.440822658000087 - ], - [ - 120.50220787900005, - 14.443182684000135 - ], - [ - 120.491465691, - 14.442084052000098 - ], - [ - 120.4884546230002, - 14.43793366100006 - ], - [ - 120.48682701900012, - 14.430731512000122 - ], - [ - 120.48145592500023, - 14.423976955000086 - ], - [ - 120.46705162900017, - 14.421047268000066 - ], - [ - 120.46322675900015, - 14.424261786000116 - ], - [ - 120.46045983200011, - 14.431545315000136 - ], - [ - 120.45590254000015, - 14.43878815300016 - ], - [ - 120.41016686300023, - 14.452053127000099 - ], - [ - 120.40211022200012, - 14.455755927000126 - ], - [ - 120.38200931100008, - 14.48029205900015 - ], - [ - 120.37680097700016, - 14.508205471000096 - ], - [ - 120.38160241000006, - 14.568101304000137 - ], - [ - 120.37794030000006, - 14.60203685100008 - ], - [ - 120.36736087300002, - 14.62075429900014 - ], - [ - 120.326426629, - 14.64752838700015 - ], - [ - 120.31519616, - 14.641302802000098 - ], - [ - 120.30494225400017, - 14.64057038000007 - ], - [ - 120.29688561300023, - 14.64484284100017 - ], - [ - 120.292246941, - 14.653753973000107 - ], - [ - 120.285411004, - 14.653753973000107 - ], - [ - 120.25318444100017, - 14.69863515800013 - ], - [ - 120.24236087300008, - 14.729641018000152 - ], - [ - 120.26091556100008, - 14.7437197940001 - ], - [ - 120.27263431100008, - 14.747056382000125 - ], - [ - 120.26514733200011, - 14.754584052000084 - ], - [ - 120.243907097, - 14.767035223000093 - ], - [ - 120.247325066, - 14.778062242000146 - ], - [ - 120.25538170700017, - 14.78705475500007 - ], - [ - 120.26465905000012, - 14.795152085000097 - ], - [ - 120.27173912900017, - 14.803941148000149 - ], - [ - 120.27767988399998, - 14.802720445000134 - ], - [ - 120.28337649800008, - 14.806708075000117 - ], - [ - 120.28834069100006, - 14.814764716000141 - ], - [ - 120.292246941, - 14.82566966400013 - ], - [ - 120.27572675900015, - 14.827134507000096 - ], - [ - 120.2677514980002, - 14.829535223000136 - ], - [ - 120.26433353000019, - 14.835353908000087 - ], - [ - 120.26335696700019, - 14.846584377000084 - ], - [ - 120.25977623800023, - 14.851507880000142 - ], - [ - 120.25261478000019, - 14.852606512000179 - ], - [ - 120.24073326900023, - 14.852362372000144 - ], - [ - 120.23031660200016, - 14.85980866100013 - ], - [ - 120.22022545700011, - 14.873358466000099 - ], - [ - 120.20932050900004, - 14.880031643000137 - ], - [ - 120.19605553500017, - 14.866644598000136 - ], - [ - 120.20142662900005, - 14.843085028000104 - ], - [ - 120.19711347700004, - 14.808010158000116 - ], - [ - 120.187266472, - 14.774969794000157 - ], - [ - 120.17554772200006, - 14.757391669000128 - ], - [ - 120.16179446700019, - 14.756415106000148 - ], - [ - 120.14356530000023, - 14.760402736000131 - ], - [ - 120.12777753999998, - 14.767035223000093 - ], - [ - 120.12094160200016, - 14.773871161000116 - ], - [ - 120.11573326900006, - 14.785467841000127 - ], - [ - 120.090098504, - 14.794338283000087 - ], - [ - 120.07992597700016, - 14.803941148000149 - ], - [ - 120.08822675900015, - 14.807440497000144 - ], - [ - 120.09343509200002, - 14.811835028000132 - ], - [ - 120.096934441, - 14.817613023000177 - ], - [ - 120.10043379000004, - 14.82566966400013 - ], - [ - 120.09595787900005, - 14.823472398000135 - ], - [ - 120.07992597700016, - 14.818264065000136 - ], - [ - 120.05665123800023, - 14.893255927000084 - ], - [ - 120.04981530000012, - 14.9312197940001 - ], - [ - 120.0568139980002, - 15.022162177000055 - ], - [ - 120.05298912900011, - 15.062445380000128 - ], - [ - 120.01807701900006, - 15.206122137000179 - ], - [ - 120.00831139400023, - 15.215480861000117 - ], - [ - 120.00245201900006, - 15.219671942000147 - ], - [ - 120.00196373800011, - 15.22943756700009 - ], - [ - 120.00489342500012, - 15.24681224200016 - ], - [ - 120.00513756600017, - 15.269435940000122 - ], - [ - 120.00123131600017, - 15.277411200000174 - ], - [ - 119.98064212300002, - 15.307806708000143 - ], - [ - 119.96387780000012, - 15.341009833000072 - ], - [ - 119.95337975400005, - 15.356390692000105 - ], - [ - 119.89698326900012, - 15.410589911000073 - ], - [ - 119.88819420700023, - 15.42902252800009 - ], - [ - 119.890879754, - 15.437445380000057 - ], - [ - 119.90544681100002, - 15.446763414000188 - ], - [ - 119.90870201900006, - 15.452297268 - ], - [ - 119.90821373800011, - 15.461615302000055 - ], - [ - 119.90699303500017, - 15.468654690000122 - ], - [ - 119.90186608200005, - 15.48297760600012 - ], - [ - 119.92066491, - 15.471502997000172 - ], - [ - 119.94092858200023, - 15.475775458000086 - ], - [ - 119.95728600400005, - 15.49144114800005 - ], - [ - 119.96387780000012, - 15.514349677000055 - ], - [ - 119.96208743600002, - 15.521307684000035 - ], - [ - 119.95728600400005, - 15.528876044000086 - ], - [ - 119.95167076900023, - 15.535060940000065 - ], - [ - 119.94654381600006, - 15.53758372600008 - ], - [ - 119.94410241000011, - 15.542547919000029 - ], - [ - 119.94174238400015, - 15.55361562700007 - ], - [ - 119.93734785200016, - 15.565578518 - ], - [ - 119.92920983200023, - 15.57298411700016 - ], - [ - 119.92774498800006, - 15.568670966000084 - ], - [ - 119.92237389400012, - 15.558742580000072 - ], - [ - 119.90430748800011, - 15.597072658000016 - ], - [ - 119.90186608200005, - 15.610256252000156 - ], - [ - 119.90455162900005, - 15.62128327 - ], - [ - 119.91765384200019, - 15.647447007000054 - ], - [ - 119.92237389400012, - 15.661118882 - ], - [ - 119.91968834700006, - 15.690334377000127 - ], - [ - 119.9025171230002, - 15.704657294000114 - ], - [ - 119.88135826900012, - 15.71771881700009 - ], - [ - 119.86719811300011, - 15.743068752000042 - ], - [ - 119.88941491000006, - 15.748032945000162 - ], - [ - 119.89405358200005, - 15.763902085 - ], - [ - 119.88819420700023, - 15.805731512000122 - ], - [ - 119.89177493600019, - 15.822984117000132 - ], - [ - 119.89625084700018, - 15.837469794000171 - ], - [ - 119.89861087300014, - 15.853176174000126 - ], - [ - 119.89503014400023, - 15.87400950700011 - ], - [ - 119.87891686300006, - 15.914740302 - ], - [ - 119.86719811300011, - 15.935003973 - ], - [ - 119.85401451900023, - 15.949164130000113 - ], - [ - 119.8282983730002, - 15.955715236000017 - ], - [ - 119.81251061300023, - 15.941880601000108 - ], - [ - 119.80014082100004, - 15.926662502000127 - ], - [ - 119.78516686300006, - 15.928656317000062 - ], - [ - 119.78207441499998, - 15.924790757000082 - ], - [ - 119.77084394599999, - 15.914984442000119 - ], - [ - 119.75586998800023, - 15.944566148000192 - ], - [ - 119.75782311300011, - 16.05898672100001 - ], - [ - 119.76026451900023, - 16.075588283000073 - ], - [ - 119.77491295700023, - 16.117987372000144 - ], - [ - 119.77833092500023, - 16.137844143000066 - ], - [ - 119.77515709700018, - 16.146877346000068 - ], - [ - 119.76099694100017, - 16.162014065000065 - ], - [ - 119.75782311300011, - 16.172267971000096 - ], - [ - 119.75570722699999, - 16.203436591000084 - ], - [ - 119.75782311300011, - 16.216701565 - ], - [ - 119.77605228000019, - 16.280747789000188 - ], - [ - 119.78191165500002, - 16.322251695000162 - ], - [ - 119.79078209700018, - 16.341864325000145 - ], - [ - 119.80193118600019, - 16.357855536000145 - ], - [ - 119.81251061300023, - 16.367499091000113 - ], - [ - 119.81706790500019, - 16.368312893000123 - ], - [ - 119.82837975400017, - 16.366603908000016 - ], - [ - 119.83285566500004, - 16.367499091000113 - ], - [ - 119.84961998800017, - 16.378892320000162 - ], - [ - 119.85401451900023, - 16.38117096600014 - ], - [ - 119.87029056100008, - 16.385402736000074 - ], - [ - 119.89161217500023, - 16.387355861000017 - ], - [ - 119.91635175900004, - 16.380845445000134 - ], - [ - 119.92579186300023, - 16.364976304 - ], - [ - 119.92579186300023, - 16.3451195330001 - ], - [ - 119.90186608200005, - 16.25079987200003 - ], - [ - 119.91480553500017, - 16.24249909100014 - ], - [ - 119.96021569100017, - 16.231431382000025 - ], - [ - 119.97022545700023, - 16.226548570000134 - ], - [ - 119.97624759200008, - 16.218247789000046 - ], - [ - 120.00513756600017, - 16.188421942000062 - ], - [ - 120.01514733200023, - 16.181870835000083 - ], - [ - 120.037364129, - 16.182359117000075 - ], - [ - 120.05005944100017, - 16.18085358300003 - ], - [ - 120.06153405000012, - 16.173000393000123 - ], - [ - 120.07992597700016, - 16.154527085 - ], - [ - 120.08773847700016, - 16.157212632000082 - ], - [ - 120.09115644600016, - 16.15346914300015 - ], - [ - 120.10043379000004, - 16.089748440000093 - ], - [ - 120.1056421230002, - 16.06964752800006 - ], - [ - 120.11915123800006, - 16.05573151200015 - ], - [ - 120.13884524800014, - 16.046128648000163 - ], - [ - 120.18531334700018, - 16.03339264500012 - ], - [ - 120.20850670700011, - 16.032660223 - ], - [ - 120.22982832100016, - 16.03729889500012 - ], - [ - 120.247813347, - 16.048488674000126 - ], - [ - 120.25766035200004, - 16.052191473000093 - ], - [ - 120.292246941, - 16.055609442 - ], - [ - 120.30665123800011, - 16.04466380400011 - ], - [ - 120.29908287900005, - 16.017401434000035 - ], - [ - 120.31137128999998, - 16.027085679 - ], - [ - 120.32276451900017, - 16.04857005400011 - ], - [ - 120.33383222699999, - 16.05898672100001 - ], - [ - 120.34083092500006, - 16.054877020000063 - ], - [ - 120.35254967500018, - 16.052720445000077 - ], - [ - 120.36329186300006, - 16.05548737200003 - ], - [ - 120.36736087300002, - 16.06582265800013 - ], - [ - 120.36101321700019, - 16.07318756700012 - ], - [ - 120.34815514400006, - 16.07029857000019 - ], - [ - 120.33464603000013, - 16.065252997000144 - ], - [ - 120.326426629, - 16.06582265800013 - ], - [ - 120.32935631600006, - 16.079494533000158 - ], - [ - 120.36524498800023, - 16.10871002800009 - ], - [ - 120.37419681100008, - 16.123846747000087 - ], - [ - 120.37859134200002, - 16.134100653000033 - ], - [ - 120.397715691, - 16.15403880400011 - ], - [ - 120.40211022200012, - 16.165472723000065 - ], - [ - 120.40211022200012, - 16.20575592700014 - ], - [ - 120.39747155000006, - 16.22898997600008 - ], - [ - 120.38550866000006, - 16.25193919500005 - ], - [ - 120.35377037900017, - 16.291693427000055 - ], - [ - 120.35377037900017, - 16.271307684000178 - ], - [ - 120.34864342500006, - 16.279527085000083 - ], - [ - 120.342051629, - 16.28558991100006 - ], - [ - 120.33627363400004, - 16.292181708000143 - ], - [ - 120.31218509200019, - 16.456203518000095 - ], - [ - 120.29908287900005, - 16.493801174000097 - ], - [ - 120.30665123800011, - 16.54498932500003 - ], - [ - 120.29786217500012, - 16.56891510600009 - ], - [ - 120.28419030000006, - 16.592962958000143 - ], - [ - 120.27613366000006, - 16.611883856000148 - ], - [ - 120.285411004, - 16.62067291900003 - ], - [ - 120.285411004, - 16.616848049000012 - ], - [ - 120.28842207100004, - 16.614569403000033 - ], - [ - 120.29525800900004, - 16.613714911000116 - ], - [ - 120.30665123800011, - 16.613918361000074 - ], - [ - 120.30665123800011, - 16.62067291900003 - ], - [ - 120.30144290500019, - 16.633205471000124 - ], - [ - 120.30250084700006, - 16.654974677 - ], - [ - 120.307871941, - 16.677679755000113 - ], - [ - 120.325938347, - 16.712591864000146 - ], - [ - 120.32341556100019, - 16.73383209800012 - ], - [ - 120.31617272200018, - 16.755804755000057 - ], - [ - 120.31218509200019, - 16.77777741100006 - ], - [ - 120.31364993600008, - 16.799627997000115 - ], - [ - 120.3157658210001, - 16.809271552000084 - ], - [ - 120.31959069100012, - 16.819322007000054 - ], - [ - 120.326426629, - 16.830959377000156 - ], - [ - 120.33350670700005, - 16.83698151200015 - ], - [ - 120.341563347, - 16.841945705000015 - ], - [ - 120.35059655000012, - 16.85032786700016 - ], - [ - 120.42725670700005, - 16.961900132000054 - ], - [ - 120.43409264400012, - 16.98212311400009 - ], - [ - 120.43628991000017, - 17.00800202000009 - ], - [ - 120.41635175900004, - 17.179348049000126 - ], - [ - 120.4142358730002, - 17.18431224200016 - ], - [ - 120.40430748800011, - 17.198309637000037 - ], - [ - 120.40211022200012, - 17.206691799000012 - ], - [ - 120.40308678500017, - 17.221625067000147 - ], - [ - 120.41236412900005, - 17.264593817 - ], - [ - 120.40821373800006, - 17.32269928600006 - ], - [ - 120.41138756600006, - 17.328314520000063 - ], - [ - 120.42945397200018, - 17.34756094 - ], - [ - 120.43751061300011, - 17.358832098 - ], - [ - 120.44174238400004, - 17.367987372000172 - ], - [ - 120.44336998800023, - 17.37710195500007 - ], - [ - 120.4436955090001, - 17.388495184000035 - ], - [ - 120.43523196700002, - 17.422796942 - ], - [ - 120.40170332099999, - 17.49701569200012 - ], - [ - 120.40211022200012, - 17.518866278000147 - ], - [ - 120.35792076900012, - 17.53025950700011 - ], - [ - 120.34083092500006, - 17.53876373900006 - ], - [ - 120.33383222699999, - 17.55638255400008 - ], - [ - 120.35320071700014, - 17.67812734600001 - ], - [ - 120.36353600400005, - 17.687160549000012 - ], - [ - 120.38477623800011, - 17.690130927000112 - ], - [ - 120.40235436300023, - 17.696966864000146 - ], - [ - 120.41244550900004, - 17.712836005000085 - ], - [ - 120.41667728000002, - 17.731024481000148 - ], - [ - 120.41635175900004, - 17.744777736000074 - ], - [ - 120.40821373800006, - 17.759995835000055 - ], - [ - 120.39714603000007, - 17.770738023000163 - ], - [ - 120.39128665500019, - 17.78143952 - ], - [ - 120.39869225400011, - 17.79633209800015 - ], - [ - 120.42261803500006, - 17.823553778000147 - ], - [ - 120.42790774800002, - 17.838120835000083 - ], - [ - 120.42945397200018, - 17.86082591400013 - ], - [ - 120.42530358200023, - 17.90241120000009 - ], - [ - 120.42790774800002, - 17.916652736000103 - ], - [ - 120.45167076900023, - 17.948879299000126 - ], - [ - 120.47266686300006, - 17.991603908000158 - ], - [ - 120.47722415500013, - 18.004828192 - ], - [ - 120.47828209700018, - 18.02179596600017 - ], - [ - 120.476817254, - 18.043646552000112 - ], - [ - 120.47299238399998, - 18.064276434000035 - ], - [ - 120.46705162900017, - 18.077134507000054 - ], - [ - 120.47006269600016, - 18.091009833000058 - ], - [ - 120.5262150400001, - 18.204087632 - ], - [ - 120.52344811300011, - 18.20254140800013 - ], - [ - 120.52027428500006, - 18.20604075700014 - ], - [ - 120.51791425899998, - 18.212103583000115 - ], - [ - 120.51807701900017, - 18.21771881700012 - ], - [ - 120.52084394600004, - 18.2196312520001 - ], - [ - 120.52556399800002, - 18.22125885600012 - ], - [ - 120.52995853000013, - 18.22353750200007 - ], - [ - 120.53191165500007, - 18.227362372000087 - ], - [ - 120.53614342500006, - 18.239813544000114 - ], - [ - 120.56609134200008, - 18.292222398000163 - ], - [ - 120.57911217500023, - 18.325140692000062 - ], - [ - 120.586192254, - 18.364488023000078 - ], - [ - 120.58497155000006, - 18.405462958000086 - ], - [ - 120.57349694100006, - 18.44306061400009 - ], - [ - 120.56177819100006, - 18.46967194200012 - ], - [ - 120.56080162900017, - 18.48676178600006 - ], - [ - 120.57016035199999, - 18.501776434000092 - ], - [ - 120.59050540500019, - 18.522162177000084 - ], - [ - 120.61109459700006, - 18.53856028900016 - ], - [ - 120.62712649800014, - 18.541489976000022 - ], - [ - 120.66968834700018, - 18.532416083 - ], - [ - 120.690684441, - 18.53440989800005 - ], - [ - 120.73536217500006, - 18.54930247599999 - ], - [ - 120.75424238400004, - 18.552923895000063 - ], - [ - 120.77084394600016, - 18.56146881700009 - ], - [ - 120.77564537900005, - 18.581366278000175 - ], - [ - 120.77588951900012, - 18.604315497000144 - ], - [ - 120.77898196700008, - 18.621812242000104 - ], - [ - 120.79273522200012, - 18.6361351580001 - ], - [ - 120.81299889400012, - 18.64451732000005 - ], - [ - 120.83423912900011, - 18.64594147300012 - ], - [ - 120.85084069100006, - 18.638861395000063 - ], - [ - 120.86589603000007, - 18.620306708000058 - ], - [ - 120.89185631600006, - 18.57990143400012 - ], - [ - 120.90919030000023, - 18.567206122000144 - ] - ] - ], - [ - [ - [ - 121.45801842500023, - 18.88393789300015 - ], - [ - 121.46697024800008, - 18.881781317000147 - ], - [ - 121.47779381600006, - 18.881903387000122 - ], - [ - 121.45362389400023, - 18.865952867000104 - ], - [ - 121.43140709700018, - 18.856146552 - ], - [ - 121.40674889400012, - 18.850816148000106 - ], - [ - 121.318614129, - 18.843207098000065 - ], - [ - 121.29493248800006, - 18.846828518000123 - ], - [ - 121.27914472700004, - 18.862005927000112 - ], - [ - 121.27523847700004, - 18.875881252000013 - ], - [ - 121.28003991000006, - 18.880560614000117 - ], - [ - 121.29957116, - 18.881903387000122 - ], - [ - 121.35328209700018, - 18.89883047100001 - ], - [ - 121.38843834700006, - 18.90298086100013 - ], - [ - 121.41675866000017, - 18.908148505000057 - ], - [ - 121.42986087300008, - 18.905585028000033 - ], - [ - 121.44361412900017, - 18.895493882000082 - ], - [ - 121.45053144600016, - 18.88841380400011 - ], - [ - 121.45801842500023, - 18.88393789300015 - ] - ] - ], - [ - [ - [ - 121.96070397200012, - 19.000962632000082 - ], - [ - 121.96461022200012, - 18.99188873900006 - ], - [ - 121.97120201900006, - 18.984930731000176 - ], - [ - 121.98365319100017, - 18.97483958500011 - ], - [ - 121.99089603000013, - 18.96112702000009 - ], - [ - 121.98910566500004, - 18.949123440000065 - ], - [ - 121.96257571700008, - 18.938666083 - ], - [ - 121.94239342500023, - 18.909979559000035 - ], - [ - 121.92969811300006, - 18.895493882000082 - ], - [ - 121.89527428500006, - 18.867661851000108 - ], - [ - 121.88103274800002, - 18.850165106000148 - ], - [ - 121.87501061300023, - 18.83038971600014 - ], - [ - 121.86573326900006, - 18.821926174000012 - ], - [ - 121.84717858200005, - 18.82436758000013 - ], - [ - 121.8341577480002, - 18.834295966000056 - ], - [ - 121.84083092500023, - 18.848334052 - ], - [ - 121.84107506600017, - 18.868150132000025 - ], - [ - 121.86158287900005, - 18.884019273000135 - ], - [ - 121.87484785200016, - 18.900824286000145 - ], - [ - 121.85385175900004, - 18.923488674000012 - ], - [ - 121.86410566500015, - 18.934637762000122 - ], - [ - 121.87159264400012, - 18.950628973000036 - ], - [ - 121.87468509200019, - 18.96503327000009 - ], - [ - 121.87159264400012, - 18.971258856000034 - ], - [ - 121.87916100400017, - 18.975409247000087 - ], - [ - 121.89258873800006, - 18.99648672100001 - ], - [ - 121.90235436300011, - 19.005357164000046 - ], - [ - 121.907969597, - 19.004584052000112 - ], - [ - 121.91504967500018, - 19.00063711100013 - ], - [ - 121.92090905000012, - 18.99811432500003 - ], - [ - 121.92351321700019, - 19.00202057500003 - ], - [ - 121.92660566499998, - 19.00389232000019 - ], - [ - 121.941661004, - 19.01072825700011 - ], - [ - 121.94662519600016, - 19.01219310100008 - ], - [ - 121.95582116000006, - 19.008856512000037 - ], - [ - 121.96070397200012, - 19.000962632000082 - ] - ] - ], - [ - [ - [ - 121.25896243600019, - 19.045721747000115 - ], - [ - 121.24496504000015, - 19.018459377000013 - ], - [ - 121.209239129, - 19.050238348000065 - ], - [ - 121.19678795700011, - 19.065497137000037 - ], - [ - 121.19027753999998, - 19.087347723000065 - ], - [ - 121.19239342500012, - 19.111721096000124 - ], - [ - 121.20818118600008, - 19.153794664000102 - ], - [ - 121.21094811300011, - 19.176703192 - ], - [ - 121.21973717500006, - 19.171779690000122 - ], - [ - 121.22584069100017, - 19.16620514500012 - ], - [ - 121.22982832100016, - 19.159247137000037 - ], - [ - 121.23853600400005, - 19.11839427299999 - ], - [ - 121.25220787900017, - 19.08128489799999 - ], - [ - 121.25896243600019, - 19.045721747000115 - ] - ] - ], - [ - [ - [ - 121.45240319100006, - 19.384344794000143 - ], - [ - 121.47095787900005, - 19.382147528000147 - ], - [ - 121.48894290500019, - 19.385931708000086 - ], - [ - 121.50424238400015, - 19.392279364 - ], - [ - 121.51661217500006, - 19.39354075700011 - ], - [ - 121.52613366000017, - 19.38226959800012 - ], - [ - 121.52613366000017, - 19.3348656270001 - ], - [ - 121.52515709700012, - 19.33136627800009 - ], - [ - 121.524668816, - 19.32786692900011 - ], - [ - 121.52613366000017, - 19.320705471000068 - ], - [ - 121.53785241000017, - 19.3067894550001 - ], - [ - 121.539805535, - 19.303371486000074 - ], - [ - 121.54086347700016, - 19.300116278000033 - ], - [ - 121.54330488399998, - 19.29588450700011 - ], - [ - 121.54558353000007, - 19.290269273000106 - ], - [ - 121.54672285199999, - 19.282863674000126 - ], - [ - 121.54330488399998, - 19.278876044000143 - ], - [ - 121.53516686300006, - 19.278753973000093 - ], - [ - 121.52588951900023, - 19.27973053600006 - ], - [ - 121.51872806100019, - 19.279120184000092 - ], - [ - 121.51270592500006, - 19.273993231000176 - ], - [ - 121.51010175899998, - 19.267645575000145 - ], - [ - 121.5066837900001, - 19.262152411000116 - ], - [ - 121.498301629, - 19.259263414000188 - ], - [ - 121.47095787900005, - 19.26923248900009 - ], - [ - 121.464610222, - 19.274969794000143 - ], - [ - 121.42628014400006, - 19.29653554900007 - ], - [ - 121.42115319100017, - 19.297919012000037 - ], - [ - 121.41391035200004, - 19.297593492000104 - ], - [ - 121.40601647200018, - 19.298529364 - ], - [ - 121.39893639400012, - 19.303371486000074 - ], - [ - 121.39356530000023, - 19.311224677000055 - ], - [ - 121.38160241, - 19.33437734600001 - ], - [ - 121.34986412900017, - 19.370306708 - ], - [ - 121.35084069100006, - 19.375921942 - ], - [ - 121.36768639400023, - 19.377997137000122 - ], - [ - 121.37891686300023, - 19.38373444200009 - ], - [ - 121.39576256600006, - 19.403265692000062 - ], - [ - 121.45240319100006, - 19.384344794000143 - ] - ] - ], - [ - [ - [ - 121.99789472699999, - 19.56028880400011 - ], - [ - 121.99203535200016, - 19.548163153000033 - ], - [ - 121.98715253999998, - 19.51312897300012 - ], - [ - 121.97803795700011, - 19.498846747000144 - ], - [ - 121.96094811300023, - 19.491766669000086 - ], - [ - 121.94711347700016, - 19.496771552000112 - ], - [ - 121.92351321700019, - 19.519354559000092 - ], - [ - 121.90552819100017, - 19.52993398600013 - ], - [ - 121.89820397200018, - 19.53676992400007 - ], - [ - 121.89551842500006, - 19.546616929 - ], - [ - 121.89682050899998, - 19.55687083500011 - ], - [ - 121.90023847699999, - 19.559230861000074 - ], - [ - 121.90642337300008, - 19.55866120000009 - ], - [ - 121.926524285, - 19.56256745000009 - ], - [ - 121.94157962300002, - 19.559963283000016 - ], - [ - 121.95004316500015, - 19.56028880400011 - ], - [ - 121.9573673840001, - 19.564113674000126 - ], - [ - 121.96949303500017, - 19.575344143000123 - ], - [ - 121.97730553500017, - 19.577378648000078 - ], - [ - 121.98292076900017, - 19.575344143000123 - ], - [ - 121.99122155000023, - 19.570542710000055 - ], - [ - 121.99773196700002, - 19.56492747600005 - ], - [ - 121.99789472699999, - 19.56028880400011 - ] - ] - ], - [ - [ - [ - 121.86182701900006, - 20.273749091000028 - ], - [ - 121.85084069100006, - 20.27342357000019 - ], - [ - 121.83920332100004, - 20.320786851000136 - ], - [ - 121.83765709700018, - 20.333929755 - ], - [ - 121.83838951900012, - 20.340765692 - ], - [ - 121.84164472700016, - 20.346014716000084 - ], - [ - 121.85938561300023, - 20.34735748900009 - ], - [ - 121.87940514400012, - 20.333441473 - ], - [ - 121.89323978000013, - 20.313666083000086 - ], - [ - 121.89210045700005, - 20.29734935100005 - ], - [ - 121.86931399800008, - 20.276190497000144 - ], - [ - 121.86182701900006, - 20.273749091000028 - ] - ] - ], - [ - [ - [ - 121.95801842500012, - 20.354966539000102 - ], - [ - 121.93897545700023, - 20.34870026200015 - ], - [ - 121.92212975400005, - 20.354152736000017 - ], - [ - 121.91602623800023, - 20.375921942000062 - ], - [ - 121.92237389400006, - 20.393296617000047 - ], - [ - 121.96371504000004, - 20.45160553600006 - ], - [ - 121.96599368600008, - 20.46063873900006 - ], - [ - 121.98023522200018, - 20.472967841000113 - ], - [ - 121.99789472699999, - 20.483872789000188 - ], - [ - 122.00977623800023, - 20.48847077000012 - ], - [ - 122.01929772200006, - 20.48647695500007 - ], - [ - 122.02759850400005, - 20.481146552000112 - ], - [ - 122.03272545700023, - 20.473456122000087 - ], - [ - 122.03239993600019, - 20.464056708000086 - ], - [ - 122.02654056100008, - 20.45579661700016 - ], - [ - 121.99122155000023, - 20.432359117000104 - ], - [ - 121.96876061300023, - 20.41339752800009 - ], - [ - 121.96371504000004, - 20.406642971000068 - ], - [ - 121.96615644600004, - 20.393540757 - ], - [ - 121.97087649800002, - 20.386053778000033 - ], - [ - 121.97388756600006, - 20.379299221000096 - ], - [ - 121.97120201900006, - 20.36847565300009 - ], - [ - 121.95801842500012, - 20.354966539000102 - ] - ] - ], - [ - [ - [ - 121.82984459700018, - 20.69896067900011 - ], - [ - 121.80339603000019, - 20.69114817900011 - ], - [ - 121.78638756600006, - 20.703070380000057 - ], - [ - 121.79118899800002, - 20.73004791900003 - ], - [ - 121.80543053500006, - 20.758978583000115 - ], - [ - 121.82374108200011, - 20.78681061400009 - ], - [ - 121.83765709700018, - 20.820257880000142 - ], - [ - 121.84587649800008, - 20.831366278000147 - ], - [ - 121.85580488399998, - 20.83832428600006 - ], - [ - 121.86597741000006, - 20.838202216000084 - ], - [ - 121.87484785200016, - 20.827826239 - ], - [ - 121.87924238400015, - 20.814032294000086 - ], - [ - 121.88070722700004, - 20.799383856000148 - ], - [ - 121.87989342500012, - 20.784491278000118 - ], - [ - 121.87720787900005, - 20.770331122000087 - ], - [ - 121.86768639400023, - 20.744289455000015 - ], - [ - 121.85173587300014, - 20.71857330900015 - ], - [ - 121.82984459700018, - 20.69896067900011 - ] - ] - ], - [ - [ - [ - 121.93669681100008, - 21.065619208000058 - ], - [ - 121.92969811300006, - 21.064520575000117 - ], - [ - 121.93482506600017, - 21.073228257 - ], - [ - 121.93669681100008, - 21.065619208000058 - ] - ] - ], - [ - [ - [ - 121.95427493600019, - 21.11839427300005 - ], - [ - 121.94906660199999, - 21.106878973 - ], - [ - 121.94743899800008, - 21.116156317000062 - ], - [ - 121.95069420700011, - 21.122381903000033 - ], - [ - 121.95427493600019, - 21.11839427300005 - ] - ] - ] - ] - } - } - ] -} \ No newline at end of file diff --git a/test/fixtures/asia_unionPoly.geojson b/test/fixtures/asia_unionPoly.geojson new file mode 100644 index 0000000..ec89ba2 --- /dev/null +++ b/test/fixtures/asia_unionPoly.geojson @@ -0,0 +1,31 @@ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 91.318359375, + -0.4394488164139641 + ], + [ + 105.205078125, + -0.4394488164139641 + ], + [ + 105.205078125, + 8.320212289522944 + ], + [ + 91.318359375, + 8.320212289522944 + ], + [ + 91.318359375, + -0.4394488164139641 + ] + ] + ] + } + } \ No newline at end of file From 3e0982bcc369a027d159e0e20bae6dbb36f2ed72 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Wed, 6 Sep 2017 10:21:46 +0300 Subject: [PATCH 07/42] performance tweaking, splitting the code up --- bench.js | 49 +- demo/index.html | 12 +- demo/js/bundle.js | 1050 ++++++++++++++++++---------------- demo/js/index.js | 34 +- package-lock.json | 41 ++ package.json | 2 + src/compare_events.js | 7 +- src/compare_segments.js | 11 +- src/compute_fields.js | 66 +++ src/connect_edges.js | 169 ++++++ src/divide_segment.js | 37 ++ src/fill_queue.js | 70 +++ src/index.js | 612 +------------------- src/operation.js | 6 + src/possible_intersection.js | 109 ++++ src/subdivide_segments.js | 118 ++++ src/sweep_event.js | 7 +- 17 files changed, 1259 insertions(+), 1141 deletions(-) create mode 100644 src/compute_fields.js create mode 100644 src/connect_edges.js create mode 100644 src/divide_segment.js create mode 100644 src/fill_queue.js create mode 100644 src/operation.js create mode 100644 src/possible_intersection.js create mode 100644 src/subdivide_segments.js diff --git a/bench.js b/bench.js index ab9f630..c08f610 100644 --- a/bench.js +++ b/bench.js @@ -15,21 +15,34 @@ const martinez = require('./src/index'); * Asia - JSTS x 6.62 ops/sec ±2.74% (21 runs sampled) */ - - -// Define benchmark -const suite = new Benchmark.Suite('martinez'); - -var hole_hole = load.sync('./test/fixtures/hole_hole.geojson') -suite.add('Hole_Hole', () => martinez.union(hole_hole.features[0].geometry.coordinates, hole_hole.features[1].geometry.coordinates)); -suite.add('Hole_Hole - JSTS', () => jstsUnion(hole_hole.features[0], hole_hole.features[1])) - -var asia = load.sync('./test/fixtures/asia.geojson') -var unionPoly = load.sync('./test/fixtures/asia_unionPoly.geojson') -suite.add('Asia', () => martinez.union(asia.features[0].geometry.coordinates, unionPoly.geometry.coordinates)); -suite.add('Asia - JSTS', () => jstsUnion(asia.features[0], unionPoly)) - -suite - .on('cycle', e => console.log(String(e.target))) - .on('complete', () => {}) - .run(); \ No newline at end of file +const options = { + onStart (event) { console.log(this.name); }, + onError (event) { console.log(event.target.error); }, + onCycle (event) { console.log(String(event.target)); }, + onComplete() { + console.log('- Fastest is ' + this.filter('fastest').map('name') + '\n'); + } +}; + +const hole_hole = load.sync('./test/fixtures/hole_hole.geojson') +new Benchmark.Suite('Hole_Hole', options) + .add('Martinez', () => { + martinez.union( + hole_hole.features[0].geometry.coordinates, + hole_hole.features[1].geometry.coordinates); + }) + .add('JSTS', () => { + jstsUnion(hole_hole.features[0], hole_hole.features[1]); + }) + .run(); + +const asia = load.sync('./test/fixtures/asia.geojson'); +const unionPoly = load.sync('./test/fixtures/asia_unionPoly.geojson'); +new Benchmark.Suite('Asia union', options) + .add('Martinez', () => { + martinez.union( + asia.features[0].geometry.coordinates, + unionPoly.geometry.coordinates); + }) + .add('JSTS', () => jstsUnion(asia.features[0], unionPoly)) + .run(); diff --git a/demo/index.html b/demo/index.html index 7ff14ec..9429d44 100644 --- a/demo/index.html +++ b/demo/index.html @@ -4,11 +4,15 @@ Martinez Clipping - + + - - - + + + + + + diff --git a/demo/js/bundle.js b/demo/js/bundle.js index 3011771..c779f67 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -207,23 +207,23 @@ function run (op) { } }); - setTimeout(function() { - console.time('jsts'); - var s = reader.read(subject); - var c = reader.read(clipping); - var res; - if (op === OPERATIONS.INTERSECTION) { - res = s.geometry.intersection(c.geometry); - } else if (op === OPERATIONS.UNION) { - res = s.geometry.union(c.geometry); - } else if (op === OPERATIONS.DIFFERENCE) { - res = s.geometry.difference(c.geometry); - } else { - res = s.geometry.symDifference(c.geometry); - } - res = writer.write(res); - console.timeEnd('jsts'); - }, 500); + // setTimeout(function() { + // console.time('jsts'); + // var s = reader.read(subject); + // var c = reader.read(clipping); + // var res; + // if (op === OPERATIONS.INTERSECTION) { + // res = s.geometry.intersection(c.geometry); + // } else if (op === OPERATIONS.UNION) { + // res = s.geometry.union(c.geometry); + // } else if (op === OPERATIONS.DIFFERENCE) { + // res = s.geometry.difference(c.geometry); + // } else { + // res = s.geometry.symDifference(c.geometry); + // } + // res = writer.write(res); + // console.timeEnd('jsts'); + // }, 500); } //drawnItems.addData(oneInside); @@ -298,7 +298,7 @@ module.exports = { intersection: martinez.intersection }; -},{"./src/index":17}],6:[function(require,module,exports){ +},{"./src/index":21}],6:[function(require,module,exports){ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -2681,7 +2681,7 @@ var signedArea = require('./signed_area'); * @param {SweepEvent} e2 * @return {Number} */ -module.exports = function sweepEventsComp(e1, e2) { +module.exports = function compareEvents (e1, e2) { var p1 = e1.point; var p2 = e2.point; @@ -2696,6 +2696,7 @@ module.exports = function sweepEventsComp(e1, e2) { return specialCases(e1, e2, p1, p2); }; + /* eslint-disable no-unused-vars */ function specialCases(e1, e2, p1, p2) { // Same coordinates, but one is a left endpoint and the other is @@ -2703,10 +2704,12 @@ function specialCases(e1, e2, p1, p2) { if (e1.left !== e2.left) return e1.left ? 1 : -1; + var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; + var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) // Same coordinates, both events // are left endpoints or right endpoints. // not collinear - if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) { + if (sa/*signedArea(p1, e1.otherEvent.point, e2.otherEvent.point)*/ !== 0) { // the event associate to the bottom segment is processed first return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; } @@ -2724,7 +2727,7 @@ function specialCases(e1, e2, p1, p2) { } /* eslint-enable no-unused-vars */ -},{"./signed_area":19}],14:[function(require,module,exports){ +},{"./signed_area":25}],14:[function(require,module,exports){ 'use strict'; var signedArea = require('./signed_area'); @@ -2760,12 +2763,11 @@ module.exports = function compareSegments(le1, le2) { } if (le1.isSubject === le2.isSubject) { // same polygon - if (equals(le1.point, le2.point)) { - if (equals(le1.otherEvent.point, le2.otherEvent.point)) { - return 0; - } else { - return le1.contourId > le2.contourId ? 1 : -1; - } + var p1 = le1.point, p2 = le2.point; + if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) { + p1 = le1.otherEvent.point; p2 = le2.otherEvent.point; + if (ep1[0] === p2[0] && p1[1] === p2[1]) return 0; + else return le1.contourId > le2.contourId ? 1 : -1; } } else { // Segments are collinear, but belong to separate polygons return le1.isSubject ? -1 : 1; @@ -2774,132 +2776,20 @@ module.exports = function compareSegments(le1, le2) { return compareEvents(le1, le2) === 1 ? 1 : -1; }; -},{"./compare_events":13,"./equals":16,"./signed_area":19}],15:[function(require,module,exports){ -'use strict'; - -module.exports = { - NORMAL: 0, - NON_CONTRIBUTING: 1, - SAME_TRANSITION: 2, - DIFFERENT_TRANSITION: 3 -}; - -},{}],16:[function(require,module,exports){ -'use strict'; - -// var EPSILON = 1e-9; -// var abs = Math.abs; - -module.exports = function equals(p1, p2) { - return p1[0] === p2[0] && p1[1] === p2[1]; -}; - -// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164 -// Precision problem. -// -// module.exports = function equals(p1, p2) { -// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON; -// }; - -},{}],17:[function(require,module,exports){ -'use strict'; - -var Queue = require('tinyqueue'); -var Tree = require('avl'); -var edgeType = require('./edge_type'); -var SweepEvent = require('./sweep_event'); -var compareEvents = require('./compare_events'); -var compareSegments = require('./compare_segments'); -var intersection = require('./segment_intersection'); -var equals = require('./equals'); +},{"./compare_events":13,"./equals":19,"./signed_area":25}],15:[function(require,module,exports){ +var edgeType = require('./edge_type'); var INTERSECTION = 0; -var UNION = 1; -var DIFFERENCE = 2; -var XOR = 3; -var EMPTY = []; - -var max = Math.max; -var min = Math.min; - -/** - * @param {Array} s1 - * @param {Array} s2 - * @param {Boolean} isSubject - * @param {Queue} eventQueue - * @param {Array} bbox - */ -function processSegment(s1, s2, isSubject, depth, eventQueue, bbox, isExteriorRing) { - // Possible degenerate condition. - // if (equals(s1, s2)) return; - - var e1 = new SweepEvent(s1, false, undefined, isSubject); - var e2 = new SweepEvent(s2, false, e1, isSubject); - e1.otherEvent = e2; - - e1.contourId = e2.contourId = depth; - if (!isExteriorRing) { - e1.isExteriorRing = false; - e2.isExteriorRing = false; - } - if (compareEvents(e1, e2) > 0) { - e2.left = true; - } else { - e1.left = true; - } - - bbox[0] = min(bbox[0], s1[0]); - bbox[1] = min(bbox[1], s1[1]); - bbox[2] = max(bbox[2], s1[0]); - bbox[3] = max(bbox[3], s1[1]); - - // Pushing it so the queue is sorted from left to right, - // with object on the left having the highest priority. - eventQueue.push(e1); - eventQueue.push(e2); -} - -var contourId = 0; - -function processPolygon(contourOrHole, isSubject, depth, queue, bbox, isExteriorRing) { - var i, len; - for (i = 0, len = contourOrHole.length - 1; i < len; i++) { - processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, queue, bbox, isExteriorRing); - } -} - -function fillQueue(subject, clipping, sbbox, cbbox) { - var eventQueue = new Queue(null, compareEvents); - var polygonSet, isExteriorRing, i, ii, j, jj; - - for (i = 0, ii = subject.length; i < ii; i++) { - polygonSet = subject[i]; - for (j = 0, jj = polygonSet.length; j < jj; j++) { - isExteriorRing = j === 0; - if (isExteriorRing) contourId++; - processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing); - } - } - - for (i = 0, ii = clipping.length; i < ii; i++) { - polygonSet = clipping[i]; - for (j = 0, jj = polygonSet.length; j < jj; j++) { - isExteriorRing = j === 0; - if (isExteriorRing) contourId++; - processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing); - } - } - - return eventQueue; -} - +var UNION = 1; +var DIFFERENCE = 2; +var XOR = 3; /** * @param {SweepEvent} event * @param {SweepEvent} prev * @param {Operation} operation */ -function computeFields(event, prev, operation) { +module.exports = function computeFields(event, prev, operation) { // compute inOut and otherInOut fields if (prev === null) { event.inOut = false; @@ -2926,7 +2816,7 @@ function computeFields(event, prev, operation) { // check if the line segment belongs to the Boolean operation event.inResult = inResult(event, operation); -} +}; function inResult(event, operation) { @@ -2954,422 +2844,333 @@ function inResult(event, operation) { return false; } +},{"./edge_type":18}],16:[function(require,module,exports){ +var equals = require('./equals'); +var compareEvents = require('./compare_events'); + /** - * @param {SweepEvent} se1 - * @param {SweepEvent} se2 - * @param {Queue} queue - * @return {Number} + * @param {Array.} sortedEvents + * @return {Array.} */ -function possibleIntersection(se1, se2, queue) { - // that disallows self-intersecting polygons, - // did cost us half a day, so I'll leave it - // out of respect - // if (se1.isSubject === se2.isSubject) return; - var inter = intersection( - se1.point, se1.otherEvent.point, - se2.point, se2.otherEvent.point - ); - - var nintersections = inter ? inter.length : 0; - if (nintersections === 0) return 0; // no intersection - - // the line segments intersect at an endpoint of both line segments - if ((nintersections === 1) && - (equals(se1.point, se2.point) || - equals(se1.otherEvent.point, se2.otherEvent.point))) { - return 0; +function orderEvents(sortedEvents) { + var event, i, len, tmp; + var resultEvents = []; + for (i = 0, len = sortedEvents.length; i < len; i++) { + event = sortedEvents[i]; + if ((event.left && event.inResult) || + (!event.left && event.otherEvent.inResult)) { + resultEvents.push(event); + } } - if (nintersections === 2 && se1.isSubject === se2.isSubject) { - // if(se1.contourId === se2.contourId){ - // console.warn('Edges of the same polygon overlap', - // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point); - // } - //throw new Error('Edges of the same polygon overlap'); - return 0; + // Due to overlapping edges the resultEvents array can be not wholly sorted + var sorted = false; + while (!sorted) { + sorted = true; + for (i = 0, len = resultEvents.length; i < len; i++) { + if ((i + 1) < len && + compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) { + tmp = resultEvents[i]; + resultEvents[i] = resultEvents[i + 1]; + resultEvents[i + 1] = tmp; + sorted = false; + } + } } - // The line segments associated to se1 and se2 intersect - if (nintersections === 1) { - - // if the intersection point is not an endpoint of se1 - if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) { - divideSegment(se1, inter[0], queue); - } + for (i = 0, len = resultEvents.length; i < len; i++) { + resultEvents[i].pos = i; + } - // if the intersection point is not an endpoint of se2 - if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) { - divideSegment(se2, inter[0], queue); + for (i = 0, len = resultEvents.length; i < len; i++) { + var event = resultEvents[i]; + if (!event.left) { + tmp = event.pos; + event.pos = event.otherEvent.pos; + event.otherEvent.pos = tmp; } - return 1; } - // The line segments associated to se1 and se2 overlap - var events = []; - var leftCoincide = false; - var rightCoincide = false; - - if (equals(se1.point, se2.point)) { - leftCoincide = true; // linked - } else if (compareEvents(se1, se2) === 1) { - events.push(se2, se1); - } else { - events.push(se1, se2); - } + return resultEvents; +} - if (equals(se1.otherEvent.point, se2.otherEvent.point)) { - rightCoincide = true; - } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) { - events.push(se2.otherEvent, se1.otherEvent); - } else { - events.push(se1.otherEvent, se2.otherEvent); - } - if ((leftCoincide && rightCoincide) || leftCoincide) { - // both line segments are equal or share the left endpoint - se1.type = edgeType.NON_CONTRIBUTING; - se2.type = (se1.inOut === se2.inOut) ? - edgeType.SAME_TRANSITION : - edgeType.DIFFERENT_TRANSITION; +/** + * @param {Number} pos + * @param {Array.} resultEvents + * @param {Object>} processed + * @return {Number} + */ +function nextPos(pos, resultEvents, processed) { + var newPos = pos + 1; + var length = resultEvents.length; + var p = resultEvents[pos].point; + var p1 = resultEvents[newPos].point; - if (leftCoincide && !rightCoincide) { - // honestly no idea, but changing events selection from [2, 1] - // to [0, 1] fixes the overlapping self-intersecting polygons issue - divideSegment(events[1].otherEvent, events[0].point, queue); - } - return 2; - } + // if (newPos < length && + // p1[0] !== p[0] || p1[1] !== p[1] && + // !processed[newPos]) return newPos; + // else return pos - 1; - // the line segments share the right endpoint - if (rightCoincide) { - divideSegment(events[0], events[1].point, queue); - return 3; - } - // no line segment includes totally the other one - if (events[0] !== events[3].otherEvent) { - divideSegment(events[0], events[1].point, queue); - divideSegment(events[1], events[2].point, queue); - return 3; + // while in range and not the current one by value + while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { + if (!processed[newPos]) { + console.log(pos, newPos, length); + return newPos; + } + else newPos++; + p1 = resultEvents[newPos].point } - // one line segment includes the other one - divideSegment(events[0], events[1].point, queue); - divideSegment(events[3].otherEvent, events[2].point, queue); + newPos = pos - 1; - return 3; + while (processed[newPos]) newPos--; + console.log('other', pos, newPos, length); + return newPos; } /** - * @param {SweepEvent} se - * @param {Array.} p - * @param {Queue} queue - * @return {Queue} + * @param {Array.} sortedEvents + * @return {Array.<*>} polygons */ -function divideSegment(se, p, queue) { - var r = new SweepEvent(p, false, se, se.isSubject); - var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); +module.exports = function (sortedEvents, operation) { + var i, len; + var resultEvents = orderEvents(sortedEvents); - if (equals(se.point, se.otherEvent.point)) { - console.warn('what is that?', se); - } + // "false"-filled array + var processed = {}; + var result = []; + var event; - r.contourId = l.contourId = se.contourId; + for (i = 0, len = resultEvents.length; i < len; i++) { + if (processed[i]) continue; + var contour = [[]]; - // avoid a rounding error. The left event would be processed after the right event - if (compareEvents(l, se.otherEvent) > 0) { - se.otherEvent.left = true; - l.left = false; - } + if (!resultEvents[i].isExteriorRing) { + if (result.length === 0) { + result.push([[contour]]); + } else { + if (operation === 1) { + result.push(contour) + } else { + result[result.length - 1].push(contour); + } + } + } else { + result.push(contour); + } - // avoid a rounding error. The left event would be processed after the right event - // if (compareEvents(se, r) > 0) {} + var ringId = result.length - 1; + var pos = i; - se.otherEvent.otherEvent = l; - se.otherEvent = r; + var initial = resultEvents[i].point; + // initial.push(resultEvents[i].isExteriorRing); + contour[0].push(initial); - queue.push(l); - queue.push(r); - - return queue; -} - - -/* eslint-disable no-unused-vars, no-debugger, no-undef */ -function iteratorEquals(it1, it2) { - return it1._cursor === it2._cursor; -} - - -function _renderSweepLine(sweepLine, pos, event) { - var map = window.map; - if (!map) return; - if (window.sws) window.sws.forEach(function (p) { - map.removeLayer(p); - }); - window.sws = []; - sweepLine.forEach(function (e) { - var poly = L.polyline([ - e.point.slice().reverse(), - e.otherEvent.point.slice().reverse() - ], {color: 'green'}).addTo(map); - window.sws.push(poly); - }); - - if (window.vt) map.removeLayer(window.vt); - var v = pos.slice(); - var b = map.getBounds(); - window.vt = L.polyline([ - [b.getNorth(), v[0]], - [b.getSouth(), v[0]] - ], {color: 'green', weight: 1}).addTo(map); - - if (window.ps) map.removeLayer(window.ps); - window.ps = L.polyline([ - event.point.slice().reverse(), - event.otherEvent.point.slice().reverse() - ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); - debugger; -} -/* eslint-enable no-unused-vars, no-debugger, no-undef */ - - -function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation) { - var sweepLine = new Tree(compareSegments); - var sortedEvents = []; - - var rightbound = min(sbbox[2], cbbox[2]); - - var prev, next, begin, end; - - while (eventQueue.length) { - var event = eventQueue.pop(); - sortedEvents.push(event); - - // optimization by bboxes for intersection and difference goes here - if ((operation === INTERSECTION && event.point[0] > rightbound) || - (operation === DIFFERENCE && event.point[0] > sbbox[2])) { - break; - } - - if (event.left) { - next = prev = sweepLine.insert(event); - //_renderSweepLine(sweepLine, event.point, event); - begin = sweepLine.minNode(); - - if (prev !== begin) prev = sweepLine.prev(prev); - else prev = null; - - next = sweepLine.next(next); - - var prevEvent = prev ? prev.key : null; - var prevprevEvent; - computeFields(event, prevEvent, operation); - if (next) { - if (possibleIntersection(event, next.key, eventQueue) === 2) { - computeFields(event, prevEvent, operation); - computeFields(event, next.key, operation); - } - } - if (prev) { - if (possibleIntersection(prev.key, event, eventQueue) === 2) { - var prevprev = prev; - if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); - else prevprev = null; + while (pos >= i) { + var event = resultEvents[pos]; + processed[pos] = true; - prevprevEvent = prevprev ? prevprev.key : null; - computeFields(prevEvent, prevprevEvent, operation); - computeFields(event, prevEvent, operation); - } + if (event.left) { + event.resultInOut = false; + event.contourId = ringId; + } else { + event.otherEvent.resultInOut = true; + event.otherEvent.contourId = ringId; } - } else { - event = event.otherEvent; - next = prev = sweepLine.find(event); - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - - if (prev && next) { + pos = event.pos; + processed[pos] = true; + // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); - if (prev !== begin) prev = sweepLine.prev(prev); - else prev = null; + contour[0].push(resultEvents[pos].point); + pos = nextPos(pos, resultEvents, processed); + } - next = sweepLine.next(next); - sweepLine.remove(event); + pos = pos === -1 ? i : pos; - // _renderSweepLine(sweepLine, event.otherEvent.point, event); + event = resultEvents[pos]; + processed[pos] = processed[event.pos] = true; + event.otherEvent.resultInOut = true; + event.otherEvent.contourId = ringId; + } - if (next && prev) { - //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { - possibleIntersection(prev.key, next.key, eventQueue); - //} + for (i = 0, len = result.length; i < len; i++) { + var polygon = result[i]; + for (var j = 0, jj = polygon.length; j < jj; j++) { + var polygonContour = polygon[j]; + for (var k = 0, kk = polygonContour.length; k < kk; k++) { + var coords = polygonContour[k]; + if (typeof coords[0] !== 'number') { + polygon.push(coords[0]); + polygon.splice(j, 1); } } } } - return sortedEvents; -} + return result; +}; + +},{"./compare_events":13,"./equals":19}],17:[function(require,module,exports){ +var SweepEvent = require('./sweep_event'); +var equals = require('./equals'); +var compareEvents = require('./compare_events'); /** - * @param {Array.} sortedEvents - * @return {Array.} + * @param {SweepEvent} se + * @param {Array.} p + * @param {Queue} queue + * @return {Queue} */ -function orderEvents(sortedEvents) { - var event, i, len, tmp; - var resultEvents = []; - for (i = 0, len = sortedEvents.length; i < len; i++) { - event = sortedEvents[i]; - if ((event.left && event.inResult) || - (!event.left && event.otherEvent.inResult)) { - resultEvents.push(event); - } - } +module.exports = function divideSegment(se, p, queue) { + var r = new SweepEvent(p, false, se, se.isSubject); + var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); - // Due to overlapping edges the resultEvents array can be not wholly sorted - var sorted = false; - while (!sorted) { - sorted = true; - for (i = 0, len = resultEvents.length; i < len; i++) { - if ((i + 1) < len && - compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) { - tmp = resultEvents[i]; - resultEvents[i] = resultEvents[i + 1]; - resultEvents[i + 1] = tmp; - sorted = false; - } - } + if (equals(se.point, se.otherEvent.point)) { + console.warn('what is that?', se); } - for (i = 0, len = resultEvents.length; i < len; i++) { - resultEvents[i].pos = i; - } + r.contourId = l.contourId = se.contourId; - for (i = 0, len = resultEvents.length; i < len; i++) { - if (!resultEvents[i].left) { - var temp = resultEvents[i].pos; - resultEvents[i].pos = resultEvents[i].otherEvent.pos; - resultEvents[i].otherEvent.pos = temp; - } + // avoid a rounding error. The left event would be processed after the right event + if (compareEvents(l, se.otherEvent) > 0) { + se.otherEvent.left = true; + l.left = false; } - return resultEvents; -} + // avoid a rounding error. The left event would be processed after the right event + // if (compareEvents(se, r) > 0) {} + se.otherEvent.otherEvent = l; + se.otherEvent = r; -/** - * @param {Array.} sortedEvents - * @return {Array.<*>} polygons - */ -function connectEdges(sortedEvents) { - var i, len; - var resultEvents = orderEvents(sortedEvents); + queue.push(l); + queue.push(r); - // "false"-filled array - var processed = new Array(resultEvents.length); - var result = []; + return queue; +}; - for (i = 0, len = resultEvents.length; i < len; i++) { - if (processed[i]) continue; - var contour = [[]]; +},{"./compare_events":13,"./equals":19,"./sweep_event":27}],18:[function(require,module,exports){ +'use strict'; - if (!resultEvents[i].isExteriorRing) { - if (result.length === 0) { - result.push([[contour]]); - } else { - result[result.length - 1].push([contour]); - } - } else { - result.push(contour); - } +module.exports = { + NORMAL: 0, + NON_CONTRIBUTING: 1, + SAME_TRANSITION: 2, + DIFFERENT_TRANSITION: 3 +}; - var ringId = result.length - 1; - var pos = i; +},{}],19:[function(require,module,exports){ +'use strict'; - var initial = resultEvents[i].point; - // initial.push(resultEvents[i].isExteriorRing); - contour[0].push(initial); +// var EPSILON = 1e-9; +// var abs = Math.abs; - while (pos >= i) { - processed[pos] = true; +module.exports = function equals(p1, p2) { + return p1[0] === p2[0] && p1[1] === p2[1]; +}; - if (resultEvents[pos].left) { - resultEvents[pos].resultInOut = false; - resultEvents[pos].contourId = ringId; - } else { - resultEvents[pos].otherEvent.resultInOut = true; - resultEvents[pos].otherEvent.contourId = ringId; - } +// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164 +// Precision problem. +// +// module.exports = function equals(p1, p2) { +// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON; +// }; - pos = resultEvents[pos].pos; - processed[pos] = true; - // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); +},{}],20:[function(require,module,exports){ +var Queue = require('tinyqueue'); +var SweepEvent = require('./sweep_event'); +var compareEvents = require('./compare_events'); - contour[0].push(resultEvents[pos].point); - pos = nextPos(pos, resultEvents, processed); - } +var max = Math.max; +var min = Math.min; - pos = pos === -1 ? i : pos; +var contourId = 0; - processed[pos] = processed[resultEvents[pos].pos] = true; - resultEvents[pos].otherEvent.resultInOut = true; - resultEvents[pos].otherEvent.contourId = ringId; - } - for (i = 0, len = result.length; i < len; i++) { - var polygon = result[i]; - for (var j = 0, jj = polygon.length; j < jj; j++) { - var polygonContour = polygon[j]; - for (var k = 0, kk = polygonContour.length; k < kk; k++) { - var coords = polygonContour[k]; - if (typeof coords[0] !== 'number') { - polygon.push(coords[0]); - polygon.splice(j, 1); - } - } +function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { + var i, len, s1, s2, e1, e2; + var d = depth + 1; + for (i = 0, len = contourOrHole.length - 1; i < len; i++) { + s1 = contourOrHole[i], + s2 = contourOrHole[i + 1]; + //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); + e1 = new SweepEvent(s1, false, undefined, isSubject); + e2 = new SweepEvent(s2, false, e1, isSubject); + e1.otherEvent = e2; + + e1.contourId = e2.contourId = depth; + if (!isExteriorRing) { + e1.isExteriorRing = false; + e2.isExteriorRing = false; + } + if (compareEvents(e1, e2) > 0) { + e2.left = true; + } else { + e1.left = true; } - } - return result; + var x = s1[0], y = s1[1]; + bbox[0] = min(bbox[0], x); + bbox[1] = min(bbox[1], y); + bbox[2] = max(bbox[2], x); + bbox[3] = max(bbox[3], y); + + // Pushing it so the queue is sorted from left to right, + // with object on the left having the highest priority. + Q.push(e1); + Q.push(e2); + } } -/** - * @param {Number} pos - * @param {Array.} resultEvents - * @param {Array.} processed - * @return {Number} - */ -function nextPos(pos, resultEvents, processed) { - var newPos = pos + 1; - var length = resultEvents.length; - while (newPos < length && - equals(resultEvents[newPos].point, resultEvents[pos].point)) { - if (!processed[newPos]) { - return newPos; - } else { - newPos = newPos + 1; +module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { + var eventQueue = new Queue(null, compareEvents); + var polygonSet, isExteriorRing, i, ii, j, jj, k, kk; + + for (i = 0, ii = subject.length; i < ii; i++) { + polygonSet = subject[i]; + for (j = 0, jj = polygonSet.length; j < jj; j++) { + isExteriorRing = j === 0; + if (isExteriorRing) contourId++; + processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing); } } - newPos = pos - 1; - - while (processed[newPos]) { - newPos = newPos - 1; + for (i = 0, ii = clipping.length; i < ii; i++) { + polygonSet = clipping[i]; + for (j = 0, jj = polygonSet.length; j < jj; j++) { + isExteriorRing = j === 0; + if (isExteriorRing) contourId++; + processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing); + } } - return newPos; + + return eventQueue; } +},{"./compare_events":13,"./sweep_event":27,"tinyqueue":12}],21:[function(require,module,exports){ +'use strict'; +var subdivideSegments = require('./subdivide_segments'); +var connectEdges = require('./connect_edges'); +var equals = require('./equals'); +var fillQueue = require('./fill_queue'); +var operations = require('./operation') + function trivialOperation(subject, clipping, operation) { var result = null; if (subject.length * clipping.length === 0) { - if (operation === INTERSECTION) { + if (operation === operations.INTERSECTION) { result = EMPTY; - } else if (operation === DIFFERENCE) { + } else if (operation === operations.DIFFERENCE) { result = subject; - } else if (operation === UNION || operation === XOR) { + } else if (operation === operations.UNION || + operation === operations.XOR) { result = (subject.length === 0) ? clipping : subject; } } @@ -3383,11 +3184,12 @@ function compareBBoxes(subject, clipping, sbbox, cbbox, operation) { cbbox[0] > sbbox[2] || sbbox[1] > cbbox[3] || cbbox[1] > sbbox[3]) { - if (operation === INTERSECTION) { + if (operation === operations.INTERSECTION) { result = EMPTY; - } else if (operation === DIFFERENCE) { + } else if (operation === operations.DIFFERENCE) { result = subject; - } else if (operation === UNION || operation === XOR) { + } else if (operation === operations.UNION || + operation === operations.XOR) { result = subject.concat(clipping); } } @@ -3409,14 +3211,21 @@ function boolean(subject, clipping, operation) { var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; + //console.time('fill'); var eventQueue = fillQueue(subject, clipping, sbbox, cbbox); + //console.timeEnd('fill'); trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation); if (trivial) { return trivial === EMPTY ? null : trivial; } + //console.time('subdiv'); var sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); - return connectEdges(sortedEvents); + //console.timeEnd('subdiv'); + //console.time('connect'); + var result = connectEdges(sortedEvents, operation); + //console.timeEnd('connect'); + return result; } @@ -3424,44 +3233,150 @@ module.exports = boolean; module.exports.union = function (subject, clipping) { - return boolean(subject, clipping, UNION); + return boolean(subject, clipping, operations.UNION); }; module.exports.diff = function (subject, clipping) { - return boolean(subject, clipping, DIFFERENCE); + return boolean(subject, clipping, operations.DIFFERENCE); }; module.exports.xor = function (subject, clipping) { - return boolean(subject, clipping, XOR); + return boolean(subject, clipping, operations.XOR); }; module.exports.intersection = function (subject, clipping) { - return boolean(subject, clipping, INTERSECTION); + return boolean(subject, clipping, operations.INTERSECTION); }; /** * @enum {Number} */ -module.exports.operations = { - INTERSECTION: INTERSECTION, - DIFFERENCE: DIFFERENCE, - UNION: UNION, - XOR: XOR +module.exports.operations = operations; + +},{"./connect_edges":16,"./equals":19,"./fill_queue":20,"./operation":22,"./subdivide_segments":26}],22:[function(require,module,exports){ +module.exports = { + INTERSECTION: 0, + UNION: 1, + DIFFERENCE: 2, + XOR: 3 }; +},{}],23:[function(require,module,exports){ +var divideSegment = require('./divide_segment'); +var intersection = require('./segment_intersection'); +var equals = require('./equals'); + +/** + * @param {SweepEvent} se1 + * @param {SweepEvent} se2 + * @param {Queue} queue + * @return {Number} + */ +module.exports = function possibleIntersection(se1, se2, queue) { + // that disallows self-intersecting polygons, + // did cost us half a day, so I'll leave it + // out of respect + // if (se1.isSubject === se2.isSubject) return; + var inter = intersection( + se1.point, se1.otherEvent.point, + se2.point, se2.otherEvent.point + ); + + var nintersections = inter ? inter.length : 0; + if (nintersections === 0) return 0; // no intersection + + // the line segments intersect at an endpoint of both line segments + if ((nintersections === 1) && + (equals(se1.point, se2.point) || + equals(se1.otherEvent.point, se2.otherEvent.point))) { + return 0; + } + + if (nintersections === 2 && se1.isSubject === se2.isSubject) { + // if(se1.contourId === se2.contourId){ + // console.warn('Edges of the same polygon overlap', + // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point); + // } + //throw new Error('Edges of the same polygon overlap'); + return 0; + } + + // The line segments associated to se1 and se2 intersect + if (nintersections === 1) { + + // if the intersection point is not an endpoint of se1 + if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) { + divideSegment(se1, inter[0], queue); + } + + // if the intersection point is not an endpoint of se2 + if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) { + divideSegment(se2, inter[0], queue); + } + return 1; + } + + // The line segments associated to se1 and se2 overlap + var events = []; + var leftCoincide = false; + var rightCoincide = false; + + if (equals(se1.point, se2.point)) { + leftCoincide = true; // linked + } else if (compareEvents(se1, se2) === 1) { + events.push(se2, se1); + } else { + events.push(se1, se2); + } + + if (equals(se1.otherEvent.point, se2.otherEvent.point)) { + rightCoincide = true; + } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) { + events.push(se2.otherEvent, se1.otherEvent); + } else { + events.push(se1.otherEvent, se2.otherEvent); + } + + if ((leftCoincide && rightCoincide) || leftCoincide) { + // both line segments are equal or share the left endpoint + se1.type = edgeType.NON_CONTRIBUTING; + se2.type = (se1.inOut === se2.inOut) ? + edgeType.SAME_TRANSITION : + edgeType.DIFFERENT_TRANSITION; + + if (leftCoincide && !rightCoincide) { + // honestly no idea, but changing events selection from [2, 1] + // to [0, 1] fixes the overlapping self-intersecting polygons issue + divideSegment(events[1].otherEvent, events[0].point, queue); + } + return 2; + } + + // the line segments share the right endpoint + if (rightCoincide) { + divideSegment(events[0], events[1].point, queue); + return 3; + } + + // no line segment includes totally the other one + if (events[0] !== events[3].otherEvent) { + divideSegment(events[0], events[1].point, queue); + divideSegment(events[1], events[2].point, queue); + return 3; + } + + // one line segment includes the other one + divideSegment(events[0], events[1].point, queue); + divideSegment(events[3].otherEvent, events[2].point, queue); -// for testing -module.exports.fillQueue = fillQueue; -module.exports.computeFields = computeFields; -module.exports.subdivideSegments = subdivideSegments; -module.exports.divideSegment = divideSegment; -module.exports.possibleIntersection = possibleIntersection; + return 3; +}; -},{"./compare_events":13,"./compare_segments":14,"./edge_type":15,"./equals":16,"./segment_intersection":18,"./sweep_event":20,"avl":6,"tinyqueue":12}],18:[function(require,module,exports){ +},{"./divide_segment":17,"./equals":19,"./segment_intersection":24}],24:[function(require,module,exports){ 'use strict'; var EPSILON = 1e-9; @@ -3606,7 +3521,7 @@ module.exports = function (a1, a2, b1, b2, noEndpointTouch) { return null; }; -},{}],19:[function(require,module,exports){ +},{}],25:[function(require,module,exports){ 'use strict'; /** @@ -3620,7 +3535,127 @@ module.exports = function signedArea(p0, p1, p2) { return (p0[0] - p2[0]) * (p1[1] - p2[1]) - (p1[0] - p2[0]) * (p0[1] - p2[1]); }; -},{}],20:[function(require,module,exports){ +},{}],26:[function(require,module,exports){ +var Tree = require('avl'); +var computeFields = require('./compute_fields'); +var possibleIntersection = require('./possible_intersection'); +var compareSegments = require('./compare_segments'); +var operations = require('./operation'); + + +module.exports = function subdivide (eventQueue, subject, clipping, sbbox, cbbox, operation) { + var sweepLine = new Tree(compareSegments); + var sortedEvents = []; + + var rightbound = Math.min(sbbox[2], cbbox[2]); + + var prev, next, begin, end; + + var INTERSECTION = operations.INTERSECTION; + var DIFFERENCE = operations.DIFFERENCE; + + while (eventQueue.length) { + var event = eventQueue.pop(); + sortedEvents.push(event); + + // optimization by bboxes for intersection and difference goes here + if ((operation === INTERSECTION && event.point[0] > rightbound) || + (operation === DIFFERENCE && event.point[0] > sbbox[2])) { + break; + } + + if (event.left) { + next = prev = sweepLine.insert(event); + //_renderSweepLine(sweepLine, event.point, event); + begin = sweepLine.minNode(); + + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; + + next = sweepLine.next(next); + + var prevEvent = prev ? prev.key : null; + var prevprevEvent; + computeFields(event, prevEvent, operation); + if (next) { + if (possibleIntersection(event, next.key, eventQueue) === 2) { + computeFields(event, prevEvent, operation); + computeFields(event, next.key, operation); + } + } + if (prev) { + if (possibleIntersection(prev.key, event, eventQueue) === 2) { + var prevprev = prev; + if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); + else prevprev = null; + + prevprevEvent = prevprev ? prevprev.key : null; + computeFields(prevEvent, prevprevEvent, operation); + computeFields(event, prevEvent, operation); + } + } + } else { + event = event.otherEvent; + next = prev = sweepLine.find(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); + + if (prev && next) { + + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; + + next = sweepLine.next(next); + sweepLine.remove(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); + + if (next && prev) { + //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + possibleIntersection(prev.key, next.key, eventQueue); + //} + } + } + } + } + return sortedEvents; +}; + + +/* eslint-disable no-unused-vars, no-debugger, no-undef */ +function _renderSweepLine(sweepLine, pos, event) { + var map = window.map; + if (!map) return; + if (window.sws) window.sws.forEach(function (p) { + map.removeLayer(p); + }); + window.sws = []; + sweepLine.forEach(function (e) { + var poly = L.polyline([ + e.point.slice().reverse(), + e.otherEvent.point.slice().reverse() + ], {color: 'green'}).addTo(map); + window.sws.push(poly); + }); + + if (window.vt) map.removeLayer(window.vt); + var v = pos.slice(); + var b = map.getBounds(); + window.vt = L.polyline([ + [b.getNorth(), v[0]], + [b.getSouth(), v[0]] + ], {color: 'green', weight: 1}).addTo(map); + + if (window.ps) map.removeLayer(window.ps); + window.ps = L.polyline([ + event.point.slice().reverse(), + event.otherEvent.point.slice().reverse() + ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); + debugger; +} +/* eslint-enable no-unused-vars, no-debugger, no-undef */ + +},{"./compare_segments":14,"./compute_fields":15,"./operation":22,"./possible_intersection":23,"avl":6}],27:[function(require,module,exports){ 'use strict'; var signedArea = require('./signed_area'); @@ -3710,9 +3745,12 @@ SweepEvent.prototype = { * @return {Boolean} */ isBelow: function (p) { + var p0 = this.point, p1 = this.otherEvent.point; return this.left ? - signedArea(this.point, this.otherEvent.point, p) > 0 : - signedArea(this.otherEvent.point, this.point, p) > 0; + (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0 : + // signedArea(this.point, this.otherEvent.point, p) > 0 : + (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0 + //signedArea(this.otherEvent.point, this.point, p) > 0; }, @@ -3735,5 +3773,5 @@ SweepEvent.prototype = { module.exports = SweepEvent; -},{"./edge_type":15,"./signed_area":19}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvbGliL2lzLW9iamVjdC5qcyIsIm5vZGVfbW9kdWxlcy9zdXBlcmFnZW50L2xpYi9yZXF1ZXN0LWJhc2UuanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvcmVxdWVzdC5qcyIsIm5vZGVfbW9kdWxlcy90aW55cXVldWUvaW5kZXguanMiLCJzcmMvY29tcGFyZ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B7IHJldHVybiBuLmtleTsgfTtcblxuICB2YXIgb3V0ID0gW107XG4gIHJvdyhyb290LCAnJywgdHJ1ZSwgZnVuY3Rpb24gKHYpIHsgcmV0dXJuIG91dC5wdXNoKHYpOyB9LCBwcmludE5vZGUpO1xuICByZXR1cm4gb3V0LmpvaW4oJycpO1xufVxuXG4vKipcbiAqIFByaW50cyBsZXZlbCBvZiB0aGUgdHJlZVxuICogQHBhcmFtICB7Tm9kZX0gICAgICAgICAgICAgICAgICAgICAgICByb290XG4gKiBAcGFyYW0gIHtTdHJpbmd9ICAgICAgICAgICAgICAgICAgICAgIHByZWZpeFxuICogQHBhcmFtICB7Qm9vbGVhbn0gICAgICAgICAgICAgICAgICAgICBpc1RhaWxcbiAqIEBwYXJhbSAge0Z1bmN0aW9uKGluOnN0cmluZyk6dm9pZH0gICAgb3V0XG4gKiBAcGFyYW0gIHtGdW5jdGlvbihub2RlOk5vZGUpOlN0cmluZ30gIHByaW50Tm9kZVxuICovXG5mdW5jdGlvbiByb3cgKHJvb3QsIHByZWZpeCwgaXNUYWlsLCBvdXQsIHByaW50Tm9kZSkge1xuICBpZiAocm9vdCkge1xuICAgIG91dCgoXCJcIiArIHByZWZpeCArIChpc1RhaWwgPyAn4pSU4pSA4pSAICcgOiAn4pSc4pSA4pSAICcpICsgKHByaW50Tm9kZShyb290KSkgKyBcIlxcblwiKSk7XG4gICAgdmFyIGluZGVudCA9IHByZWZpeCArIChpc1RhaWwgPyAnICAgICcgOiAn4pSCICAgJyk7XG4gICAgaWYgKHJvb3QubGVmdCkgIHsgcm93KHJvb3QubGVmdCwgIGluZGVudCwgZmFsc2UsIG91dCwgcHJpbnROb2RlKTsgfVxuICAgIGlmIChyb290LnJpZ2h0KSB7IHJvdyhyb290LnJpZ2h0LCBpbmRlbnQsIHRydWUsICBvdXQsIHByaW50Tm9kZSk7IH1cbiAgfVxufVxuXG5cbi8qKlxuICogSXMgdGhlIHRyZWUgYmFsYW5jZWQgKG5vbmUgb2YgdG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W50ID0gTWF0aC5mbG9vcigocG9zIC0gMSkgLyAyKTtcbiAgICAgICAgICAgIGlmIChjb21wYXJlKGRhdGFbcG9zXSwgZGF0YVtwYXJlbnRdKSA8IDApIHtcbiAgICAgICAgICAgICAgICBzd2FwKGRhdGEsIHBhcmVudCwgcG9zKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBwYXJlbnQ7XG5cbiAgICAgICAgICAgIH0gZWxzZSBicmVhaztcbiAgICAgICAgfVxuICAgIH0sXG5cbiAgICBfZG93bjogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmUsXG4gICAgICAgICAgICBsZW4gPSB0aGlzLmxlbmd0aDtcblxuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgdmFyIGxlZnQgPSAyICogcG9zICsgMSxcbiAgICAgICAgICAgICAgICByaWdodCA9IGxlZnQgKyAxLFxuICAgICAgICAgICAgICAgIG1pbiA9IHBvcztcblxuICAgICAgICAgICAgaWYgKGxlZnQgPCBsZW4gJiYgY29tcGFyZShkYXRhW2xlZnRdLCBkYXRhW21pbl0pIDwgMCkgbWluID0gbGVmdDtcbiAgICAgICAgICAgIGlmIChyaWdodCA8IGxlbiAmJiBjb21wYXJlKGRhdGFbcmlnaHRdLCBkYXRhW21pbl0pIDwgMCkgbWluID0gcmlnaHQ7XG5cbiAgICAgICAgICAgIGlmIChtaW4gPT09IHBvcykgcmV0dXJuO1xuXG4gICAgICAgICAgICBzd2FwKGRhdGEsIG1pbiwgcG9zKTtcbiAgICAgICAgICAgIHBvcyA9IG1pbjtcbiAgICAgICAgfVxuICAgIH1cbn07XG5cbmZ1bmN0aW9uIHN3YXAoZGF0YSwgaSwgaikge1xuICAgIHZhciB0bXAgPSBkYXRhW2ldO1xuICAgIGRhdGFbaV0gPSBkYXRhW2pdO1xuICAgIGRhdGFbal0gPSB0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50LnBvaW50WzBdID4gcmlnaHRib3VuZCkgfHxcbiAgICAgICAgKG9wZXJhdGlvbiA9PT0gRElGRkVSRU5DRSAgICYmIGV2ZW50LnBvaW50WzBdID4gc2Jib3hbMl0pKSB7XG4gICAgICBicmVhaztcbiAgICB9XG5cbiAgICBpZiAoZXZlbnQubGVmdCkge1xuICAgICAgbmV4dCAgPSBwcmV2ID0gc3dlZXBMaW5lLmluc2VydChldmVudCk7XG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5wb2ludCwgZXZlbnQpO1xuICAgICAgYmVnaW4gPSBzd2VlcExpbmUubWluTm9kZSgpO1xuXG4gICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZXZlbnQgPSBldmVudC5vdGhlckV2ZW50O1xuICAgICAgbmV4dCA9IHByZXYgPSBzd2VlcExpbmUuZmluZChldmVudCk7XG5cbiAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgIGlmIChwcmV2ICYmIG5leHQpIHtcblxuICAgICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgICAgZWxzZSAgICAgICAgICAgICAgICBwcmV2ID0gbnVsbDtcblxuICAgICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG4gICAgICAgIHN3ZWVwTGluZS5yZW1vdmUoZXZlbnQpO1xuXG4gICAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgICAgaWYgKG5leHQgJiYgcHJldikge1xuICAgICAgICAgIC8vaWYgKHR5cGVvZiBwcmV2ICE9PSAndW5kZWZpb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G4gIH0sXG5cblxuICAvKipcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzVmVydGljYWw6IGZ1bmN0aW9uICgpIHtcbiAgICByZXR1cm4gdGhpcy5wb2ludFswXSA9PT0gdGhpcy5vdGhlckV2ZW50LnBvaW50WzBdO1xuICB9XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IFN3ZWVwRXZlbnQ7XG4iXX0= +},{"./edge_type":18,"./signed_area":25}]},{},[3]) +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvbGliL2lzLW9iamVjdC5qcyIsIm5vZGVfbW9kdWxlcy9zdXBlcmFnZW50L2xpYi9yZXF1ZXN0LWJhc2UuanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvcmVxdWVzdC5qcyIsIm5vZGVfbW9kdWxlcy90aW55cXVldWUvaW5kZXguanMiLCJzcmMvY29tcGFyZV9ldmVudHMuanMiLCJzcmMvY29tcGFyZV9zZWdtZW50cy5qcyIsInNyYy9jb21wdXRlX2ZpZWxkcy5qcyIsInNyYy9jb25uZWN0X2VkZ2VzLmpzIiwic3JjL2RpdmlkZV9zZWdtZW50LmpzIiwic3JjL2VkZ2VfdH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0OlxuICAgICAgcmV0dXJuIGZhbHNlO1xuICB9XG59XG5cbi8qKlxuICogU2VuZCBgZGF0YWAgYXMgdGhlIHJlcXVlc3QgYm9keSwgZGVmYXVsdGluZyB0aGUgYC50eXBlKClgIHRvIFwianNvblwiIHdoZW5cbiAqIGFuIG9iamVjdCBpcyBnaXZlbi5cbiAqXG4gKiBFeGFtcGxlczpcbiAqXG4gKiAgICAgICAvLyBtYW51YWwganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGRlZmF1bHRzIHRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAuc2VuZ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S07XG4gICAgICAgIHRoaXMuZGF0YS5wb3AoKTtcbiAgICAgICAgdGhpcy5fZG93bigwKTtcbiAgICAgICAgcmV0dXJuIHRvcDtcbiAgICB9LFxuXG4gICAgcGVlazogZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kYXRhWzBdO1xuICAgIH0sXG5cbiAgICBfdXA6IGZ1bmN0aW9uIChwb3MpIHtcbiAgICAgICAgdmFyIGRhdGEgPSB0aGlzLmRhdGEsXG4gICAgICAgICAgICBjb21wYXJlID0gdGhpcy5jb21wYXJlO1xuXG4gICAgICAgIHdoaWxlIChwb3MgPiAwKSB7XG4gICAgICAgICAgICB2YXIgcGFyZW50ID0gTWF0aC5mbG9vcigocG9zIC0gMSkgLyAyKTtcbiAgICAgICAgICAgIGlmIChjb21wYXJlKGRhdGFbcG9zXSwgZGF0YVtwYXJlbnRdKSA8IDApIHtcbiAgICAgICAgICAgICAgICBzd2FwKGRhdGEsIHBhcmVudCwgcG9zKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBwYXJlbnQ7XG5cbiAgICAgICAgICAgIH0gZWxzZSBicmVhaztcbiAgICAgICAgfVxuICAgIH0sXG5cbiAgICBfZG93bjogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmUsXG4gICAgICAgICAgICBsZW4gPSB0aGlzLmxlbmd0aDtcblxuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgdmFyIGxlZnQgPSAyICogcG9zICsgMSxcbiAgICAgICAgICAgICAgICByaWdodCA9IGxlZnQgKyAxLFxuICAgICAgICAgICAgICAgIG1pbiA9IHBvcztcblxuICAgICAgICAgICAgaWYgKGxlZnQgPCBsZW4gJiYgY29tcGFyZShkYXRhW2xlZnRdLCBkYXRhW21pbl0pIDwgMCkgbWluID0gbGVmdDtcbiAgICAgICAgICAg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V4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW50LCAgICAgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBldmVudCA9IGV2ZW50Lm90aGVyRXZlbnQ7XG4gICAgICBuZXh0ID0gcHJldiA9IHN3ZWVwTGluZS5maW5kKGV2ZW50KTtcblxuICAgICAgLy8gX3JlbmRlclN3ZWVwTGluZShzd2VlcExpbmUsIGV2ZW50Lm90aGVyRXZlbnQucG9pbnQsIGV2ZW50KTtcblxuICAgICAgaWYgKHByZXYgJiYgbmV4dCkge1xuXG4gICAgICAgIGlmIChwcmV2ICE9PSBiZWdpbikgcHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXYpO1x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mVudC5wb2ludCwgdGhpcy5wb2ludCwgcCkgPiAwO1xuICB9LFxuXG5cbiAgLyoqXG4gICAqIEBwYXJhbSAge0FycmF5LjxOdW1iZXI+fSAgcFxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNBYm92ZTogZnVuY3Rpb24gKHApIHtcbiAgICByZXR1cm4gIXRoaXMuaXNCZWxvdyhwKTtcbiAgfSxcblxuXG4gIC8qKlxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNWZXJ0aWNhbDogZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiB0aGlzLnBvaW50WzBdID09PSB0aGlzLm90aGVyRXZlbnQucG9pbnRbMF07XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzID0gU3dlZXBFdmVudDtcbiJdfQ== diff --git a/demo/js/index.js b/demo/js/index.js index b780a1f..697eb73 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -142,23 +142,23 @@ function run (op) { } }); - setTimeout(function() { - console.time('jsts'); - var s = reader.read(subject); - var c = reader.read(clipping); - var res; - if (op === OPERATIONS.INTERSECTION) { - res = s.geometry.intersection(c.geometry); - } else if (op === OPERATIONS.UNION) { - res = s.geometry.union(c.geometry); - } else if (op === OPERATIONS.DIFFERENCE) { - res = s.geometry.difference(c.geometry); - } else { - res = s.geometry.symDifference(c.geometry); - } - res = writer.write(res); - console.timeEnd('jsts'); - }, 500); + // setTimeout(function() { + // console.time('jsts'); + // var s = reader.read(subject); + // var c = reader.read(clipping); + // var res; + // if (op === OPERATIONS.INTERSECTION) { + // res = s.geometry.intersection(c.geometry); + // } else if (op === OPERATIONS.UNION) { + // res = s.geometry.union(c.geometry); + // } else if (op === OPERATIONS.DIFFERENCE) { + // res = s.geometry.difference(c.geometry); + // } else { + // res = s.geometry.symDifference(c.geometry); + // } + // res = writer.write(res); + // console.timeEnd('jsts'); + // }, 500); } //drawnItems.addData(oneInside); diff --git a/package-lock.json b/package-lock.json index 7e33c30..5640268 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,15 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@turf/union": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@turf/union/-/union-4.6.0.tgz", + "integrity": "sha1-O4YeNfbOMX6Gszuido5dP2JUF7M=", + "dev": true, + "requires": { + "jsts": "1.3.0" + } + }, "@types/geojson": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.3.tgz", @@ -920,6 +929,16 @@ "tweetnacl": "0.14.5" } }, + "benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", + "dev": true, + "requires": { + "lodash": "4.17.4", + "platform": "1.3.4" + } + }, "binary-extensions": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz", @@ -4207,6 +4226,12 @@ } } }, + "jsts": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsts/-/jsts-1.3.0.tgz", + "integrity": "sha1-6Tp2+XrJvafUYl2dZHDw1grIDkU=", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -4294,6 +4319,16 @@ "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", "dev": true }, + "leaflet": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.2.0.tgz", + "integrity": "sha512-Bold8phAE6WcRsuwhofrQ7cOK1REFHaYIkKuj7+TBYK3ONKRpGGIb5oXR5akYotFnrWN0TWKh6Svlhflm3dogg==" + }, + "leaflet-editable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/leaflet-editable/-/leaflet-editable-1.1.0.tgz", + "integrity": "sha1-93dZekCoGic/KHtIn9D+XM1gyNA=" + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -6436,6 +6471,12 @@ "pinkie": "2.0.4" } }, + "platform": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.4.tgz", + "integrity": "sha1-bw+xftqqSPIUQrOpdcBjEw8cPr0=", + "dev": true + }, "pluralize": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", diff --git a/package.json b/package.json index 755a94c..7c15e28 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,8 @@ "dependencies": { "avl": "^1.4.0", "functional-red-black-tree": "1.0.1", + "leaflet": "^1.2.0", + "leaflet-editable": "^1.1.0", "tinyqueue": "1.1.0" } } diff --git a/src/compare_events.js b/src/compare_events.js index fba6e52..3e66508 100644 --- a/src/compare_events.js +++ b/src/compare_events.js @@ -8,7 +8,7 @@ var signedArea = require('./signed_area'); * @param {SweepEvent} e2 * @return {Number} */ -module.exports = function sweepEventsComp(e1, e2) { +module.exports = function compareEvents (e1, e2) { var p1 = e1.point; var p2 = e2.point; @@ -23,6 +23,7 @@ module.exports = function sweepEventsComp(e1, e2) { return specialCases(e1, e2, p1, p2); }; + /* eslint-disable no-unused-vars */ function specialCases(e1, e2, p1, p2) { // Same coordinates, but one is a left endpoint and the other is @@ -30,10 +31,12 @@ function specialCases(e1, e2, p1, p2) { if (e1.left !== e2.left) return e1.left ? 1 : -1; + var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; + var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) // Same coordinates, both events // are left endpoints or right endpoints. // not collinear - if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) { + if (sa/*signedArea(p1, e1.otherEvent.point, e2.otherEvent.point)*/ !== 0) { // the event associate to the bottom segment is processed first return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; } diff --git a/src/compare_segments.js b/src/compare_segments.js index 21f7176..ddf06f7 100644 --- a/src/compare_segments.js +++ b/src/compare_segments.js @@ -33,12 +33,11 @@ module.exports = function compareSegments(le1, le2) { } if (le1.isSubject === le2.isSubject) { // same polygon - if (equals(le1.point, le2.point)) { - if (equals(le1.otherEvent.point, le2.otherEvent.point)) { - return 0; - } else { - return le1.contourId > le2.contourId ? 1 : -1; - } + var p1 = le1.point, p2 = le2.point; + if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) { + p1 = le1.otherEvent.point; p2 = le2.otherEvent.point; + if (ep1[0] === p2[0] && p1[1] === p2[1]) return 0; + else return le1.contourId > le2.contourId ? 1 : -1; } } else { // Segments are collinear, but belong to separate polygons return le1.isSubject ? -1 : 1; diff --git a/src/compute_fields.js b/src/compute_fields.js new file mode 100644 index 0000000..649bb14 --- /dev/null +++ b/src/compute_fields.js @@ -0,0 +1,66 @@ +var edgeType = require('./edge_type'); + +var INTERSECTION = 0; +var UNION = 1; +var DIFFERENCE = 2; +var XOR = 3; + +/** + * @param {SweepEvent} event + * @param {SweepEvent} prev + * @param {Operation} operation + */ +module.exports = function computeFields(event, prev, operation) { + // compute inOut and otherInOut fields + if (prev === null) { + event.inOut = false; + event.otherInOut = true; + + // previous line segment in sweepline belongs to the same polygon + } else { + if (event.isSubject === prev.isSubject) { + event.inOut = !prev.inOut; + event.otherInOut = prev.otherInOut; + + // previous line segment in sweepline belongs to the clipping polygon + } else { + event.inOut = !prev.otherInOut; + event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut; + } + + // compute prevInResult field + if (prev) { + event.prevInResult = (!inResult(prev, operation) || prev.isVertical()) ? + prev.prevInResult : prev; + } + } + + // check if the line segment belongs to the Boolean operation + event.inResult = inResult(event, operation); +}; + + +function inResult(event, operation) { + switch (event.type) { + case edgeType.NORMAL: + switch (operation) { + case INTERSECTION: + return !event.otherInOut; + case UNION: + return event.otherInOut; + case DIFFERENCE: + return (event.isSubject && event.otherInOut) || + (!event.isSubject && !event.otherInOut); + case XOR: + return true; + } + break; + case edgeType.SAME_TRANSITION: + return operation === INTERSECTION || operation === UNION; + case edgeType.DIFFERENT_TRANSITION: + return operation === DIFFERENCE; + case edgeType.NON_CONTRIBUTING: + return false; + } + return false; +} diff --git a/src/connect_edges.js b/src/connect_edges.js new file mode 100644 index 0000000..ae0725c --- /dev/null +++ b/src/connect_edges.js @@ -0,0 +1,169 @@ +var equals = require('./equals'); +var compareEvents = require('./compare_events'); + + +/** + * @param {Array.} sortedEvents + * @return {Array.} + */ +function orderEvents(sortedEvents) { + var event, i, len, tmp; + var resultEvents = []; + for (i = 0, len = sortedEvents.length; i < len; i++) { + event = sortedEvents[i]; + if ((event.left && event.inResult) || + (!event.left && event.otherEvent.inResult)) { + resultEvents.push(event); + } + } + + // Due to overlapping edges the resultEvents array can be not wholly sorted + var sorted = false; + while (!sorted) { + sorted = true; + for (i = 0, len = resultEvents.length; i < len; i++) { + if ((i + 1) < len && + compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) { + tmp = resultEvents[i]; + resultEvents[i] = resultEvents[i + 1]; + resultEvents[i + 1] = tmp; + sorted = false; + } + } + } + + for (i = 0, len = resultEvents.length; i < len; i++) { + resultEvents[i].pos = i; + } + + for (i = 0, len = resultEvents.length; i < len; i++) { + var event = resultEvents[i]; + if (!event.left) { + tmp = event.pos; + event.pos = event.otherEvent.pos; + event.otherEvent.pos = tmp; + } + } + + return resultEvents; +} + + +/** + * @param {Number} pos + * @param {Array.} resultEvents + * @param {Object>} processed + * @return {Number} + */ +function nextPos(pos, resultEvents, processed) { + var newPos = pos + 1; + var length = resultEvents.length; + var p = resultEvents[pos].point; + var p1 = resultEvents[newPos].point; + + // if (newPos < length && + // p1[0] !== p[0] || p1[1] !== p[1] && + // !processed[newPos]) return newPos; + // else return pos - 1; + + + // while in range and not the current one by value + while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { + if (!processed[newPos]) { + console.log(pos, newPos, length); + return newPos; + } + else newPos++; + p1 = resultEvents[newPos].point + } + + newPos = pos - 1; + + while (processed[newPos]) newPos--; + console.log('other', pos, newPos, length); + return newPos; +} + + +/** + * @param {Array.} sortedEvents + * @return {Array.<*>} polygons + */ +module.exports = function (sortedEvents, operation) { + var i, len; + var resultEvents = orderEvents(sortedEvents); + + // "false"-filled array + var processed = {}; + var result = []; + var event; + + for (i = 0, len = resultEvents.length; i < len; i++) { + if (processed[i]) continue; + var contour = [[]]; + + if (!resultEvents[i].isExteriorRing) { + if (result.length === 0) { + result.push([[contour]]); + } else { + if (operation === 1) { + result.push(contour) + } else { + result[result.length - 1].push(contour); + } + } + } else { + result.push(contour); + } + + var ringId = result.length - 1; + var pos = i; + + var initial = resultEvents[i].point; + // initial.push(resultEvents[i].isExteriorRing); + contour[0].push(initial); + + while (pos >= i) { + var event = resultEvents[pos]; + processed[pos] = true; + + if (event.left) { + event.resultInOut = false; + event.contourId = ringId; + } else { + event.otherEvent.resultInOut = true; + event.otherEvent.contourId = ringId; + } + + pos = event.pos; + processed[pos] = true; + // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); + + contour[0].push(resultEvents[pos].point); + pos = nextPos(pos, resultEvents, processed); + } + + pos = pos === -1 ? i : pos; + + event = resultEvents[pos]; + processed[pos] = processed[event.pos] = true; + event.otherEvent.resultInOut = true; + event.otherEvent.contourId = ringId; + } + + for (i = 0, len = result.length; i < len; i++) { + var polygon = result[i]; + for (var j = 0, jj = polygon.length; j < jj; j++) { + var polygonContour = polygon[j]; + for (var k = 0, kk = polygonContour.length; k < kk; k++) { + var coords = polygonContour[k]; + if (typeof coords[0] !== 'number') { + polygon.push(coords[0]); + polygon.splice(j, 1); + } + } + } + } + + return result; +}; diff --git a/src/divide_segment.js b/src/divide_segment.js new file mode 100644 index 0000000..d48e05d --- /dev/null +++ b/src/divide_segment.js @@ -0,0 +1,37 @@ +var SweepEvent = require('./sweep_event'); +var equals = require('./equals'); +var compareEvents = require('./compare_events'); + +/** + * @param {SweepEvent} se + * @param {Array.} p + * @param {Queue} queue + * @return {Queue} + */ +module.exports = function divideSegment(se, p, queue) { + var r = new SweepEvent(p, false, se, se.isSubject); + var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); + + if (equals(se.point, se.otherEvent.point)) { + console.warn('what is that?', se); + } + + r.contourId = l.contourId = se.contourId; + + // avoid a rounding error. The left event would be processed after the right event + if (compareEvents(l, se.otherEvent) > 0) { + se.otherEvent.left = true; + l.left = false; + } + + // avoid a rounding error. The left event would be processed after the right event + // if (compareEvents(se, r) > 0) {} + + se.otherEvent.otherEvent = l; + se.otherEvent = r; + + queue.push(l); + queue.push(r); + + return queue; +}; diff --git a/src/fill_queue.js b/src/fill_queue.js new file mode 100644 index 0000000..9718227 --- /dev/null +++ b/src/fill_queue.js @@ -0,0 +1,70 @@ +var Queue = require('tinyqueue'); +var SweepEvent = require('./sweep_event'); +var compareEvents = require('./compare_events'); + +var max = Math.max; +var min = Math.min; + +var contourId = 0; + + +function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { + var i, len, s1, s2, e1, e2; + var d = depth + 1; + for (i = 0, len = contourOrHole.length - 1; i < len; i++) { + s1 = contourOrHole[i], + s2 = contourOrHole[i + 1]; + //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); + e1 = new SweepEvent(s1, false, undefined, isSubject); + e2 = new SweepEvent(s2, false, e1, isSubject); + e1.otherEvent = e2; + + e1.contourId = e2.contourId = depth; + if (!isExteriorRing) { + e1.isExteriorRing = false; + e2.isExteriorRing = false; + } + if (compareEvents(e1, e2) > 0) { + e2.left = true; + } else { + e1.left = true; + } + + var x = s1[0], y = s1[1]; + bbox[0] = min(bbox[0], x); + bbox[1] = min(bbox[1], y); + bbox[2] = max(bbox[2], x); + bbox[3] = max(bbox[3], y); + + // Pushing it so the queue is sorted from left to right, + // with object on the left having the highest priority. + Q.push(e1); + Q.push(e2); + } +} + + +module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { + var eventQueue = new Queue(null, compareEvents); + var polygonSet, isExteriorRing, i, ii, j, jj, k, kk; + + for (i = 0, ii = subject.length; i < ii; i++) { + polygonSet = subject[i]; + for (j = 0, jj = polygonSet.length; j < jj; j++) { + isExteriorRing = j === 0; + if (isExteriorRing) contourId++; + processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing); + } + } + + for (i = 0, ii = clipping.length; i < ii; i++) { + polygonSet = clipping[i]; + for (j = 0, jj = polygonSet.length; j < jj; j++) { + isExteriorRing = j === 0; + if (isExteriorRing) contourId++; + processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing); + } + } + + return eventQueue; +} diff --git a/src/index.js b/src/index.js index 56444f1..7325bcd 100644 --- a/src/index.js +++ b/src/index.js @@ -1,575 +1,20 @@ 'use strict'; - -var Queue = require('tinyqueue'); -var Tree = require('avl'); -var edgeType = require('./edge_type'); -var SweepEvent = require('./sweep_event'); -var compareEvents = require('./compare_events'); -var compareSegments = require('./compare_segments'); -var intersection = require('./segment_intersection'); -var equals = require('./equals'); - -var INTERSECTION = 0; -var UNION = 1; -var DIFFERENCE = 2; -var XOR = 3; -var EMPTY = []; - -var max = Math.max; -var min = Math.min; - -/** - * @param {Array} s1 - * @param {Array} s2 - * @param {Boolean} isSubject - * @param {Queue} eventQueue - * @param {Array} bbox - */ -function processSegment(s1, s2, isSubject, depth, eventQueue, bbox, isExteriorRing) { - // Possible degenerate condition. - // if (equals(s1, s2)) return; - - var e1 = new SweepEvent(s1, false, undefined, isSubject); - var e2 = new SweepEvent(s2, false, e1, isSubject); - e1.otherEvent = e2; - - e1.contourId = e2.contourId = depth; - if (!isExteriorRing) { - e1.isExteriorRing = false; - e2.isExteriorRing = false; - } - if (compareEvents(e1, e2) > 0) { - e2.left = true; - } else { - e1.left = true; - } - - bbox[0] = min(bbox[0], s1[0]); - bbox[1] = min(bbox[1], s1[1]); - bbox[2] = max(bbox[2], s1[0]); - bbox[3] = max(bbox[3], s1[1]); - - // Pushing it so the queue is sorted from left to right, - // with object on the left having the highest priority. - eventQueue.push(e1); - eventQueue.push(e2); -} - -var contourId = 0; - -function processPolygon(contourOrHole, isSubject, depth, queue, bbox, isExteriorRing) { - var i, len; - for (i = 0, len = contourOrHole.length - 1; i < len; i++) { - processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, queue, bbox, isExteriorRing); - } -} - -function fillQueue(subject, clipping, sbbox, cbbox) { - var eventQueue = new Queue(null, compareEvents); - var polygonSet, isExteriorRing, i, ii, j, jj; - - for (i = 0, ii = subject.length; i < ii; i++) { - polygonSet = subject[i]; - for (j = 0, jj = polygonSet.length; j < jj; j++) { - isExteriorRing = j === 0; - if (isExteriorRing) contourId++; - processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing); - } - } - - for (i = 0, ii = clipping.length; i < ii; i++) { - polygonSet = clipping[i]; - for (j = 0, jj = polygonSet.length; j < jj; j++) { - isExteriorRing = j === 0; - if (isExteriorRing) contourId++; - processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing); - } - } - - return eventQueue; -} - - -/** - * @param {SweepEvent} event - * @param {SweepEvent} prev - * @param {Operation} operation - */ -function computeFields(event, prev, operation) { - // compute inOut and otherInOut fields - if (prev === null) { - event.inOut = false; - event.otherInOut = true; - - // previous line segment in sweepline belongs to the same polygon - } else { - if (event.isSubject === prev.isSubject) { - event.inOut = !prev.inOut; - event.otherInOut = prev.otherInOut; - - // previous line segment in sweepline belongs to the clipping polygon - } else { - event.inOut = !prev.otherInOut; - event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut; - } - - // compute prevInResult field - if (prev) { - event.prevInResult = (!inResult(prev, operation) || prev.isVertical()) ? - prev.prevInResult : prev; - } - } - - // check if the line segment belongs to the Boolean operation - event.inResult = inResult(event, operation); -} - - -function inResult(event, operation) { - switch (event.type) { - case edgeType.NORMAL: - switch (operation) { - case INTERSECTION: - return !event.otherInOut; - case UNION: - return event.otherInOut; - case DIFFERENCE: - return (event.isSubject && event.otherInOut) || - (!event.isSubject && !event.otherInOut); - case XOR: - return true; - } - break; - case edgeType.SAME_TRANSITION: - return operation === INTERSECTION || operation === UNION; - case edgeType.DIFFERENT_TRANSITION: - return operation === DIFFERENCE; - case edgeType.NON_CONTRIBUTING: - return false; - } - return false; -} - - -/** - * @param {SweepEvent} se1 - * @param {SweepEvent} se2 - * @param {Queue} queue - * @return {Number} - */ -function possibleIntersection(se1, se2, queue) { - // that disallows self-intersecting polygons, - // did cost us half a day, so I'll leave it - // out of respect - // if (se1.isSubject === se2.isSubject) return; - var inter = intersection( - se1.point, se1.otherEvent.point, - se2.point, se2.otherEvent.point - ); - - var nintersections = inter ? inter.length : 0; - if (nintersections === 0) return 0; // no intersection - - // the line segments intersect at an endpoint of both line segments - if ((nintersections === 1) && - (equals(se1.point, se2.point) || - equals(se1.otherEvent.point, se2.otherEvent.point))) { - return 0; - } - - if (nintersections === 2 && se1.isSubject === se2.isSubject) { - // if(se1.contourId === se2.contourId){ - // console.warn('Edges of the same polygon overlap', - // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point); - // } - //throw new Error('Edges of the same polygon overlap'); - return 0; - } - - // The line segments associated to se1 and se2 intersect - if (nintersections === 1) { - - // if the intersection point is not an endpoint of se1 - if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) { - divideSegment(se1, inter[0], queue); - } - - // if the intersection point is not an endpoint of se2 - if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) { - divideSegment(se2, inter[0], queue); - } - return 1; - } - - // The line segments associated to se1 and se2 overlap - var events = []; - var leftCoincide = false; - var rightCoincide = false; - - if (equals(se1.point, se2.point)) { - leftCoincide = true; // linked - } else if (compareEvents(se1, se2) === 1) { - events.push(se2, se1); - } else { - events.push(se1, se2); - } - - if (equals(se1.otherEvent.point, se2.otherEvent.point)) { - rightCoincide = true; - } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) { - events.push(se2.otherEvent, se1.otherEvent); - } else { - events.push(se1.otherEvent, se2.otherEvent); - } - - if ((leftCoincide && rightCoincide) || leftCoincide) { - // both line segments are equal or share the left endpoint - se1.type = edgeType.NON_CONTRIBUTING; - se2.type = (se1.inOut === se2.inOut) ? - edgeType.SAME_TRANSITION : - edgeType.DIFFERENT_TRANSITION; - - if (leftCoincide && !rightCoincide) { - // honestly no idea, but changing events selection from [2, 1] - // to [0, 1] fixes the overlapping self-intersecting polygons issue - divideSegment(events[1].otherEvent, events[0].point, queue); - } - return 2; - } - - // the line segments share the right endpoint - if (rightCoincide) { - divideSegment(events[0], events[1].point, queue); - return 3; - } - - // no line segment includes totally the other one - if (events[0] !== events[3].otherEvent) { - divideSegment(events[0], events[1].point, queue); - divideSegment(events[1], events[2].point, queue); - return 3; - } - - // one line segment includes the other one - divideSegment(events[0], events[1].point, queue); - divideSegment(events[3].otherEvent, events[2].point, queue); - - return 3; -} - - -/** - * @param {SweepEvent} se - * @param {Array.} p - * @param {Queue} queue - * @return {Queue} - */ -function divideSegment(se, p, queue) { - var r = new SweepEvent(p, false, se, se.isSubject); - var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); - - if (equals(se.point, se.otherEvent.point)) { - console.warn('what is that?', se); - } - - r.contourId = l.contourId = se.contourId; - - // avoid a rounding error. The left event would be processed after the right event - if (compareEvents(l, se.otherEvent) > 0) { - se.otherEvent.left = true; - l.left = false; - } - - // avoid a rounding error. The left event would be processed after the right event - // if (compareEvents(se, r) > 0) {} - - se.otherEvent.otherEvent = l; - se.otherEvent = r; - - queue.push(l); - queue.push(r); - - return queue; -} - - -/* eslint-disable no-unused-vars, no-debugger, no-undef */ -function iteratorEquals(it1, it2) { - return it1._cursor === it2._cursor; -} - - -function _renderSweepLine(sweepLine, pos, event) { - var map = window.map; - if (!map) return; - if (window.sws) window.sws.forEach(function (p) { - map.removeLayer(p); - }); - window.sws = []; - sweepLine.forEach(function (e) { - var poly = L.polyline([ - e.point.slice().reverse(), - e.otherEvent.point.slice().reverse() - ], {color: 'green'}).addTo(map); - window.sws.push(poly); - }); - - if (window.vt) map.removeLayer(window.vt); - var v = pos.slice(); - var b = map.getBounds(); - window.vt = L.polyline([ - [b.getNorth(), v[0]], - [b.getSouth(), v[0]] - ], {color: 'green', weight: 1}).addTo(map); - - if (window.ps) map.removeLayer(window.ps); - window.ps = L.polyline([ - event.point.slice().reverse(), - event.otherEvent.point.slice().reverse() - ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); - debugger; -} -/* eslint-enable no-unused-vars, no-debugger, no-undef */ - - -function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation) { - var sweepLine = new Tree(compareSegments); - var sortedEvents = []; - - var rightbound = min(sbbox[2], cbbox[2]); - - var prev, next, begin, end; - - while (eventQueue.length) { - var event = eventQueue.pop(); - sortedEvents.push(event); - - // optimization by bboxes for intersection and difference goes here - if ((operation === INTERSECTION && event.point[0] > rightbound) || - (operation === DIFFERENCE && event.point[0] > sbbox[2])) { - break; - } - - if (event.left) { - next = prev = sweepLine.insert(event); - //_renderSweepLine(sweepLine, event.point, event); - begin = sweepLine.minNode(); - - if (prev !== begin) prev = sweepLine.prev(prev); - else prev = null; - - next = sweepLine.next(next); - - var prevEvent = prev ? prev.key : null; - var prevprevEvent; - computeFields(event, prevEvent, operation); - if (next) { - if (possibleIntersection(event, next.key, eventQueue) === 2) { - computeFields(event, prevEvent, operation); - computeFields(event, next.key, operation); - } - } - if (prev) { - if (possibleIntersection(prev.key, event, eventQueue) === 2) { - var prevprev = prev; - if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); - else prevprev = null; - - prevprevEvent = prevprev ? prevprev.key : null; - computeFields(prevEvent, prevprevEvent, operation); - computeFields(event, prevEvent, operation); - } - } - } else { - event = event.otherEvent; - next = prev = sweepLine.find(event); - - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - - if (prev && next) { - - if (prev !== begin) prev = sweepLine.prev(prev); - else prev = null; - - next = sweepLine.next(next); - sweepLine.remove(event); - - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - - if (next && prev) { - //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { - possibleIntersection(prev.key, next.key, eventQueue); - //} - } - } - } - } - return sortedEvents; -} - - -/** - * @param {Array.} sortedEvents - * @return {Array.} - */ -function orderEvents(sortedEvents) { - var event, i, len, tmp; - var resultEvents = []; - for (i = 0, len = sortedEvents.length; i < len; i++) { - event = sortedEvents[i]; - if ((event.left && event.inResult) || - (!event.left && event.otherEvent.inResult)) { - resultEvents.push(event); - } - } - - // Due to overlapping edges the resultEvents array can be not wholly sorted - var sorted = false; - while (!sorted) { - sorted = true; - for (i = 0, len = resultEvents.length; i < len; i++) { - if ((i + 1) < len && - compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) { - tmp = resultEvents[i]; - resultEvents[i] = resultEvents[i + 1]; - resultEvents[i + 1] = tmp; - sorted = false; - } - } - } - - for (i = 0, len = resultEvents.length; i < len; i++) { - resultEvents[i].pos = i; - } - - for (i = 0, len = resultEvents.length; i < len; i++) { - if (!resultEvents[i].left) { - var temp = resultEvents[i].pos; - resultEvents[i].pos = resultEvents[i].otherEvent.pos; - resultEvents[i].otherEvent.pos = temp; - } - } - - return resultEvents; -} - - -/** - * @param {Array.} sortedEvents - * @return {Array.<*>} polygons - */ -function connectEdges(sortedEvents, operation) { - var i, len; - var resultEvents = orderEvents(sortedEvents); - - // "false"-filled array - var processed = new Array(resultEvents.length); - var result = []; - - for (i = 0, len = resultEvents.length; i < len; i++) { - if (processed[i]) continue; - var contour = [[]]; - - if (!resultEvents[i].isExteriorRing) { - if (result.length === 0) { - result.push([[contour]]); - } else { - if (operation === 1) { - result.push(contour) - } else { - result[result.length - 1].push(contour); - } - } - } else { - result.push(contour); - } - - var ringId = result.length - 1; - var pos = i; - - var initial = resultEvents[i].point; - // initial.push(resultEvents[i].isExteriorRing); - contour[0].push(initial); - - while (pos >= i) { - processed[pos] = true; - - if (resultEvents[pos].left) { - resultEvents[pos].resultInOut = false; - resultEvents[pos].contourId = ringId; - } else { - resultEvents[pos].otherEvent.resultInOut = true; - resultEvents[pos].otherEvent.contourId = ringId; - } - - pos = resultEvents[pos].pos; - processed[pos] = true; - // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); - - contour[0].push(resultEvents[pos].point); - pos = nextPos(pos, resultEvents, processed); - } - - pos = pos === -1 ? i : pos; - - processed[pos] = processed[resultEvents[pos].pos] = true; - resultEvents[pos].otherEvent.resultInOut = true; - resultEvents[pos].otherEvent.contourId = ringId; - } - - for (i = 0, len = result.length; i < len; i++) { - var polygon = result[i]; - for (var j = 0, jj = polygon.length; j < jj; j++) { - var polygonContour = polygon[j]; - for (var k = 0, kk = polygonContour.length; k < kk; k++) { - var coords = polygonContour[k]; - if (typeof coords[0] !== 'number') { - polygon.push(coords[0]); - polygon.splice(j, 1); - } - } - } - } - - return result; -} - - -/** - * @param {Number} pos - * @param {Array.} resultEvents - * @param {Array.} processed - * @return {Number} - */ -function nextPos(pos, resultEvents, processed) { - var newPos = pos + 1; - var length = resultEvents.length; - while (newPos < length && - equals(resultEvents[newPos].point, resultEvents[pos].point)) { - if (!processed[newPos]) { - return newPos; - } else { - newPos = newPos + 1; - } - } - - newPos = pos - 1; - - while (processed[newPos]) { - newPos = newPos - 1; - } - return newPos; -} +var subdivideSegments = require('./subdivide_segments'); +var connectEdges = require('./connect_edges'); +var equals = require('./equals'); +var fillQueue = require('./fill_queue'); +var operations = require('./operation') function trivialOperation(subject, clipping, operation) { var result = null; if (subject.length * clipping.length === 0) { - if (operation === INTERSECTION) { + if (operation === operations.INTERSECTION) { result = EMPTY; - } else if (operation === DIFFERENCE) { + } else if (operation === operations.DIFFERENCE) { result = subject; - } else if (operation === UNION || operation === XOR) { + } else if (operation === operations.UNION || + operation === operations.XOR) { result = (subject.length === 0) ? clipping : subject; } } @@ -583,11 +28,12 @@ function compareBBoxes(subject, clipping, sbbox, cbbox, operation) { cbbox[0] > sbbox[2] || sbbox[1] > cbbox[3] || cbbox[1] > sbbox[3]) { - if (operation === INTERSECTION) { + if (operation === operations.INTERSECTION) { result = EMPTY; - } else if (operation === DIFFERENCE) { + } else if (operation === operations.DIFFERENCE) { result = subject; - } else if (operation === UNION || operation === XOR) { + } else if (operation === operations.UNION || + operation === operations.XOR) { result = subject.concat(clipping); } } @@ -609,14 +55,21 @@ function boolean(subject, clipping, operation) { var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; + //console.time('fill'); var eventQueue = fillQueue(subject, clipping, sbbox, cbbox); + //console.timeEnd('fill'); trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation); if (trivial) { return trivial === EMPTY ? null : trivial; } + //console.time('subdiv'); var sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); - return connectEdges(sortedEvents, operation); + //console.timeEnd('subdiv'); + //console.time('connect'); + var result = connectEdges(sortedEvents, operation); + //console.timeEnd('connect'); + return result; } @@ -624,39 +77,26 @@ module.exports = boolean; module.exports.union = function (subject, clipping) { - return boolean(subject, clipping, UNION); + return boolean(subject, clipping, operations.UNION); }; module.exports.diff = function (subject, clipping) { - return boolean(subject, clipping, DIFFERENCE); + return boolean(subject, clipping, operations.DIFFERENCE); }; module.exports.xor = function (subject, clipping) { - return boolean(subject, clipping, XOR); + return boolean(subject, clipping, operations.XOR); }; module.exports.intersection = function (subject, clipping) { - return boolean(subject, clipping, INTERSECTION); + return boolean(subject, clipping, operations.INTERSECTION); }; /** * @enum {Number} */ -module.exports.operations = { - INTERSECTION: INTERSECTION, - DIFFERENCE: DIFFERENCE, - UNION: UNION, - XOR: XOR -}; - - -// for testing -module.exports.fillQueue = fillQueue; -module.exports.computeFields = computeFields; -module.exports.subdivideSegments = subdivideSegments; -module.exports.divideSegment = divideSegment; -module.exports.possibleIntersection = possibleIntersection; +module.exports.operations = operations; diff --git a/src/operation.js b/src/operation.js new file mode 100644 index 0000000..675f038 --- /dev/null +++ b/src/operation.js @@ -0,0 +1,6 @@ +module.exports = { + INTERSECTION: 0, + UNION: 1, + DIFFERENCE: 2, + XOR: 3 +}; diff --git a/src/possible_intersection.js b/src/possible_intersection.js new file mode 100644 index 0000000..d2a0e5c --- /dev/null +++ b/src/possible_intersection.js @@ -0,0 +1,109 @@ +var divideSegment = require('./divide_segment'); +var intersection = require('./segment_intersection'); +var equals = require('./equals'); + +/** + * @param {SweepEvent} se1 + * @param {SweepEvent} se2 + * @param {Queue} queue + * @return {Number} + */ +module.exports = function possibleIntersection(se1, se2, queue) { + // that disallows self-intersecting polygons, + // did cost us half a day, so I'll leave it + // out of respect + // if (se1.isSubject === se2.isSubject) return; + var inter = intersection( + se1.point, se1.otherEvent.point, + se2.point, se2.otherEvent.point + ); + + var nintersections = inter ? inter.length : 0; + if (nintersections === 0) return 0; // no intersection + + // the line segments intersect at an endpoint of both line segments + if ((nintersections === 1) && + (equals(se1.point, se2.point) || + equals(se1.otherEvent.point, se2.otherEvent.point))) { + return 0; + } + + if (nintersections === 2 && se1.isSubject === se2.isSubject) { + // if(se1.contourId === se2.contourId){ + // console.warn('Edges of the same polygon overlap', + // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point); + // } + //throw new Error('Edges of the same polygon overlap'); + return 0; + } + + // The line segments associated to se1 and se2 intersect + if (nintersections === 1) { + + // if the intersection point is not an endpoint of se1 + if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) { + divideSegment(se1, inter[0], queue); + } + + // if the intersection point is not an endpoint of se2 + if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) { + divideSegment(se2, inter[0], queue); + } + return 1; + } + + // The line segments associated to se1 and se2 overlap + var events = []; + var leftCoincide = false; + var rightCoincide = false; + + if (equals(se1.point, se2.point)) { + leftCoincide = true; // linked + } else if (compareEvents(se1, se2) === 1) { + events.push(se2, se1); + } else { + events.push(se1, se2); + } + + if (equals(se1.otherEvent.point, se2.otherEvent.point)) { + rightCoincide = true; + } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) { + events.push(se2.otherEvent, se1.otherEvent); + } else { + events.push(se1.otherEvent, se2.otherEvent); + } + + if ((leftCoincide && rightCoincide) || leftCoincide) { + // both line segments are equal or share the left endpoint + se1.type = edgeType.NON_CONTRIBUTING; + se2.type = (se1.inOut === se2.inOut) ? + edgeType.SAME_TRANSITION : + edgeType.DIFFERENT_TRANSITION; + + if (leftCoincide && !rightCoincide) { + // honestly no idea, but changing events selection from [2, 1] + // to [0, 1] fixes the overlapping self-intersecting polygons issue + divideSegment(events[1].otherEvent, events[0].point, queue); + } + return 2; + } + + // the line segments share the right endpoint + if (rightCoincide) { + divideSegment(events[0], events[1].point, queue); + return 3; + } + + // no line segment includes totally the other one + if (events[0] !== events[3].otherEvent) { + divideSegment(events[0], events[1].point, queue); + divideSegment(events[1], events[2].point, queue); + return 3; + } + + // one line segment includes the other one + divideSegment(events[0], events[1].point, queue); + divideSegment(events[3].otherEvent, events[2].point, queue); + + return 3; +}; diff --git a/src/subdivide_segments.js b/src/subdivide_segments.js new file mode 100644 index 0000000..9b4c2c0 --- /dev/null +++ b/src/subdivide_segments.js @@ -0,0 +1,118 @@ +var Tree = require('avl'); +var computeFields = require('./compute_fields'); +var possibleIntersection = require('./possible_intersection'); +var compareSegments = require('./compare_segments'); +var operations = require('./operation'); + + +module.exports = function subdivide (eventQueue, subject, clipping, sbbox, cbbox, operation) { + var sweepLine = new Tree(compareSegments); + var sortedEvents = []; + + var rightbound = Math.min(sbbox[2], cbbox[2]); + + var prev, next, begin, end; + + var INTERSECTION = operations.INTERSECTION; + var DIFFERENCE = operations.DIFFERENCE; + + while (eventQueue.length) { + var event = eventQueue.pop(); + sortedEvents.push(event); + + // optimization by bboxes for intersection and difference goes here + if ((operation === INTERSECTION && event.point[0] > rightbound) || + (operation === DIFFERENCE && event.point[0] > sbbox[2])) { + break; + } + + if (event.left) { + next = prev = sweepLine.insert(event); + //_renderSweepLine(sweepLine, event.point, event); + begin = sweepLine.minNode(); + + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; + + next = sweepLine.next(next); + + var prevEvent = prev ? prev.key : null; + var prevprevEvent; + computeFields(event, prevEvent, operation); + if (next) { + if (possibleIntersection(event, next.key, eventQueue) === 2) { + computeFields(event, prevEvent, operation); + computeFields(event, next.key, operation); + } + } + if (prev) { + if (possibleIntersection(prev.key, event, eventQueue) === 2) { + var prevprev = prev; + if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); + else prevprev = null; + + prevprevEvent = prevprev ? prevprev.key : null; + computeFields(prevEvent, prevprevEvent, operation); + computeFields(event, prevEvent, operation); + } + } + } else { + event = event.otherEvent; + next = prev = sweepLine.find(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); + + if (prev && next) { + + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; + + next = sweepLine.next(next); + sweepLine.remove(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); + + if (next && prev) { + //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + possibleIntersection(prev.key, next.key, eventQueue); + //} + } + } + } + } + return sortedEvents; +}; + + +/* eslint-disable no-unused-vars, no-debugger, no-undef */ +function _renderSweepLine(sweepLine, pos, event) { + var map = window.map; + if (!map) return; + if (window.sws) window.sws.forEach(function (p) { + map.removeLayer(p); + }); + window.sws = []; + sweepLine.forEach(function (e) { + var poly = L.polyline([ + e.point.slice().reverse(), + e.otherEvent.point.slice().reverse() + ], {color: 'green'}).addTo(map); + window.sws.push(poly); + }); + + if (window.vt) map.removeLayer(window.vt); + var v = pos.slice(); + var b = map.getBounds(); + window.vt = L.polyline([ + [b.getNorth(), v[0]], + [b.getSouth(), v[0]] + ], {color: 'green', weight: 1}).addTo(map); + + if (window.ps) map.removeLayer(window.ps); + window.ps = L.polyline([ + event.point.slice().reverse(), + event.otherEvent.point.slice().reverse() + ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); + debugger; +} +/* eslint-enable no-unused-vars, no-debugger, no-undef */ diff --git a/src/sweep_event.js b/src/sweep_event.js index 9a5f7f3..e9bfbb1 100644 --- a/src/sweep_event.js +++ b/src/sweep_event.js @@ -87,9 +87,12 @@ SweepEvent.prototype = { * @return {Boolean} */ isBelow: function (p) { + var p0 = this.point, p1 = this.otherEvent.point; return this.left ? - signedArea(this.point, this.otherEvent.point, p) > 0 : - signedArea(this.otherEvent.point, this.point, p) > 0; + (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0 : + // signedArea(this.point, this.otherEvent.point, p) > 0 : + (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0 + //signedArea(this.otherEvent.point, this.point, p) > 0; }, From 916c8b098f9d38387835bbfcad9c67b8d49b75c9 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Thu, 14 Sep 2017 13:41:08 +0200 Subject: [PATCH 08/42] made tests pass --- demo/js/bundle.js | 180 +++--- dist/martinez.js | 1144 +++++++++++++++++----------------- src/compare_segments.js | 2 +- src/possible_intersection.js | 2 + test/divide_segment.test.js | 32 +- test/index.test.js | 11 +- 6 files changed, 677 insertions(+), 694 deletions(-) diff --git a/demo/js/bundle.js b/demo/js/bundle.js index c779f67..4a5d247 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -375,12 +375,12 @@ function height(node) { /** * @typedef {{ - * parent: ?Node, - * left: ?Node, - * right: ?Node, - * balanceFactor: number, - * key: Key, - * data: Value + * parent: Node|Null, + * left: Node|Null, + * right: Node|Null, + * balanceFactor: Number, + * key: any, + * data: object? * }} Node */ @@ -388,15 +388,10 @@ function height(node) { * @typedef {*} Key */ -/** - * @typedef {*} Value - */ - /** * Default comparison function - * @param {Key} a - * @param {Key} b - * @returns {number} + * @param {*} a + * @param {*} b */ function DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; } @@ -480,7 +475,7 @@ function rotateRight (node) { // } -var AVLTree = function AVLTree (comparator, noDuplicates) { +var Tree = function Tree (comparator, noDuplicates) { if ( noDuplicates === void 0 ) noDuplicates = false; this._comparator = comparator || DEFAULT_COMPARE; @@ -494,16 +489,14 @@ var prototypeAccessors = { size: {} }; /** * Clear the tree - * @return {AVLTree} */ -AVLTree.prototype.destroy = function destroy () { +Tree.prototype.destroy = function destroy () { this._root = null; - return this; }; /** * Number of nodes - * @return {number} + * @return {Number} */ prototypeAccessors.size.get = function () { return this._size; @@ -513,9 +506,9 @@ prototypeAccessors.size.get = function () { /** * Whether the tree contains a node with the given key * @param{Key} key - * @return {boolean} true/false + * @return {Boolean} */ -AVLTree.prototype.contains = function contains (key) { +Tree.prototype.contains = function contains (key) { if (this._root){ var node = this._root; var comparator = this._comparator; @@ -535,9 +528,9 @@ AVLTree.prototype.contains = function contains (key) { /** * Successor node * @param{Node} node - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.next = function next (node) { +Tree.prototype.next = function next (node) { var successor = node; if (successor) { if (successor.right) { @@ -557,9 +550,9 @@ AVLTree.prototype.next = function next (node) { /** * Predecessor node * @param{Node} node - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.prev = function prev (node) { +Tree.prototype.prev = function prev (node) { var predecessor = node; if (predecessor) { if (predecessor.left) { @@ -579,17 +572,10 @@ AVLTree.prototype.prev = function prev (node) { /** - * Callback for forEach - * @callback forEachCallback - * @param {Node} node - * @param {number} index - */ - -/** - * @param{forEachCallback} callback + * @param{Function(node:Node):void} fn * @return {AVLTree} */ -AVLTree.prototype.forEach = function forEach (callback) { +Tree.prototype.forEach = function forEach (fn) { var current = this._root; var s = [], done = false, i = 0; @@ -606,7 +592,7 @@ AVLTree.prototype.forEach = function forEach (callback) { // empty you are done if (s.length > 0) { current = s.pop(); - callback(current, i++); + fn(current, i++); // We have visited the node and its left // subtree. Now, it's right subtree's turn @@ -622,7 +608,7 @@ AVLTree.prototype.forEach = function forEach (callback) { * Returns all keys in order * @return {Array} */ -AVLTree.prototype.keys = function keys () { +Tree.prototype.keys = function keys () { var current = this._root; var s = [], r = [], done = false; @@ -644,9 +630,9 @@ AVLTree.prototype.keys = function keys () { /** * Returns `data` fields of all nodes in order. - * @return {Array} + * @return {Array<*>} */ -AVLTree.prototype.values = function values () { +Tree.prototype.values = function values () { var current = this._root; var s = [], r = [], done = false; @@ -666,15 +652,9 @@ AVLTree.prototype.values = function values () { }; -/** - * Returns node at given index - * @param{number} index - * @return {?Node} - */ -AVLTree.prototype.at = function at (index) { - // removed after a consideration, more misleading than useful - // index = index % this.size; - // if (index < 0) index = this.size - index; +Tree.prototype.at = function at (index) { + index = index % this.size; + if (index < 0) { index = this.size - index; } var current = this._root; var s = [], done = false, i = 0; @@ -698,9 +678,9 @@ AVLTree.prototype.at = function at (index) { /** * Returns node with the minimum key - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.minNode = function minNode () { +Tree.prototype.minNode = function minNode () { var node = this._root; if (!node) { return null; } while (node.left) { node = node.left; } @@ -710,9 +690,9 @@ AVLTree.prototype.minNode = function minNode () { /** * Returns node with the max key - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.maxNode = function maxNode () { +Tree.prototype.maxNode = function maxNode () { var node = this._root; if (!node) { return null; } while (node.right) { node = node.right; } @@ -722,21 +702,20 @@ AVLTree.prototype.maxNode = function maxNode () { /** * Min key - * @return {?Key} + * @return {Key} */ -AVLTree.prototype.min = function min () { +Tree.prototype.min = function min () { var node = this._root; if (!node) { return null; } while (node.left) { node = node.left; } return node.key; }; - /** * Max key - * @return {?Key} + * @return {Key|Null} */ -AVLTree.prototype.max = function max () { +Tree.prototype.max = function max () { var node = this._root; if (!node) { return null; } while (node.right) { node = node.right; } @@ -745,18 +724,18 @@ AVLTree.prototype.max = function max () { /** - * @return {boolean} true/false + * @return {Boolean} */ -AVLTree.prototype.isEmpty = function isEmpty () { +Tree.prototype.isEmpty = function isEmpty () { return !this._root; }; /** * Removes and returns the node with smallest key - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.pop = function pop () { +Tree.prototype.pop = function pop () { var node = this._root, returnValue = null; if (node) { while (node.left) { node = node.left; } @@ -770,12 +749,12 @@ AVLTree.prototype.pop = function pop () { /** * Find node by key * @param{Key} key - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.find = function find (key) { +Tree.prototype.find = function find (key) { var root = this._root; - // if (root === null) return null; - // if (key === root.key) return root; + if (root === null) { return null; } + if (key === root.key) { return root; } var subtree = root, cmp; var compare = this._comparator; @@ -793,10 +772,10 @@ AVLTree.prototype.find = function find (key) { /** * Insert a node into the tree * @param{Key} key - * @param{Value} [data] - * @return {?Node} + * @param{*} [data] + * @return {Node|Null} */ -AVLTree.prototype.insert = function insert (key, data) { +Tree.prototype.insert = function insert (key, data) { var this$1 = this; if (!this._root) { @@ -831,12 +810,9 @@ AVLTree.prototype.insert = function insert (key, data) { } var newNode = { - left: null, - right: null, - balanceFactor: 0, + left: null, right: null, balanceFactor: 0, parent: parent, key: key, data: data }; - var newRoot; if (cmp <= 0) { parent.left= newNode; } else { parent.right = newNode; } @@ -847,20 +823,18 @@ AVLTree.prototype.insert = function insert (key, data) { if (parent.balanceFactor === 0) { break; } else if (parent.balanceFactor < -1) { - // inlined - //var newRoot = rightBalance(parent); + //let newRoot = rightBalance(parent); if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } - newRoot = rotateLeft(parent); + var newRoot = rotateLeft(parent); if (parent === this$1._root) { this$1._root = newRoot; } break; } else if (parent.balanceFactor > 1) { - // inlined - // var newRoot = leftBalance(parent); + // let newRoot = leftBalance(parent); if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } - newRoot = rotateRight(parent); + var newRoot$1 = rotateRight(parent); - if (parent === this$1._root) { this$1._root = newRoot; } + if (parent === this$1._root) { this$1._root = newRoot$1; } break; } parent = parent.parent; @@ -874,30 +848,27 @@ AVLTree.prototype.insert = function insert (key, data) { /** * Removes the node from the tree. If not found, returns null. * @param{Key} key - * @return {?Node} + * @return {Node:Null} */ -AVLTree.prototype.remove = function remove (key) { +Tree.prototype.remove = function remove (key) { var this$1 = this; if (!this._root) { return null; } var node = this._root; var compare = this._comparator; - var cmp = 0; while (node) { - cmp = compare(key, node.key); + var cmp = compare(key, node.key); if (cmp === 0) { break; } else if (cmp < 0) { node = node.left; } else { node = node.right; } } if (!node) { return null; } - var returnValue = node.key; - var max, min; if (node.left) { - max = node.left; + var max = node.left; while (max.left || max.right) { while (max.right) { max = max.right; } @@ -916,7 +887,7 @@ AVLTree.prototype.remove = function remove (key) { } if (node.right) { - min = node.right; + var min = node.right; while (min.left || min.right) { while (min.left) { min = min.left; } @@ -936,28 +907,25 @@ AVLTree.prototype.remove = function remove (key) { var parent = node.parent; var pp = node; - var newRoot; while (parent) { if (parent.left === pp) { parent.balanceFactor -= 1; } else { parent.balanceFactor += 1; } if (parent.balanceFactor < -1) { - // inlined - //var newRoot = rightBalance(parent); + //let newRoot = rightBalance(parent); if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } - newRoot = rotateLeft(parent); + var newRoot = rotateLeft(parent); if (parent === this$1._root) { this$1._root = newRoot; } parent = newRoot; } else if (parent.balanceFactor > 1) { - // inlined - // var newRoot = leftBalance(parent); + // let newRoot = leftBalance(parent); if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } - newRoot = rotateRight(parent); + var newRoot$1 = rotateRight(parent); - if (parent === this$1._root) { this$1._root = newRoot; } - parent = newRoot; + if (parent === this$1._root) { this$1._root = newRoot$1; } + parent = newRoot$1; } if (parent.balanceFactor === -1 || parent.balanceFactor === 1) { break; } @@ -980,11 +948,11 @@ AVLTree.prototype.remove = function remove (key) { /** * Bulk-load items - * @param{Array}keys - * @param{Array}[values] - * @return {AVLTree} + * @param{Array}keys + * @param{Array}[values] + * @return {Tree} */ -AVLTree.prototype.load = function load (keys, values) { +Tree.prototype.load = function load (keys, values) { var this$1 = this; if ( keys === void 0 ) keys = []; if ( values === void 0 ) values = []; @@ -1000,25 +968,25 @@ AVLTree.prototype.load = function load (keys, values) { /** * Returns true if the tree is balanced - * @return {boolean} + * @return {Boolean} */ -AVLTree.prototype.isBalanced = function isBalanced$1 () { +Tree.prototype.isBalanced = function isBalanced$1 () { return isBalanced(this._root); }; /** * String representation of the tree - primitive horizontal print-out - * @param{Function(Node):string} [printNode] - * @return {string} + * @param{Function(Node):String} [printNode] + * @return {String} */ -AVLTree.prototype.toString = function toString (printNode) { +Tree.prototype.toString = function toString (printNode) { return print(this._root, printNode); }; -Object.defineProperties( AVLTree.prototype, prototypeAccessors ); +Object.defineProperties( Tree.prototype, prototypeAccessors ); -return AVLTree; +return Tree; }))); @@ -3774,4 +3742,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":18,"./signed_area":25}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvbGliL2lzLW9iamVjdC5qcyIsIm5vZGVfbW9kdWxlcy9zdXBlcmFnZW50L2xpYi9yZXF1ZXN0LWJhc2UuanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvcmVxdWVzdC5qcyIsIm5vZGVfbW9kdWxlcy90aW55cXVldWUvaW5kZXguanMiLCJzcmMvY29tcGFyZV9ldmVudHMuanMiLC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NlICdbb2JqZWN0IEZpbGVdJzpcbiAgICBjYXNlICdbb2JqZWN0IEJsb2JdJzpcbiAgICBjYXNlICdbb2JqZWN0IEZvcm1EYXRhXSc6XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICBkZWZhdWx0OlxuICAgICAgcmV0dXJuIGZhbHNlO1xuICB9XG59XG5cbi8qKlxuICogU2VuZCBgZGF0YWAgYXMgdGhlIHJlcXVlc3QgYm9keSwgZGVmYXVsdGluZyB0aGUgYC50eXBlKClgIHRvIFwianNvblwiIHdoZW5cbiAqIGFuIG9iamVjdCBpcyBnaXZlbi5cbiAqXG4gKiBFeGFtcGxlczpcbiAqXG4gKiAgICAgICAvLyBtYW51YWwganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICA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gpIHtcbiAgICAgICAgdmFyIHRvcCA9IHRoaXMuZGF0YVswXTtcbiAgICAgICAgdGhpcy5kYXRhWzBdID0gdGhpcy5kYXRhW3RoaXMubGVuZ3RoIC0gMV07XG4gICAgICAgIHRoaXMubGVuZ3RoLS07XG4gICAgICAgIHRoaXMuZGF0YS5wb3AoKTtcbiAgICAgICAgdGhpcy5fZG93bigwKTtcbiAgICAgICAgcmV0dXJuIHRvcDtcbiAgICB9LFxuXG4gICAgcGVlazogZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kYXRhWzBdO1xuICAgIH0sXG5cbiAgICBfdXA6IGZ1bmN0aW9uIChwb3MpIHtcbiAgICAgICAgdmFyIGRhdGEgPSB0aGlzLmRhdGEsXG4gICAgICAgICAgICBjb21wYXJlID0gdGhpcy5jb21wYXJlO1xuXG4gICAgICAgIHdoaWxlIChwb3MgPiAwKSB7XG4gICAgICAgICAgICB2YXIgcGFyZW50ID0gTWF0aC5mbG9vcigocG9zIC0gMSkgLyAyKTtcbiAgICAgICAgICAgIGlmIChjb21wYXJlKGRhdGFbcG9zXSwgZGF0YVtwYXJlbnRdKSA8IDApIHtcbiAgICAgICAgICAgICAgICBzd2FwKGRhdGEsIHBhcmVudCwgcG9zKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBwYXJlbnQ7XG5cbiAgICAgICAgICAgIH0gZWxzZSBicmVhaztcbiAgICAgICAgfVxuICAgIH0sXG5cbiAgICBfZG93bjogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmUsXG4gICAgICAgICAgICBsZW4gPSB0aGlzLmxlbmd0aDtcblxuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgdmFyIGxlZnQgPSAyICogcG9zICsgMSxcbiAgICAgICAgICAgICAgICByaWdodCA9IGxlZnQgKyAxLFxuICAg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cbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW50LCAgICAgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBldmVudCA9IGV2ZW50Lm90aGVyRXZlbnQ7XG4gICAgICBuZXh0ID0gcHJldiA9IHN3ZWVwTGluZS5maW5kKGV2ZW50KTtcblxuICAgICAgLy8gX3JlbmRlclN3ZWVwTGluZShzd2VlcExpbmUsIGV2ZW50Lm90a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wIDpcbiAgICAgIChwMVswXSAtIHBbMF0pICogKHAwWzFdIC0gcFsxXSkgLSAocDBbMF0gLSBwWzBdKSAqIChwMVsxXSAtIHBbMV0pID4gMFxuICAgICAgLy9zaWduZWRBcmVhKHRoaXMub3RoZXJFdmVudC5wb2ludCwgdGhpcy5wb2ludCwgcCkgPiAwO1xuICB9LFxuXG5cbiAgLyoqXG4gICAqIEBwYXJhbSAge0FycmF5LjxOdW1iZXI+fSAgcFxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNBYm92ZTogZnVuY3Rpb24gKHApIHtcbiAgICByZXR1cm4gIXRoaXMuaXNCZWxvdyhwKTtcbiAgfSxcblxuXG4gIC8qKlxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNWZXJ0aWNhbDogZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiB0aGlzLnBvaW50WzBdID09PSB0aGlzLm90aGVyRXZlbnQucG9pbnRbMF07XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzID0gU3dlZXBFdmVudDtcbiJdfQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvbGliL2lzLW9iamVjdC5qcyIsI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1xuICAgIEwuRG9tRXZlbnRcbiAgICAgIC5vbihmb3JtLCAnc3VibWl0JywgZnVuY3Rpb24gKGV2dCkge1xuICAgICAgICBMLkRvbUV2ZW50LnN0b3AoZXZ0KTtcbiAgICAgICAgdmFyIHJhZGlvcyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKFxuICAgICAgICAgIGZvcm0ucXVlcnlTZWxlY3RvckFsbCgnaW5wdXRbdHlwZT1yYWRpb10nKSk7XG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSByYWRpb3MubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgICBpZiAocmFkaW9zW2ldLmNoZWNrZWQpIHtcbiAgICAgICAgICAgIHRoaXMub3B0aW9ucy5jYWxsYmFjayhwYXJzZUludChyYWRpb3NbaV0udmFsdWUpKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSwgdGhpcylcbiAgICAgIC5vbihmb3JtWydjbGVhciddLCAnY2xpY2snLCBmdW5jdGlvbihldnQpIHtcbiAgICAgICAgTC5Eb21FdmVudC5zdG9wKGV2dCk7XG4gICAgICAgIHRoaXMub3B0aW9ucy5jbGVhcigpO1xuICAgICAgfSwgdGhpcyk7XG5cbiAgICBMLkRvbUV2ZW50XG4gICAgICAuZGlzYWJsZUNsaWNrUHJvcGFnYXRpb24odGhpcy5fY29udGFpbmVyKVxuICAgICAgLmRpc2FibGVTY3JvbGxQcm9wYWdhdGlvbih0aGlzLl9jb250YWluZXIpO1xuICAgIHJldHVybiB0aGlzLl9jb250YWluZXI7XG4gIH1cblxufSk7IiwiTC5Db29yZGluYXRlcyA9IEwuQ29udHJvbC5leHRlbmQoe1xuICBvcHRpb25zOiB7XG4gICAgcG9zaXRpb246ICdib3R0b21yaWdodCdcbiAgfSxcblxuICBvbkFkZDogZnVuY3Rpb24obWFwKSB7XG4gICAgdGhpcy5fY29udGFpbmVyID0gTC5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mVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW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JFdmVudC5wb2ludDtcbiAgICByZXR1cm4gdGhpcy5sZWZ0ID9cbiAgICAgIChwMFswXSAtIHBbMF0pICogKHAxWzFdIC0gcFsxXSkgLSAocDFbMF0gLSBwWzBdKSAqIChwMFsxXSAtIHBbMV0pID4gMCA6XG4gICAgICAvLyBzaWduZWRBcmVhKHRoaXMucG9pbnQsIHRoaXMub3RoZXJFdmVudC5wb2ludCwgcCkgPiAwIDpcbiAgICAgIChwMVswXSAtIHBbMF0pICogKHAwWzFdIC0gcFsxXSkgLSAocDBbMF0gLSBwWzBdKSAqIChwMVsxXSAtIHBbMV0pID4gMFxuICAgICAgLy9zaWduZWRBcmVhKHRoaXMub3RoZXJFdmVudC5wb2ludCwgdGhpcy5wb2ludCwgcCkgPiAwO1xuICB9LFxuXG5cbiAgLyoqXG4gICAqIEBwYXJhbSAge0FycmF5LjxOdW1iZXI+fSAgcFxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNBYm92ZTogZnVuY3Rpb24gKHApIHtcbiAgICByZXR1cm4gIXRoaXMuaXNCZWxvdyhwKTtcbiAgfSxcblxuXG4gIC8qKlxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNWZXJ0aWNhbDogZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiB0aGlzLnBvaW50WzBdID09PSB0aGlzLm90aGVyRXZlbnQucG9pbnRbMF07XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzID0gU3dlZXBFdmVudDtcbiJdfQ== diff --git a/dist/martinez.js b/dist/martinez.js index 42e26ce..341c17f 100644 --- a/dist/martinez.js +++ b/dist/martinez.js @@ -10,7 +10,7 @@ module.exports = { intersection: martinez.intersection }; -},{"./src/index":8}],2:[function(require,module,exports){ +},{"./src/index":12}],2:[function(require,module,exports){ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -87,12 +87,12 @@ function height(node) { /** * @typedef {{ - * parent: ?Node, - * left: ?Node, - * right: ?Node, - * balanceFactor: number, - * key: Key, - * data: Value + * parent: Node|Null, + * left: Node|Null, + * right: Node|Null, + * balanceFactor: Number, + * key: any, + * data: object? * }} Node */ @@ -100,15 +100,10 @@ function height(node) { * @typedef {*} Key */ -/** - * @typedef {*} Value - */ - /** * Default comparison function - * @param {Key} a - * @param {Key} b - * @returns {number} + * @param {*} a + * @param {*} b */ function DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; } @@ -192,7 +187,7 @@ function rotateRight (node) { // } -var AVLTree = function AVLTree (comparator, noDuplicates) { +var Tree = function Tree (comparator, noDuplicates) { if ( noDuplicates === void 0 ) noDuplicates = false; this._comparator = comparator || DEFAULT_COMPARE; @@ -206,16 +201,14 @@ var prototypeAccessors = { size: {} }; /** * Clear the tree - * @return {AVLTree} */ -AVLTree.prototype.destroy = function destroy () { +Tree.prototype.destroy = function destroy () { this._root = null; - return this; }; /** * Number of nodes - * @return {number} + * @return {Number} */ prototypeAccessors.size.get = function () { return this._size; @@ -225,9 +218,9 @@ prototypeAccessors.size.get = function () { /** * Whether the tree contains a node with the given key * @param{Key} key - * @return {boolean} true/false + * @return {Boolean} */ -AVLTree.prototype.contains = function contains (key) { +Tree.prototype.contains = function contains (key) { if (this._root){ var node = this._root; var comparator = this._comparator; @@ -247,9 +240,9 @@ AVLTree.prototype.contains = function contains (key) { /** * Successor node * @param{Node} node - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.next = function next (node) { +Tree.prototype.next = function next (node) { var successor = node; if (successor) { if (successor.right) { @@ -269,9 +262,9 @@ AVLTree.prototype.next = function next (node) { /** * Predecessor node * @param{Node} node - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.prev = function prev (node) { +Tree.prototype.prev = function prev (node) { var predecessor = node; if (predecessor) { if (predecessor.left) { @@ -291,17 +284,10 @@ AVLTree.prototype.prev = function prev (node) { /** - * Callback for forEach - * @callback forEachCallback - * @param {Node} node - * @param {number} index - */ - -/** - * @param{forEachCallback} callback + * @param{Function(node:Node):void} fn * @return {AVLTree} */ -AVLTree.prototype.forEach = function forEach (callback) { +Tree.prototype.forEach = function forEach (fn) { var current = this._root; var s = [], done = false, i = 0; @@ -318,7 +304,7 @@ AVLTree.prototype.forEach = function forEach (callback) { // empty you are done if (s.length > 0) { current = s.pop(); - callback(current, i++); + fn(current, i++); // We have visited the node and its left // subtree. Now, it's right subtree's turn @@ -334,7 +320,7 @@ AVLTree.prototype.forEach = function forEach (callback) { * Returns all keys in order * @return {Array} */ -AVLTree.prototype.keys = function keys () { +Tree.prototype.keys = function keys () { var current = this._root; var s = [], r = [], done = false; @@ -356,9 +342,9 @@ AVLTree.prototype.keys = function keys () { /** * Returns `data` fields of all nodes in order. - * @return {Array} + * @return {Array<*>} */ -AVLTree.prototype.values = function values () { +Tree.prototype.values = function values () { var current = this._root; var s = [], r = [], done = false; @@ -378,15 +364,9 @@ AVLTree.prototype.values = function values () { }; -/** - * Returns node at given index - * @param{number} index - * @return {?Node} - */ -AVLTree.prototype.at = function at (index) { - // removed after a consideration, more misleading than useful - // index = index % this.size; - // if (index < 0) index = this.size - index; +Tree.prototype.at = function at (index) { + index = index % this.size; + if (index < 0) { index = this.size - index; } var current = this._root; var s = [], done = false, i = 0; @@ -410,9 +390,9 @@ AVLTree.prototype.at = function at (index) { /** * Returns node with the minimum key - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.minNode = function minNode () { +Tree.prototype.minNode = function minNode () { var node = this._root; if (!node) { return null; } while (node.left) { node = node.left; } @@ -422,9 +402,9 @@ AVLTree.prototype.minNode = function minNode () { /** * Returns node with the max key - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.maxNode = function maxNode () { +Tree.prototype.maxNode = function maxNode () { var node = this._root; if (!node) { return null; } while (node.right) { node = node.right; } @@ -434,21 +414,20 @@ AVLTree.prototype.maxNode = function maxNode () { /** * Min key - * @return {?Key} + * @return {Key} */ -AVLTree.prototype.min = function min () { +Tree.prototype.min = function min () { var node = this._root; if (!node) { return null; } while (node.left) { node = node.left; } return node.key; }; - /** * Max key - * @return {?Key} + * @return {Key|Null} */ -AVLTree.prototype.max = function max () { +Tree.prototype.max = function max () { var node = this._root; if (!node) { return null; } while (node.right) { node = node.right; } @@ -457,18 +436,18 @@ AVLTree.prototype.max = function max () { /** - * @return {boolean} true/false + * @return {Boolean} */ -AVLTree.prototype.isEmpty = function isEmpty () { +Tree.prototype.isEmpty = function isEmpty () { return !this._root; }; /** * Removes and returns the node with smallest key - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.pop = function pop () { +Tree.prototype.pop = function pop () { var node = this._root, returnValue = null; if (node) { while (node.left) { node = node.left; } @@ -482,12 +461,12 @@ AVLTree.prototype.pop = function pop () { /** * Find node by key * @param{Key} key - * @return {?Node} + * @return {Node|Null} */ -AVLTree.prototype.find = function find (key) { +Tree.prototype.find = function find (key) { var root = this._root; - // if (root === null) return null; - // if (key === root.key) return root; + if (root === null) { return null; } + if (key === root.key) { return root; } var subtree = root, cmp; var compare = this._comparator; @@ -505,10 +484,10 @@ AVLTree.prototype.find = function find (key) { /** * Insert a node into the tree * @param{Key} key - * @param{Value} [data] - * @return {?Node} + * @param{*} [data] + * @return {Node|Null} */ -AVLTree.prototype.insert = function insert (key, data) { +Tree.prototype.insert = function insert (key, data) { var this$1 = this; if (!this._root) { @@ -543,12 +522,9 @@ AVLTree.prototype.insert = function insert (key, data) { } var newNode = { - left: null, - right: null, - balanceFactor: 0, + left: null, right: null, balanceFactor: 0, parent: parent, key: key, data: data }; - var newRoot; if (cmp <= 0) { parent.left= newNode; } else { parent.right = newNode; } @@ -559,20 +535,18 @@ AVLTree.prototype.insert = function insert (key, data) { if (parent.balanceFactor === 0) { break; } else if (parent.balanceFactor < -1) { - // inlined - //var newRoot = rightBalance(parent); + //let newRoot = rightBalance(parent); if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } - newRoot = rotateLeft(parent); + var newRoot = rotateLeft(parent); if (parent === this$1._root) { this$1._root = newRoot; } break; } else if (parent.balanceFactor > 1) { - // inlined - // var newRoot = leftBalance(parent); + // let newRoot = leftBalance(parent); if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } - newRoot = rotateRight(parent); + var newRoot$1 = rotateRight(parent); - if (parent === this$1._root) { this$1._root = newRoot; } + if (parent === this$1._root) { this$1._root = newRoot$1; } break; } parent = parent.parent; @@ -586,30 +560,27 @@ AVLTree.prototype.insert = function insert (key, data) { /** * Removes the node from the tree. If not found, returns null. * @param{Key} key - * @return {?Node} + * @return {Node:Null} */ -AVLTree.prototype.remove = function remove (key) { +Tree.prototype.remove = function remove (key) { var this$1 = this; if (!this._root) { return null; } var node = this._root; var compare = this._comparator; - var cmp = 0; while (node) { - cmp = compare(key, node.key); + var cmp = compare(key, node.key); if (cmp === 0) { break; } else if (cmp < 0) { node = node.left; } else { node = node.right; } } if (!node) { return null; } - var returnValue = node.key; - var max, min; if (node.left) { - max = node.left; + var max = node.left; while (max.left || max.right) { while (max.right) { max = max.right; } @@ -628,7 +599,7 @@ AVLTree.prototype.remove = function remove (key) { } if (node.right) { - min = node.right; + var min = node.right; while (min.left || min.right) { while (min.left) { min = min.left; } @@ -648,28 +619,25 @@ AVLTree.prototype.remove = function remove (key) { var parent = node.parent; var pp = node; - var newRoot; while (parent) { if (parent.left === pp) { parent.balanceFactor -= 1; } else { parent.balanceFactor += 1; } if (parent.balanceFactor < -1) { - // inlined - //var newRoot = rightBalance(parent); + //let newRoot = rightBalance(parent); if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } - newRoot = rotateLeft(parent); + var newRoot = rotateLeft(parent); if (parent === this$1._root) { this$1._root = newRoot; } parent = newRoot; } else if (parent.balanceFactor > 1) { - // inlined - // var newRoot = leftBalance(parent); + // let newRoot = leftBalance(parent); if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } - newRoot = rotateRight(parent); + var newRoot$1 = rotateRight(parent); - if (parent === this$1._root) { this$1._root = newRoot; } - parent = newRoot; + if (parent === this$1._root) { this$1._root = newRoot$1; } + parent = newRoot$1; } if (parent.balanceFactor === -1 || parent.balanceFactor === 1) { break; } @@ -692,11 +660,11 @@ AVLTree.prototype.remove = function remove (key) { /** * Bulk-load items - * @param{Array}keys - * @param{Array}[values] - * @return {AVLTree} + * @param{Array}keys + * @param{Array}[values] + * @return {Tree} */ -AVLTree.prototype.load = function load (keys, values) { +Tree.prototype.load = function load (keys, values) { var this$1 = this; if ( keys === void 0 ) keys = []; if ( values === void 0 ) values = []; @@ -712,25 +680,25 @@ AVLTree.prototype.load = function load (keys, values) { /** * Returns true if the tree is balanced - * @return {boolean} + * @return {Boolean} */ -AVLTree.prototype.isBalanced = function isBalanced$1 () { +Tree.prototype.isBalanced = function isBalanced$1 () { return isBalanced(this._root); }; /** * String representation of the tree - primitive horizontal print-out - * @param{Function(Node):string} [printNode] - * @return {string} + * @param{Function(Node):String} [printNode] + * @return {String} */ -AVLTree.prototype.toString = function toString (printNode) { +Tree.prototype.toString = function toString (printNode) { return print(this._root, printNode); }; -Object.defineProperties( AVLTree.prototype, prototypeAccessors ); +Object.defineProperties( Tree.prototype, prototypeAccessors ); -return AVLTree; +return Tree; }))); @@ -827,7 +795,7 @@ var signedArea = require('./signed_area'); * @param {SweepEvent} e2 * @return {Number} */ -module.exports = function sweepEventsComp(e1, e2) { +module.exports = function compareEvents (e1, e2) { var p1 = e1.point; var p2 = e2.point; @@ -842,6 +810,7 @@ module.exports = function sweepEventsComp(e1, e2) { return specialCases(e1, e2, p1, p2); }; + /* eslint-disable no-unused-vars */ function specialCases(e1, e2, p1, p2) { // Same coordinates, but one is a left endpoint and the other is @@ -849,10 +818,12 @@ function specialCases(e1, e2, p1, p2) { if (e1.left !== e2.left) return e1.left ? 1 : -1; + var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; + var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) // Same coordinates, both events // are left endpoints or right endpoints. // not collinear - if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) { + if (sa/*signedArea(p1, e1.otherEvent.point, e2.otherEvent.point)*/ !== 0) { // the event associate to the bottom segment is processed first return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; } @@ -870,7 +841,7 @@ function specialCases(e1, e2, p1, p2) { } /* eslint-enable no-unused-vars */ -},{"./signed_area":10}],5:[function(require,module,exports){ +},{"./signed_area":16}],5:[function(require,module,exports){ 'use strict'; var signedArea = require('./signed_area'); @@ -906,12 +877,11 @@ module.exports = function compareSegments(le1, le2) { } if (le1.isSubject === le2.isSubject) { // same polygon - if (equals(le1.point, le2.point)) { - if (equals(le1.otherEvent.point, le2.otherEvent.point)) { - return 0; - } else { - return le1.contourId > le2.contourId ? 1 : -1; - } + var p1 = le1.point, p2 = le2.point; + if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) { + p1 = le1.otherEvent.point; p2 = le2.otherEvent.point; + if (p1[0] === p2[0] && p1[1] === p2[1]) return 0; + else return le1.contourId > le2.contourId ? 1 : -1; } } else { // Segments are collinear, but belong to separate polygons return le1.isSubject ? -1 : 1; @@ -920,132 +890,20 @@ module.exports = function compareSegments(le1, le2) { return compareEvents(le1, le2) === 1 ? 1 : -1; }; -},{"./compare_events":4,"./equals":7,"./signed_area":10}],6:[function(require,module,exports){ -'use strict'; - -module.exports = { - NORMAL: 0, - NON_CONTRIBUTING: 1, - SAME_TRANSITION: 2, - DIFFERENT_TRANSITION: 3 -}; - -},{}],7:[function(require,module,exports){ -'use strict'; - -// var EPSILON = 1e-9; -// var abs = Math.abs; - -module.exports = function equals(p1, p2) { - return p1[0] === p2[0] && p1[1] === p2[1]; -}; - -// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164 -// Precision problem. -// -// module.exports = function equals(p1, p2) { -// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON; -// }; - -},{}],8:[function(require,module,exports){ -'use strict'; - -var Queue = require('tinyqueue'); -var Tree = require('avl'); -var edgeType = require('./edge_type'); -var SweepEvent = require('./sweep_event'); -var compareEvents = require('./compare_events'); -var compareSegments = require('./compare_segments'); -var intersection = require('./segment_intersection'); -var equals = require('./equals'); +},{"./compare_events":4,"./equals":10,"./signed_area":16}],6:[function(require,module,exports){ +var edgeType = require('./edge_type'); var INTERSECTION = 0; -var UNION = 1; -var DIFFERENCE = 2; -var XOR = 3; -var EMPTY = []; - -var max = Math.max; -var min = Math.min; - -/** - * @param {Array} s1 - * @param {Array} s2 - * @param {Boolean} isSubject - * @param {Queue} eventQueue - * @param {Array} bbox - */ -function processSegment(s1, s2, isSubject, depth, eventQueue, bbox, isExteriorRing) { - // Possible degenerate condition. - // if (equals(s1, s2)) return; - - var e1 = new SweepEvent(s1, false, undefined, isSubject); - var e2 = new SweepEvent(s2, false, e1, isSubject); - e1.otherEvent = e2; - - e1.contourId = e2.contourId = depth; - if (!isExteriorRing) { - e1.isExteriorRing = false; - e2.isExteriorRing = false; - } - if (compareEvents(e1, e2) > 0) { - e2.left = true; - } else { - e1.left = true; - } - - bbox[0] = min(bbox[0], s1[0]); - bbox[1] = min(bbox[1], s1[1]); - bbox[2] = max(bbox[2], s1[0]); - bbox[3] = max(bbox[3], s1[1]); - - // Pushing it so the queue is sorted from left to right, - // with object on the left having the highest priority. - eventQueue.push(e1); - eventQueue.push(e2); -} - -var contourId = 0; - -function processPolygon(contourOrHole, isSubject, depth, queue, bbox, isExteriorRing) { - var i, len; - for (i = 0, len = contourOrHole.length - 1; i < len; i++) { - processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, queue, bbox, isExteriorRing); - } -} - -function fillQueue(subject, clipping, sbbox, cbbox) { - var eventQueue = new Queue(null, compareEvents); - var polygonSet, isExteriorRing, i, ii, j, jj; - - for (i = 0, ii = subject.length; i < ii; i++) { - polygonSet = subject[i]; - for (j = 0, jj = polygonSet.length; j < jj; j++) { - isExteriorRing = j === 0; - if (isExteriorRing) contourId++; - processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing); - } - } - - for (i = 0, ii = clipping.length; i < ii; i++) { - polygonSet = clipping[i]; - for (j = 0, jj = polygonSet.length; j < jj; j++) { - isExteriorRing = j === 0; - if (isExteriorRing) contourId++; - processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing); - } - } - - return eventQueue; -} - +var UNION = 1; +var DIFFERENCE = 2; +var XOR = 3; /** * @param {SweepEvent} event * @param {SweepEvent} prev * @param {Operation} operation */ -function computeFields(event, prev, operation) { +module.exports = function computeFields(event, prev, operation) { // compute inOut and otherInOut fields if (prev === null) { event.inOut = false; @@ -1072,7 +930,7 @@ function computeFields(event, prev, operation) { // check if the line segment belongs to the Boolean operation event.inResult = inResult(event, operation); -} +}; function inResult(event, operation) { @@ -1100,307 +958,91 @@ function inResult(event, operation) { return false; } +},{"./edge_type":9}],7:[function(require,module,exports){ +var equals = require('./equals'); +var compareEvents = require('./compare_events'); + /** - * @param {SweepEvent} se1 - * @param {SweepEvent} se2 - * @param {Queue} queue - * @return {Number} + * @param {Array.} sortedEvents + * @return {Array.} */ -function possibleIntersection(se1, se2, queue) { - // that disallows self-intersecting polygons, - // did cost us half a day, so I'll leave it - // out of respect - // if (se1.isSubject === se2.isSubject) return; - var inter = intersection( - se1.point, se1.otherEvent.point, - se2.point, se2.otherEvent.point - ); - - var nintersections = inter ? inter.length : 0; - if (nintersections === 0) return 0; // no intersection - - // the line segments intersect at an endpoint of both line segments - if ((nintersections === 1) && - (equals(se1.point, se2.point) || - equals(se1.otherEvent.point, se2.otherEvent.point))) { - return 0; - } - - if (nintersections === 2 && se1.isSubject === se2.isSubject) { - // if(se1.contourId === se2.contourId){ - // console.warn('Edges of the same polygon overlap', - // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point); - // } - //throw new Error('Edges of the same polygon overlap'); - return 0; - } - - // The line segments associated to se1 and se2 intersect - if (nintersections === 1) { - - // if the intersection point is not an endpoint of se1 - if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) { - divideSegment(se1, inter[0], queue); - } - - // if the intersection point is not an endpoint of se2 - if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) { - divideSegment(se2, inter[0], queue); +function orderEvents(sortedEvents) { + var event, i, len, tmp; + var resultEvents = []; + for (i = 0, len = sortedEvents.length; i < len; i++) { + event = sortedEvents[i]; + if ((event.left && event.inResult) || + (!event.left && event.otherEvent.inResult)) { + resultEvents.push(event); } - return 1; - } - - // The line segments associated to se1 and se2 overlap - var events = []; - var leftCoincide = false; - var rightCoincide = false; - - if (equals(se1.point, se2.point)) { - leftCoincide = true; // linked - } else if (compareEvents(se1, se2) === 1) { - events.push(se2, se1); - } else { - events.push(se1, se2); - } - - if (equals(se1.otherEvent.point, se2.otherEvent.point)) { - rightCoincide = true; - } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) { - events.push(se2.otherEvent, se1.otherEvent); - } else { - events.push(se1.otherEvent, se2.otherEvent); } - if ((leftCoincide && rightCoincide) || leftCoincide) { - // both line segments are equal or share the left endpoint - se1.type = edgeType.NON_CONTRIBUTING; - se2.type = (se1.inOut === se2.inOut) ? - edgeType.SAME_TRANSITION : - edgeType.DIFFERENT_TRANSITION; - - if (leftCoincide && !rightCoincide) { - // honestly no idea, but changing events selection from [2, 1] - // to [0, 1] fixes the overlapping self-intersecting polygons issue - divideSegment(events[1].otherEvent, events[0].point, queue); + // Due to overlapping edges the resultEvents array can be not wholly sorted + var sorted = false; + while (!sorted) { + sorted = true; + for (i = 0, len = resultEvents.length; i < len; i++) { + if ((i + 1) < len && + compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) { + tmp = resultEvents[i]; + resultEvents[i] = resultEvents[i + 1]; + resultEvents[i + 1] = tmp; + sorted = false; + } } - return 2; } - // the line segments share the right endpoint - if (rightCoincide) { - divideSegment(events[0], events[1].point, queue); - return 3; + for (i = 0, len = resultEvents.length; i < len; i++) { + resultEvents[i].pos = i; } - // no line segment includes totally the other one - if (events[0] !== events[3].otherEvent) { - divideSegment(events[0], events[1].point, queue); - divideSegment(events[1], events[2].point, queue); - return 3; + for (i = 0, len = resultEvents.length; i < len; i++) { + var event = resultEvents[i]; + if (!event.left) { + tmp = event.pos; + event.pos = event.otherEvent.pos; + event.otherEvent.pos = tmp; + } } - // one line segment includes the other one - divideSegment(events[0], events[1].point, queue); - divideSegment(events[3].otherEvent, events[2].point, queue); - - return 3; + return resultEvents; } /** - * @param {SweepEvent} se - * @param {Array.} p - * @param {Queue} queue - * @return {Queue} + * @param {Number} pos + * @param {Array.} resultEvents + * @param {Object>} processed + * @return {Number} */ -function divideSegment(se, p, queue) { - var r = new SweepEvent(p, false, se, se.isSubject); - var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); +function nextPos(pos, resultEvents, processed) { + var newPos = pos + 1; + var length = resultEvents.length; + var p = resultEvents[pos].point; + var p1 = resultEvents[newPos].point; - if (equals(se.point, se.otherEvent.point)) { - console.warn('what is that?', se); - } + // if (newPos < length && + // p1[0] !== p[0] || p1[1] !== p[1] && + // !processed[newPos]) return newPos; + // else return pos - 1; - r.contourId = l.contourId = se.contourId; - // avoid a rounding error. The left event would be processed after the right event - if (compareEvents(l, se.otherEvent) > 0) { - se.otherEvent.left = true; - l.left = false; + // while in range and not the current one by value + while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { + if (!processed[newPos]) { + console.log(pos, newPos, length); + return newPos; + } + else newPos++; + p1 = resultEvents[newPos].point } - // avoid a rounding error. The left event would be processed after the right event - // if (compareEvents(se, r) > 0) {} - - se.otherEvent.otherEvent = l; - se.otherEvent = r; - - queue.push(l); - queue.push(r); + newPos = pos - 1; - return queue; -} - - -/* eslint-disable no-unused-vars, no-debugger, no-undef */ -function iteratorEquals(it1, it2) { - return it1._cursor === it2._cursor; -} - - -function _renderSweepLine(sweepLine, pos, event) { - var map = window.map; - if (!map) return; - if (window.sws) window.sws.forEach(function (p) { - map.removeLayer(p); - }); - window.sws = []; - sweepLine.forEach(function (e) { - var poly = L.polyline([ - e.point.slice().reverse(), - e.otherEvent.point.slice().reverse() - ], {color: 'green'}).addTo(map); - window.sws.push(poly); - }); - - if (window.vt) map.removeLayer(window.vt); - var v = pos.slice(); - var b = map.getBounds(); - window.vt = L.polyline([ - [b.getNorth(), v[0]], - [b.getSouth(), v[0]] - ], {color: 'green', weight: 1}).addTo(map); - - if (window.ps) map.removeLayer(window.ps); - window.ps = L.polyline([ - event.point.slice().reverse(), - event.otherEvent.point.slice().reverse() - ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); - debugger; -} -/* eslint-enable no-unused-vars, no-debugger, no-undef */ - - -function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation) { - var sweepLine = new Tree(compareSegments); - var sortedEvents = []; - - var rightbound = min(sbbox[2], cbbox[2]); - - var prev, next, begin, end; - - while (eventQueue.length) { - var event = eventQueue.pop(); - sortedEvents.push(event); - - // optimization by bboxes for intersection and difference goes here - if ((operation === INTERSECTION && event.point[0] > rightbound) || - (operation === DIFFERENCE && event.point[0] > sbbox[2])) { - break; - } - - if (event.left) { - next = prev = sweepLine.insert(event); - //_renderSweepLine(sweepLine, event.point, event); - begin = sweepLine.minNode(); - - if (prev !== begin) prev = sweepLine.prev(prev); - else prev = null; - - next = sweepLine.next(next); - - var prevEvent = prev ? prev.key : null; - var prevprevEvent; - computeFields(event, prevEvent, operation); - if (next) { - if (possibleIntersection(event, next.key, eventQueue) === 2) { - computeFields(event, prevEvent, operation); - computeFields(event, next.key, operation); - } - } - if (prev) { - if (possibleIntersection(prev.key, event, eventQueue) === 2) { - var prevprev = prev; - if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); - else prevprev = null; - - prevprevEvent = prevprev ? prevprev.key : null; - computeFields(prevEvent, prevprevEvent, operation); - computeFields(event, prevEvent, operation); - } - } - } else { - event = event.otherEvent; - next = prev = sweepLine.find(event); - - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - - if (prev && next) { - - if (prev !== begin) prev = sweepLine.prev(prev); - else prev = null; - - next = sweepLine.next(next); - sweepLine.remove(event); - - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - - if (next && prev) { - //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { - possibleIntersection(prev.key, next.key, eventQueue); - //} - } - } - } - } - return sortedEvents; -} - - -/** - * @param {Array.} sortedEvents - * @return {Array.} - */ -function orderEvents(sortedEvents) { - var event, i, len, tmp; - var resultEvents = []; - for (i = 0, len = sortedEvents.length; i < len; i++) { - event = sortedEvents[i]; - if ((event.left && event.inResult) || - (!event.left && event.otherEvent.inResult)) { - resultEvents.push(event); - } - } - - // Due to overlapping edges the resultEvents array can be not wholly sorted - var sorted = false; - while (!sorted) { - sorted = true; - for (i = 0, len = resultEvents.length; i < len; i++) { - if ((i + 1) < len && - compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) { - tmp = resultEvents[i]; - resultEvents[i] = resultEvents[i + 1]; - resultEvents[i + 1] = tmp; - sorted = false; - } - } - } - - for (i = 0, len = resultEvents.length; i < len; i++) { - resultEvents[i].pos = i; - } - - for (i = 0, len = resultEvents.length; i < len; i++) { - if (!resultEvents[i].left) { - var temp = resultEvents[i].pos; - resultEvents[i].pos = resultEvents[i].otherEvent.pos; - resultEvents[i].otherEvent.pos = temp; - } - } - - return resultEvents; + while (processed[newPos]) newPos--; + console.log('other', pos, newPos, length); + return newPos; } @@ -1408,13 +1050,14 @@ function orderEvents(sortedEvents) { * @param {Array.} sortedEvents * @return {Array.<*>} polygons */ -function connectEdges(sortedEvents) { +module.exports = function (sortedEvents, operation) { var i, len; var resultEvents = orderEvents(sortedEvents); // "false"-filled array - var processed = new Array(resultEvents.length); + var processed = {}; var result = []; + var event; for (i = 0, len = resultEvents.length; i < len; i++) { if (processed[i]) continue; @@ -1424,7 +1067,11 @@ function connectEdges(sortedEvents) { if (result.length === 0) { result.push([[contour]]); } else { - result[result.length - 1].push([contour]); + if (operation === 1) { + result.push(contour) + } else { + result[result.length - 1].push(contour); + } } } else { result.push(contour); @@ -1438,17 +1085,18 @@ function connectEdges(sortedEvents) { contour[0].push(initial); while (pos >= i) { + var event = resultEvents[pos]; processed[pos] = true; - if (resultEvents[pos].left) { - resultEvents[pos].resultInOut = false; - resultEvents[pos].contourId = ringId; + if (event.left) { + event.resultInOut = false; + event.contourId = ringId; } else { - resultEvents[pos].otherEvent.resultInOut = true; - resultEvents[pos].otherEvent.contourId = ringId; + event.otherEvent.resultInOut = true; + event.otherEvent.contourId = ringId; } - pos = resultEvents[pos].pos; + pos = event.pos; processed[pos] = true; // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); @@ -1458,9 +1106,10 @@ function connectEdges(sortedEvents) { pos = pos === -1 ? i : pos; - processed[pos] = processed[resultEvents[pos].pos] = true; - resultEvents[pos].otherEvent.resultInOut = true; - resultEvents[pos].otherEvent.contourId = ringId; + event = resultEvents[pos]; + processed[pos] = processed[event.pos] = true; + event.otherEvent.resultInOut = true; + event.otherEvent.contourId = ringId; } for (i = 0, len = result.length; i < len; i++) { @@ -1478,44 +1127,164 @@ function connectEdges(sortedEvents) { } return result; -} +}; +},{"./compare_events":4,"./equals":10}],8:[function(require,module,exports){ +var SweepEvent = require('./sweep_event'); +var equals = require('./equals'); +var compareEvents = require('./compare_events'); /** - * @param {Number} pos - * @param {Array.} resultEvents - * @param {Array.} processed - * @return {Number} + * @param {SweepEvent} se + * @param {Array.} p + * @param {Queue} queue + * @return {Queue} */ -function nextPos(pos, resultEvents, processed) { - var newPos = pos + 1; - var length = resultEvents.length; - while (newPos < length && - equals(resultEvents[newPos].point, resultEvents[pos].point)) { - if (!processed[newPos]) { - return newPos; +module.exports = function divideSegment(se, p, queue) { + var r = new SweepEvent(p, false, se, se.isSubject); + var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); + + if (equals(se.point, se.otherEvent.point)) { + console.warn('what is that?', se); + } + + r.contourId = l.contourId = se.contourId; + + // avoid a rounding error. The left event would be processed after the right event + if (compareEvents(l, se.otherEvent) > 0) { + se.otherEvent.left = true; + l.left = false; + } + + // avoid a rounding error. The left event would be processed after the right event + // if (compareEvents(se, r) > 0) {} + + se.otherEvent.otherEvent = l; + se.otherEvent = r; + + queue.push(l); + queue.push(r); + + return queue; +}; + +},{"./compare_events":4,"./equals":10,"./sweep_event":18}],9:[function(require,module,exports){ +'use strict'; + +module.exports = { + NORMAL: 0, + NON_CONTRIBUTING: 1, + SAME_TRANSITION: 2, + DIFFERENT_TRANSITION: 3 +}; + +},{}],10:[function(require,module,exports){ +'use strict'; + +// var EPSILON = 1e-9; +// var abs = Math.abs; + +module.exports = function equals(p1, p2) { + return p1[0] === p2[0] && p1[1] === p2[1]; +}; + +// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164 +// Precision problem. +// +// module.exports = function equals(p1, p2) { +// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON; +// }; + +},{}],11:[function(require,module,exports){ +var Queue = require('tinyqueue'); +var SweepEvent = require('./sweep_event'); +var compareEvents = require('./compare_events'); + +var max = Math.max; +var min = Math.min; + +var contourId = 0; + + +function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { + var i, len, s1, s2, e1, e2; + var d = depth + 1; + for (i = 0, len = contourOrHole.length - 1; i < len; i++) { + s1 = contourOrHole[i], + s2 = contourOrHole[i + 1]; + //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); + e1 = new SweepEvent(s1, false, undefined, isSubject); + e2 = new SweepEvent(s2, false, e1, isSubject); + e1.otherEvent = e2; + + e1.contourId = e2.contourId = depth; + if (!isExteriorRing) { + e1.isExteriorRing = false; + e2.isExteriorRing = false; + } + if (compareEvents(e1, e2) > 0) { + e2.left = true; } else { - newPos = newPos + 1; + e1.left = true; } + + var x = s1[0], y = s1[1]; + bbox[0] = min(bbox[0], x); + bbox[1] = min(bbox[1], y); + bbox[2] = max(bbox[2], x); + bbox[3] = max(bbox[3], y); + + // Pushing it so the queue is sorted from left to right, + // with object on the left having the highest priority. + Q.push(e1); + Q.push(e2); } +} - newPos = pos - 1; - while (processed[newPos]) { - newPos = newPos - 1; +module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { + var eventQueue = new Queue(null, compareEvents); + var polygonSet, isExteriorRing, i, ii, j, jj, k, kk; + + for (i = 0, ii = subject.length; i < ii; i++) { + polygonSet = subject[i]; + for (j = 0, jj = polygonSet.length; j < jj; j++) { + isExteriorRing = j === 0; + if (isExteriorRing) contourId++; + processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing); + } + } + + for (i = 0, ii = clipping.length; i < ii; i++) { + polygonSet = clipping[i]; + for (j = 0, jj = polygonSet.length; j < jj; j++) { + isExteriorRing = j === 0; + if (isExteriorRing) contourId++; + processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing); + } } - return newPos; + + return eventQueue; } +},{"./compare_events":4,"./sweep_event":18,"tinyqueue":3}],12:[function(require,module,exports){ +'use strict'; +var subdivideSegments = require('./subdivide_segments'); +var connectEdges = require('./connect_edges'); +var equals = require('./equals'); +var fillQueue = require('./fill_queue'); +var operations = require('./operation') + function trivialOperation(subject, clipping, operation) { var result = null; if (subject.length * clipping.length === 0) { - if (operation === INTERSECTION) { + if (operation === operations.INTERSECTION) { result = EMPTY; - } else if (operation === DIFFERENCE) { + } else if (operation === operations.DIFFERENCE) { result = subject; - } else if (operation === UNION || operation === XOR) { + } else if (operation === operations.UNION || + operation === operations.XOR) { result = (subject.length === 0) ? clipping : subject; } } @@ -1529,11 +1298,12 @@ function compareBBoxes(subject, clipping, sbbox, cbbox, operation) { cbbox[0] > sbbox[2] || sbbox[1] > cbbox[3] || cbbox[1] > sbbox[3]) { - if (operation === INTERSECTION) { + if (operation === operations.INTERSECTION) { result = EMPTY; - } else if (operation === DIFFERENCE) { + } else if (operation === operations.DIFFERENCE) { result = subject; - } else if (operation === UNION || operation === XOR) { + } else if (operation === operations.UNION || + operation === operations.XOR) { result = subject.concat(clipping); } } @@ -1555,14 +1325,21 @@ function boolean(subject, clipping, operation) { var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; + //console.time('fill'); var eventQueue = fillQueue(subject, clipping, sbbox, cbbox); + //console.timeEnd('fill'); trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation); if (trivial) { return trivial === EMPTY ? null : trivial; } + //console.time('subdiv'); var sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); - return connectEdges(sortedEvents); + //console.timeEnd('subdiv'); + //console.time('connect'); + var result = connectEdges(sortedEvents, operation); + //console.timeEnd('connect'); + return result; } @@ -1570,44 +1347,152 @@ module.exports = boolean; module.exports.union = function (subject, clipping) { - return boolean(subject, clipping, UNION); + return boolean(subject, clipping, operations.UNION); }; module.exports.diff = function (subject, clipping) { - return boolean(subject, clipping, DIFFERENCE); + return boolean(subject, clipping, operations.DIFFERENCE); }; module.exports.xor = function (subject, clipping) { - return boolean(subject, clipping, XOR); + return boolean(subject, clipping, operations.XOR); }; module.exports.intersection = function (subject, clipping) { - return boolean(subject, clipping, INTERSECTION); + return boolean(subject, clipping, operations.INTERSECTION); }; /** * @enum {Number} */ -module.exports.operations = { - INTERSECTION: INTERSECTION, - DIFFERENCE: DIFFERENCE, - UNION: UNION, - XOR: XOR +module.exports.operations = operations; + +},{"./connect_edges":7,"./equals":10,"./fill_queue":11,"./operation":13,"./subdivide_segments":17}],13:[function(require,module,exports){ +module.exports = { + INTERSECTION: 0, + UNION: 1, + DIFFERENCE: 2, + XOR: 3 }; +},{}],14:[function(require,module,exports){ +var divideSegment = require('./divide_segment'); +var intersection = require('./segment_intersection'); +var equals = require('./equals'); +var compareEvents = require('./compare_events'); +var edgeType = require('./edge_type'); + +/** + * @param {SweepEvent} se1 + * @param {SweepEvent} se2 + * @param {Queue} queue + * @return {Number} + */ +module.exports = function possibleIntersection(se1, se2, queue) { + // that disallows self-intersecting polygons, + // did cost us half a day, so I'll leave it + // out of respect + // if (se1.isSubject === se2.isSubject) return; + var inter = intersection( + se1.point, se1.otherEvent.point, + se2.point, se2.otherEvent.point + ); + + var nintersections = inter ? inter.length : 0; + if (nintersections === 0) return 0; // no intersection + + // the line segments intersect at an endpoint of both line segments + if ((nintersections === 1) && + (equals(se1.point, se2.point) || + equals(se1.otherEvent.point, se2.otherEvent.point))) { + return 0; + } + + if (nintersections === 2 && se1.isSubject === se2.isSubject) { + // if(se1.contourId === se2.contourId){ + // console.warn('Edges of the same polygon overlap', + // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point); + // } + //throw new Error('Edges of the same polygon overlap'); + return 0; + } + + // The line segments associated to se1 and se2 intersect + if (nintersections === 1) { + + // if the intersection point is not an endpoint of se1 + if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) { + divideSegment(se1, inter[0], queue); + } + + // if the intersection point is not an endpoint of se2 + if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) { + divideSegment(se2, inter[0], queue); + } + return 1; + } + + // The line segments associated to se1 and se2 overlap + var events = []; + var leftCoincide = false; + var rightCoincide = false; + + if (equals(se1.point, se2.point)) { + leftCoincide = true; // linked + } else if (compareEvents(se1, se2) === 1) { + events.push(se2, se1); + } else { + events.push(se1, se2); + } + + if (equals(se1.otherEvent.point, se2.otherEvent.point)) { + rightCoincide = true; + } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) { + events.push(se2.otherEvent, se1.otherEvent); + } else { + events.push(se1.otherEvent, se2.otherEvent); + } + + if ((leftCoincide && rightCoincide) || leftCoincide) { + // both line segments are equal or share the left endpoint + se1.type = edgeType.NON_CONTRIBUTING; + se2.type = (se1.inOut === se2.inOut) ? + edgeType.SAME_TRANSITION : + edgeType.DIFFERENT_TRANSITION; + + if (leftCoincide && !rightCoincide) { + // honestly no idea, but changing events selection from [2, 1] + // to [0, 1] fixes the overlapping self-intersecting polygons issue + divideSegment(events[1].otherEvent, events[0].point, queue); + } + return 2; + } -// for testing -module.exports.fillQueue = fillQueue; -module.exports.computeFields = computeFields; -module.exports.subdivideSegments = subdivideSegments; -module.exports.divideSegment = divideSegment; -module.exports.possibleIntersection = possibleIntersection; + // the line segments share the right endpoint + if (rightCoincide) { + divideSegment(events[0], events[1].point, queue); + return 3; + } -},{"./compare_events":4,"./compare_segments":5,"./edge_type":6,"./equals":7,"./segment_intersection":9,"./sweep_event":11,"avl":2,"tinyqueue":3}],9:[function(require,module,exports){ + // no line segment includes totally the other one + if (events[0] !== events[3].otherEvent) { + divideSegment(events[0], events[1].point, queue); + divideSegment(events[1], events[2].point, queue); + return 3; + } + + // one line segment includes the other one + divideSegment(events[0], events[1].point, queue); + divideSegment(events[3].otherEvent, events[2].point, queue); + + return 3; +}; + +},{"./compare_events":4,"./divide_segment":8,"./edge_type":9,"./equals":10,"./segment_intersection":15}],15:[function(require,module,exports){ 'use strict'; var EPSILON = 1e-9; @@ -1752,7 +1637,7 @@ module.exports = function (a1, a2, b1, b2, noEndpointTouch) { return null; }; -},{}],10:[function(require,module,exports){ +},{}],16:[function(require,module,exports){ 'use strict'; /** @@ -1766,7 +1651,127 @@ module.exports = function signedArea(p0, p1, p2) { return (p0[0] - p2[0]) * (p1[1] - p2[1]) - (p1[0] - p2[0]) * (p0[1] - p2[1]); }; -},{}],11:[function(require,module,exports){ +},{}],17:[function(require,module,exports){ +var Tree = require('avl'); +var computeFields = require('./compute_fields'); +var possibleIntersection = require('./possible_intersection'); +var compareSegments = require('./compare_segments'); +var operations = require('./operation'); + + +module.exports = function subdivide (eventQueue, subject, clipping, sbbox, cbbox, operation) { + var sweepLine = new Tree(compareSegments); + var sortedEvents = []; + + var rightbound = Math.min(sbbox[2], cbbox[2]); + + var prev, next, begin, end; + + var INTERSECTION = operations.INTERSECTION; + var DIFFERENCE = operations.DIFFERENCE; + + while (eventQueue.length) { + var event = eventQueue.pop(); + sortedEvents.push(event); + + // optimization by bboxes for intersection and difference goes here + if ((operation === INTERSECTION && event.point[0] > rightbound) || + (operation === DIFFERENCE && event.point[0] > sbbox[2])) { + break; + } + + if (event.left) { + next = prev = sweepLine.insert(event); + //_renderSweepLine(sweepLine, event.point, event); + begin = sweepLine.minNode(); + + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; + + next = sweepLine.next(next); + + var prevEvent = prev ? prev.key : null; + var prevprevEvent; + computeFields(event, prevEvent, operation); + if (next) { + if (possibleIntersection(event, next.key, eventQueue) === 2) { + computeFields(event, prevEvent, operation); + computeFields(event, next.key, operation); + } + } + if (prev) { + if (possibleIntersection(prev.key, event, eventQueue) === 2) { + var prevprev = prev; + if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); + else prevprev = null; + + prevprevEvent = prevprev ? prevprev.key : null; + computeFields(prevEvent, prevprevEvent, operation); + computeFields(event, prevEvent, operation); + } + } + } else { + event = event.otherEvent; + next = prev = sweepLine.find(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); + + if (prev && next) { + + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; + + next = sweepLine.next(next); + sweepLine.remove(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); + + if (next && prev) { + //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + possibleIntersection(prev.key, next.key, eventQueue); + //} + } + } + } + } + return sortedEvents; +}; + + +/* eslint-disable no-unused-vars, no-debugger, no-undef */ +function _renderSweepLine(sweepLine, pos, event) { + var map = window.map; + if (!map) return; + if (window.sws) window.sws.forEach(function (p) { + map.removeLayer(p); + }); + window.sws = []; + sweepLine.forEach(function (e) { + var poly = L.polyline([ + e.point.slice().reverse(), + e.otherEvent.point.slice().reverse() + ], {color: 'green'}).addTo(map); + window.sws.push(poly); + }); + + if (window.vt) map.removeLayer(window.vt); + var v = pos.slice(); + var b = map.getBounds(); + window.vt = L.polyline([ + [b.getNorth(), v[0]], + [b.getSouth(), v[0]] + ], {color: 'green', weight: 1}).addTo(map); + + if (window.ps) map.removeLayer(window.ps); + window.ps = L.polyline([ + event.point.slice().reverse(), + event.otherEvent.point.slice().reverse() + ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); + debugger; +} +/* eslint-enable no-unused-vars, no-debugger, no-undef */ + +},{"./compare_segments":5,"./compute_fields":6,"./operation":13,"./possible_intersection":14,"avl":2}],18:[function(require,module,exports){ 'use strict'; var signedArea = require('./signed_area'); @@ -1856,9 +1861,12 @@ SweepEvent.prototype = { * @return {Boolean} */ isBelow: function (p) { + var p0 = this.point, p1 = this.otherEvent.point; return this.left ? - signedArea(this.point, this.otherEvent.point, p) > 0 : - signedArea(this.otherEvent.point, this.point, p) > 0; + (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0 : + // signedArea(this.point, this.otherEvent.point, p) > 0 : + (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0 + //signedArea(this.otherEvent.point, this.point, p) > 0; }, @@ -1881,5 +1889,5 @@ SweepEvent.prototype = { module.exports = SweepEvent; -},{"./edge_type":6,"./signed_area":10}]},{},[1])(1) +},{"./edge_type":9,"./signed_area":16}]},{},[1])(1) }); \ No newline at end of file diff --git a/src/compare_segments.js b/src/compare_segments.js index ddf06f7..6d7a8e2 100644 --- a/src/compare_segments.js +++ b/src/compare_segments.js @@ -36,7 +36,7 @@ module.exports = function compareSegments(le1, le2) { var p1 = le1.point, p2 = le2.point; if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) { p1 = le1.otherEvent.point; p2 = le2.otherEvent.point; - if (ep1[0] === p2[0] && p1[1] === p2[1]) return 0; + if (p1[0] === p2[0] && p1[1] === p2[1]) return 0; else return le1.contourId > le2.contourId ? 1 : -1; } } else { // Segments are collinear, but belong to separate polygons diff --git a/src/possible_intersection.js b/src/possible_intersection.js index d2a0e5c..0e0dcb8 100644 --- a/src/possible_intersection.js +++ b/src/possible_intersection.js @@ -1,6 +1,8 @@ var divideSegment = require('./divide_segment'); var intersection = require('./segment_intersection'); var equals = require('./equals'); +var compareEvents = require('./compare_events'); +var edgeType = require('./edge_type'); /** * @param {SweepEvent} se1 diff --git a/test/divide_segment.test.js b/test/divide_segment.test.js index 1d3f335..0d81345 100644 --- a/test/divide_segment.test.js +++ b/test/divide_segment.test.js @@ -1,14 +1,18 @@ 'use strict'; -var tap = require('tap'); -var path = require('path'); -var Queue = require('tinyqueue'); -var load = require('load-json-file'); -var martinez = require('../src/'); -var SweepEvent = require('../src/sweep_event'); -var compareEvents = require('../src/compare_events').compare; -var intersection = require('../src/segment_intersection'); -var equals = require('../src/equals'); +var tap = require('tap'); +var path = require('path'); +var Queue = require('tinyqueue'); +var load = require('load-json-file'); +var martinez = require('../src/'); +var SweepEvent = require('../src/sweep_event'); +var compareEvents = require('../src/compare_events').compare; +var intersection = require('../src/segment_intersection'); +var equals = require('../src/equals'); +var fillQueue = require('../src/fill_queue'); +var divideSegment = require('../src/divide_segment'); +var subdivideSegments = require('../src/subdivide_segments'); +var possibleIntersection = require('../src/possible_intersection'); // GeoJSON Data var shapes = load.sync(path.join(__dirname, 'fixtures', 'two_shapes.geojson')); @@ -35,8 +39,8 @@ tap.test('divide segments', function (main) { ); - martinez.divideSegment(se1, iter[0], q); - martinez.divideSegment(se2, iter[0], q); + divideSegment(se1, iter[0], q); + divideSegment(se2, iter[0], q); t.equals(q.length, 6, 'subdivided in 4 segments by intersection point'); @@ -56,7 +60,7 @@ tap.test('divide segments', function (main) { // console.log(se1.point, se1.left, se1.otherEvent.point, se1.otherEvent.left); // console.log(se2.point, se2.left, se2.otherEvent.point, se2.otherEvent.left); - t.equals(martinez.possibleIntersection(se1, se2, q), 1); + t.equals(possibleIntersection(se1, se2, q), 1); t.equals(q.length, 4); var e = q.pop(); @@ -83,7 +87,7 @@ tap.test('divide segments', function (main) { var c = [clipping.geometry.coordinates]; var bbox = [Infinity, Infinity, -Infinity, -Infinity]; - var q = martinez.fillQueue(s, c, bbox, bbox); + var q = fillQueue(s, c, bbox, bbox); var p0 = [16, 282]; var p1 = [298, 359]; var p2 = [156, 203.5]; @@ -107,7 +111,7 @@ tap.test('divide segments', function (main) { t.equals(compareSegments(te, te3), 1); t.equals(compareSegments(te3, te), -1); - var segments = martinez.subdivideSegments(q, s, c, bbox, bbox, 0); + var segments = subdivideSegments(q, s, c, bbox, bbox, 0); var leftSegments = []; for (var i = 0; i < segments.length; i++) { if (segments[i].left) { diff --git a/test/index.test.js b/test/index.test.js index de5df62..b56b280 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,9 +1,10 @@ 'use strict'; -var tap = require('tap'); -var path = require('path'); -var load = require('load-json-file'); -var martinez = require('../src/'); +var tap = require('tap'); +var path = require('path'); +var load = require('load-json-file'); +var martinez = require('../src/'); +var fillQueue = require('../src/fill_queue'); // GeoJSON Data var data = load.sync(path.join(__dirname, 'fixtures', 'two_triangles.geojson')); @@ -17,7 +18,7 @@ tap.test('fill event queue', function(main) { var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; - var q = martinez.fillQueue(s, c, sbbox, cbbox); + var q = fillQueue(s, c, sbbox, cbbox); var currentPoint; main.test('bboxes', function (t) { From 7f0a6bfa59f4f75d8b0128209905a1573cfef2a8 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Thu, 14 Sep 2017 14:00:35 +0200 Subject: [PATCH 09/42] made eslint happy --- src/compare_events.js | 8 ++++---- src/compute_fields.js | 2 ++ src/connect_edges.js | 25 ++++++++++++------------- src/divide_segment.js | 2 ++ src/fill_queue.js | 10 ++++++---- src/index.js | 6 ++++-- src/operation.js | 2 ++ src/possible_intersection.js | 2 ++ src/subdivide_segments.js | 6 ++++-- src/sweep_event.js | 4 ++-- 10 files changed, 40 insertions(+), 27 deletions(-) diff --git a/src/compare_events.js b/src/compare_events.js index 3e66508..778a901 100644 --- a/src/compare_events.js +++ b/src/compare_events.js @@ -8,7 +8,7 @@ var signedArea = require('./signed_area'); * @param {SweepEvent} e2 * @return {Number} */ -module.exports = function compareEvents (e1, e2) { +module.exports = function compareEvents(e1, e2) { var p1 = e1.point; var p2 = e2.point; @@ -31,12 +31,12 @@ function specialCases(e1, e2, p1, p2) { if (e1.left !== e2.left) return e1.left ? 1 : -1; - var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; - var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) + // var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; + // var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) // Same coordinates, both events // are left endpoints or right endpoints. // not collinear - if (sa/*signedArea(p1, e1.otherEvent.point, e2.otherEvent.point)*/ !== 0) { + if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) { // the event associate to the bottom segment is processed first return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; } diff --git a/src/compute_fields.js b/src/compute_fields.js index 649bb14..fa326e9 100644 --- a/src/compute_fields.js +++ b/src/compute_fields.js @@ -1,3 +1,5 @@ +'use strict'; + var edgeType = require('./edge_type'); var INTERSECTION = 0; diff --git a/src/connect_edges.js b/src/connect_edges.js index ae0725c..4684c11 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -1,6 +1,8 @@ -var equals = require('./equals'); -var compareEvents = require('./compare_events'); +'use strict'; +// var equals = require('./equals'); +var compareEvents = require('./compare_events'); +var operationType = require('./operation'); /** * @param {Array.} sortedEvents @@ -37,7 +39,7 @@ function orderEvents(sortedEvents) { } for (i = 0, len = resultEvents.length; i < len; i++) { - var event = resultEvents[i]; + event = resultEvents[i]; if (!event.left) { tmp = event.pos; event.pos = event.otherEvent.pos; @@ -72,15 +74,14 @@ function nextPos(pos, resultEvents, processed) { if (!processed[newPos]) { console.log(pos, newPos, length); return newPos; - } - else newPos++; - p1 = resultEvents[newPos].point + } else newPos++; + p1 = resultEvents[newPos].point; } newPos = pos - 1; while (processed[newPos]) newPos--; - console.log('other', pos, newPos, length); + // console.log('other', pos, newPos, length); return newPos; } @@ -105,12 +106,10 @@ module.exports = function (sortedEvents, operation) { if (!resultEvents[i].isExteriorRing) { if (result.length === 0) { result.push([[contour]]); + } else if (operation === operationType.UNION) { + result.push(contour); } else { - if (operation === 1) { - result.push(contour) - } else { - result[result.length - 1].push(contour); - } + result[result.length - 1].push(contour); } } else { result.push(contour); @@ -124,7 +123,7 @@ module.exports = function (sortedEvents, operation) { contour[0].push(initial); while (pos >= i) { - var event = resultEvents[pos]; + event = resultEvents[pos]; processed[pos] = true; if (event.left) { diff --git a/src/divide_segment.js b/src/divide_segment.js index d48e05d..485b35b 100644 --- a/src/divide_segment.js +++ b/src/divide_segment.js @@ -1,3 +1,5 @@ +'use strict'; + var SweepEvent = require('./sweep_event'); var equals = require('./equals'); var compareEvents = require('./compare_events'); diff --git a/src/fill_queue.js b/src/fill_queue.js index 9718227..1e67046 100644 --- a/src/fill_queue.js +++ b/src/fill_queue.js @@ -1,3 +1,5 @@ +'use strict'; + var Queue = require('tinyqueue'); var SweepEvent = require('./sweep_event'); var compareEvents = require('./compare_events'); @@ -10,9 +12,9 @@ var contourId = 0; function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { var i, len, s1, s2, e1, e2; - var d = depth + 1; + // var d = depth + 1; for (i = 0, len = contourOrHole.length - 1; i < len; i++) { - s1 = contourOrHole[i], + s1 = contourOrHole[i]; s2 = contourOrHole[i + 1]; //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); e1 = new SweepEvent(s1, false, undefined, isSubject); @@ -46,7 +48,7 @@ function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { var eventQueue = new Queue(null, compareEvents); - var polygonSet, isExteriorRing, i, ii, j, jj, k, kk; + var polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk; for (i = 0, ii = subject.length; i < ii; i++) { polygonSet = subject[i]; @@ -67,4 +69,4 @@ module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { } return eventQueue; -} +}; diff --git a/src/index.js b/src/index.js index 7325bcd..a495991 100644 --- a/src/index.js +++ b/src/index.js @@ -1,9 +1,11 @@ 'use strict'; + var subdivideSegments = require('./subdivide_segments'); var connectEdges = require('./connect_edges'); -var equals = require('./equals'); var fillQueue = require('./fill_queue'); -var operations = require('./operation') +var operations = require('./operation'); + +var EMPTY = []; function trivialOperation(subject, clipping, operation) { diff --git a/src/operation.js b/src/operation.js index 675f038..3aa7272 100644 --- a/src/operation.js +++ b/src/operation.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = { INTERSECTION: 0, UNION: 1, diff --git a/src/possible_intersection.js b/src/possible_intersection.js index 0e0dcb8..b857731 100644 --- a/src/possible_intersection.js +++ b/src/possible_intersection.js @@ -1,3 +1,5 @@ +'use strict'; + var divideSegment = require('./divide_segment'); var intersection = require('./segment_intersection'); var equals = require('./equals'); diff --git a/src/subdivide_segments.js b/src/subdivide_segments.js index 9b4c2c0..b01cc5d 100644 --- a/src/subdivide_segments.js +++ b/src/subdivide_segments.js @@ -1,3 +1,5 @@ +'use strict'; + var Tree = require('avl'); var computeFields = require('./compute_fields'); var possibleIntersection = require('./possible_intersection'); @@ -5,13 +7,13 @@ var compareSegments = require('./compare_segments'); var operations = require('./operation'); -module.exports = function subdivide (eventQueue, subject, clipping, sbbox, cbbox, operation) { +module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) { var sweepLine = new Tree(compareSegments); var sortedEvents = []; var rightbound = Math.min(sbbox[2], cbbox[2]); - var prev, next, begin, end; + var prev, next, begin; var INTERSECTION = operations.INTERSECTION; var DIFFERENCE = operations.DIFFERENCE; diff --git a/src/sweep_event.js b/src/sweep_event.js index e9bfbb1..50881f2 100644 --- a/src/sweep_event.js +++ b/src/sweep_event.js @@ -1,6 +1,6 @@ 'use strict'; -var signedArea = require('./signed_area'); +//var signedArea = require('./signed_area'); var EdgeType = require('./edge_type'); /** @@ -91,7 +91,7 @@ SweepEvent.prototype = { return this.left ? (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0 : // signedArea(this.point, this.otherEvent.point, p) > 0 : - (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0 + (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0; //signedArea(this.otherEvent.point, this.point, p) > 0; }, From 25054c14edbba793dfc5b16c099b4fd29484e78e Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Mon, 25 Sep 2017 20:59:21 +1000 Subject: [PATCH 10/42] Performance Fix --- demo/js/index.js | 34 +++++++++++++++++----------------- src/connect_edges.js | 10 ++++++---- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/demo/js/index.js b/demo/js/index.js index 697eb73..b780a1f 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -142,23 +142,23 @@ function run (op) { } }); - // setTimeout(function() { - // console.time('jsts'); - // var s = reader.read(subject); - // var c = reader.read(clipping); - // var res; - // if (op === OPERATIONS.INTERSECTION) { - // res = s.geometry.intersection(c.geometry); - // } else if (op === OPERATIONS.UNION) { - // res = s.geometry.union(c.geometry); - // } else if (op === OPERATIONS.DIFFERENCE) { - // res = s.geometry.difference(c.geometry); - // } else { - // res = s.geometry.symDifference(c.geometry); - // } - // res = writer.write(res); - // console.timeEnd('jsts'); - // }, 500); + setTimeout(function() { + console.time('jsts'); + var s = reader.read(subject); + var c = reader.read(clipping); + var res; + if (op === OPERATIONS.INTERSECTION) { + res = s.geometry.intersection(c.geometry); + } else if (op === OPERATIONS.UNION) { + res = s.geometry.union(c.geometry); + } else if (op === OPERATIONS.DIFFERENCE) { + res = s.geometry.difference(c.geometry); + } else { + res = s.geometry.symDifference(c.geometry); + } + res = writer.write(res); + console.timeEnd('jsts'); + }, 500); } //drawnItems.addData(oneInside); diff --git a/src/connect_edges.js b/src/connect_edges.js index 4684c11..0888d8a 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -57,7 +57,7 @@ function orderEvents(sortedEvents) { * @param {Object>} processed * @return {Number} */ -function nextPos(pos, resultEvents, processed) { +function nextPos(pos, resultEvents, processed, origIndex) { var newPos = pos + 1; var length = resultEvents.length; var p = resultEvents[pos].point; @@ -72,7 +72,7 @@ function nextPos(pos, resultEvents, processed) { // while in range and not the current one by value while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { if (!processed[newPos]) { - console.log(pos, newPos, length); + // console.log(pos, newPos, length); return newPos; } else newPos++; p1 = resultEvents[newPos].point; @@ -80,7 +80,9 @@ function nextPos(pos, resultEvents, processed) { newPos = pos - 1; - while (processed[newPos]) newPos--; + while (processed[newPos] && newPos >= origIndex) { + newPos--; + } // console.log('other', pos, newPos, length); return newPos; } @@ -139,7 +141,7 @@ module.exports = function (sortedEvents, operation) { // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); contour[0].push(resultEvents[pos].point); - pos = nextPos(pos, resultEvents, processed); + pos = nextPos(pos, resultEvents, processed, i); } pos = pos === -1 ? i : pos; From a791d093c74d3b3efff73314fb75d8641f366c89 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Mon, 25 Sep 2017 21:58:15 +1000 Subject: [PATCH 11/42] Performance tweak based on https://jsperf.com/andcomparitor/1 --- src/equals.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/equals.js b/src/equals.js index 3064b60..ec7d4a0 100644 --- a/src/equals.js +++ b/src/equals.js @@ -4,7 +4,14 @@ // var abs = Math.abs; module.exports = function equals(p1, p2) { - return p1[0] === p2[0] && p1[1] === p2[1]; + if (p1[0] === p2[0]) { + if (p1[1] === p2[1]) { + return true; + } else { + return false; + } + } + return false; }; // TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164 From 6dbfa3918c1b1779ee0ff0ef78064dded02509f7 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Mon, 23 Oct 2017 23:32:47 +1100 Subject: [PATCH 12/42] Add new style of test --- test/featureTypes.js | 42 ++++++++++ test/featureTypes/clippingPoly.geojson | 31 ++++++++ test/featureTypes/multiPoly.geojson | 62 +++++++++++++++ test/featureTypes/multiPolyWithHole.geojson | 79 +++++++++++++++++++ .../out/difference/polyToClipping.geojson | 14 ++++ .../difference/polyWithHoleToClipping.geojson | 51 ++++++++++++ .../out/intersection/polyToClipping.geojson | 37 +++++++++ .../polyWithHoleToClipping.geojson | 36 +++++++++ .../out/union/polyToClipping.geojson | 41 ++++++++++ .../out/union/polyWithHoleToClipping.geojson | 49 ++++++++++++ .../out/xor/polyToClipping.geojson | 47 +++++++++++ .../out/xor/polyWithHoleToClipping.geojson | 56 +++++++++++++ test/featureTypes/poly.geojson | 31 ++++++++ test/featureTypes/polyWithHole.geojson | 53 +++++++++++++ 14 files changed, 629 insertions(+) create mode 100644 test/featureTypes.js create mode 100644 test/featureTypes/clippingPoly.geojson create mode 100644 test/featureTypes/multiPoly.geojson create mode 100644 test/featureTypes/multiPolyWithHole.geojson create mode 100644 test/featureTypes/out/difference/polyToClipping.geojson create mode 100644 test/featureTypes/out/difference/polyWithHoleToClipping.geojson create mode 100644 test/featureTypes/out/intersection/polyToClipping.geojson create mode 100644 test/featureTypes/out/intersection/polyWithHoleToClipping.geojson create mode 100644 test/featureTypes/out/union/polyToClipping.geojson create mode 100644 test/featureTypes/out/union/polyWithHoleToClipping.geojson create mode 100644 test/featureTypes/out/xor/polyToClipping.geojson create mode 100644 test/featureTypes/out/xor/polyWithHoleToClipping.geojson create mode 100644 test/featureTypes/poly.geojson create mode 100644 test/featureTypes/polyWithHole.geojson diff --git a/test/featureTypes.js b/test/featureTypes.js new file mode 100644 index 0000000..73d32df --- /dev/null +++ b/test/featureTypes.js @@ -0,0 +1,42 @@ +'use strict'; + +var tap = require('tap'); +var path = require('path'); +var load = require('load-json-file'); +var martinez = require('../src/'); + +var clipping = load.sync(path.join(__dirname, 'featureTypes', 'clippingPoly.geojson')); +var outDir = path.join(__dirname, 'featureTypes', 'out'); + +var testScenarios = [ + { + testName: 'polyToClipping', + subjectPoly: 'poly', + }, + { + testName: 'polyWithHoleToClipping', + subjectPoly: 'polyWithHole', + } +]; + +testScenarios.forEach(function (ts) { + var subject = load.sync(path.join(__dirname, 'featureTypes', ts.subjectPoly + '.geojson')); + + tap.test(ts.testName, function (t) { + var intResult = martinez.intersection(subject.geometry.coordinates, clipping.geometry.coordinates); + t.same(intResult[0], load.sync(path.join(outDir, 'intersection', t._name + '.geojson')).geometry.coordinates); + + var xorResult = martinez.xor(subject.geometry.coordinates, clipping.geometry.coordinates); + t.same(xorResult, load.sync(path.join(outDir, 'xor', t._name + '.geojson')).geometry.coordinates); + + var diffResult = martinez.diff(subject.geometry.coordinates, clipping.geometry.coordinates); + t.same(diffResult[0], load.sync(path.join(outDir, 'difference', t._name + '.geojson')).geometry.coordinates); + + var unionResult = martinez.union(subject.geometry.coordinates, clipping.geometry.coordinates); + t.same(unionResult[0], load.sync(path.join(outDir, 'union', t._name + '.geojson')).geometry.coordinates); + + t.end(); + }); + +}); + diff --git a/test/featureTypes/clippingPoly.geojson b/test/featureTypes/clippingPoly.geojson new file mode 100644 index 0000000..457c0aa --- /dev/null +++ b/test/featureTypes/clippingPoly.geojson @@ -0,0 +1,31 @@ +{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0.25, + 0.25 + ], + [ + 2.75, + 0.25 + ], + [ + 2.75, + 2.75 + ], + [ + 0.25, + 2.75 + ], + [ + 0.25, + 0.25 + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/multiPoly.geojson b/test/featureTypes/multiPoly.geojson new file mode 100644 index 0000000..971e39d --- /dev/null +++ b/test/featureTypes/multiPoly.geojson @@ -0,0 +1,62 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ] + ], + [ + [ + [ + 2, + 2 + ], + [ + 3, + 2 + ], + [ + 3, + 3 + ], + [ + 2, + 3 + ], + [ + 2, + 2 + ] + ] + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/test/featureTypes/multiPolyWithHole.geojson b/test/featureTypes/multiPolyWithHole.geojson new file mode 100644 index 0000000..8a5aacf --- /dev/null +++ b/test/featureTypes/multiPolyWithHole.geojson @@ -0,0 +1,79 @@ +{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ], + [ + [ + 0.2, + 0.2 + ], + [ + 0.2, + 0.4 + ], + [ + 0.4, + 0.4 + ], + [ + 0.4, + 0.2 + ], + [ + 0.2, + 0.2 + ] + ] + ], + [ + [ + [ + 2, + 2 + ], + [ + 3, + 2 + ], + [ + 3, + 3 + ], + [ + 2, + 3 + ], + [ + 2, + 2 + ] + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/difference/polyToClipping.geojson b/test/featureTypes/out/difference/polyToClipping.geojson new file mode 100644 index 0000000..4ff1fe0 --- /dev/null +++ b/test/featureTypes/out/difference/polyToClipping.geojson @@ -0,0 +1,14 @@ + { + "type": "Feature", + "properties": { + "stroke": "#a50505", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#1e8c7b", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [[[0,0],[1,0],[1,0.25],[0.25,0.25],[0.25,1],[0,1],[0,0]]] + } + } \ No newline at end of file diff --git a/test/featureTypes/out/difference/polyWithHoleToClipping.geojson b/test/featureTypes/out/difference/polyWithHoleToClipping.geojson new file mode 100644 index 0000000..3da8c3e --- /dev/null +++ b/test/featureTypes/out/difference/polyWithHoleToClipping.geojson @@ -0,0 +1,51 @@ + { + "type": "Feature", + "properties": { + "stroke": "#a50505", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#1e8c7b", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 0.4,0.25 + ], + [0.4,0.2], + [0.2,0.2], + [0.2,0.4], + [ + 0.25, + 0.4 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ] + ] + } + } \ No newline at end of file diff --git a/test/featureTypes/out/intersection/polyToClipping.geojson b/test/featureTypes/out/intersection/polyToClipping.geojson new file mode 100644 index 0000000..23f6ea4 --- /dev/null +++ b/test/featureTypes/out/intersection/polyToClipping.geojson @@ -0,0 +1,37 @@ +{ + "type": "Feature", + "properties": { + "stroke": "#978713", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0.25, + 0.25 + ], + [ + 1, + 0.25 + ], + [ + 1, + 1 + ], + [ + 0.25, + 1 + ], + [ + 0.25, + 0.25 + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/intersection/polyWithHoleToClipping.geojson b/test/featureTypes/out/intersection/polyWithHoleToClipping.geojson new file mode 100644 index 0000000..4525e85 --- /dev/null +++ b/test/featureTypes/out/intersection/polyWithHoleToClipping.geojson @@ -0,0 +1,36 @@ + { + "type": "Feature", + "properties": { + "stroke": "#978713", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0.25,0.4], + [ + 0.4, + 0.4 + ], + [0.4, 0.25], + [ + 1, + 0.25 + ], + [ + 1, + 1 + ], + [ + 0.25, + 1 + ], + [0.25,0.4] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/union/polyToClipping.geojson b/test/featureTypes/out/union/polyToClipping.geojson new file mode 100644 index 0000000..0aa4aa3 --- /dev/null +++ b/test/featureTypes/out/union/polyToClipping.geojson @@ -0,0 +1,41 @@ + { + "type": "Feature", + "properties": { + "stroke": "#5b1199", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#97109a", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 2.75, + 0.25 + ], + [2.75,2.75], + [0.25, 2.75], + [0.25, 1], + [0,1], + [ + 0, + 0 + ] + ] + ] + } + } \ No newline at end of file diff --git a/test/featureTypes/out/union/polyWithHoleToClipping.geojson b/test/featureTypes/out/union/polyWithHoleToClipping.geojson new file mode 100644 index 0000000..45e04c5 --- /dev/null +++ b/test/featureTypes/out/union/polyWithHoleToClipping.geojson @@ -0,0 +1,49 @@ + { + "type": "Feature", + "properties": { + "stroke": "#5b1199", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#97109a", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 2.75, + 0.25 + ], + [2.75,2.75], + [0.25, 2.75], + [0.25, 1], + [0,1], + [ + 0, + 0 + ] + ], + [[0.2,0.2], + [0.4,0.2], + [0.4,0.25], + [0.25,0.25], + [0.25,0.4], + [0.2,0.4], + [0.2,0.2] + ] + ] + } + } \ No newline at end of file diff --git a/test/featureTypes/out/xor/polyToClipping.geojson b/test/featureTypes/out/xor/polyToClipping.geojson new file mode 100644 index 0000000..8f4bd79 --- /dev/null +++ b/test/featureTypes/out/xor/polyToClipping.geojson @@ -0,0 +1,47 @@ + { + "type": "Feature", + "properties": { + "stroke": "#978713", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [[ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 0.25, + 0.25 + ], + [ + 0.25, + 1 + ], + [0,1], + [0,0] + ] + ], + [[ + [0.25, 1], + [1,1], + [1, 0.25], + [2.75, 0.25], + [2.75,2.75], + [0.25, 2.75], + [0.25, 1] ]]] + } + } \ No newline at end of file diff --git a/test/featureTypes/out/xor/polyWithHoleToClipping.geojson b/test/featureTypes/out/xor/polyWithHoleToClipping.geojson new file mode 100644 index 0000000..b55a00e --- /dev/null +++ b/test/featureTypes/out/xor/polyWithHoleToClipping.geojson @@ -0,0 +1,56 @@ +{ + "type": "Feature", + "properties": { + "stroke": "#978713", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [[ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 0.4, + 0.25 + ], + [0.4,0.4], + [0.25,0.4], + [ + 0.25, + 1 + ], + [0,1], + [0,0] + ], + [[0.2,0.2], + [0.4,0.2], + [0.4,0.25], + [0.25,0.25], + [0.25, 0.4], + [0.2,0.4], + [0.2,0.2]] + ], + [[ + [0.25, 1], + [1,1], + [1, 0.25], + [2.75, 0.25], + [2.75,2.75], + [0.25, 2.75], + [0.25, 1] ]]] + } + } \ No newline at end of file diff --git a/test/featureTypes/poly.geojson b/test/featureTypes/poly.geojson new file mode 100644 index 0000000..25c4503 --- /dev/null +++ b/test/featureTypes/poly.geojson @@ -0,0 +1,31 @@ +{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 0, + 1 + ], + [ + 1, + 1 + ], + [ + 1, + 0 + ], + [ + 0, + 0 + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/polyWithHole.geojson b/test/featureTypes/polyWithHole.geojson new file mode 100644 index 0000000..5682393 --- /dev/null +++ b/test/featureTypes/polyWithHole.geojson @@ -0,0 +1,53 @@ +{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ], + [ + [ + 0.2, + 0.2 + ], + [ + 0.2, + 0.4 + ], + [ + 0.4, + 0.4 + ], + [ + 0.4, + 0.2 + ], + [ + 0.2, + 0.2 + ] + ] + ] + } +} \ No newline at end of file From b984309813adc7f253fe798d4faaa5489125ad15 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Mon, 23 Oct 2017 23:44:14 +1100 Subject: [PATCH 13/42] Fix multipoly input --- test/featureTypes/multiPoly.geojson | 101 +++++++++++++--------------- 1 file changed, 48 insertions(+), 53 deletions(-) diff --git a/test/featureTypes/multiPoly.geojson b/test/featureTypes/multiPoly.geojson index 971e39d..78ab2a9 100644 --- a/test/featureTypes/multiPoly.geojson +++ b/test/featureTypes/multiPoly.geojson @@ -1,62 +1,57 @@ { - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "properties": {}, - "geometry": { - "type": "MultiPolygon", - "coordinates": [ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ [ - [ - [ - 0, - 0 - ], - [ - 1, - 0 - ], - [ - 1, - 1 - ], - [ - 0, - 1 - ], - [ - 0, - 0 - ] - ] + 0, + 0 ], [ + 1, + 0 + ], + [ + 1, + 1 + ], + [ + 0, + 1 + ], [ - [ - 2, - 2 - ], - [ - 3, - 2 - ], - [ - 3, - 3 - ], - [ - 2, - 3 - ], - [ - 2, - 2 - ] + 0, + 0 ] ] + ], + [ + [ + [ + 2, + 2 + ], + [ + 3, + 2 + ], + [ + 3, + 3 + ], + [ + 2, + 3 + ], + [ + 2, + 2 ] - } - } - ] + ] + ] + ] + } } \ No newline at end of file From 608b6aa2ef9346b79a0d428bbc2eba4f9a8c9a96 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Tue, 24 Oct 2017 00:22:47 +1100 Subject: [PATCH 14/42] Add multipoly checks --- test/featureTypes.js | 13 +- .../difference/multiPolyToClipping.geojson | 79 ++++++++ .../out/difference/polyToClipping.geojson | 59 ++++-- .../difference/polyWithHoleToClipping.geojson | 110 ++++++------ .../intersection/multiPolyToClipping.geojson | 63 +++++++ .../polyWithHoleToClipping.geojson | 17 +- .../out/union/multiPolyToClipping.geojson | 69 +++++++ .../out/union/polyToClipping.geojson | 92 +++++----- .../out/union/polyWithHoleToClipping.geojson | 130 +++++++++----- .../out/xor/multiPolyToClipping.geojson | 119 ++++++++++++ .../out/xor/polyToClipping.geojson | 124 ++++++++----- .../out/xor/polyWithHoleToClipping.geojson | 169 ++++++++++++------ 12 files changed, 783 insertions(+), 261 deletions(-) create mode 100644 test/featureTypes/out/difference/multiPolyToClipping.geojson create mode 100644 test/featureTypes/out/intersection/multiPolyToClipping.geojson create mode 100644 test/featureTypes/out/union/multiPolyToClipping.geojson create mode 100644 test/featureTypes/out/xor/multiPolyToClipping.geojson diff --git a/test/featureTypes.js b/test/featureTypes.js index 73d32df..463354d 100644 --- a/test/featureTypes.js +++ b/test/featureTypes.js @@ -16,24 +16,27 @@ var testScenarios = [ { testName: 'polyWithHoleToClipping', subjectPoly: 'polyWithHole', + }, + { + testName: 'multiPolyToClipping', + subjectPoly: 'multiPoly', } ]; testScenarios.forEach(function (ts) { var subject = load.sync(path.join(__dirname, 'featureTypes', ts.subjectPoly + '.geojson')); - tap.test(ts.testName, function (t) { var intResult = martinez.intersection(subject.geometry.coordinates, clipping.geometry.coordinates); - t.same(intResult[0], load.sync(path.join(outDir, 'intersection', t._name + '.geojson')).geometry.coordinates); + t.same(intResult, load.sync(path.join(outDir, 'intersection', t._name + '.geojson')).geometry.coordinates, ts.testName + ' - Intersect'); var xorResult = martinez.xor(subject.geometry.coordinates, clipping.geometry.coordinates); - t.same(xorResult, load.sync(path.join(outDir, 'xor', t._name + '.geojson')).geometry.coordinates); + t.same(xorResult, load.sync(path.join(outDir, 'xor', t._name + '.geojson')).geometry.coordinates, ts.testName + ' - XOR'); var diffResult = martinez.diff(subject.geometry.coordinates, clipping.geometry.coordinates); - t.same(diffResult[0], load.sync(path.join(outDir, 'difference', t._name + '.geojson')).geometry.coordinates); + t.same(diffResult, load.sync(path.join(outDir, 'difference', t._name + '.geojson')).geometry.coordinates, ts.testName + ' - Difference'); var unionResult = martinez.union(subject.geometry.coordinates, clipping.geometry.coordinates); - t.same(unionResult[0], load.sync(path.join(outDir, 'union', t._name + '.geojson')).geometry.coordinates); + t.same(unionResult, load.sync(path.join(outDir, 'union', t._name + '.geojson')).geometry.coordinates, ts.testName + ' - Union'); t.end(); }); diff --git a/test/featureTypes/out/difference/multiPolyToClipping.geojson b/test/featureTypes/out/difference/multiPolyToClipping.geojson new file mode 100644 index 0000000..52e9a59 --- /dev/null +++ b/test/featureTypes/out/difference/multiPolyToClipping.geojson @@ -0,0 +1,79 @@ +{ + "type": "Feature", + "properties": { + "stroke": "#25856a", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#521199", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 0.25, + 0.25 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ] + ], + [ + [ + [ + 2, + 2.75 + ], + [ + 2.75, + 2.75 + ], + [ + 2.75, + 2 + ], + [ + 3, + 2 + ], + [ + 3, + 3 + ], + [ + 2, + 3 + ], + [ + 2, + 2.75 + ] + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/difference/polyToClipping.geojson b/test/featureTypes/out/difference/polyToClipping.geojson index 4ff1fe0..c3c9b3f 100644 --- a/test/featureTypes/out/difference/polyToClipping.geojson +++ b/test/featureTypes/out/difference/polyToClipping.geojson @@ -1,14 +1,45 @@ - { - "type": "Feature", - "properties": { - "stroke": "#a50505", - "stroke-width": 2, - "stroke-opacity": 1, - "fill": "#1e8c7b", - "fill-opacity": 0.5 - }, - "geometry": { - "type": "Polygon", - "coordinates": [[[0,0],[1,0],[1,0.25],[0.25,0.25],[0.25,1],[0,1],[0,0]]] - } - } \ No newline at end of file +{ + "type": "Feature", + "properties": { + "stroke": "#a50505", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#1e8c7b", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 0.25, + 0.25 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/difference/polyWithHoleToClipping.geojson b/test/featureTypes/out/difference/polyWithHoleToClipping.geojson index 3da8c3e..6539a26 100644 --- a/test/featureTypes/out/difference/polyWithHoleToClipping.geojson +++ b/test/featureTypes/out/difference/polyWithHoleToClipping.geojson @@ -1,51 +1,61 @@ - { - "type": "Feature", - "properties": { - "stroke": "#a50505", - "stroke-width": 2, - "stroke-opacity": 1, - "fill": "#1e8c7b", - "fill-opacity": 0.5 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 0, - 0 - ], - [ - 1, - 0 - ], - [ - 1, - 0.25 - ], - [ - 0.4,0.25 - ], - [0.4,0.2], - [0.2,0.2], - [0.2,0.4], - [ - 0.25, - 0.4 - ], - [ - 0.25, - 1 - ], - [ - 0, - 1 - ], - [ - 0, - 0 - ] - ] +{ + "type": "Feature", + "properties": { + "stroke": "#a50505", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#1e8c7b", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 0.4, + 0.25 + ], + [ + 0.4, + 0.2 + ], + [ + 0.2, + 0.2 + ], + [ + 0.2, + 0.4 + ], + [ + 0.25, + 0.4 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 ] - } - } \ No newline at end of file + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/intersection/multiPolyToClipping.geojson b/test/featureTypes/out/intersection/multiPolyToClipping.geojson new file mode 100644 index 0000000..19841f8 --- /dev/null +++ b/test/featureTypes/out/intersection/multiPolyToClipping.geojson @@ -0,0 +1,63 @@ +{ + "type": "Feature", + "properties": { + "stroke": "#25856a", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#521199", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0.25, + 0.25 + ], + [ + 1, + 0.25 + ], + [ + 1, + 1 + ], + [ + 0.25, + 1 + ], + [ + 0.25, + 0.25 + ] + ] + ], + [ + [ + [ + 2, + 2 + ], + [ + 2.75, + 2 + ], + [ + 2.75, + 2.75 + ], + [ + 2, + 2.75 + ], + [ + 2, + 2 + ] + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/intersection/polyWithHoleToClipping.geojson b/test/featureTypes/out/intersection/polyWithHoleToClipping.geojson index 4525e85..f76e7f7 100644 --- a/test/featureTypes/out/intersection/polyWithHoleToClipping.geojson +++ b/test/featureTypes/out/intersection/polyWithHoleToClipping.geojson @@ -1,4 +1,4 @@ - { +{ "type": "Feature", "properties": { "stroke": "#978713", @@ -11,12 +11,18 @@ "type": "Polygon", "coordinates": [ [ - [0.25,0.4], + [ + 0.25, + 0.4 + ], [ 0.4, 0.4 ], - [0.4, 0.25], + [ + 0.4, + 0.25 + ], [ 1, 0.25 @@ -29,7 +35,10 @@ 0.25, 1 ], - [0.25,0.4] + [ + 0.25, + 0.4 + ] ] ] } diff --git a/test/featureTypes/out/union/multiPolyToClipping.geojson b/test/featureTypes/out/union/multiPolyToClipping.geojson new file mode 100644 index 0000000..da2c348 --- /dev/null +++ b/test/featureTypes/out/union/multiPolyToClipping.geojson @@ -0,0 +1,69 @@ +{ + "type": "Feature", + "properties": { + "stroke": "#25856a", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#521199", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 2.75, + 0.25 + ], + [ + 2.75, + 2 + ], + [ + 3, + 2 + ], + [ + 3, + 3 + ], + [ + 2, + 3 + ], + [ + 2, + 2.75 + ], + [ + 0.25, + 2.75 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/union/polyToClipping.geojson b/test/featureTypes/out/union/polyToClipping.geojson index 0aa4aa3..2822ad1 100644 --- a/test/featureTypes/out/union/polyToClipping.geojson +++ b/test/featureTypes/out/union/polyToClipping.geojson @@ -1,41 +1,53 @@ - { - "type": "Feature", - "properties": { - "stroke": "#5b1199", - "stroke-width": 2, - "stroke-opacity": 1, - "fill": "#97109a", - "fill-opacity": 0.5 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 0, - 0 - ], - [ - 1, - 0 - ], - [ - 1, - 0.25 - ], - [ - 2.75, - 0.25 - ], - [2.75,2.75], - [0.25, 2.75], - [0.25, 1], - [0,1], - [ - 0, - 0 - ] - ] +{ + "type": "Feature", + "properties": { + "stroke": "#5b1199", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#97109a", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 2.75, + 0.25 + ], + [ + 2.75, + 2.75 + ], + [ + 0.25, + 2.75 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 ] - } - } \ No newline at end of file + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/union/polyWithHoleToClipping.geojson b/test/featureTypes/out/union/polyWithHoleToClipping.geojson index 45e04c5..071242e 100644 --- a/test/featureTypes/out/union/polyWithHoleToClipping.geojson +++ b/test/featureTypes/out/union/polyWithHoleToClipping.geojson @@ -1,49 +1,83 @@ - { - "type": "Feature", - "properties": { - "stroke": "#5b1199", - "stroke-width": 2, - "stroke-opacity": 1, - "fill": "#97109a", - "fill-opacity": 0.5 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 0, - 0 - ], - [ - 1, - 0 - ], - [ - 1, - 0.25 - ], - [ - 2.75, - 0.25 - ], - [2.75,2.75], - [0.25, 2.75], - [0.25, 1], - [0,1], - [ - 0, - 0 - ] - ], - [[0.2,0.2], - [0.4,0.2], - [0.4,0.25], - [0.25,0.25], - [0.25,0.4], - [0.2,0.4], - [0.2,0.2] - ] +{ + "type": "Feature", + "properties": { + "stroke": "#5b1199", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#97109a", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 2.75, + 0.25 + ], + [ + 2.75, + 2.75 + ], + [ + 0.25, + 2.75 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 ] - } - } \ No newline at end of file + ], + [ + [ + 0.2, + 0.2 + ], + [ + 0.4, + 0.2 + ], + [ + 0.4, + 0.25 + ], + [ + 0.25, + 0.25 + ], + [ + 0.25, + 0.4 + ], + [ + 0.2, + 0.4 + ], + [ + 0.2, + 0.2 + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/xor/multiPolyToClipping.geojson b/test/featureTypes/out/xor/multiPolyToClipping.geojson new file mode 100644 index 0000000..d1abcd3 --- /dev/null +++ b/test/featureTypes/out/xor/multiPolyToClipping.geojson @@ -0,0 +1,119 @@ +{ + "type": "Feature", + "properties": { + "stroke": "#25856a", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#521199", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 0.25, + 0.25 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ] + ], + [ + [ + [ + 0.25, + 1 + ], + [ + 1, + 1 + ], + [ + 1, + 0.25 + ], + [ + 2.75, + 0.25 + ], + [ + 2.75, + 2 + ], + [ + 2, + 2 + ], + [ + 2, + 2.75 + ], + [ + 0.25, + 2.75 + ], + [ + 0.25, + 1 + ] + ] + ], + [ + [ + [ + 2, + 2.75 + ], + [ + 2.75, + 2.75 + ], + [ + 2.75, + 2 + ], + [ + 3, + 2 + ], + [ + 3, + 3 + ], + [ + 2, + 3 + ], + [ + 2, + 2.75 + ] + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/xor/polyToClipping.geojson b/test/featureTypes/out/xor/polyToClipping.geojson index 8f4bd79..b27a90f 100644 --- a/test/featureTypes/out/xor/polyToClipping.geojson +++ b/test/featureTypes/out/xor/polyToClipping.geojson @@ -1,47 +1,79 @@ - { - "type": "Feature", - "properties": { - "stroke": "#978713", - "stroke-width": 2, - "stroke-opacity": 1, - "fill": "#ffffff", - "fill-opacity": 0.5 - }, - "geometry": { - "type": "MultiPolygon", - "coordinates": [[ - [ - [ - 0, - 0 - ], - [ - 1, - 0 - ], - [ - 1, - 0.25 - ], - [ - 0.25, - 0.25 - ], - [ - 0.25, - 1 - ], - [0,1], - [0,0] +{ + "type": "Feature", + "properties": { + "stroke": "#978713", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 0.25, + 0.25 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ] + ], + [ + [ + [ + 0.25, + 1 + ], + [ + 1, + 1 + ], + [ + 1, + 0.25 + ], + [ + 2.75, + 0.25 + ], + [ + 2.75, + 2.75 + ], + [ + 0.25, + 2.75 + ], + [ + 0.25, + 1 ] - ], - [[ - [0.25, 1], - [1,1], - [1, 0.25], - [2.75, 0.25], - [2.75,2.75], - [0.25, 2.75], - [0.25, 1] ]]] - } - } \ No newline at end of file + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/xor/polyWithHoleToClipping.geojson b/test/featureTypes/out/xor/polyWithHoleToClipping.geojson index b55a00e..226a31a 100644 --- a/test/featureTypes/out/xor/polyWithHoleToClipping.geojson +++ b/test/featureTypes/out/xor/polyWithHoleToClipping.geojson @@ -1,56 +1,117 @@ { - "type": "Feature", - "properties": { - "stroke": "#978713", - "stroke-width": 2, - "stroke-opacity": 1, - "fill": "#ffffff", - "fill-opacity": 0.5 - }, - "geometry": { - "type": "MultiPolygon", - "coordinates": [[ - [ - [ - 0, - 0 - ], - [ - 1, - 0 - ], - [ - 1, - 0.25 - ], - [ - 0.4, - 0.25 - ], - [0.4,0.4], - [0.25,0.4], - [ - 0.25, - 1 - ], - [0,1], - [0,0] - ], - [[0.2,0.2], - [0.4,0.2], - [0.4,0.25], - [0.25,0.25], - [0.25, 0.4], - [0.2,0.4], - [0.2,0.2]] + "type": "Feature", + "properties": { + "stroke": "#978713", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 0.4, + 0.25 + ], + [ + 0.4, + 0.4 + ], + [ + 0.25, + 0.4 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] ], - [[ - [0.25, 1], - [1,1], - [1, 0.25], - [2.75, 0.25], - [2.75,2.75], - [0.25, 2.75], - [0.25, 1] ]]] - } - } \ No newline at end of file + [ + [ + 0.2, + 0.2 + ], + [ + 0.4, + 0.2 + ], + [ + 0.4, + 0.25 + ], + [ + 0.25, + 0.25 + ], + [ + 0.25, + 0.4 + ], + [ + 0.2, + 0.4 + ], + [ + 0.2, + 0.2 + ] + ] + ], + [ + [ + [ + 0.25, + 1 + ], + [ + 1, + 1 + ], + [ + 1, + 0.25 + ], + [ + 2.75, + 0.25 + ], + [ + 2.75, + 2.75 + ], + [ + 0.25, + 2.75 + ], + [ + 0.25, + 1 + ] + ] + ] + ] + } +} \ No newline at end of file From 1446e58635d51c56a5bf354b90f8340b36a44587 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Tue, 24 Oct 2017 19:49:11 +1100 Subject: [PATCH 15/42] Add check for outgoing poly. --- src/connect_edges.js | 2 ++ test/featureTypes.js | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/connect_edges.js b/src/connect_edges.js index 0888d8a..255f498 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -166,5 +166,7 @@ module.exports = function (sortedEvents, operation) { } } + // Handle if the result is a polygon (eg not multipoly) + if (result.length === 1) result = result[0]; return result; }; diff --git a/test/featureTypes.js b/test/featureTypes.js index 463354d..a207230 100644 --- a/test/featureTypes.js +++ b/test/featureTypes.js @@ -13,10 +13,10 @@ var testScenarios = [ testName: 'polyToClipping', subjectPoly: 'poly', }, - { - testName: 'polyWithHoleToClipping', - subjectPoly: 'polyWithHole', - }, + // { + // testName: 'polyWithHoleToClipping', + // subjectPoly: 'polyWithHole', + // } { testName: 'multiPolyToClipping', subjectPoly: 'multiPoly', From ced574bbe647d8858845b79c7ec7abc58979c425 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Tue, 24 Oct 2017 20:26:06 +1100 Subject: [PATCH 16/42] Fix union operation with hole --- src/connect_edges.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connect_edges.js b/src/connect_edges.js index 255f498..e3e68e2 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -109,7 +109,7 @@ module.exports = function (sortedEvents, operation) { if (result.length === 0) { result.push([[contour]]); } else if (operation === operationType.UNION) { - result.push(contour); + result[result.length - 1].push([contour]); } else { result[result.length - 1].push(contour); } From 794e60982ca53a1f363ca2f567dc2df2f0cf8ea3 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Tue, 24 Oct 2017 21:21:42 +1100 Subject: [PATCH 17/42] This could be it.... --- src/connect_edges.js | 2 +- test/featureTypes.js | 12 +- .../multiPolyWithHoleToClipping.geojson | 95 +++++++++++ .../multiPolyWithHoleToClipping.geojson | 71 ++++++++ .../union/multiPolyWithHoleToClipping.geojson | 99 +++++++++++ .../xor/multiPolyWithHoleToClipping.geojson | 157 ++++++++++++++++++ 6 files changed, 431 insertions(+), 5 deletions(-) create mode 100644 test/featureTypes/out/difference/multiPolyWithHoleToClipping.geojson create mode 100644 test/featureTypes/out/intersection/multiPolyWithHoleToClipping.geojson create mode 100644 test/featureTypes/out/union/multiPolyWithHoleToClipping.geojson create mode 100644 test/featureTypes/out/xor/multiPolyWithHoleToClipping.geojson diff --git a/src/connect_edges.js b/src/connect_edges.js index e3e68e2..ad65477 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -108,7 +108,7 @@ module.exports = function (sortedEvents, operation) { if (!resultEvents[i].isExteriorRing) { if (result.length === 0) { result.push([[contour]]); - } else if (operation === operationType.UNION) { + } else if (operation === operationType.UNION || operation === operationType.XOR) { result[result.length - 1].push([contour]); } else { result[result.length - 1].push(contour); diff --git a/test/featureTypes.js b/test/featureTypes.js index a207230..0fa9fd6 100644 --- a/test/featureTypes.js +++ b/test/featureTypes.js @@ -13,13 +13,17 @@ var testScenarios = [ testName: 'polyToClipping', subjectPoly: 'poly', }, - // { - // testName: 'polyWithHoleToClipping', - // subjectPoly: 'polyWithHole', - // } + { + testName: 'polyWithHoleToClipping', + subjectPoly: 'polyWithHole', + }, { testName: 'multiPolyToClipping', subjectPoly: 'multiPoly', + }, + { + testName: 'multiPolyWithHoleToClipping', + subjectPoly: 'multiPolyWithHole', } ]; diff --git a/test/featureTypes/out/difference/multiPolyWithHoleToClipping.geojson b/test/featureTypes/out/difference/multiPolyWithHoleToClipping.geojson new file mode 100644 index 0000000..a240d58 --- /dev/null +++ b/test/featureTypes/out/difference/multiPolyWithHoleToClipping.geojson @@ -0,0 +1,95 @@ +{ + "type": "Feature", + "properties": { + "stroke": "#3a8b1f", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#36744f", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 0.4, + 0.25 + ], + [ + 0.4, + 0.2 + ], + [ + 0.2, + 0.2 + ], + [ + 0.2, + 0.4 + ], + [ + 0.25, + 0.4 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ] + ], + [ + [ + [ + 2, + 2.75 + ], + [ + 2.75, + 2.75 + ], + [ + 2.75, + 2 + ], + [ + 3, + 2 + ], + [ + 3, + 3 + ], + [ + 2, + 3 + ], + [ + 2, + 2.75 + ] + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/intersection/multiPolyWithHoleToClipping.geojson b/test/featureTypes/out/intersection/multiPolyWithHoleToClipping.geojson new file mode 100644 index 0000000..032316f --- /dev/null +++ b/test/featureTypes/out/intersection/multiPolyWithHoleToClipping.geojson @@ -0,0 +1,71 @@ +{ + "type": "Feature", + "properties": { + "stroke": "#3a8b1f", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#36744f", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0.25, + 0.4 + ], + [ + 0.4, + 0.4 + ], + [ + 0.4, + 0.25 + ], + [ + 1, + 0.25 + ], + [ + 1, + 1 + ], + [ + 0.25, + 1 + ], + [ + 0.25, + 0.4 + ] + ] + ], + [ + [ + [ + 2, + 2 + ], + [ + 2.75, + 2 + ], + [ + 2.75, + 2.75 + ], + [ + 2, + 2.75 + ], + [ + 2, + 2 + ] + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/union/multiPolyWithHoleToClipping.geojson b/test/featureTypes/out/union/multiPolyWithHoleToClipping.geojson new file mode 100644 index 0000000..6323e80 --- /dev/null +++ b/test/featureTypes/out/union/multiPolyWithHoleToClipping.geojson @@ -0,0 +1,99 @@ +{ + "type": "Feature", + "properties": { + "stroke": "#3a8b1f", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#36744f", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 2.75, + 0.25 + ], + [ + 2.75, + 2 + ], + [ + 3, + 2 + ], + [ + 3, + 3 + ], + [ + 2, + 3 + ], + [ + 2, + 2.75 + ], + [ + 0.25, + 2.75 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ], + [ + [ + 0.2, + 0.2 + ], + [ + 0.4, + 0.2 + ], + [ + 0.4, + 0.25 + ], + [ + 0.25, + 0.25 + ], + [ + 0.25, + 0.4 + ], + [ + 0.2, + 0.4 + ], + [ + 0.2, + 0.2 + ] + ] + ] + } +} \ No newline at end of file diff --git a/test/featureTypes/out/xor/multiPolyWithHoleToClipping.geojson b/test/featureTypes/out/xor/multiPolyWithHoleToClipping.geojson new file mode 100644 index 0000000..1104888 --- /dev/null +++ b/test/featureTypes/out/xor/multiPolyWithHoleToClipping.geojson @@ -0,0 +1,157 @@ +{ + "type": "Feature", + "properties": { + "stroke": "#3a8b1f", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#36744f", + "fill-opacity": 0.5 + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 1, + 0.25 + ], + [ + 0.4, + 0.25 + ], + [ + 0.4, + 0.4 + ], + [ + 0.25, + 0.4 + ], + [ + 0.25, + 1 + ], + [ + 0, + 1 + ], + [ + 0, + 0 + ] + ], + [ + [ + 0.2, + 0.2 + ], + [ + 0.4, + 0.2 + ], + [ + 0.4, + 0.25 + ], + [ + 0.25, + 0.25 + ], + [ + 0.25, + 0.4 + ], + [ + 0.2, + 0.4 + ], + [ + 0.2, + 0.2 + ] + ] + ], + [ + [ + [ + 0.25, + 1 + ], + [ + 1, + 1 + ], + [ + 1, + 0.25 + ], + [ + 2.75, + 0.25 + ], + [ + 2.75, + 2 + ], + [ + 2, + 2 + ], + [ + 2, + 2.75 + ], + [ + 0.25, + 2.75 + ], + [ + 0.25, + 1 + ] + ] + ], + [ + [ + [ + 2, + 2.75 + ], + [ + 2.75, + 2.75 + ], + [ + 2.75, + 2 + ], + [ + 3, + 2 + ], + [ + 3, + 3 + ], + [ + 2, + 3 + ], + [ + 2, + 2.75 + ] + ] + ] + ] + } +} \ No newline at end of file From 57b1b5e1099631bf16f7dceafa957270a606da2f Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Tue, 24 Oct 2017 19:53:55 +0200 Subject: [PATCH 18/42] removed breaking line again --- demo/js/bundle.js | 318 +++++++++++++++++++++++++------------------ demo/js/index.js | 3 +- src/connect_edges.js | 3 +- 3 files changed, 191 insertions(+), 133 deletions(-) diff --git a/demo/js/bundle.js b/demo/js/bundle.js index 4a5d247..b6e8993 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -168,7 +168,6 @@ function clear() { var reader = new jsts.io.GeoJSONReader(); var writer = new jsts.io.GeoJSONWriter(); - function run (op) { var layers = drawnItems.getLayers(); if (layers.length < 2) return; @@ -196,7 +195,7 @@ function run (op) { console.timeEnd('martinez'); //if (op === OPERATIONS.UNION) result = result[0]; - //console.log('result', result); + console.log('result', result); results.clearLayers(); results.addData({ @@ -207,23 +206,23 @@ function run (op) { } }); - // setTimeout(function() { - // console.time('jsts'); - // var s = reader.read(subject); - // var c = reader.read(clipping); - // var res; - // if (op === OPERATIONS.INTERSECTION) { - // res = s.geometry.intersection(c.geometry); - // } else if (op === OPERATIONS.UNION) { - // res = s.geometry.union(c.geometry); - // } else if (op === OPERATIONS.DIFFERENCE) { - // res = s.geometry.difference(c.geometry); - // } else { - // res = s.geometry.symDifference(c.geometry); - // } - // res = writer.write(res); - // console.timeEnd('jsts'); - // }, 500); + setTimeout(function() { + console.time('jsts'); + var s = reader.read(subject); + var c = reader.read(clipping); + var res; + if (op === OPERATIONS.INTERSECTION) { + res = s.geometry.intersection(c.geometry); + } else if (op === OPERATIONS.UNION) { + res = s.geometry.union(c.geometry); + } else if (op === OPERATIONS.DIFFERENCE) { + res = s.geometry.difference(c.geometry); + } else { + res = s.geometry.symDifference(c.geometry); + } + res = writer.write(res); + console.timeEnd('jsts'); + }, 500); } //drawnItems.addData(oneInside); @@ -375,12 +374,12 @@ function height(node) { /** * @typedef {{ - * parent: Node|Null, - * left: Node|Null, - * right: Node|Null, - * balanceFactor: Number, - * key: any, - * data: object? + * parent: ?Node, + * left: ?Node, + * right: ?Node, + * balanceFactor: number, + * key: Key, + * data: Value * }} Node */ @@ -388,10 +387,15 @@ function height(node) { * @typedef {*} Key */ +/** + * @typedef {*} Value + */ + /** * Default comparison function - * @param {*} a - * @param {*} b + * @param {Key} a + * @param {Key} b + * @returns {number} */ function DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; } @@ -475,7 +479,7 @@ function rotateRight (node) { // } -var Tree = function Tree (comparator, noDuplicates) { +var AVLTree = function AVLTree (comparator, noDuplicates) { if ( noDuplicates === void 0 ) noDuplicates = false; this._comparator = comparator || DEFAULT_COMPARE; @@ -489,14 +493,16 @@ var prototypeAccessors = { size: {} }; /** * Clear the tree + * @return {AVLTree} */ -Tree.prototype.destroy = function destroy () { +AVLTree.prototype.destroy = function destroy () { this._root = null; + return this; }; /** * Number of nodes - * @return {Number} + * @return {number} */ prototypeAccessors.size.get = function () { return this._size; @@ -506,9 +512,9 @@ prototypeAccessors.size.get = function () { /** * Whether the tree contains a node with the given key * @param{Key} key - * @return {Boolean} + * @return {boolean} true/false */ -Tree.prototype.contains = function contains (key) { +AVLTree.prototype.contains = function contains (key) { if (this._root){ var node = this._root; var comparator = this._comparator; @@ -528,9 +534,9 @@ Tree.prototype.contains = function contains (key) { /** * Successor node * @param{Node} node - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.next = function next (node) { +AVLTree.prototype.next = function next (node) { var successor = node; if (successor) { if (successor.right) { @@ -550,9 +556,9 @@ Tree.prototype.next = function next (node) { /** * Predecessor node * @param{Node} node - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.prev = function prev (node) { +AVLTree.prototype.prev = function prev (node) { var predecessor = node; if (predecessor) { if (predecessor.left) { @@ -572,10 +578,17 @@ Tree.prototype.prev = function prev (node) { /** - * @param{Function(node:Node):void} fn + * Callback for forEach + * @callback forEachCallback + * @param {Node} node + * @param {number} index + */ + +/** + * @param{forEachCallback} callback * @return {AVLTree} */ -Tree.prototype.forEach = function forEach (fn) { +AVLTree.prototype.forEach = function forEach (callback) { var current = this._root; var s = [], done = false, i = 0; @@ -592,7 +605,7 @@ Tree.prototype.forEach = function forEach (fn) { // empty you are done if (s.length > 0) { current = s.pop(); - fn(current, i++); + callback(current, i++); // We have visited the node and its left // subtree. Now, it's right subtree's turn @@ -608,7 +621,7 @@ Tree.prototype.forEach = function forEach (fn) { * Returns all keys in order * @return {Array} */ -Tree.prototype.keys = function keys () { +AVLTree.prototype.keys = function keys () { var current = this._root; var s = [], r = [], done = false; @@ -630,9 +643,9 @@ Tree.prototype.keys = function keys () { /** * Returns `data` fields of all nodes in order. - * @return {Array<*>} + * @return {Array} */ -Tree.prototype.values = function values () { +AVLTree.prototype.values = function values () { var current = this._root; var s = [], r = [], done = false; @@ -652,9 +665,15 @@ Tree.prototype.values = function values () { }; -Tree.prototype.at = function at (index) { - index = index % this.size; - if (index < 0) { index = this.size - index; } +/** + * Returns node at given index + * @param{number} index + * @return {?Node} + */ +AVLTree.prototype.at = function at (index) { + // removed after a consideration, more misleading than useful + // index = index % this.size; + // if (index < 0) index = this.size - index; var current = this._root; var s = [], done = false, i = 0; @@ -678,9 +697,9 @@ Tree.prototype.at = function at (index) { /** * Returns node with the minimum key - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.minNode = function minNode () { +AVLTree.prototype.minNode = function minNode () { var node = this._root; if (!node) { return null; } while (node.left) { node = node.left; } @@ -690,9 +709,9 @@ Tree.prototype.minNode = function minNode () { /** * Returns node with the max key - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.maxNode = function maxNode () { +AVLTree.prototype.maxNode = function maxNode () { var node = this._root; if (!node) { return null; } while (node.right) { node = node.right; } @@ -702,20 +721,21 @@ Tree.prototype.maxNode = function maxNode () { /** * Min key - * @return {Key} + * @return {?Key} */ -Tree.prototype.min = function min () { +AVLTree.prototype.min = function min () { var node = this._root; if (!node) { return null; } while (node.left) { node = node.left; } return node.key; }; + /** * Max key - * @return {Key|Null} + * @return {?Key} */ -Tree.prototype.max = function max () { +AVLTree.prototype.max = function max () { var node = this._root; if (!node) { return null; } while (node.right) { node = node.right; } @@ -724,18 +744,18 @@ Tree.prototype.max = function max () { /** - * @return {Boolean} + * @return {boolean} true/false */ -Tree.prototype.isEmpty = function isEmpty () { +AVLTree.prototype.isEmpty = function isEmpty () { return !this._root; }; /** * Removes and returns the node with smallest key - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.pop = function pop () { +AVLTree.prototype.pop = function pop () { var node = this._root, returnValue = null; if (node) { while (node.left) { node = node.left; } @@ -749,12 +769,12 @@ Tree.prototype.pop = function pop () { /** * Find node by key * @param{Key} key - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.find = function find (key) { +AVLTree.prototype.find = function find (key) { var root = this._root; - if (root === null) { return null; } - if (key === root.key) { return root; } + // if (root === null) return null; + // if (key === root.key) return root; var subtree = root, cmp; var compare = this._comparator; @@ -772,10 +792,10 @@ Tree.prototype.find = function find (key) { /** * Insert a node into the tree * @param{Key} key - * @param{*} [data] - * @return {Node|Null} + * @param{Value} [data] + * @return {?Node} */ -Tree.prototype.insert = function insert (key, data) { +AVLTree.prototype.insert = function insert (key, data) { var this$1 = this; if (!this._root) { @@ -810,9 +830,12 @@ Tree.prototype.insert = function insert (key, data) { } var newNode = { - left: null, right: null, balanceFactor: 0, + left: null, + right: null, + balanceFactor: 0, parent: parent, key: key, data: data }; + var newRoot; if (cmp <= 0) { parent.left= newNode; } else { parent.right = newNode; } @@ -823,18 +846,20 @@ Tree.prototype.insert = function insert (key, data) { if (parent.balanceFactor === 0) { break; } else if (parent.balanceFactor < -1) { - //let newRoot = rightBalance(parent); + // inlined + //var newRoot = rightBalance(parent); if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } - var newRoot = rotateLeft(parent); + newRoot = rotateLeft(parent); if (parent === this$1._root) { this$1._root = newRoot; } break; } else if (parent.balanceFactor > 1) { - // let newRoot = leftBalance(parent); + // inlined + // var newRoot = leftBalance(parent); if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } - var newRoot$1 = rotateRight(parent); + newRoot = rotateRight(parent); - if (parent === this$1._root) { this$1._root = newRoot$1; } + if (parent === this$1._root) { this$1._root = newRoot; } break; } parent = parent.parent; @@ -848,27 +873,30 @@ Tree.prototype.insert = function insert (key, data) { /** * Removes the node from the tree. If not found, returns null. * @param{Key} key - * @return {Node:Null} + * @return {?Node} */ -Tree.prototype.remove = function remove (key) { +AVLTree.prototype.remove = function remove (key) { var this$1 = this; if (!this._root) { return null; } var node = this._root; var compare = this._comparator; + var cmp = 0; while (node) { - var cmp = compare(key, node.key); + cmp = compare(key, node.key); if (cmp === 0) { break; } else if (cmp < 0) { node = node.left; } else { node = node.right; } } if (!node) { return null; } + var returnValue = node.key; + var max, min; if (node.left) { - var max = node.left; + max = node.left; while (max.left || max.right) { while (max.right) { max = max.right; } @@ -887,7 +915,7 @@ Tree.prototype.remove = function remove (key) { } if (node.right) { - var min = node.right; + min = node.right; while (min.left || min.right) { while (min.left) { min = min.left; } @@ -907,25 +935,28 @@ Tree.prototype.remove = function remove (key) { var parent = node.parent; var pp = node; + var newRoot; while (parent) { if (parent.left === pp) { parent.balanceFactor -= 1; } else { parent.balanceFactor += 1; } if (parent.balanceFactor < -1) { - //let newRoot = rightBalance(parent); + // inlined + //var newRoot = rightBalance(parent); if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } - var newRoot = rotateLeft(parent); + newRoot = rotateLeft(parent); if (parent === this$1._root) { this$1._root = newRoot; } parent = newRoot; } else if (parent.balanceFactor > 1) { - // let newRoot = leftBalance(parent); + // inlined + // var newRoot = leftBalance(parent); if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } - var newRoot$1 = rotateRight(parent); + newRoot = rotateRight(parent); - if (parent === this$1._root) { this$1._root = newRoot$1; } - parent = newRoot$1; + if (parent === this$1._root) { this$1._root = newRoot; } + parent = newRoot; } if (parent.balanceFactor === -1 || parent.balanceFactor === 1) { break; } @@ -948,11 +979,11 @@ Tree.prototype.remove = function remove (key) { /** * Bulk-load items - * @param{Array}keys - * @param{Array}[values] - * @return {Tree} + * @param{Array}keys + * @param{Array}[values] + * @return {AVLTree} */ -Tree.prototype.load = function load (keys, values) { +AVLTree.prototype.load = function load (keys, values) { var this$1 = this; if ( keys === void 0 ) keys = []; if ( values === void 0 ) values = []; @@ -968,25 +999,25 @@ Tree.prototype.load = function load (keys, values) { /** * Returns true if the tree is balanced - * @return {Boolean} + * @return {boolean} */ -Tree.prototype.isBalanced = function isBalanced$1 () { +AVLTree.prototype.isBalanced = function isBalanced$1 () { return isBalanced(this._root); }; /** * String representation of the tree - primitive horizontal print-out - * @param{Function(Node):String} [printNode] - * @return {String} + * @param{Function(Node):string} [printNode] + * @return {string} */ -Tree.prototype.toString = function toString (printNode) { +AVLTree.prototype.toString = function toString (printNode) { return print(this._root, printNode); }; -Object.defineProperties( Tree.prototype, prototypeAccessors ); +Object.defineProperties( AVLTree.prototype, prototypeAccessors ); -return Tree; +return AVLTree; }))); @@ -2649,7 +2680,7 @@ var signedArea = require('./signed_area'); * @param {SweepEvent} e2 * @return {Number} */ -module.exports = function compareEvents (e1, e2) { +module.exports = function compareEvents(e1, e2) { var p1 = e1.point; var p2 = e2.point; @@ -2672,12 +2703,12 @@ function specialCases(e1, e2, p1, p2) { if (e1.left !== e2.left) return e1.left ? 1 : -1; - var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; - var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) + // var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; + // var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) // Same coordinates, both events // are left endpoints or right endpoints. // not collinear - if (sa/*signedArea(p1, e1.otherEvent.point, e2.otherEvent.point)*/ !== 0) { + if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) { // the event associate to the bottom segment is processed first return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; } @@ -2734,7 +2765,7 @@ module.exports = function compareSegments(le1, le2) { var p1 = le1.point, p2 = le2.point; if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) { p1 = le1.otherEvent.point; p2 = le2.otherEvent.point; - if (ep1[0] === p2[0] && p1[1] === p2[1]) return 0; + if (p1[0] === p2[0] && p1[1] === p2[1]) return 0; else return le1.contourId > le2.contourId ? 1 : -1; } } else { // Segments are collinear, but belong to separate polygons @@ -2745,6 +2776,8 @@ module.exports = function compareSegments(le1, le2) { }; },{"./compare_events":13,"./equals":19,"./signed_area":25}],15:[function(require,module,exports){ +'use strict'; + var edgeType = require('./edge_type'); var INTERSECTION = 0; @@ -2813,9 +2846,11 @@ function inResult(event, operation) { } },{"./edge_type":18}],16:[function(require,module,exports){ -var equals = require('./equals'); -var compareEvents = require('./compare_events'); +'use strict'; +// var equals = require('./equals'); +var compareEvents = require('./compare_events'); +var operationType = require('./operation'); /** * @param {Array.} sortedEvents @@ -2852,7 +2887,7 @@ function orderEvents(sortedEvents) { } for (i = 0, len = resultEvents.length; i < len; i++) { - var event = resultEvents[i]; + event = resultEvents[i]; if (!event.left) { tmp = event.pos; event.pos = event.otherEvent.pos; @@ -2870,7 +2905,7 @@ function orderEvents(sortedEvents) { * @param {Object>} processed * @return {Number} */ -function nextPos(pos, resultEvents, processed) { +function nextPos(pos, resultEvents, processed, origIndex) { var newPos = pos + 1; var length = resultEvents.length; var p = resultEvents[pos].point; @@ -2885,17 +2920,18 @@ function nextPos(pos, resultEvents, processed) { // while in range and not the current one by value while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { if (!processed[newPos]) { - console.log(pos, newPos, length); + // console.log(pos, newPos, length); return newPos; - } - else newPos++; - p1 = resultEvents[newPos].point + } else newPos++; + p1 = resultEvents[newPos].point; } newPos = pos - 1; - while (processed[newPos]) newPos--; - console.log('other', pos, newPos, length); + while (processed[newPos] && newPos >= origIndex) { + newPos--; + } + // console.log('other', pos, newPos, length); return newPos; } @@ -2920,12 +2956,10 @@ module.exports = function (sortedEvents, operation) { if (!resultEvents[i].isExteriorRing) { if (result.length === 0) { result.push([[contour]]); + } else if (operation === operationType.UNION || operation === operationType.XOR) { + result[result.length - 1].push([contour]); } else { - if (operation === 1) { - result.push(contour) - } else { - result[result.length - 1].push(contour); - } + result[result.length - 1].push(contour); } } else { result.push(contour); @@ -2939,7 +2973,7 @@ module.exports = function (sortedEvents, operation) { contour[0].push(initial); while (pos >= i) { - var event = resultEvents[pos]; + event = resultEvents[pos]; processed[pos] = true; if (event.left) { @@ -2955,7 +2989,7 @@ module.exports = function (sortedEvents, operation) { // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); contour[0].push(resultEvents[pos].point); - pos = nextPos(pos, resultEvents, processed); + pos = nextPos(pos, resultEvents, processed, i); } pos = pos === -1 ? i : pos; @@ -2980,10 +3014,15 @@ module.exports = function (sortedEvents, operation) { } } + // Handle if the result is a polygon (eg not multipoly) + // Commented it again, let's see what do we mean by that + // if (result.length === 1) result = result[0]; return result; }; -},{"./compare_events":13,"./equals":19}],17:[function(require,module,exports){ +},{"./compare_events":13,"./operation":22}],17:[function(require,module,exports){ +'use strict'; + var SweepEvent = require('./sweep_event'); var equals = require('./equals'); var compareEvents = require('./compare_events'); @@ -3039,7 +3078,14 @@ module.exports = { // var abs = Math.abs; module.exports = function equals(p1, p2) { - return p1[0] === p2[0] && p1[1] === p2[1]; + if (p1[0] === p2[0]) { + if (p1[1] === p2[1]) { + return true; + } else { + return false; + } + } + return false; }; // TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164 @@ -3050,6 +3096,8 @@ module.exports = function equals(p1, p2) { // }; },{}],20:[function(require,module,exports){ +'use strict'; + var Queue = require('tinyqueue'); var SweepEvent = require('./sweep_event'); var compareEvents = require('./compare_events'); @@ -3062,9 +3110,9 @@ var contourId = 0; function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { var i, len, s1, s2, e1, e2; - var d = depth + 1; + // var d = depth + 1; for (i = 0, len = contourOrHole.length - 1; i < len; i++) { - s1 = contourOrHole[i], + s1 = contourOrHole[i]; s2 = contourOrHole[i + 1]; //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); e1 = new SweepEvent(s1, false, undefined, isSubject); @@ -3098,7 +3146,7 @@ function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { var eventQueue = new Queue(null, compareEvents); - var polygonSet, isExteriorRing, i, ii, j, jj, k, kk; + var polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk; for (i = 0, ii = subject.length; i < ii; i++) { polygonSet = subject[i]; @@ -3119,15 +3167,17 @@ module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { } return eventQueue; -} +}; },{"./compare_events":13,"./sweep_event":27,"tinyqueue":12}],21:[function(require,module,exports){ 'use strict'; + var subdivideSegments = require('./subdivide_segments'); var connectEdges = require('./connect_edges'); -var equals = require('./equals'); var fillQueue = require('./fill_queue'); -var operations = require('./operation') +var operations = require('./operation'); + +var EMPTY = []; function trivialOperation(subject, clipping, operation) { @@ -3225,7 +3275,9 @@ module.exports.intersection = function (subject, clipping) { */ module.exports.operations = operations; -},{"./connect_edges":16,"./equals":19,"./fill_queue":20,"./operation":22,"./subdivide_segments":26}],22:[function(require,module,exports){ +},{"./connect_edges":16,"./fill_queue":20,"./operation":22,"./subdivide_segments":26}],22:[function(require,module,exports){ +'use strict'; + module.exports = { INTERSECTION: 0, UNION: 1, @@ -3234,9 +3286,13 @@ module.exports = { }; },{}],23:[function(require,module,exports){ +'use strict'; + var divideSegment = require('./divide_segment'); var intersection = require('./segment_intersection'); var equals = require('./equals'); +var compareEvents = require('./compare_events'); +var edgeType = require('./edge_type'); /** * @param {SweepEvent} se1 @@ -3344,7 +3400,7 @@ module.exports = function possibleIntersection(se1, se2, queue) { return 3; }; -},{"./divide_segment":17,"./equals":19,"./segment_intersection":24}],24:[function(require,module,exports){ +},{"./compare_events":13,"./divide_segment":17,"./edge_type":18,"./equals":19,"./segment_intersection":24}],24:[function(require,module,exports){ 'use strict'; var EPSILON = 1e-9; @@ -3504,6 +3560,8 @@ module.exports = function signedArea(p0, p1, p2) { }; },{}],26:[function(require,module,exports){ +'use strict'; + var Tree = require('avl'); var computeFields = require('./compute_fields'); var possibleIntersection = require('./possible_intersection'); @@ -3511,13 +3569,13 @@ var compareSegments = require('./compare_segments'); var operations = require('./operation'); -module.exports = function subdivide (eventQueue, subject, clipping, sbbox, cbbox, operation) { +module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) { var sweepLine = new Tree(compareSegments); var sortedEvents = []; var rightbound = Math.min(sbbox[2], cbbox[2]); - var prev, next, begin, end; + var prev, next, begin; var INTERSECTION = operations.INTERSECTION; var DIFFERENCE = operations.DIFFERENCE; @@ -3626,7 +3684,7 @@ function _renderSweepLine(sweepLine, pos, event) { },{"./compare_segments":14,"./compute_fields":15,"./operation":22,"./possible_intersection":23,"avl":6}],27:[function(require,module,exports){ 'use strict'; -var signedArea = require('./signed_area'); +//var signedArea = require('./signed_area'); var EdgeType = require('./edge_type'); /** @@ -3717,7 +3775,7 @@ SweepEvent.prototype = { return this.left ? (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0 : // signedArea(this.point, this.otherEvent.point, p) > 0 : - (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0 + (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0; //signedArea(this.otherEvent.point, this.point, p) > 0; }, @@ -3741,5 +3799,5 @@ SweepEvent.prototype = { module.exports = SweepEvent; -},{"./edge_type":18,"./signed_area":25}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9k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dCAgPSBwcmV2ID0gc3dlZXBMaW5lLmluc2VydChldmVudCk7XG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5wb2ludCwgZXZlbnQpO1xuICAgICAgYmVnaW4gPSBzd2VlcExpbmUubWluTm9kZSgpO1xuXG4gICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW50LCAgICAgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBldmVudCA9IGV2ZW50Lm90aGVyRXZlbnQ7XG4gICAgICBuZXh0ID0gcHJldiA9IHN3ZWVwTGluZS5maW5kKGV2ZW50KTtcblxuICAgICAgLy8gX3JlbmRlclN3ZWVwTGluZShzd2VlcExpbmUsIGV2ZW50Lm90aGVyRXZlbnQucG9pbnQsIGV2ZW50KTtcblxuICAgICAgaWYgKHByZXYgJiYgbmV4dCkge1xuXG4gICAgICAgIGlmIChwcmV2ICE9PSBiZWdpbikgcHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXYpO1xuICAgICAgICBlbHNlICAgICAgICAgICAgICAgIHByZXYgPSBudWxsO1xuXG4gICAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcbiAgICAgICAgc3dlZXBMaW5lLnJlbW92ZShldmVudCk7XG5cbiAgICAgICAgLy8gX3JlbmRlclN3ZWVwTGluZShzd2VlcExpbmUsIGV2ZW50Lm90aGVyRXZlbnQucG9pbnQsIGV2ZW50KTtcblxuICAgICAgICBpZiAobmV4dCAmJiBwcmV2KSB7XG4gICAgICAgICAgLy9pZiAodHlwZW9mIHByZXYgIT09ICd1bmRlZmluZWQnICYmIHR5cGVvZiBuZXh0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgIHBvc3NpYmxlSW50ZXJzZWN0aW9uKHByZXYua2V5LCBuZXh0LmtleSwgZXZlbnRRdWV1ZSk7XG4gICAgICAgICAgLy99XG4gICAgICAgIH1cbiAgICAgIH1cbiAgIC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UgPSB7XG5cbiAgLyoqXG4gICAqIEBwYXJhbSAge0FycmF5LjxOdW1iZXI+fSAgcFxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNCZWxvdzogZnVuY3Rpb24gKHApIHtcbiAgICB2YXIgcDAgPSB0aGlzLnBvaW50LCBwMSA9IHRoaXMub3RoZXJFdmVudC5wb2ludDtcbiAgICByZXR1cm4gdGhpcy5sZWZ0ID9cbiAgICAgIChwMFswXSAtIHBbMF0pICogKHAxWzFdIC0gcFsxXSkgLSAocDFbMF0gLSBwWzBdKSAqIChwMFsxXSAtIHBbMV0pID4gMCA6XG4gICAgICAvLyBzaWduZWRBcmVhKHRoaXMucG9pbnQsIHRoaXMub3RoZXJFdmVudC5wb2ludCwgcCkgPiAwIDpcbiAgICAgIChwMVswXSAtIHBbMF0pICogKHAwWzFdIC0gcFsxXSkgLSAocDBbMF0gLSBwWzBdKSAqIChwMVsxXSAtIHBbMV0pID4gMFxuICAgICAgLy9zaWduZWRBcmVhKHRoaXMub3RoZXJFdmVudC5wb2ludCwgdGhpcy5wb2ludCwgcCkgPiAwO1xuICB9LFxuXG5cbiAgLyoqXG4gICAqIEBwYXJhbSAge0FycmF5LjxOdW1iZXI+fSAgcFxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNBYm92ZTogZnVuY3Rpb24gKHApIHtcbiAgICByZXR1cm4gIXRoaXMuaXNCZWxvdyhwKTtcbiAgfSxcblxuXG4gIC8qKlxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNWZXJ0aWNhbDogZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiB0aGlzLnBvaW50WzBdID09PSB0aGlzLm90aGVyRXZlbnQucG9pbnRbMF07XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzID0gU3dlZXBFdmVudDtcbiJdfQ== +},{"./edge_type":18}]},{},[3]) +//# sourceMappingURL=data:application/json;charset=utf-8;base64,e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ZW50LnN0b3AoZXZ0KTtcbiAgICAgICAgdmFyIHJhZGlvcyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKFxuICAgICAgICAgIGZvcm0ucXVlcnlTZWxlY3RvckFsbCgnaW5wdXRbdHlwZT1yYWRpb10nKSk7XG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSByYWRpb3MubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgICBpZiAocmFkaW9zW2ldLmNoZWNrZWQpIHtcbiAgICAgICAgICAgIHRoaXMub3B0aW9ucy5jYWxsYmFjayhwYXJzZUludChyYWRpb3NbaV0udmFsdWUpKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSwgdGhpcylcbiAgICAgIC5vbihmb3JtWydjbGVhciddLCAnY2xpY2snLCBmdW5jdGlvbihldnQpIHtcbiAgICAgICAgTC5Eb21FdmVudC5zdG9wKGV2dCk7XG4gICAgICAgIHRoaXMub3B0aW9ucy5jbGVhcigpO1xuICAgICAgfSwgdGhpcyk7XG5cbiAgICBMLkRvbUV2ZW50XG4gICAgICAuZGlzYWJsZUNsaWNrUHJvcGFnYXRpb24odGhpcy5fY29udGFpbmVyKVxuICAgICAgLmRpc2FibGVTY3JvbGxQcm9wYWdhdGlvbih0aGlzLl9jb250YWluZXIpO1xuICAgIHJldHVybiB0aGlzLl9jb250YWluZXI7XG4gIH1cblxufSk7IiwiTC5Db29yZGluYXRlcyA9IEwuQ29udHJvbC5leHRlbmQoe1xuICBvcHRpb25zOiB7XG4gICAgcG9zaXRpb246ICdib3R0b21yaWdodCdcbiAgfSxcblxuICBvbkFkZDogZnVuY3Rpb24obWFwKSB7XG4gICAgdGhpcy5fY29udGFpbmVyID0gTC5Eb21VdGlsLmNyZWF0ZSgnZGl2JywgJ2xlYWZsZXQtYmFyJyk7XG4gICAgdGhpcy5fY29udGFpbmVyLnN0eWxlLmJhY2tncm91bmQ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gZ2l2ZW4uXG4gKlxuICogRXhhbXBsZXM6XG4gKlxuICogICAgICAgLy8gbWFudWFsIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnanNvbicpXG4gKiAgICAgICAgIC5zZW5kKCd7XCJuYW1lXCI6XCJ0alwifScpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byBqc29uXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnNlbmQoeyBuYW1lOiAndGonIH0pXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gbWFudWFsIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdmb3JtJylcbiAqICAgICAgICAgLnNlbmQoJ25hbWU9dGonKVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGF1dG8geC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBkZWZhdWx0cyB0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgLnNlbmQoJ25hbWU9dG9iaScpXG4gKiAgICAgICAgLnNlbmQoJ3NwZWNpZXM9ZmVycmV0JylcbiAqICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqIEBwYXJhbSB7U3RyaW5nfE9iamVjdH0gZGF0YVxuICogQHJldHVybiB7UmVxdWVzd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tcbiAgICB9LFxuXG4gICAgX3VwOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhLFxuICAgICAgICAgICAgY29tcGFyZSA9IHRoaXMuY29tcGFyZTtcblxuICAgICAgICB3aGlsZSAocG9zID4gMCkge1xuICAgICAgICAgICAgdmFyIHBhcmVudCA9IE1hdGguZmxvb3IoKHBvcyAtIDEpIC8gMik7XG4gICAgICAgICAgICBpZiAoY29tcGFyZShkYXRhW3Bvc10sIGRhdGFbcGFyZW50XSkgPCAwKSB7XG4gICAgICAgICAgICAgICAgc3dhcChkYXRhLCBwYXJlbnQsIHBvcyk7XG4gICAgICAgICAgICAgICAgcG9zID0gcGFyZW50O1xuXG4gICAgICAgICAgICB9IGVsc2UgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgX2Rvd246IGZ1bmN0aW9uIChwb3MpIHtcbiAgICAgICAgdmFyIGRhdGEgPSB0aGlzLmRhdGEsXG4gICAgICAgICAgICBjb21wYXJlID0gdGhpcy5jb21wYXJlLFxuICAgICAgICAgICAgbGVuID0gdGhpcy5sZW5ndGg7XG5cbiAgICAgICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgIHZhciBsZWZ0ID0gMiAqIHBvcyArIDEsXG4gICAgICAgICAgICAgICAgcmlnaHQgPSBsZWZ0ICsgMSxcbiAgICAgICAgICAgICAgICBtaW4gPSBwb3M7XG5cbiAgICAgICAgICAgIGlmIChsZWZ0IDwgbGVuICYmIGNvbXBhcmUoZGF0YVtsZWZ0XSwgZGF0YVttaW5dKSA8IDApIG1pbiA9IGxlZnQ7XG4gICAgICAgICAgICBpZiAocmlnaHQgPCBsZW4gJiYgY29tcGFyZShkYXRhW3JpZ2h0XSwgZGF0YVttaW5dKSA8IDApIG1pbiA9IHJpZ2h0O1xuXG4gICAgICAgICAgICBpZiAobWluID09PSBwb3MpIHJldHVybjtcblxuICAgICAgICAgICAgc3dhcChkYXRhLCB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AgIG5leHQgID0gcHJldiA9IHN3ZWVwTGluZS5pbnNlcnQoZXZlbnQpO1xuICAgICAgLy9fcmVuZGVyU3dlZXBMaW5lKHN3ZWVwTGluZSwgZXZlbnQucG9pbnQsIGV2ZW50KTtcbiAgICAgIGJlZ2luID0gc3dlZXBMaW5lLm1pbk5vZGUoKTtcblxuICAgICAgaWYgKHByZXYgIT09IGJlZ2luKSBwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldik7XG4gICAgICBlbHNlICAgICAgICAgICAgICAgIHByZXYgPSBudWxsO1xuXG4gICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG5cbiAgICAgIHZhciBwcmV2RXZlbnQgPSBwcmV2ID8gcHJldi5rZXkgOiBudWxsO1xuICAgICAgdmFyIHByZXZwcmV2RXZlbnQ7XG4gICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICBpZiAobmV4dCkge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKHByZXYpIHtcbiAgICAgICAgaWYgKHBvc3NpYmxlSW50ZXJzZWN0aW9uKHByZXYua2V5LCBldmVudCwgZXZlbnRRdWV1ZSkgPT09IDIpIHtcbiAgICAgICAgICB2YXIgcHJldnByZXYgPSBwcmV2O1xuICAgICAgICAgIGlmIChwcmV2cHJldiAhPT0gYmVnaW4pIHByZXZwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldnByZXYpO1xuICAgICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgIHByZXZwcmV2ID0gbnVsbDtcblxuICAgICAgICAgIHByZXZwcmV2RXZlbnQgPSBwcmV2cHJldiA/IHByZXZwcmV2LmtleSA6IG51bGw7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhwcmV2RXZlbnQsIHByZXZwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgICAgIHByZXZFdmVudCwgICAgIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZXZlbnQgPSBldmVudC5vdGhlckV2ZW50O1xuICAgICAgbmV4dCA9IHByZXYgPSBzd2VlcExpbmUuZmluZChldmVudCk7XG5cbiAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgIGlmIChwcmV2ICYmIG5leHQpIHtcblxuICAgICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgICAgZWxzZSAgICAgICAgICAgICAgICBwcmV2ID0gbnVsbDtcblxuICAgICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG4gICAgICAgIHN3ZWVwTGluZS5yZW1vdmUoZXZlbnQpO1xuXG4gICAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgICAgaWYgKG5leHQgJiYgcHJldikge1xuICAgICAgICAgIC8vaWYgKHR5cGVvZiBwcmV2ICE9PSAndW5kZWZpbmVkJyAmJiB0eXBlb2YgbmV4dCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICBwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgbmV4dC5rZXksIGV2ZW50UXVldWUpO1xuICAgIC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git a/demo/js/index.js b/demo/js/index.js index b780a1f..41e804e 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -103,7 +103,6 @@ function clear() { var reader = new jsts.io.GeoJSONReader(); var writer = new jsts.io.GeoJSONWriter(); - function run (op) { var layers = drawnItems.getLayers(); if (layers.length < 2) return; @@ -131,7 +130,7 @@ function run (op) { console.timeEnd('martinez'); //if (op === OPERATIONS.UNION) result = result[0]; - //console.log('result', result); + console.log('result', result); results.clearLayers(); results.addData({ diff --git a/src/connect_edges.js b/src/connect_edges.js index ad65477..5799999 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -167,6 +167,7 @@ module.exports = function (sortedEvents, operation) { } // Handle if the result is a polygon (eg not multipoly) - if (result.length === 1) result = result[0]; + // Commented it again, let's see what do we mean by that + // if (result.length === 1) result = result[0]; return result; }; From 281b04724f65711000e6590f9d62ec216fcbdcac Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Wed, 25 Oct 2017 10:31:24 +0200 Subject: [PATCH 19/42] test case for #43 --- demo/js/bundle.js | 5 +++- demo/js/index.js | 3 +++ test/divide_segment.test.js | 15 ++++++------ test/fixtures/hole_cut.geojson | 44 ++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 test/fixtures/hole_cut.geojson diff --git a/demo/js/bundle.js b/demo/js/bundle.js index b6e8993..b514977 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -98,6 +98,9 @@ switch (mode) { case 'triangles': file = 'two_pointed_triangles.geojson'; break; + case 'holecut': + file = 'hole_cut.geojson'; + break; default: file = 'hole_hole.geojson'; break; @@ -3800,4 +3803,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1v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A9IE1hdGguZmxvb3IoKHBvcyAtIDEpIC8gMik7XG4gICAgICAgICAgICBpZiAoY29tcGFyZShkYXRhW3Bvc10sIGRhdGFbcGFyZW50XSkgPCAwKSB7XG4gICAgICAgICAgICAgICAgc3dhcChkYXRhLCBwYXJlbnQsIHBvcyk7XG4gICAgICAgICAgICAgICAgcG9zID0gcGFyZW50O1xuXG4gICAgICAgICAgICB9IGVsc2UgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgX2Rvd246IGZ1bmN0aW9uIChwb3MpIHtcbiAgICAgICAgdmFyIGRhdGEgPSB0aGlzLmRhdGEsXG4gICAgICAgICAgICBjb21wYXJlID0gdGhpcy5jb21wYXJlLFxuICAgICAgICAgICAgbGVuID0gdGhpcy5sZW5ndGg7XG5cbiAgICAgICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgIHZhciBsZWZ0ID0gMiAqIHBvcyArIDEsXG4gICAgICAgICAgICAgICAgcmlnaHQgPSBsZWZ0ICsgMSxcbiAgICAgICAgICAgICAgICBtaW4gPSBwb3M7XG5cbiAgICAgICAgICAgIGlmIChsZWZ0IDwgbGVuICYmIGNvbXBhcmUoZGF0YVtsZWZ0XSwgZGF0YVttaW5dKSA8IDApIG1pbiA9IGxlZnQ7XG4gICAgICAgICAgICBpZiAocmlnaHQgPCBsZW4gJiYgY29tcGFyZShkYXRhW3JpZ2h0XSwgZGF0YVttaW5dKSA8IDApIG1pbiA9IHJpZ2h0O1xuXG4gICAgICAgICAgICBpZiAobWluID09PSBwb3MpIHJldHVybjtcblxuICAgICAgICAgICAgc3dhcChkYXRhLCBtaW4sIHBvcyk7XG4gICAgICAgICAgICBwb3MgPSBtaW47XG4gICAgICAgIH1cbiAgICB9XG59O1xuXG5mdW5jdGlvbiBzd2FwKGRhdGEsIGksIGopIHtcbiAgICB2YXIgdG1wID0gZGF0YVtpXTtcbiAgICBkYXRhW2ldID0gZGF0YVtqXTtcbiAgICBkYXRhW2pdID0gdG1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KHByZXYgIT09IGJlZ2luKSBwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldik7XG4gICAgICBlbHNlICAgICAgICAgICAgICAgIHByZXYgPSBudWxsO1xuXG4gICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG5cbiAgICAgIHZhciBwcmV2RXZlbnQgPSBwcmV2ID8gcHJldi5rZXkgOiBudWxsO1xuICAgICAgdmFyIHByZXZwcmV2RXZlbnQ7XG4gICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICBpZiAobmV4dCkge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKHByZXYpIHtcbiAgICAgICAgaWYgKHBvc3NpYmxlSW50ZXJzZWN0aW9uKHByZXYua2V5LCBldmVudCwgZXZlbnRRdWV1ZSkgPT09IDIpIHtcbiAgICAgICAgICB2YXIgcHJldnByZXYgPSBwcmV2O1xuICAgICAgICAgIGlmIChwcmV2cHJldiAhPT0gYmVnaW4pIHByZXZwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldnByZXYpO1xuICAgICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgIHByZXZwcmV2ID0gbnVsbDtcblxuICAgICAgICAgIHByZXZwcmV2RXZlbnQgPSBwcmV2cHJldiA/IHByZXZwcmV2LmtleSA6IG51bGw7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhwcmV2RXZlbnQsIHByZXZwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgICAgIHByZXZFdmVudCwgICAgIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZXZlbnQgPSBldmVudC5vdGhlckV2ZW50O1xuICAgICAgbmV4dCA9IHByZXYgPSBzd2VlcExpbmUuZmluZChldmVudCk7XG5cbiAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgIGlmIChwcmV2ICYmIG5leHQpIHtcblxuICAgICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgICAgZWxzZSAgICAgICAgICAgICAgICBwcmV2ID0gbnVsbDtcblxuICAgICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG4gICAgICAgIHN3ZWVwTGluZS5yZW1vdmUoZXZlbnQpO1xuXG4gICAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgICAgaWYgKG5leHQgJiYgcHJldikge1xuICAgICAgICAgIC8vaWYgKHR5cGVvZiBwcmV2ICE9PSAndW5kZWZpbmVkJyAmJiB0eXBlb2YgbmV4dCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICBwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgbmV4dC5rZXksIGV2ZW50UXVldWUpO1xuICAgICAgICAgIC8vfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiBzb3J0ZWRFdmVudHM7XG59O1xuXG5cbi8qIGVzbGludC1kaXNhYmxlIG5vLXVudXNlZC12YXJzLCBuby1kZWJ1Z2dlciwgbm8tdW5kZWYgKi9cbmZ1bmN0aW9uIF9yZW5kZXJ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xuICAgICAgICAgICAgdmFyIHBhcmVudCA9IE1hdGguZmxvb3IoKHBvcyAtIDEpIC8gMik7XG4gICAgICAgICAgICBpZiAoY29tcGFyZShkYXRhW3Bvc10sIGRhdGFbcGFyZW50XSkgPCAwKSB7XG4gICAgICAgICAgICAgICAgc3dhcChkYXRhLCBwYXJlbnQsIHBvcyk7XG4gICAgICAgICAgICAgICAgcG9zID0gcGFyZW50O1xuXG4gICAgICAgICAgICB9IGVsc2UgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgX2Rvd246IGZ1bmN0aW9uIChwb3MpIHtcbiAgICAgICAgdmFyIGRhdGEgPSB0aGlzLmRhdGEsXG4gICAgICAgICAgICBjb21wYXJlID0gdGhpcy5jb21wYXJlLFxuICAgICAgICAgICAgbGVuID0gdGhpcy5sZW5ndGg7XG5cbiAgICAgICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgIHZhciBsZWZ0ID0gMiAqIHBvcyArIDEsXG4gICAgICAgICAgICAgICAgcmlnaHQgPSBsZWZ0ICsgMSxcbiAgICAgICAgICAgICAgICBtaW4gPSBwb3M7XG5cbiAgICAgICAgICAgIGlmIChsZWZ0IDwgbGVuICYmIGNvbXBhcmUoZGF0YVtsZWZ0XSwgZGF0YVttaW5dKSA8IDApIG1pbiA9IGxlZnQ7XG4gICAgICAgICAgICBpZiAocmlnaHQgPCBsZW4gJiYgY29tcGFyZShkYXRhW3JpZ2h0XSwgZGF0YVttaW5dKSA8IDApIG1pbiA9IHJpZ2h0O1xuXG4gICAgICAgICAgICBpZiAobWluID09PSBwb3MpIHJldHVybjtcblxuICAgICAgICAgICAgc3dhcChkYXRhLCBtaW4sIHBvcyk7XG4gICAgICAgICAgICBwb3MgPSBtaW47XG4gICAgICAgIH1cbiAgICB9XG59O1xuXG5mdW5jdGlvbiBzd2FwKGRhdGEsIGksIGopIHtcbiAgICB2YXIgdG1wID0gZGF0YVtpXTtcbiAgICBkYXRhW2ldID0gZGF0YV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1pbk5vZGUoKTtcblxuICAgICAgaWYgKHByZXYgIT09IGJlZ2luKSBwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldik7XG4gICAgICBlbHNlICAgICAgICAgICAgICAgIHByZXYgPSBudWxsO1xuXG4gICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG5cbiAgICAgIHZhciBwcmV2RXZlbnQgPSBwcmV2ID8gcHJldi5rZXkgOiBudWxsO1xuICAgICAgdmFyIHByZXZwcmV2RXZlbnQ7XG4gICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICBpZiAobmV4dCkge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKHByZXYpIHtcbiAgICAgICAgaWYgKHBvc3NpYmxlSW50ZXJzZWN0aW9uKHByZXYua2V5LCBldmVudCwgZXZlbnRRdWV1ZSkgPT09IDIpIHtcbiAgICAgICAgICB2YXIgcHJldnByZXYgPSBwcmV2O1xuICAgICAgICAgIGlmIChwcmV2cHJldiAhPT0gYmVnaW4pIHByZXZwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldnByZXYpO1xuICAgICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgIHByZXZwcmV2ID0gbnVsbDtcblxuICAgICAgICAgIHByZXZwcmV2RXZlbnQgPSBwcmV2cHJldiA/IHByZXZwcmV2LmtleSA6IG51bGw7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhwcmV2RXZlbnQsIHByZXZwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgICAgIHByZXZFdmVudCwgICAgIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZXZlbnQgPSBldmVudC5vdGhlckV2ZW50O1xuICAgICAgbmV4dCA9IHByZXYgPSBzd2VlcExpbmUuZmluZChldmVudCk7XG5cbiAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgIGlmIChwcmV2ICYmIG5leHQpIHtcblxuICAgICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgICAgZWxzZSAgICAgICAgICAgICAgICBwcmV2ID0gbnVsbDtcblxuICAgICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG4gICAgICAgIHN3ZWVwTGluZS5yZW1vdmUoZXZlbnQpO1xuXG4gICAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgICAgaWYgKG5leHQgJiYgcHJldikge1xuICAgICAgICAgIC8vaWYgKHR5cGVvZiBwcmV2ICE9PSAndW5kZWZpbmVkJyAmJiB0eXBlb2YgbmV4dCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICBwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgbmV4dC5rZXksIGV2ZW50UXVldWUpO1xuICAgICAgICAgIC8vfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiBzb3J0ZWRFdmVudHM7XG59O1xuXG5cbi8qIGVzbGludC1kaXNhYmxlIG5vLXVudXNlZC12YXJzLCBuby1kZWJ1Z2dlciwgbm8tdW5kZWYgK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uY3Rpb24gKHApIHtcbiAgICB2YXIgcDAgPSB0aGlzLnBvaW50LCBwMSA9IHRoaXMub3RoZXJFdmVudC5wb2ludDtcbiAgICByZXR1cm4gdGhpcy5sZWZ0ID9cbiAgICAgIChwMFswXSAtIHBbMF0pICogKHAxWzFdIC0gcFsxXSkgLSAocDFbMF0gLSBwWzBdKSAqIChwMFsxXSAtIHBbMV0pID4gMCA6XG4gICAgICAvLyBzaWduZWRBcmVhKHRoaXMucG9pbnQsIHRoaXMub3RoZXJFdmVudC5wb2ludCwgcCkgPiAwIDpcbiAgICAgIChwMVswXSAtIHBbMF0pICogKHAwWzFdIC0gcFsxXSkgLSAocDBbMF0gLSBwWzBdKSAqIChwMVsxXSAtIHBbMV0pID4gMDtcbiAgICAgIC8vc2lnbmVkQXJlYSh0aGlzLm90aGVyRXZlbnQucG9pbnQsIHRoaXMucG9pbnQsIHApID4gMDtcbiAgfSxcblxuXG4gIC8qKlxuICAgKiBAcGFyYW0gIHtBcnJheS48TnVtYmVyPn0gIHBcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzQWJvdmU6IGZ1bmN0aW9uIChwKSB7XG4gICAgcmV0dXJuICF0aGlzLmlzQmVsb3cocCk7XG4gIH0sXG5cblxuICAvKipcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzVmVydGljYWw6IGZ1bmN0aW9uICgpIHtcbiAgICByZXR1cm4gdGhpcy5wb2ludFswXSA9PT0gdGhpcy5vdGhlckV2ZW50LnBvaW50WzBdO1xuICB9XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IFN3ZWVwRXZlbnQ7XG4iXX0= diff --git a/demo/js/index.js b/demo/js/index.js index 41e804e..b1ef5b8 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -33,6 +33,9 @@ switch (mode) { case 'triangles': file = 'two_pointed_triangles.geojson'; break; + case 'holecut': + file = 'hole_cut.geojson'; + break; default: file = 'hole_hole.geojson'; break; diff --git a/test/divide_segment.test.js b/test/divide_segment.test.js index 0d81345..b9278bd 100644 --- a/test/divide_segment.test.js +++ b/test/divide_segment.test.js @@ -6,7 +6,7 @@ var Queue = require('tinyqueue'); var load = require('load-json-file'); var martinez = require('../src/'); var SweepEvent = require('../src/sweep_event'); -var compareEvents = require('../src/compare_events').compare; +var compareEvents = require('../src/compare_events'); var intersection = require('../src/segment_intersection'); var equals = require('../src/equals'); var fillQueue = require('../src/fill_queue'); @@ -63,21 +63,22 @@ tap.test('divide segments', function (main) { t.equals(possibleIntersection(se1, se2, q), 1); t.equals(q.length, 4); - var e = q.pop(); - t.strictSame(e.point, [100.79403384562251, 233.41363754101192]); - t.strictSame(e.otherEvent.point, [153, 203.5]); e = q.pop(); t.strictSame(e.point, [100.79403384562251, 233.41363754101192]); - t.strictSame(e.otherEvent.point, [56, 181]); + t.strictSame(e.otherEvent.point, [56, 181], '1'); e = q.pop(); t.strictSame(e.point, [100.79403384562251, 233.41363754101192]); - t.strictSame(e.otherEvent.point, [153, 294.5]); + t.strictSame(e.otherEvent.point, [16, 282], '2'); + + var e = q.pop(); + t.strictSame(e.point, [100.79403384562251, 233.41363754101192]); + t.strictSame(e.otherEvent.point, [153, 203.5], '3'); e = q.pop(); t.strictSame(e.point, [100.79403384562251, 233.41363754101192]); - t.strictSame(e.otherEvent.point, [16, 282]); + t.strictSame(e.otherEvent.point, [153, 294.5], '4'); t.end(); }); diff --git a/test/fixtures/hole_cut.geojson b/test/fixtures/hole_cut.geojson new file mode 100644 index 0000000..6e244b6 --- /dev/null +++ b/test/fixtures/hole_cut.geojson @@ -0,0 +1,44 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [6.399999999999977, -552], + [49.60000000000002, 19.200000000000045], + [748.8, 28.799999999999955], + [774.3999999999999, -574.4], + [6.399999999999977, -552] + ], + [ + [227.2, -441.6], + [228.8, -283.19999999999993], + [430.40000000000003, -289.6], + [428.8, -448], + [227.2, -441.6] + ] +] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [344,-211.2], + [344,-123.2], + [552,-121.6], + [547.2,-216], + [344,-211.2] + ] +] + } + } + ] +} From 60a5614ba2f4bca8ef92d56fb66e718d2ed57262 Mon Sep 17 00:00:00 2001 From: oeh-rowanwinsemius Date: Thu, 26 Oct 2017 13:01:23 +1100 Subject: [PATCH 20/42] Another fix hole_hole.geojson now working again. --- demo/js/bundle.js | 2805 ++++++++++---------- demo/js/index.js | 5 +- src/connect_edges.js | 2 +- test/featureTypes.js | 17 +- test/fixtures/overlapping_segments.geojson | 22 + 5 files changed, 1444 insertions(+), 1407 deletions(-) create mode 100644 test/fixtures/overlapping_segments.geojson diff --git a/demo/js/bundle.js b/demo/js/bundle.js index b514977..e6a922e 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -1,304 +1,307 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o', - '
    ', - '
  • ','', '
  • ', - '
  • ','', '
  • ', - '
  • ','', '
  • ', - '
  • ','', '
  • ', - '
', - '', '', - ''].join(''); - var form = container.querySelector('form'); - L.DomEvent - .on(form, 'submit', function (evt) { - L.DomEvent.stop(evt); - var radios = Array.prototype.slice.call( - form.querySelectorAll('input[type=radio]')); - for (var i = 0, len = radios.length; i < len; i++) { - if (radios[i].checked) { - this.options.callback(parseInt(radios[i].value)); - break; - } - } - }, this) - .on(form['clear'], 'click', function(evt) { - L.DomEvent.stop(evt); - this.options.clear(); - }, this); - - L.DomEvent - .disableClickPropagation(this._container) - .disableScrollPropagation(this._container); - return this._container; - } - +L.BooleanControl = L.Control.extend({ + options: { + position: 'topright' + }, + + onAdd: function(map) { + var container = this._container = L.DomUtil.create('div', 'leaflet-bar'); + this._container.style.background = '#ffffff'; + this._container.style.padding = '10px'; + container.innerHTML = [ + '
', + '
    ', + '
  • ','', '
  • ', + '
  • ','', '
  • ', + '
  • ','', '
  • ', + '
  • ','', '
  • ', + '
', + '', '', + '
'].join(''); + var form = container.querySelector('form'); + L.DomEvent + .on(form, 'submit', function (evt) { + L.DomEvent.stop(evt); + var radios = Array.prototype.slice.call( + form.querySelectorAll('input[type=radio]')); + for (var i = 0, len = radios.length; i < len; i++) { + if (radios[i].checked) { + this.options.callback(parseInt(radios[i].value)); + break; + } + } + }, this) + .on(form['clear'], 'click', function(evt) { + L.DomEvent.stop(evt); + this.options.clear(); + }, this); + + L.DomEvent + .disableClickPropagation(this._container) + .disableScrollPropagation(this._container); + return this._container; + } + }); },{}],2:[function(require,module,exports){ -L.Coordinates = L.Control.extend({ - options: { - position: 'bottomright' - }, - - onAdd: function(map) { - this._container = L.DomUtil.create('div', 'leaflet-bar'); - this._container.style.background = '#ffffff'; - map.on('mousemove', this._onMouseMove, this); - return this._container; - }, - - _onMouseMove: function(e) { - this._container.innerHTML = '' + - e.latlng.lng.toFixed(3) + ', ' + e.latlng.lat.toFixed(3) + ''; - } - +L.Coordinates = L.Control.extend({ + options: { + position: 'bottomright' + }, + + onAdd: function(map) { + this._container = L.DomUtil.create('div', 'leaflet-bar'); + this._container.style.background = '#ffffff'; + map.on('mousemove', this._onMouseMove, this); + return this._container; + }, + + _onMouseMove: function(e) { + this._container.innerHTML = '' + + e.latlng.lng.toFixed(3) + ', ' + e.latlng.lat.toFixed(3) + ''; + } + }); },{}],3:[function(require,module,exports){ -require('./coordinates'); -require('./polygoncontrol'); -require('./booleanopcontrol'); -var martinez = window.martinez = require('../../'); -//var martinez = require('../../dist/martinez.min'); -var xhr = require('superagent'); -var mode = window.location.hash.substring(1); -var path = '../test/fixtures/'; -var file; - -switch (mode) { - case 'geo': - file = 'asia.geojson'; - break; - case 'trapezoid': - file = 'trapezoid-box.geojson'; - break; - case 'canada': - file = 'canada.geojson'; - break; - case 'horseshoe': - file = 'horseshoe.geojson'; - break; - case 'hourglasses': - file = 'hourglasses.geojson'; - break; - case 'edge_overlap': - file = 'polygon_trapezoid_edge_overlap.geojson'; - break; - case 'touching': - file = 'touching_boxes.geojson'; - break; - case 'triangles': - file = 'two_pointed_triangles.geojson'; - break; - case 'holecut': - file = 'hole_cut.geojson'; - break; - default: - file = 'hole_hole.geojson'; - break; -} - -console.log(mode); - - -var OPERATIONS = { - INTERSECTION: 0, - UNION: 1, - DIFFERENCE: 2, - XOR: 3 -}; - -var div = document.createElement('div'); -div.id = 'image-map'; -div.style.width = div.style.height = '100%'; -document.body.appendChild(div); - -// create the slippy map -var map = window.map = L.map('image-map', { - minZoom: 1, - maxZoom: 20, - center: [0, 0], - zoom: 2, - crs: mode === 'geo' ? L.CRS.EPSG4326 : L.extend({}, L.CRS.Simple, { - transformation: new L.Transformation(0.5, 0, -0.5, 0) - }), - editable: true -}); - -map.addControl(new L.NewPolygonControl({ - callback: map.editTools.startPolygon -})); -map.addControl(new L.Coordinates()); -map.addControl(new L.BooleanControl({ - callback: run, - clear: clear -})); - -var drawnItems = window.drawnItems = L.geoJson().addTo(map); - -function loadData(path) { - console.log(path); - // var two_triangles = require('../../test/fixtures/two_shapes.geojson'); - // var oneInside = require('../../test/fixtures/one_inside.geojson'); - // var twoPointedTriangles = require('../../test/fixtures/two_pointed_triangles.geojson'); - // var selfIntersecting = require('../../test/fixtures/self_intersecting.geojson'); - // var holes = require('../../test/fixtures/hole_hole.geojson'); - //var data = require('../../test/fixtures/indonesia.geojson'); - xhr - .get(path) - .accept('json') - .end(function(e, r) { - if (!e) { - drawnItems.addData(JSON.parse(r.text)); - map.fitBounds(drawnItems.getBounds().pad(0.05), { animate: false }); - } - }); -} - -function clear() { - drawnItems.clearLayers(); - results.clearLayers(); -} - -var reader = new jsts.io.GeoJSONReader(); -var writer = new jsts.io.GeoJSONWriter(); - -function run (op) { - var layers = drawnItems.getLayers(); - if (layers.length < 2) return; - var subject = layers[0].toGeoJSON(); - var clipping = layers[1].toGeoJSON(); - - console.log('input', subject, clipping, op); - - subject = JSON.parse(JSON.stringify(subject)); - clipping = JSON.parse(JSON.stringify(clipping)); - - var operation; - if (op === OPERATIONS.INTERSECTION) { - operation = martinez.intersection; - } else if (op === OPERATIONS.UNION) { - operation = martinez.union; - } else if (op === OPERATIONS.DIFFERENCE) { - operation = martinez.diff; - } else { - operation = martinez.xor; - } - - console.time('martinez'); - var result = operation(subject.geometry.coordinates, clipping.geometry.coordinates); - console.timeEnd('martinez'); - - //if (op === OPERATIONS.UNION) result = result[0]; - console.log('result', result); - - results.clearLayers(); - results.addData({ - 'type': 'Feature', - 'geometry': { - 'type': 'MultiPolygon', - 'coordinates': result - } - }); - - setTimeout(function() { - console.time('jsts'); - var s = reader.read(subject); - var c = reader.read(clipping); - var res; - if (op === OPERATIONS.INTERSECTION) { - res = s.geometry.intersection(c.geometry); - } else if (op === OPERATIONS.UNION) { - res = s.geometry.union(c.geometry); - } else if (op === OPERATIONS.DIFFERENCE) { - res = s.geometry.difference(c.geometry); - } else { - res = s.geometry.symDifference(c.geometry); - } - res = writer.write(res); - console.timeEnd('jsts'); - }, 500); -} - -//drawnItems.addData(oneInside); -//drawnItems.addData(twoPointedTriangles); -//drawnItems.addData(selfIntersecting); -//drawnItems.addData(holes); -//drawnItems.addData(data); - -map.on('editable:created', function(evt) { - drawnItems.addLayer(evt.layer); - evt.layer.on('click', function(e) { - if ((e.originalEvent.ctrlKey || e.originalEvent.metaKey) && this.editEnabled()) { - this.editor.newHole(e.latlng); - } - }); -}); - -var results = window.results = L.geoJson(null, { - style: function(feature) { - return { - color: 'red', - weight: 1 - }; - } -}).addTo(map); - -loadData(path + file); +require('./coordinates'); +require('./polygoncontrol'); +require('./booleanopcontrol'); +var martinez = window.martinez = require('../../'); +//var martinez = require('../../dist/martinez.min'); +var xhr = require('superagent'); +var mode = window.location.hash.substring(1); +var path = '../test/fixtures/'; +var file; + +switch (mode) { + case 'geo': + file = 'asia.geojson'; + break; + case 'trapezoid': + file = 'trapezoid-box.geojson'; + break; + case 'canada': + file = 'canada.geojson'; + break; + case 'horseshoe': + file = 'horseshoe.geojson'; + break; + case 'hourglasses': + file = 'hourglasses.geojson'; + break; + case 'edge_overlap': + file = 'polygon_trapezoid_edge_overlap.geojson'; + break; + case 'touching': + file = 'touching_boxes.geojson'; + break; + case 'triangles': + file = 'two_pointed_triangles.geojson'; + break; + case 'holecut': + file = 'hole_cut.geojson'; + break; + case 'overlapping_segments': + file = 'overlapping_segments.geojson'; + break; + default: + file = 'hole_hole.geojson'; + break; +} + +console.log(mode); + + +var OPERATIONS = { + INTERSECTION: 0, + UNION: 1, + DIFFERENCE: 2, + XOR: 3 +}; + +var div = document.createElement('div'); +div.id = 'image-map'; +div.style.width = div.style.height = '100%'; +document.body.appendChild(div); + +// create the slippy map +var map = window.map = L.map('image-map', { + minZoom: 1, + maxZoom: 20, + center: [0, 0], + zoom: 2, + crs: mode === 'geo' ? L.CRS.EPSG4326 : L.extend({}, L.CRS.Simple, { + transformation: new L.Transformation(0.5, 0, -0.5, 0) + }), + editable: true +}); + +map.addControl(new L.NewPolygonControl({ + callback: map.editTools.startPolygon +})); +map.addControl(new L.Coordinates()); +map.addControl(new L.BooleanControl({ + callback: run, + clear: clear +})); + +var drawnItems = window.drawnItems = L.geoJson().addTo(map); + +function loadData(path) { + console.log(path); + // var two_triangles = require('../../test/fixtures/two_shapes.geojson'); + // var oneInside = require('../../test/fixtures/one_inside.geojson'); + // var twoPointedTriangles = require('../../test/fixtures/two_pointed_triangles.geojson'); + // var selfIntersecting = require('../../test/fixtures/self_intersecting.geojson'); + // var holes = require('../../test/fixtures/hole_hole.geojson'); + //var data = require('../../test/fixtures/indonesia.geojson'); + xhr + .get(path) + .accept('json') + .end(function(e, r) { + if (!e) { + drawnItems.addData(JSON.parse(r.text)); + map.fitBounds(drawnItems.getBounds().pad(0.05), { animate: false }); + } + }); +} + +function clear() { + drawnItems.clearLayers(); + results.clearLayers(); +} + +var reader = new jsts.io.GeoJSONReader(); +var writer = new jsts.io.GeoJSONWriter(); + +function run (op) { + var layers = drawnItems.getLayers(); + if (layers.length < 2) return; + var subject = layers[0].toGeoJSON(); + var clipping = layers[1].toGeoJSON(); + + console.log('input', subject, clipping, op); + + subject = JSON.parse(JSON.stringify(subject)); + clipping = JSON.parse(JSON.stringify(clipping)); + + var operation; + if (op === OPERATIONS.INTERSECTION) { + operation = martinez.intersection; + } else if (op === OPERATIONS.UNION) { + operation = martinez.union; + } else if (op === OPERATIONS.DIFFERENCE) { + operation = martinez.diff; + } else { + operation = martinez.xor; + } + + console.time('martinez'); + var result = operation(subject.geometry.coordinates, clipping.geometry.coordinates); + console.timeEnd('martinez'); + + //if (op === OPERATIONS.UNION) result = result[0]; + console.log('result', result); + console.log(JSON.stringify(result)) + results.clearLayers(); + results.addData({ + 'type': 'Feature', + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': result + } + }); + + setTimeout(function() { + console.time('jsts'); + var s = reader.read(subject); + var c = reader.read(clipping); + var res; + if (op === OPERATIONS.INTERSECTION) { + res = s.geometry.intersection(c.geometry); + } else if (op === OPERATIONS.UNION) { + res = s.geometry.union(c.geometry); + } else if (op === OPERATIONS.DIFFERENCE) { + res = s.geometry.difference(c.geometry); + } else { + res = s.geometry.symDifference(c.geometry); + } + res = writer.write(res); + console.timeEnd('jsts'); + }, 500); +} + +//drawnItems.addData(oneInside); +//drawnItems.addData(twoPointedTriangles); +//drawnItems.addData(selfIntersecting); +//drawnItems.addData(holes); +//drawnItems.addData(data); + +map.on('editable:created', function(evt) { + drawnItems.addLayer(evt.layer); + evt.layer.on('click', function(e) { + if ((e.originalEvent.ctrlKey || e.originalEvent.metaKey) && this.editEnabled()) { + this.editor.newHole(e.latlng); + } + }); +}); + +var results = window.results = L.geoJson(null, { + style: function(feature) { + return { + color: 'red', + weight: 1 + }; + } +}).addTo(map); + +loadData(path + file); },{"../../":5,"./booleanopcontrol":1,"./coordinates":2,"./polygoncontrol":4,"superagent":8}],4:[function(require,module,exports){ -L.EditControl = L.Control.extend({ - - options: { - position: 'topleft', - callback: null, - kind: '', - html: '' - }, - - onAdd: function (map) { - var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'), - link = L.DomUtil.create('a', '', container); - - link.href = '#'; - link.title = 'Create a new ' + this.options.kind; - link.innerHTML = this.options.html; - L.DomEvent.on(link, 'click', L.DomEvent.stop) - .on(link, 'click', function () { - window.LAYER = this.options.callback.call(map.editTools); - }, this); - - return container; - } - -}); - -L.NewPolygonControl = L.EditControl.extend({ - options: { - position: 'topleft', - kind: 'polygon', - html: 'â–°' - } +L.EditControl = L.Control.extend({ + + options: { + position: 'topleft', + callback: null, + kind: '', + html: '' + }, + + onAdd: function (map) { + var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'), + link = L.DomUtil.create('a', '', container); + + link.href = '#'; + link.title = 'Create a new ' + this.options.kind; + link.innerHTML = this.options.html; + L.DomEvent.on(link, 'click', L.DomEvent.stop) + .on(link, 'click', function () { + window.LAYER = this.options.callback.call(map.editTools); + }, this); + + return container; + } + +}); + +L.NewPolygonControl = L.EditControl.extend({ + options: { + position: 'topleft', + kind: 'polygon', + html: 'â–°' + } }); },{}],5:[function(require,module,exports){ -'use strict'; - -var martinez = require('./src/index'); - -module.exports = { - union: martinez.union, - diff: martinez.diff, - xor: martinez.xor, - intersection: martinez.intersection -}; +'use strict'; + +var martinez = require('./src/index'); + +module.exports = { + union: martinez.union, + diff: martinez.diff, + xor: martinez.xor, + intersection: martinez.intersection +}; },{"./src/index":21}],6:[function(require,module,exports){ (function (global, factory) { @@ -2673,1134 +2676,1134 @@ function swap(data, i, j) { } },{}],13:[function(require,module,exports){ -'use strict'; - -var signedArea = require('./signed_area'); -// var equals = require('./equals'); - -/** - * @param {SweepEvent} e1 - * @param {SweepEvent} e2 - * @return {Number} - */ -module.exports = function compareEvents(e1, e2) { - var p1 = e1.point; - var p2 = e2.point; - - // Different x-coordinate - if (p1[0] > p2[0]) return 1; - if (p1[0] < p2[0]) return -1; - - // Different points, but same x-coordinate - // Event with lower y-coordinate is processed first - if (p1[1] !== p2[1]) return p1[1] > p2[1] ? 1 : -1; - - return specialCases(e1, e2, p1, p2); -}; - - -/* eslint-disable no-unused-vars */ -function specialCases(e1, e2, p1, p2) { - // Same coordinates, but one is a left endpoint and the other is - // a right endpoint. The right endpoint is processed first - if (e1.left !== e2.left) - return e1.left ? 1 : -1; - - // var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; - // var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) - // Same coordinates, both events - // are left endpoints or right endpoints. - // not collinear - if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) { - // the event associate to the bottom segment is processed first - return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; - } - - // uncomment this if you want to play with multipolygons - // if (e1.isSubject === e2.isSubject) { - // if(equals(e1.point, e2.point) && e1.contourId === e2.contourId) { - // return 0; - // } else { - // return e1.contourId > e2.contourId ? 1 : -1; - // } - // } - - return (!e1.isSubject && e2.isSubject) ? 1 : -1; -} -/* eslint-enable no-unused-vars */ +'use strict'; + +var signedArea = require('./signed_area'); +// var equals = require('./equals'); + +/** + * @param {SweepEvent} e1 + * @param {SweepEvent} e2 + * @return {Number} + */ +module.exports = function compareEvents(e1, e2) { + var p1 = e1.point; + var p2 = e2.point; + + // Different x-coordinate + if (p1[0] > p2[0]) return 1; + if (p1[0] < p2[0]) return -1; + + // Different points, but same x-coordinate + // Event with lower y-coordinate is processed first + if (p1[1] !== p2[1]) return p1[1] > p2[1] ? 1 : -1; + + return specialCases(e1, e2, p1, p2); +}; + + +/* eslint-disable no-unused-vars */ +function specialCases(e1, e2, p1, p2) { + // Same coordinates, but one is a left endpoint and the other is + // a right endpoint. The right endpoint is processed first + if (e1.left !== e2.left) + return e1.left ? 1 : -1; + + // var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; + // var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) + // Same coordinates, both events + // are left endpoints or right endpoints. + // not collinear + if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) { + // the event associate to the bottom segment is processed first + return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; + } + + // uncomment this if you want to play with multipolygons + // if (e1.isSubject === e2.isSubject) { + // if(equals(e1.point, e2.point) && e1.contourId === e2.contourId) { + // return 0; + // } else { + // return e1.contourId > e2.contourId ? 1 : -1; + // } + // } + + return (!e1.isSubject && e2.isSubject) ? 1 : -1; +} +/* eslint-enable no-unused-vars */ },{"./signed_area":25}],14:[function(require,module,exports){ -'use strict'; - -var signedArea = require('./signed_area'); -var compareEvents = require('./compare_events'); -var equals = require('./equals'); - +'use strict'; + +var signedArea = require('./signed_area'); +var compareEvents = require('./compare_events'); +var equals = require('./equals'); + + +/** + * @param {SweepEvent} le1 + * @param {SweepEvent} le2 + * @return {Number} + */ +module.exports = function compareSegments(le1, le2) { + if (le1 === le2) return 0; + + // Segments are not collinear + if (signedArea(le1.point, le1.otherEvent.point, le2.point) !== 0 || + signedArea(le1.point, le1.otherEvent.point, le2.otherEvent.point) !== 0) { + + // If they share their left endpoint use the right endpoint to sort + if (equals(le1.point, le2.point)) return le1.isBelow(le2.otherEvent.point) ? -1 : 1; + + // Different left endpoint: use the left endpoint to sort + if (le1.point[0] === le2.point[0]) return le1.point[1] < le2.point[1] ? -1 : 1; + + // has the line segment associated to e1 been inserted + // into S after the line segment associated to e2 ? + if (compareEvents(le1, le2) === 1) return le2.isAbove(le1.point) ? -1 : 1; + + // The line segment associated to e2 has been inserted + // into S after the line segment associated to e1 + return le1.isBelow(le2.point) ? -1 : 1; + } + + if (le1.isSubject === le2.isSubject) { // same polygon + var p1 = le1.point, p2 = le2.point; + if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) { + p1 = le1.otherEvent.point; p2 = le2.otherEvent.point; + if (p1[0] === p2[0] && p1[1] === p2[1]) return 0; + else return le1.contourId > le2.contourId ? 1 : -1; + } + } else { // Segments are collinear, but belong to separate polygons + return le1.isSubject ? -1 : 1; + } + + return compareEvents(le1, le2) === 1 ? 1 : -1; +}; -/** - * @param {SweepEvent} le1 - * @param {SweepEvent} le2 - * @return {Number} - */ -module.exports = function compareSegments(le1, le2) { - if (le1 === le2) return 0; +},{"./compare_events":13,"./equals":19,"./signed_area":25}],15:[function(require,module,exports){ +'use strict'; + +var edgeType = require('./edge_type'); + +var INTERSECTION = 0; +var UNION = 1; +var DIFFERENCE = 2; +var XOR = 3; + +/** + * @param {SweepEvent} event + * @param {SweepEvent} prev + * @param {Operation} operation + */ +module.exports = function computeFields(event, prev, operation) { + // compute inOut and otherInOut fields + if (prev === null) { + event.inOut = false; + event.otherInOut = true; + + // previous line segment in sweepline belongs to the same polygon + } else { + if (event.isSubject === prev.isSubject) { + event.inOut = !prev.inOut; + event.otherInOut = prev.otherInOut; + + // previous line segment in sweepline belongs to the clipping polygon + } else { + event.inOut = !prev.otherInOut; + event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut; + } + + // compute prevInResult field + if (prev) { + event.prevInResult = (!inResult(prev, operation) || prev.isVertical()) ? + prev.prevInResult : prev; + } + } + + // check if the line segment belongs to the Boolean operation + event.inResult = inResult(event, operation); +}; + + +function inResult(event, operation) { + switch (event.type) { + case edgeType.NORMAL: + switch (operation) { + case INTERSECTION: + return !event.otherInOut; + case UNION: + return event.otherInOut; + case DIFFERENCE: + return (event.isSubject && event.otherInOut) || + (!event.isSubject && !event.otherInOut); + case XOR: + return true; + } + break; + case edgeType.SAME_TRANSITION: + return operation === INTERSECTION || operation === UNION; + case edgeType.DIFFERENT_TRANSITION: + return operation === DIFFERENCE; + case edgeType.NON_CONTRIBUTING: + return false; + } + return false; +} - // Segments are not collinear - if (signedArea(le1.point, le1.otherEvent.point, le2.point) !== 0 || - signedArea(le1.point, le1.otherEvent.point, le2.otherEvent.point) !== 0) { +},{"./edge_type":18}],16:[function(require,module,exports){ +'use strict'; + +// var equals = require('./equals'); +var compareEvents = require('./compare_events'); +var operationType = require('./operation'); + +/** + * @param {Array.} sortedEvents + * @return {Array.} + */ +function orderEvents(sortedEvents) { + var event, i, len, tmp; + var resultEvents = []; + for (i = 0, len = sortedEvents.length; i < len; i++) { + event = sortedEvents[i]; + if ((event.left && event.inResult) || + (!event.left && event.otherEvent.inResult)) { + resultEvents.push(event); + } + } + + // Due to overlapping edges the resultEvents array can be not wholly sorted + var sorted = false; + while (!sorted) { + sorted = true; + for (i = 0, len = resultEvents.length; i < len; i++) { + if ((i + 1) < len && + compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) { + tmp = resultEvents[i]; + resultEvents[i] = resultEvents[i + 1]; + resultEvents[i + 1] = tmp; + sorted = false; + } + } + } + + for (i = 0, len = resultEvents.length; i < len; i++) { + resultEvents[i].pos = i; + } + + for (i = 0, len = resultEvents.length; i < len; i++) { + event = resultEvents[i]; + if (!event.left) { + tmp = event.pos; + event.pos = event.otherEvent.pos; + event.otherEvent.pos = tmp; + } + } + + return resultEvents; +} + + +/** + * @param {Number} pos + * @param {Array.} resultEvents + * @param {Object>} processed + * @return {Number} + */ +function nextPos(pos, resultEvents, processed, origIndex) { + var newPos = pos + 1; + var length = resultEvents.length; + var p = resultEvents[pos].point; + var p1 = resultEvents[newPos].point; + + // if (newPos < length && + // p1[0] !== p[0] || p1[1] !== p[1] && + // !processed[newPos]) return newPos; + // else return pos - 1; + + + // while in range and not the current one by value + while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { + if (!processed[newPos]) { + // console.log(pos, newPos, length); + return newPos; + } else newPos++; + p1 = resultEvents[newPos].point; + } + + newPos = pos - 1; + + while (processed[newPos] && newPos >= origIndex) { + newPos--; + } + // console.log('other', pos, newPos, length); + return newPos; +} + + +/** + * @param {Array.} sortedEvents + * @return {Array.<*>} polygons + */ +module.exports = function (sortedEvents, operation) { + var i, len; + var resultEvents = orderEvents(sortedEvents); + + // "false"-filled array + var processed = {}; + var result = []; + var event; + + for (i = 0, len = resultEvents.length; i < len; i++) { + if (processed[i]) continue; + var contour = [[]]; + + if (!resultEvents[i].isExteriorRing) { + if (result.length === 0) { + result.push([[contour]]); + } else if (operation === operationType.UNION || operation === operationType.XOR) { + result[result.length - 1].push(contour[0]); + } else { + result[result.length - 1].push(contour); + } + } else { + result.push(contour); + } + + var ringId = result.length - 1; + var pos = i; + + var initial = resultEvents[i].point; + // initial.push(resultEvents[i].isExteriorRing); + contour[0].push(initial); + + while (pos >= i) { + event = resultEvents[pos]; + processed[pos] = true; + + if (event.left) { + event.resultInOut = false; + event.contourId = ringId; + } else { + event.otherEvent.resultInOut = true; + event.otherEvent.contourId = ringId; + } + + pos = event.pos; + processed[pos] = true; + // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); + + contour[0].push(resultEvents[pos].point); + pos = nextPos(pos, resultEvents, processed, i); + } + + pos = pos === -1 ? i : pos; + + event = resultEvents[pos]; + processed[pos] = processed[event.pos] = true; + event.otherEvent.resultInOut = true; + event.otherEvent.contourId = ringId; + } + + for (i = 0, len = result.length; i < len; i++) { + var polygon = result[i]; + for (var j = 0, jj = polygon.length; j < jj; j++) { + var polygonContour = polygon[j]; + for (var k = 0, kk = polygonContour.length; k < kk; k++) { + var coords = polygonContour[k]; + if (typeof coords[0] !== 'number') { + polygon.push(coords[0]); + polygon.splice(j, 1); + } + } + } + } + + // Handle if the result is a polygon (eg not multipoly) + // Commented it again, let's see what do we mean by that + // if (result.length === 1) result = result[0]; + return result; +}; - // If they share their left endpoint use the right endpoint to sort - if (equals(le1.point, le2.point)) return le1.isBelow(le2.otherEvent.point) ? -1 : 1; +},{"./compare_events":13,"./operation":22}],17:[function(require,module,exports){ +'use strict'; + +var SweepEvent = require('./sweep_event'); +var equals = require('./equals'); +var compareEvents = require('./compare_events'); + +/** + * @param {SweepEvent} se + * @param {Array.} p + * @param {Queue} queue + * @return {Queue} + */ +module.exports = function divideSegment(se, p, queue) { + var r = new SweepEvent(p, false, se, se.isSubject); + var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); + + if (equals(se.point, se.otherEvent.point)) { + console.warn('what is that?', se); + } + + r.contourId = l.contourId = se.contourId; + + // avoid a rounding error. The left event would be processed after the right event + if (compareEvents(l, se.otherEvent) > 0) { + se.otherEvent.left = true; + l.left = false; + } + + // avoid a rounding error. The left event would be processed after the right event + // if (compareEvents(se, r) > 0) {} + + se.otherEvent.otherEvent = l; + se.otherEvent = r; + + queue.push(l); + queue.push(r); + + return queue; +}; - // Different left endpoint: use the left endpoint to sort - if (le1.point[0] === le2.point[0]) return le1.point[1] < le2.point[1] ? -1 : 1; - - // has the line segment associated to e1 been inserted - // into S after the line segment associated to e2 ? - if (compareEvents(le1, le2) === 1) return le2.isAbove(le1.point) ? -1 : 1; - - // The line segment associated to e2 has been inserted - // into S after the line segment associated to e1 - return le1.isBelow(le2.point) ? -1 : 1; - } - - if (le1.isSubject === le2.isSubject) { // same polygon - var p1 = le1.point, p2 = le2.point; - if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) { - p1 = le1.otherEvent.point; p2 = le2.otherEvent.point; - if (p1[0] === p2[0] && p1[1] === p2[1]) return 0; - else return le1.contourId > le2.contourId ? 1 : -1; - } - } else { // Segments are collinear, but belong to separate polygons - return le1.isSubject ? -1 : 1; - } - - return compareEvents(le1, le2) === 1 ? 1 : -1; -}; - -},{"./compare_events":13,"./equals":19,"./signed_area":25}],15:[function(require,module,exports){ -'use strict'; - -var edgeType = require('./edge_type'); - -var INTERSECTION = 0; -var UNION = 1; -var DIFFERENCE = 2; -var XOR = 3; - -/** - * @param {SweepEvent} event - * @param {SweepEvent} prev - * @param {Operation} operation - */ -module.exports = function computeFields(event, prev, operation) { - // compute inOut and otherInOut fields - if (prev === null) { - event.inOut = false; - event.otherInOut = true; - - // previous line segment in sweepline belongs to the same polygon - } else { - if (event.isSubject === prev.isSubject) { - event.inOut = !prev.inOut; - event.otherInOut = prev.otherInOut; - - // previous line segment in sweepline belongs to the clipping polygon - } else { - event.inOut = !prev.otherInOut; - event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut; - } - - // compute prevInResult field - if (prev) { - event.prevInResult = (!inResult(prev, operation) || prev.isVertical()) ? - prev.prevInResult : prev; - } - } - - // check if the line segment belongs to the Boolean operation - event.inResult = inResult(event, operation); -}; - - -function inResult(event, operation) { - switch (event.type) { - case edgeType.NORMAL: - switch (operation) { - case INTERSECTION: - return !event.otherInOut; - case UNION: - return event.otherInOut; - case DIFFERENCE: - return (event.isSubject && event.otherInOut) || - (!event.isSubject && !event.otherInOut); - case XOR: - return true; - } - break; - case edgeType.SAME_TRANSITION: - return operation === INTERSECTION || operation === UNION; - case edgeType.DIFFERENT_TRANSITION: - return operation === DIFFERENCE; - case edgeType.NON_CONTRIBUTING: - return false; - } - return false; -} - -},{"./edge_type":18}],16:[function(require,module,exports){ -'use strict'; - -// var equals = require('./equals'); -var compareEvents = require('./compare_events'); -var operationType = require('./operation'); - -/** - * @param {Array.} sortedEvents - * @return {Array.} - */ -function orderEvents(sortedEvents) { - var event, i, len, tmp; - var resultEvents = []; - for (i = 0, len = sortedEvents.length; i < len; i++) { - event = sortedEvents[i]; - if ((event.left && event.inResult) || - (!event.left && event.otherEvent.inResult)) { - resultEvents.push(event); - } - } - - // Due to overlapping edges the resultEvents array can be not wholly sorted - var sorted = false; - while (!sorted) { - sorted = true; - for (i = 0, len = resultEvents.length; i < len; i++) { - if ((i + 1) < len && - compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) { - tmp = resultEvents[i]; - resultEvents[i] = resultEvents[i + 1]; - resultEvents[i + 1] = tmp; - sorted = false; - } - } - } - - for (i = 0, len = resultEvents.length; i < len; i++) { - resultEvents[i].pos = i; - } - - for (i = 0, len = resultEvents.length; i < len; i++) { - event = resultEvents[i]; - if (!event.left) { - tmp = event.pos; - event.pos = event.otherEvent.pos; - event.otherEvent.pos = tmp; - } - } - - return resultEvents; -} - - -/** - * @param {Number} pos - * @param {Array.} resultEvents - * @param {Object>} processed - * @return {Number} - */ -function nextPos(pos, resultEvents, processed, origIndex) { - var newPos = pos + 1; - var length = resultEvents.length; - var p = resultEvents[pos].point; - var p1 = resultEvents[newPos].point; - - // if (newPos < length && - // p1[0] !== p[0] || p1[1] !== p[1] && - // !processed[newPos]) return newPos; - // else return pos - 1; - - - // while in range and not the current one by value - while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { - if (!processed[newPos]) { - // console.log(pos, newPos, length); - return newPos; - } else newPos++; - p1 = resultEvents[newPos].point; - } - - newPos = pos - 1; - - while (processed[newPos] && newPos >= origIndex) { - newPos--; - } - // console.log('other', pos, newPos, length); - return newPos; -} - - -/** - * @param {Array.} sortedEvents - * @return {Array.<*>} polygons - */ -module.exports = function (sortedEvents, operation) { - var i, len; - var resultEvents = orderEvents(sortedEvents); - - // "false"-filled array - var processed = {}; - var result = []; - var event; - - for (i = 0, len = resultEvents.length; i < len; i++) { - if (processed[i]) continue; - var contour = [[]]; - - if (!resultEvents[i].isExteriorRing) { - if (result.length === 0) { - result.push([[contour]]); - } else if (operation === operationType.UNION || operation === operationType.XOR) { - result[result.length - 1].push([contour]); - } else { - result[result.length - 1].push(contour); - } - } else { - result.push(contour); - } - - var ringId = result.length - 1; - var pos = i; - - var initial = resultEvents[i].point; - // initial.push(resultEvents[i].isExteriorRing); - contour[0].push(initial); - - while (pos >= i) { - event = resultEvents[pos]; - processed[pos] = true; - - if (event.left) { - event.resultInOut = false; - event.contourId = ringId; - } else { - event.otherEvent.resultInOut = true; - event.otherEvent.contourId = ringId; - } - - pos = event.pos; - processed[pos] = true; - // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); - - contour[0].push(resultEvents[pos].point); - pos = nextPos(pos, resultEvents, processed, i); - } - - pos = pos === -1 ? i : pos; - - event = resultEvents[pos]; - processed[pos] = processed[event.pos] = true; - event.otherEvent.resultInOut = true; - event.otherEvent.contourId = ringId; - } - - for (i = 0, len = result.length; i < len; i++) { - var polygon = result[i]; - for (var j = 0, jj = polygon.length; j < jj; j++) { - var polygonContour = polygon[j]; - for (var k = 0, kk = polygonContour.length; k < kk; k++) { - var coords = polygonContour[k]; - if (typeof coords[0] !== 'number') { - polygon.push(coords[0]); - polygon.splice(j, 1); - } - } - } - } - - // Handle if the result is a polygon (eg not multipoly) - // Commented it again, let's see what do we mean by that - // if (result.length === 1) result = result[0]; - return result; -}; - -},{"./compare_events":13,"./operation":22}],17:[function(require,module,exports){ -'use strict'; - -var SweepEvent = require('./sweep_event'); -var equals = require('./equals'); -var compareEvents = require('./compare_events'); - -/** - * @param {SweepEvent} se - * @param {Array.} p - * @param {Queue} queue - * @return {Queue} - */ -module.exports = function divideSegment(se, p, queue) { - var r = new SweepEvent(p, false, se, se.isSubject); - var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); - - if (equals(se.point, se.otherEvent.point)) { - console.warn('what is that?', se); - } - - r.contourId = l.contourId = se.contourId; - - // avoid a rounding error. The left event would be processed after the right event - if (compareEvents(l, se.otherEvent) > 0) { - se.otherEvent.left = true; - l.left = false; - } - - // avoid a rounding error. The left event would be processed after the right event - // if (compareEvents(se, r) > 0) {} - - se.otherEvent.otherEvent = l; - se.otherEvent = r; - - queue.push(l); - queue.push(r); - - return queue; -}; - -},{"./compare_events":13,"./equals":19,"./sweep_event":27}],18:[function(require,module,exports){ -'use strict'; - -module.exports = { - NORMAL: 0, - NON_CONTRIBUTING: 1, - SAME_TRANSITION: 2, - DIFFERENT_TRANSITION: 3 -}; +},{"./compare_events":13,"./equals":19,"./sweep_event":27}],18:[function(require,module,exports){ +'use strict'; + +module.exports = { + NORMAL: 0, + NON_CONTRIBUTING: 1, + SAME_TRANSITION: 2, + DIFFERENT_TRANSITION: 3 +}; },{}],19:[function(require,module,exports){ -'use strict'; - -// var EPSILON = 1e-9; -// var abs = Math.abs; - -module.exports = function equals(p1, p2) { - if (p1[0] === p2[0]) { - if (p1[1] === p2[1]) { - return true; - } else { - return false; - } - } - return false; -}; - -// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164 -// Precision problem. -// -// module.exports = function equals(p1, p2) { -// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON; -// }; +'use strict'; + +// var EPSILON = 1e-9; +// var abs = Math.abs; + +module.exports = function equals(p1, p2) { + if (p1[0] === p2[0]) { + if (p1[1] === p2[1]) { + return true; + } else { + return false; + } + } + return false; +}; + +// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164 +// Precision problem. +// +// module.exports = function equals(p1, p2) { +// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON; +// }; },{}],20:[function(require,module,exports){ -'use strict'; - -var Queue = require('tinyqueue'); -var SweepEvent = require('./sweep_event'); -var compareEvents = require('./compare_events'); - -var max = Math.max; -var min = Math.min; - -var contourId = 0; - - -function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { - var i, len, s1, s2, e1, e2; - // var d = depth + 1; - for (i = 0, len = contourOrHole.length - 1; i < len; i++) { - s1 = contourOrHole[i]; - s2 = contourOrHole[i + 1]; - //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); - e1 = new SweepEvent(s1, false, undefined, isSubject); - e2 = new SweepEvent(s2, false, e1, isSubject); - e1.otherEvent = e2; - - e1.contourId = e2.contourId = depth; - if (!isExteriorRing) { - e1.isExteriorRing = false; - e2.isExteriorRing = false; - } - if (compareEvents(e1, e2) > 0) { - e2.left = true; - } else { - e1.left = true; - } - - var x = s1[0], y = s1[1]; - bbox[0] = min(bbox[0], x); - bbox[1] = min(bbox[1], y); - bbox[2] = max(bbox[2], x); - bbox[3] = max(bbox[3], y); - - // Pushing it so the queue is sorted from left to right, - // with object on the left having the highest priority. - Q.push(e1); - Q.push(e2); - } -} - - -module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { - var eventQueue = new Queue(null, compareEvents); - var polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk; - - for (i = 0, ii = subject.length; i < ii; i++) { - polygonSet = subject[i]; - for (j = 0, jj = polygonSet.length; j < jj; j++) { - isExteriorRing = j === 0; - if (isExteriorRing) contourId++; - processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing); - } - } - - for (i = 0, ii = clipping.length; i < ii; i++) { - polygonSet = clipping[i]; - for (j = 0, jj = polygonSet.length; j < jj; j++) { - isExteriorRing = j === 0; - if (isExteriorRing) contourId++; - processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing); - } - } - - return eventQueue; -}; - -},{"./compare_events":13,"./sweep_event":27,"tinyqueue":12}],21:[function(require,module,exports){ -'use strict'; - -var subdivideSegments = require('./subdivide_segments'); -var connectEdges = require('./connect_edges'); -var fillQueue = require('./fill_queue'); -var operations = require('./operation'); - -var EMPTY = []; - - -function trivialOperation(subject, clipping, operation) { - var result = null; - if (subject.length * clipping.length === 0) { - if (operation === operations.INTERSECTION) { - result = EMPTY; - } else if (operation === operations.DIFFERENCE) { - result = subject; - } else if (operation === operations.UNION || - operation === operations.XOR) { - result = (subject.length === 0) ? clipping : subject; - } - } - return result; -} - - -function compareBBoxes(subject, clipping, sbbox, cbbox, operation) { - var result = null; - if (sbbox[0] > cbbox[2] || - cbbox[0] > sbbox[2] || - sbbox[1] > cbbox[3] || - cbbox[1] > sbbox[3]) { - if (operation === operations.INTERSECTION) { - result = EMPTY; - } else if (operation === operations.DIFFERENCE) { - result = subject; - } else if (operation === operations.UNION || - operation === operations.XOR) { - result = subject.concat(clipping); - } - } - return result; -} - - -function boolean(subject, clipping, operation) { - if (typeof subject[0][0][0] === 'number') { - subject = [subject]; - } - if (typeof clipping[0][0][0] === 'number') { - clipping = [clipping]; - } - var trivial = trivialOperation(subject, clipping, operation); - if (trivial) { - return trivial === EMPTY ? null : trivial; - } - var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; - var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; - - //console.time('fill'); - var eventQueue = fillQueue(subject, clipping, sbbox, cbbox); - //console.timeEnd('fill'); - - trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation); - if (trivial) { - return trivial === EMPTY ? null : trivial; - } - //console.time('subdiv'); - var sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); - //console.timeEnd('subdiv'); - //console.time('connect'); - var result = connectEdges(sortedEvents, operation); - //console.timeEnd('connect'); - return result; -} - - -module.exports = boolean; - - -module.exports.union = function (subject, clipping) { - return boolean(subject, clipping, operations.UNION); -}; - - -module.exports.diff = function (subject, clipping) { - return boolean(subject, clipping, operations.DIFFERENCE); -}; - - -module.exports.xor = function (subject, clipping) { - return boolean(subject, clipping, operations.XOR); -}; - - -module.exports.intersection = function (subject, clipping) { - return boolean(subject, clipping, operations.INTERSECTION); -}; - - -/** - * @enum {Number} - */ -module.exports.operations = operations; - -},{"./connect_edges":16,"./fill_queue":20,"./operation":22,"./subdivide_segments":26}],22:[function(require,module,exports){ -'use strict'; - -module.exports = { - INTERSECTION: 0, - UNION: 1, - DIFFERENCE: 2, - XOR: 3 -}; - -},{}],23:[function(require,module,exports){ -'use strict'; - -var divideSegment = require('./divide_segment'); -var intersection = require('./segment_intersection'); -var equals = require('./equals'); -var compareEvents = require('./compare_events'); -var edgeType = require('./edge_type'); - -/** - * @param {SweepEvent} se1 - * @param {SweepEvent} se2 - * @param {Queue} queue - * @return {Number} - */ -module.exports = function possibleIntersection(se1, se2, queue) { - // that disallows self-intersecting polygons, - // did cost us half a day, so I'll leave it - // out of respect - // if (se1.isSubject === se2.isSubject) return; - var inter = intersection( - se1.point, se1.otherEvent.point, - se2.point, se2.otherEvent.point - ); - - var nintersections = inter ? inter.length : 0; - if (nintersections === 0) return 0; // no intersection - - // the line segments intersect at an endpoint of both line segments - if ((nintersections === 1) && - (equals(se1.point, se2.point) || - equals(se1.otherEvent.point, se2.otherEvent.point))) { - return 0; - } - - if (nintersections === 2 && se1.isSubject === se2.isSubject) { - // if(se1.contourId === se2.contourId){ - // console.warn('Edges of the same polygon overlap', - // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point); - // } - //throw new Error('Edges of the same polygon overlap'); - return 0; - } - - // The line segments associated to se1 and se2 intersect - if (nintersections === 1) { - - // if the intersection point is not an endpoint of se1 - if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) { - divideSegment(se1, inter[0], queue); - } - - // if the intersection point is not an endpoint of se2 - if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) { - divideSegment(se2, inter[0], queue); - } - return 1; - } - - // The line segments associated to se1 and se2 overlap - var events = []; - var leftCoincide = false; - var rightCoincide = false; - - if (equals(se1.point, se2.point)) { - leftCoincide = true; // linked - } else if (compareEvents(se1, se2) === 1) { - events.push(se2, se1); - } else { - events.push(se1, se2); - } - - if (equals(se1.otherEvent.point, se2.otherEvent.point)) { - rightCoincide = true; - } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) { - events.push(se2.otherEvent, se1.otherEvent); - } else { - events.push(se1.otherEvent, se2.otherEvent); - } - - if ((leftCoincide && rightCoincide) || leftCoincide) { - // both line segments are equal or share the left endpoint - se1.type = edgeType.NON_CONTRIBUTING; - se2.type = (se1.inOut === se2.inOut) ? - edgeType.SAME_TRANSITION : - edgeType.DIFFERENT_TRANSITION; - - if (leftCoincide && !rightCoincide) { - // honestly no idea, but changing events selection from [2, 1] - // to [0, 1] fixes the overlapping self-intersecting polygons issue - divideSegment(events[1].otherEvent, events[0].point, queue); - } - return 2; - } - - // the line segments share the right endpoint - if (rightCoincide) { - divideSegment(events[0], events[1].point, queue); - return 3; - } - - // no line segment includes totally the other one - if (events[0] !== events[3].otherEvent) { - divideSegment(events[0], events[1].point, queue); - divideSegment(events[1], events[2].point, queue); - return 3; - } - - // one line segment includes the other one - divideSegment(events[0], events[1].point, queue); - divideSegment(events[3].otherEvent, events[2].point, queue); - - return 3; -}; - -},{"./compare_events":13,"./divide_segment":17,"./edge_type":18,"./equals":19,"./segment_intersection":24}],24:[function(require,module,exports){ -'use strict'; - -var EPSILON = 1e-9; - -/** - * Finds the magnitude of the cross product of two vectors (if we pretend - * they're in three dimensions) - * - * @param {Object} a First vector - * @param {Object} b Second vector - * @private - * @returns {Number} The magnitude of the cross product - */ -function crossProduct(a, b) { - return a[0] * b[1] - a[1] * b[0]; -} - -/** - * Finds the dot product of two vectors. - * - * @param {Object} a First vector - * @param {Object} b Second vector - * @private - * @returns {Number} The dot product - */ -function dotProduct(a, b) { - return a[0] * b[0] + a[1] * b[1]; -} - -/** - * Finds the intersection (if any) between two line segments a and b, given the - * line segments' end points a1, a2 and b1, b2. - * - * This algorithm is based on Schneider and Eberly. - * http://www.cimec.org.ar/~ncalvo/Schneider_Eberly.pdf - * Page 244. - * - * @param {Array.} a1 point of first line - * @param {Array.} a2 point of first line - * @param {Array.} b1 point of second line - * @param {Array.} b2 point of second line - * @param {Boolean=} noEndpointTouch whether to skip single touchpoints - * (meaning connected segments) as - * intersections - * @returns {Array.>|Null} If the lines intersect, the point of - * intersection. If they overlap, the two end points of the overlapping segment. - * Otherwise, null. - */ -module.exports = function (a1, a2, b1, b2, noEndpointTouch) { - // The algorithm expects our lines in the form P + sd, where P is a point, - // s is on the interval [0, 1], and d is a vector. - // We are passed two points. P can be the first point of each pair. The - // vector, then, could be thought of as the distance (in x and y components) - // from the first point to the second point. - // So first, let's make our vectors: - var va = [a2[0] - a1[0], a2[1] - a1[1]]; - var vb = [b2[0] - b1[0], b2[1] - b1[1]]; - // We also define a function to convert back to regular point form: - - /* eslint-disable arrow-body-style */ - - function toPoint(p, s, d) { - return [ - p[0] + s * d[0], - p[1] + s * d[1] - ]; - } - - /* eslint-enable arrow-body-style */ - - // The rest is pretty much a straight port of the algorithm. - var e = [b1[0] - a1[0], b1[1] - a1[1]]; - var kross = crossProduct(va, vb); - var sqrKross = kross * kross; - var sqrLenA = dotProduct(va, va); - var sqrLenB = dotProduct(vb, vb); - - // Check for line intersection. This works because of the properties of the - // cross product -- specifically, two vectors are parallel if and only if the - // cross product is the 0 vector. The full calculation involves relative error - // to account for possible very small line segments. See Schneider & Eberly - // for details. - if (sqrKross > EPSILON * sqrLenA * sqrLenB) { - // If they're not parallel, then (because these are line segments) they - // still might not actually intersect. This code checks that the - // intersection point of the lines is actually on both line segments. - var s = crossProduct(e, vb) / kross; - if (s < 0 || s > 1) { - // not on line segment a - return null; - } - var t = crossProduct(e, va) / kross; - if (t < 0 || t > 1) { - // not on line segment b - return null; - } - return noEndpointTouch ? null : [toPoint(a1, s, va)]; - } - - // If we've reached this point, then the lines are either parallel or the - // same, but the segments could overlap partially or fully, or not at all. - // So we need to find the overlap, if any. To do that, we can use e, which is - // the (vector) difference between the two initial points. If this is parallel - // with the line itself, then the two lines are the same line, and there will - // be overlap. - var sqrLenE = dotProduct(e, e); - kross = crossProduct(e, va); - sqrKross = kross * kross; - - if (sqrKross > EPSILON * sqrLenA * sqrLenE) { - // Lines are just parallel, not the same. No overlap. - return null; - } - - var sa = dotProduct(va, e) / sqrLenA; - var sb = sa + dotProduct(va, vb) / sqrLenA; - var smin = Math.min(sa, sb); - var smax = Math.max(sa, sb); - - // this is, essentially, the FindIntersection acting on floats from - // Schneider & Eberly, just inlined into this function. - if (smin <= 1 && smax >= 0) { - - // overlap on an end point - if (smin === 1) { - return noEndpointTouch ? null : [toPoint(a1, smin > 0 ? smin : 0, va)]; - } +'use strict'; + +var Queue = require('tinyqueue'); +var SweepEvent = require('./sweep_event'); +var compareEvents = require('./compare_events'); + +var max = Math.max; +var min = Math.min; + +var contourId = 0; + + +function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { + var i, len, s1, s2, e1, e2; + // var d = depth + 1; + for (i = 0, len = contourOrHole.length - 1; i < len; i++) { + s1 = contourOrHole[i]; + s2 = contourOrHole[i + 1]; + //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); + e1 = new SweepEvent(s1, false, undefined, isSubject); + e2 = new SweepEvent(s2, false, e1, isSubject); + e1.otherEvent = e2; + + e1.contourId = e2.contourId = depth; + if (!isExteriorRing) { + e1.isExteriorRing = false; + e2.isExteriorRing = false; + } + if (compareEvents(e1, e2) > 0) { + e2.left = true; + } else { + e1.left = true; + } + + var x = s1[0], y = s1[1]; + bbox[0] = min(bbox[0], x); + bbox[1] = min(bbox[1], y); + bbox[2] = max(bbox[2], x); + bbox[3] = max(bbox[3], y); + + // Pushing it so the queue is sorted from left to right, + // with object on the left having the highest priority. + Q.push(e1); + Q.push(e2); + } +} + + +module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { + var eventQueue = new Queue(null, compareEvents); + var polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk; + + for (i = 0, ii = subject.length; i < ii; i++) { + polygonSet = subject[i]; + for (j = 0, jj = polygonSet.length; j < jj; j++) { + isExteriorRing = j === 0; + if (isExteriorRing) contourId++; + processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing); + } + } + + for (i = 0, ii = clipping.length; i < ii; i++) { + polygonSet = clipping[i]; + for (j = 0, jj = polygonSet.length; j < jj; j++) { + isExteriorRing = j === 0; + if (isExteriorRing) contourId++; + processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing); + } + } + + return eventQueue; +}; - if (smax === 0) { - return noEndpointTouch ? null : [toPoint(a1, smax < 1 ? smax : 1, va)]; - } +},{"./compare_events":13,"./sweep_event":27,"tinyqueue":12}],21:[function(require,module,exports){ +'use strict'; + +var subdivideSegments = require('./subdivide_segments'); +var connectEdges = require('./connect_edges'); +var fillQueue = require('./fill_queue'); +var operations = require('./operation'); + +var EMPTY = []; + + +function trivialOperation(subject, clipping, operation) { + var result = null; + if (subject.length * clipping.length === 0) { + if (operation === operations.INTERSECTION) { + result = EMPTY; + } else if (operation === operations.DIFFERENCE) { + result = subject; + } else if (operation === operations.UNION || + operation === operations.XOR) { + result = (subject.length === 0) ? clipping : subject; + } + } + return result; +} + + +function compareBBoxes(subject, clipping, sbbox, cbbox, operation) { + var result = null; + if (sbbox[0] > cbbox[2] || + cbbox[0] > sbbox[2] || + sbbox[1] > cbbox[3] || + cbbox[1] > sbbox[3]) { + if (operation === operations.INTERSECTION) { + result = EMPTY; + } else if (operation === operations.DIFFERENCE) { + result = subject; + } else if (operation === operations.UNION || + operation === operations.XOR) { + result = subject.concat(clipping); + } + } + return result; +} + + +function boolean(subject, clipping, operation) { + if (typeof subject[0][0][0] === 'number') { + subject = [subject]; + } + if (typeof clipping[0][0][0] === 'number') { + clipping = [clipping]; + } + var trivial = trivialOperation(subject, clipping, operation); + if (trivial) { + return trivial === EMPTY ? null : trivial; + } + var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; + var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; + + //console.time('fill'); + var eventQueue = fillQueue(subject, clipping, sbbox, cbbox); + //console.timeEnd('fill'); + + trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation); + if (trivial) { + return trivial === EMPTY ? null : trivial; + } + //console.time('subdiv'); + var sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); + //console.timeEnd('subdiv'); + //console.time('connect'); + var result = connectEdges(sortedEvents, operation); + //console.timeEnd('connect'); + return result; +} + + +module.exports = boolean; + + +module.exports.union = function (subject, clipping) { + return boolean(subject, clipping, operations.UNION); +}; + + +module.exports.diff = function (subject, clipping) { + return boolean(subject, clipping, operations.DIFFERENCE); +}; + + +module.exports.xor = function (subject, clipping) { + return boolean(subject, clipping, operations.XOR); +}; + + +module.exports.intersection = function (subject, clipping) { + return boolean(subject, clipping, operations.INTERSECTION); +}; + + +/** + * @enum {Number} + */ +module.exports.operations = operations; - if (noEndpointTouch && smin === 0 && smax === 1) return null; +},{"./connect_edges":16,"./fill_queue":20,"./operation":22,"./subdivide_segments":26}],22:[function(require,module,exports){ +'use strict'; + +module.exports = { + INTERSECTION: 0, + UNION: 1, + DIFFERENCE: 2, + XOR: 3 +}; - // There's overlap on a segment -- two points of intersection. Return both. - return [ - toPoint(a1, smin > 0 ? smin : 0, va), - toPoint(a1, smax < 1 ? smax : 1, va), - ]; - } +},{}],23:[function(require,module,exports){ +'use strict'; + +var divideSegment = require('./divide_segment'); +var intersection = require('./segment_intersection'); +var equals = require('./equals'); +var compareEvents = require('./compare_events'); +var edgeType = require('./edge_type'); + +/** + * @param {SweepEvent} se1 + * @param {SweepEvent} se2 + * @param {Queue} queue + * @return {Number} + */ +module.exports = function possibleIntersection(se1, se2, queue) { + // that disallows self-intersecting polygons, + // did cost us half a day, so I'll leave it + // out of respect + // if (se1.isSubject === se2.isSubject) return; + var inter = intersection( + se1.point, se1.otherEvent.point, + se2.point, se2.otherEvent.point + ); + + var nintersections = inter ? inter.length : 0; + if (nintersections === 0) return 0; // no intersection + + // the line segments intersect at an endpoint of both line segments + if ((nintersections === 1) && + (equals(se1.point, se2.point) || + equals(se1.otherEvent.point, se2.otherEvent.point))) { + return 0; + } + + if (nintersections === 2 && se1.isSubject === se2.isSubject) { + // if(se1.contourId === se2.contourId){ + // console.warn('Edges of the same polygon overlap', + // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point); + // } + //throw new Error('Edges of the same polygon overlap'); + return 0; + } + + // The line segments associated to se1 and se2 intersect + if (nintersections === 1) { + + // if the intersection point is not an endpoint of se1 + if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) { + divideSegment(se1, inter[0], queue); + } + + // if the intersection point is not an endpoint of se2 + if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) { + divideSegment(se2, inter[0], queue); + } + return 1; + } + + // The line segments associated to se1 and se2 overlap + var events = []; + var leftCoincide = false; + var rightCoincide = false; + + if (equals(se1.point, se2.point)) { + leftCoincide = true; // linked + } else if (compareEvents(se1, se2) === 1) { + events.push(se2, se1); + } else { + events.push(se1, se2); + } + + if (equals(se1.otherEvent.point, se2.otherEvent.point)) { + rightCoincide = true; + } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) { + events.push(se2.otherEvent, se1.otherEvent); + } else { + events.push(se1.otherEvent, se2.otherEvent); + } + + if ((leftCoincide && rightCoincide) || leftCoincide) { + // both line segments are equal or share the left endpoint + se1.type = edgeType.NON_CONTRIBUTING; + se2.type = (se1.inOut === se2.inOut) ? + edgeType.SAME_TRANSITION : + edgeType.DIFFERENT_TRANSITION; + + if (leftCoincide && !rightCoincide) { + // honestly no idea, but changing events selection from [2, 1] + // to [0, 1] fixes the overlapping self-intersecting polygons issue + divideSegment(events[1].otherEvent, events[0].point, queue); + } + return 2; + } + + // the line segments share the right endpoint + if (rightCoincide) { + divideSegment(events[0], events[1].point, queue); + return 3; + } + + // no line segment includes totally the other one + if (events[0] !== events[3].otherEvent) { + divideSegment(events[0], events[1].point, queue); + divideSegment(events[1], events[2].point, queue); + return 3; + } + + // one line segment includes the other one + divideSegment(events[0], events[1].point, queue); + divideSegment(events[3].otherEvent, events[2].point, queue); + + return 3; +}; - return null; -}; +},{"./compare_events":13,"./divide_segment":17,"./edge_type":18,"./equals":19,"./segment_intersection":24}],24:[function(require,module,exports){ +'use strict'; + +var EPSILON = 1e-9; + +/** + * Finds the magnitude of the cross product of two vectors (if we pretend + * they're in three dimensions) + * + * @param {Object} a First vector + * @param {Object} b Second vector + * @private + * @returns {Number} The magnitude of the cross product + */ +function crossProduct(a, b) { + return a[0] * b[1] - a[1] * b[0]; +} + +/** + * Finds the dot product of two vectors. + * + * @param {Object} a First vector + * @param {Object} b Second vector + * @private + * @returns {Number} The dot product + */ +function dotProduct(a, b) { + return a[0] * b[0] + a[1] * b[1]; +} + +/** + * Finds the intersection (if any) between two line segments a and b, given the + * line segments' end points a1, a2 and b1, b2. + * + * This algorithm is based on Schneider and Eberly. + * http://www.cimec.org.ar/~ncalvo/Schneider_Eberly.pdf + * Page 244. + * + * @param {Array.} a1 point of first line + * @param {Array.} a2 point of first line + * @param {Array.} b1 point of second line + * @param {Array.} b2 point of second line + * @param {Boolean=} noEndpointTouch whether to skip single touchpoints + * (meaning connected segments) as + * intersections + * @returns {Array.>|Null} If the lines intersect, the point of + * intersection. If they overlap, the two end points of the overlapping segment. + * Otherwise, null. + */ +module.exports = function (a1, a2, b1, b2, noEndpointTouch) { + // The algorithm expects our lines in the form P + sd, where P is a point, + // s is on the interval [0, 1], and d is a vector. + // We are passed two points. P can be the first point of each pair. The + // vector, then, could be thought of as the distance (in x and y components) + // from the first point to the second point. + // So first, let's make our vectors: + var va = [a2[0] - a1[0], a2[1] - a1[1]]; + var vb = [b2[0] - b1[0], b2[1] - b1[1]]; + // We also define a function to convert back to regular point form: + + /* eslint-disable arrow-body-style */ + + function toPoint(p, s, d) { + return [ + p[0] + s * d[0], + p[1] + s * d[1] + ]; + } + + /* eslint-enable arrow-body-style */ + + // The rest is pretty much a straight port of the algorithm. + var e = [b1[0] - a1[0], b1[1] - a1[1]]; + var kross = crossProduct(va, vb); + var sqrKross = kross * kross; + var sqrLenA = dotProduct(va, va); + var sqrLenB = dotProduct(vb, vb); + + // Check for line intersection. This works because of the properties of the + // cross product -- specifically, two vectors are parallel if and only if the + // cross product is the 0 vector. The full calculation involves relative error + // to account for possible very small line segments. See Schneider & Eberly + // for details. + if (sqrKross > EPSILON * sqrLenA * sqrLenB) { + // If they're not parallel, then (because these are line segments) they + // still might not actually intersect. This code checks that the + // intersection point of the lines is actually on both line segments. + var s = crossProduct(e, vb) / kross; + if (s < 0 || s > 1) { + // not on line segment a + return null; + } + var t = crossProduct(e, va) / kross; + if (t < 0 || t > 1) { + // not on line segment b + return null; + } + return noEndpointTouch ? null : [toPoint(a1, s, va)]; + } + + // If we've reached this point, then the lines are either parallel or the + // same, but the segments could overlap partially or fully, or not at all. + // So we need to find the overlap, if any. To do that, we can use e, which is + // the (vector) difference between the two initial points. If this is parallel + // with the line itself, then the two lines are the same line, and there will + // be overlap. + var sqrLenE = dotProduct(e, e); + kross = crossProduct(e, va); + sqrKross = kross * kross; + + if (sqrKross > EPSILON * sqrLenA * sqrLenE) { + // Lines are just parallel, not the same. No overlap. + return null; + } + + var sa = dotProduct(va, e) / sqrLenA; + var sb = sa + dotProduct(va, vb) / sqrLenA; + var smin = Math.min(sa, sb); + var smax = Math.max(sa, sb); + + // this is, essentially, the FindIntersection acting on floats from + // Schneider & Eberly, just inlined into this function. + if (smin <= 1 && smax >= 0) { + + // overlap on an end point + if (smin === 1) { + return noEndpointTouch ? null : [toPoint(a1, smin > 0 ? smin : 0, va)]; + } + + if (smax === 0) { + return noEndpointTouch ? null : [toPoint(a1, smax < 1 ? smax : 1, va)]; + } + + if (noEndpointTouch && smin === 0 && smax === 1) return null; + + // There's overlap on a segment -- two points of intersection. Return both. + return [ + toPoint(a1, smin > 0 ? smin : 0, va), + toPoint(a1, smax < 1 ? smax : 1, va), + ]; + } + + return null; +}; },{}],25:[function(require,module,exports){ -'use strict'; - -/** - * Signed area of the triangle (p0, p1, p2) - * @param {Array.} p0 - * @param {Array.} p1 - * @param {Array.} p2 - * @return {Number} - */ -module.exports = function signedArea(p0, p1, p2) { - return (p0[0] - p2[0]) * (p1[1] - p2[1]) - (p1[0] - p2[0]) * (p0[1] - p2[1]); -}; +'use strict'; + +/** + * Signed area of the triangle (p0, p1, p2) + * @param {Array.} p0 + * @param {Array.} p1 + * @param {Array.} p2 + * @return {Number} + */ +module.exports = function signedArea(p0, p1, p2) { + return (p0[0] - p2[0]) * (p1[1] - p2[1]) - (p1[0] - p2[0]) * (p0[1] - p2[1]); +}; },{}],26:[function(require,module,exports){ -'use strict'; - -var Tree = require('avl'); -var computeFields = require('./compute_fields'); -var possibleIntersection = require('./possible_intersection'); -var compareSegments = require('./compare_segments'); -var operations = require('./operation'); - - -module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) { - var sweepLine = new Tree(compareSegments); - var sortedEvents = []; - - var rightbound = Math.min(sbbox[2], cbbox[2]); - - var prev, next, begin; - - var INTERSECTION = operations.INTERSECTION; - var DIFFERENCE = operations.DIFFERENCE; - - while (eventQueue.length) { - var event = eventQueue.pop(); - sortedEvents.push(event); - - // optimization by bboxes for intersection and difference goes here - if ((operation === INTERSECTION && event.point[0] > rightbound) || - (operation === DIFFERENCE && event.point[0] > sbbox[2])) { - break; - } - - if (event.left) { - next = prev = sweepLine.insert(event); - //_renderSweepLine(sweepLine, event.point, event); - begin = sweepLine.minNode(); - - if (prev !== begin) prev = sweepLine.prev(prev); - else prev = null; - - next = sweepLine.next(next); - - var prevEvent = prev ? prev.key : null; - var prevprevEvent; - computeFields(event, prevEvent, operation); - if (next) { - if (possibleIntersection(event, next.key, eventQueue) === 2) { - computeFields(event, prevEvent, operation); - computeFields(event, next.key, operation); - } - } - if (prev) { - if (possibleIntersection(prev.key, event, eventQueue) === 2) { - var prevprev = prev; - if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); - else prevprev = null; - - prevprevEvent = prevprev ? prevprev.key : null; - computeFields(prevEvent, prevprevEvent, operation); - computeFields(event, prevEvent, operation); - } - } - } else { - event = event.otherEvent; - next = prev = sweepLine.find(event); - - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - - if (prev && next) { - - if (prev !== begin) prev = sweepLine.prev(prev); - else prev = null; - - next = sweepLine.next(next); - sweepLine.remove(event); - - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - - if (next && prev) { - //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { - possibleIntersection(prev.key, next.key, eventQueue); - //} - } - } - } - } - return sortedEvents; -}; - - -/* eslint-disable no-unused-vars, no-debugger, no-undef */ -function _renderSweepLine(sweepLine, pos, event) { - var map = window.map; - if (!map) return; - if (window.sws) window.sws.forEach(function (p) { - map.removeLayer(p); - }); - window.sws = []; - sweepLine.forEach(function (e) { - var poly = L.polyline([ - e.point.slice().reverse(), - e.otherEvent.point.slice().reverse() - ], {color: 'green'}).addTo(map); - window.sws.push(poly); - }); - - if (window.vt) map.removeLayer(window.vt); - var v = pos.slice(); - var b = map.getBounds(); - window.vt = L.polyline([ - [b.getNorth(), v[0]], - [b.getSouth(), v[0]] - ], {color: 'green', weight: 1}).addTo(map); - - if (window.ps) map.removeLayer(window.ps); - window.ps = L.polyline([ - event.point.slice().reverse(), - event.otherEvent.point.slice().reverse() - ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); - debugger; -} -/* eslint-enable no-unused-vars, no-debugger, no-undef */ +'use strict'; + +var Tree = require('avl'); +var computeFields = require('./compute_fields'); +var possibleIntersection = require('./possible_intersection'); +var compareSegments = require('./compare_segments'); +var operations = require('./operation'); + + +module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) { + var sweepLine = new Tree(compareSegments); + var sortedEvents = []; + + var rightbound = Math.min(sbbox[2], cbbox[2]); + + var prev, next, begin; + + var INTERSECTION = operations.INTERSECTION; + var DIFFERENCE = operations.DIFFERENCE; + + while (eventQueue.length) { + var event = eventQueue.pop(); + sortedEvents.push(event); + + // optimization by bboxes for intersection and difference goes here + if ((operation === INTERSECTION && event.point[0] > rightbound) || + (operation === DIFFERENCE && event.point[0] > sbbox[2])) { + break; + } + + if (event.left) { + next = prev = sweepLine.insert(event); + //_renderSweepLine(sweepLine, event.point, event); + begin = sweepLine.minNode(); + + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; + + next = sweepLine.next(next); + + var prevEvent = prev ? prev.key : null; + var prevprevEvent; + computeFields(event, prevEvent, operation); + if (next) { + if (possibleIntersection(event, next.key, eventQueue) === 2) { + computeFields(event, prevEvent, operation); + computeFields(event, next.key, operation); + } + } + if (prev) { + if (possibleIntersection(prev.key, event, eventQueue) === 2) { + var prevprev = prev; + if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); + else prevprev = null; + + prevprevEvent = prevprev ? prevprev.key : null; + computeFields(prevEvent, prevprevEvent, operation); + computeFields(event, prevEvent, operation); + } + } + } else { + event = event.otherEvent; + next = prev = sweepLine.find(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); + + if (prev && next) { + + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; + + next = sweepLine.next(next); + sweepLine.remove(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); + + if (next && prev) { + //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + possibleIntersection(prev.key, next.key, eventQueue); + //} + } + } + } + } + return sortedEvents; +}; + + +/* eslint-disable no-unused-vars, no-debugger, no-undef */ +function _renderSweepLine(sweepLine, pos, event) { + var map = window.map; + if (!map) return; + if (window.sws) window.sws.forEach(function (p) { + map.removeLayer(p); + }); + window.sws = []; + sweepLine.forEach(function (e) { + var poly = L.polyline([ + e.point.slice().reverse(), + e.otherEvent.point.slice().reverse() + ], {color: 'green'}).addTo(map); + window.sws.push(poly); + }); + + if (window.vt) map.removeLayer(window.vt); + var v = pos.slice(); + var b = map.getBounds(); + window.vt = L.polyline([ + [b.getNorth(), v[0]], + [b.getSouth(), v[0]] + ], {color: 'green', weight: 1}).addTo(map); + + if (window.ps) map.removeLayer(window.ps); + window.ps = L.polyline([ + event.point.slice().reverse(), + event.otherEvent.point.slice().reverse() + ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); + debugger; +} +/* eslint-enable no-unused-vars, no-debugger, no-undef */ },{"./compare_segments":14,"./compute_fields":15,"./operation":22,"./possible_intersection":23,"avl":6}],27:[function(require,module,exports){ -'use strict'; - -//var signedArea = require('./signed_area'); -var EdgeType = require('./edge_type'); - -/** - * Sweepline event - * - * @param {Array.} point - * @param {Boolean} left - * @param {SweepEvent=} otherEvent - * @param {Boolean} isSubject - * @param {Number} edgeType - */ -function SweepEvent(point, left, otherEvent, isSubject, edgeType) { - - /** - * Is left endpoint? - * @type {Boolean} - */ - this.left = left; - - /** - * @type {Array.} - */ - this.point = point; - - /** - * Other edge reference - * @type {SweepEvent} - */ - this.otherEvent = otherEvent; - - /** - * Belongs to source or clipping polygon - * @type {Boolean} - */ - this.isSubject = isSubject; - - /** - * Edge contribution type - * @type {Number} - */ - this.type = edgeType || EdgeType.NORMAL; - - - /** - * In-out transition for the sweepline crossing polygon - * @type {Boolean} - */ - this.inOut = false; - - - /** - * @type {Boolean} - */ - this.otherInOut = false; - - /** - * Previous event in result? - * @type {SweepEvent} - */ - this.prevInResult = null; - - /** - * Does event belong to result? - * @type {Boolean} - */ - this.inResult = false; - - - // connection step - - /** - * @type {Boolean} - */ - this.resultInOut = false; - - this.isExteriorRing = true; -} - - -SweepEvent.prototype = { - - /** - * @param {Array.} p - * @return {Boolean} - */ - isBelow: function (p) { - var p0 = this.point, p1 = this.otherEvent.point; - return this.left ? - (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0 : - // signedArea(this.point, this.otherEvent.point, p) > 0 : - (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0; - //signedArea(this.otherEvent.point, this.point, p) > 0; - }, - - - /** - * @param {Array.} p - * @return {Boolean} - */ - isAbove: function (p) { - return !this.isBelow(p); - }, - - - /** - * @return {Boolean} - */ - isVertical: function () { - return this.point[0] === this.otherEvent.point[0]; - } -}; - -module.exports = SweepEvent; +'use strict'; + +//var signedArea = require('./signed_area'); +var EdgeType = require('./edge_type'); + +/** + * Sweepline event + * + * @param {Array.} point + * @param {Boolean} left + * @param {SweepEvent=} otherEvent + * @param {Boolean} isSubject + * @param {Number} edgeType + */ +function SweepEvent(point, left, otherEvent, isSubject, edgeType) { + + /** + * Is left endpoint? + * @type {Boolean} + */ + this.left = left; + + /** + * @type {Array.} + */ + this.point = point; + + /** + * Other edge reference + * @type {SweepEvent} + */ + this.otherEvent = otherEvent; + + /** + * Belongs to source or clipping polygon + * @type {Boolean} + */ + this.isSubject = isSubject; + + /** + * Edge contribution type + * @type {Number} + */ + this.type = edgeType || EdgeType.NORMAL; + + + /** + * In-out transition for the sweepline crossing polygon + * @type {Boolean} + */ + this.inOut = false; + + + /** + * @type {Boolean} + */ + this.otherInOut = false; + + /** + * Previous event in result? + * @type {SweepEvent} + */ + this.prevInResult = null; + + /** + * Does event belong to result? + * @type {Boolean} + */ + this.inResult = false; + + + // connection step + + /** + * @type {Boolean} + */ + this.resultInOut = false; + + this.isExteriorRing = true; +} + + +SweepEvent.prototype = { + + /** + * @param {Array.} p + * @return {Boolean} + */ + isBelow: function (p) { + var p0 = this.point, p1 = this.otherEvent.point; + return this.left ? + (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0 : + // signedArea(this.point, this.otherEvent.point, p) > 0 : + (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0; + //signedArea(this.otherEvent.point, this.point, p) > 0; + }, + + + /** + * @param {Array.} p + * @return {Boolean} + */ + isAbove: function (p) { + return !this.isBelow(p); + }, + + + /** + * @return {Boolean} + */ + isVertical: function () { + return this.point[0] === this.otherEvent.point[0]; + } +}; + +module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9k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8gcHJldi5rZXkgOiBudWxsO1xuICAgICAgdmFyIHByZXZwcmV2RXZlbnQ7XG4gICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICBpZiAobmV4dCkge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKHByZXYpIHtcbiAgICAgICAgaWYgKHBvc3NpYmxlSW50ZXJzZWN0aW9uKHByZXYua2V5LCBldmVudCwgZXZlbnRRdWV1ZSkgPT09IDIpIHtcbiAgICAgICAgICB2YXIgcHJldnByZXYgPSBwcmV2O1xuICAgICAgICAgIGlmIChwcmV2cHJldiAhPT0gYmVnaW4pIHByZXZwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldnByZXYpO1xuICAgICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgIHByZXZwcmV2ID0gbnVsbDtcblxuICAgICAgICAgIHByZXZwcmV2RXZlbnQgPSBwcmV2cHJldiA/IHByZXZwcmV2LmtleSA6IG51bGw7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhwcmV2RXZlbnQsIHByZXZwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgICAgIHByZXZFdmVudCwgICAgIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZXZlbnQgPSBldmVudC5vdGhlckV2ZW50O1xuICAgICAgbmV4dCA9IHByZXYgPSBzd2VlcExpbmUuZmluZ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ID8gLTEgOiBhID4gYiA/IDEgOiAwO1xufVxuXG5UaW55UXVldWUucHJvdG90eXBlID0ge1xuXG4gICAgcHVzaDogZnVuY3Rpb24gKGl0ZW0pIHtcbiAgICAgICAgdGhpcy5kYXRhLnB1c2goaXRlbSk7XG4gICAgICAgIHRoaXMubGVuZ3RoKys7XG4gICAgICAgIHRoaXMuX3VwKHRoaXMubGVuZ3RoIC0gMSk7XG4gICAgfSxcblxuICAgIHBvcDogZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgdG9wID0gdGhpcy5kYXRhWzBdO1xuICAgICAgICB0aGlzLmRhdGFbMF0gPSB0aGlzLmRhdGFbdGhpcy5sZW5ndGggLSAxXTtcbiAgICAgICAgdGhpcy5sZW5ndGgtLTtcbiAgICAgICAgdGhpcy5kYXRhLnBvcCgpO1xuICAgICAgICB0aGlzLl9kb3duKDApO1xuICAgICAgICByZXR1cm4gdG9wO1xuICAgIH0sXG5cbiAgICBwZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRhdGFbMF07XG4gICAgfSxcblxuICAgIF91cDogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmU7XG5cbiAgICAgICAgd2hpbGUgKHBvcyA+IDApIHtcbiAgICAgICAgICAgIHZhciBwYXJlbnQgPSBNYXRoLmZsb29yKChwb3MgLSAxKSAvIDIpO1xuICAgICAgICAgICAgaWYgKGNvbXBhcmUoZGF0YVtwb3NdLCBkYXRhW3BhcmVudF0pIDwgMCkge1xuICAgICAgICAgICAgICAgIHN3YXAoZGF0YSwgcGFyZW50LCBwb3MpO1xuICAgICAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcblxuICAgICAgICAgICAgfSBlbHNlIGJyZWFrO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9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nVsbDtcclxuICAgICAgdmFyIHByZXZwcmV2RXZlbnQ7XHJcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcclxuICAgICAgaWYgKG5leHQpIHtcclxuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xyXG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xyXG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgbmV4dC5rZXksIG9wZXJhdGlvbik7XHJcbiAgICAgICAgfVxyXG4gICAgICB9XHJcbiAgICAgIGlmIChwcmV2KSB7XHJcbiAgICAgICAgaWYgKHBvc3NpYmxlSW50ZXJzZWN0aW9uKHByZXYua2V5LCBldmVudCwgZXZlbnRRdWV1ZSkgPT09IDIpIHtcclxuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XHJcbiAgICAgICAgICBpZiAocHJldnByZXYgIT09IGJlZ2luKSBwcmV2cHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXZwcmV2KTtcclxuICAgICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgIHByZXZwcmV2ID0gbnVsbDtcclxuXHJcbiAgICAgICAgICBwcmV2cHJldkV2ZW50ID0gcHJldnByZXYgPyBwcmV2cHJldi5rZXkgOiBudWxsO1xyXG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhwcmV2RXZlbnQsIHByZXZwcmV2RXZlbnQsIG9wZXJhdGlvbik7XHJcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW50LCAgICAgb3BlcmF0aW9uKTtcclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgIH0gZWxzZSB7XHJcbiAgICAgIGV2ZW50ID0gZXZlbnQub3RoZXJFdmVudDtcclxuIC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pbnRbMF07XHJcbiAgfVxyXG59O1xyXG5cclxubW9kdWxlLmV4cG9ydHMgPSBTd2VlcEV2ZW50O1xyXG4iXX0= diff --git a/demo/js/index.js b/demo/js/index.js index b1ef5b8..9bcaf8e 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -36,6 +36,9 @@ switch (mode) { case 'holecut': file = 'hole_cut.geojson'; break; + case 'overlapping_segments': + file = 'overlapping_segments.geojson'; + break; default: file = 'hole_hole.geojson'; break; @@ -134,7 +137,7 @@ function run (op) { //if (op === OPERATIONS.UNION) result = result[0]; console.log('result', result); - + console.log(JSON.stringify(result)) results.clearLayers(); results.addData({ 'type': 'Feature', diff --git a/src/connect_edges.js b/src/connect_edges.js index 5799999..99dac2e 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -109,7 +109,7 @@ module.exports = function (sortedEvents, operation) { if (result.length === 0) { result.push([[contour]]); } else if (operation === operationType.UNION || operation === operationType.XOR) { - result[result.length - 1].push([contour]); + result[result.length - 1].push(contour[0]); } else { result[result.length - 1].push(contour); } diff --git a/test/featureTypes.js b/test/featureTypes.js index 0fa9fd6..c6890ed 100644 --- a/test/featureTypes.js +++ b/test/featureTypes.js @@ -30,17 +30,26 @@ var testScenarios = [ testScenarios.forEach(function (ts) { var subject = load.sync(path.join(__dirname, 'featureTypes', ts.subjectPoly + '.geojson')); tap.test(ts.testName, function (t) { + + var expectedIntResult = load.sync(path.join(outDir, 'intersection', t._name + '.geojson')) + if (expectedIntResult.geometry.type === 'Polygon') expectedIntResult.geometry.coordinates = [expectedIntResult.geometry.coordinates] var intResult = martinez.intersection(subject.geometry.coordinates, clipping.geometry.coordinates); - t.same(intResult, load.sync(path.join(outDir, 'intersection', t._name + '.geojson')).geometry.coordinates, ts.testName + ' - Intersect'); + t.same(intResult, expectedIntResult.geometry.coordinates, ts.testName + ' - Intersect'); + var expectedXorResult = load.sync(path.join(outDir, 'xor', t._name + '.geojson')) + if (expectedXorResult.geometry.type === 'Polygon') expectedXorResult.geometry.coordinates = [expectedXorResult.geometry.coordinates] var xorResult = martinez.xor(subject.geometry.coordinates, clipping.geometry.coordinates); - t.same(xorResult, load.sync(path.join(outDir, 'xor', t._name + '.geojson')).geometry.coordinates, ts.testName + ' - XOR'); + t.same(xorResult, expectedXorResult.geometry.coordinates, ts.testName + ' - XOR'); + var expectedDiffResult = load.sync(path.join(outDir, 'difference', t._name + '.geojson')) + if (expectedDiffResult.geometry.type === 'Polygon') expectedDiffResult.geometry.coordinates = [expectedDiffResult.geometry.coordinates] var diffResult = martinez.diff(subject.geometry.coordinates, clipping.geometry.coordinates); - t.same(diffResult, load.sync(path.join(outDir, 'difference', t._name + '.geojson')).geometry.coordinates, ts.testName + ' - Difference'); + t.same(diffResult, expectedDiffResult.geometry.coordinates, ts.testName + ' - Difference'); + var expectedUnionResult = load.sync(path.join(outDir, 'union', t._name + '.geojson')) + if (expectedUnionResult.geometry.type === 'Polygon') expectedUnionResult.geometry.coordinates = [expectedUnionResult.geometry.coordinates] var unionResult = martinez.union(subject.geometry.coordinates, clipping.geometry.coordinates); - t.same(unionResult, load.sync(path.join(outDir, 'union', t._name + '.geojson')).geometry.coordinates, ts.testName + ' - Union'); + t.same(unionResult, expectedUnionResult.geometry.coordinates, ts.testName + ' - Union'); t.end(); }); diff --git a/test/fixtures/overlapping_segments.geojson b/test/fixtures/overlapping_segments.geojson new file mode 100644 index 0000000..af9c9b6 --- /dev/null +++ b/test/fixtures/overlapping_segments.geojson @@ -0,0 +1,22 @@ +{ + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-25, -25], [25, -25], [25, 25], [18, 25], [18, 27], [11, 27], [11, 25], [-25, 25], [-25, -25] + ] + ] + } + },{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [[[23, -18], [23,-25], [27, -25], [27, -18], [23, -18]]] + } + }] +} \ No newline at end of file From 41a8cfd3a11c947fbc710afec7e513c29b12da86 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Thu, 26 Oct 2017 20:04:01 +1100 Subject: [PATCH 21/42] Fix render --- src/subdivide_segments.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/subdivide_segments.js b/src/subdivide_segments.js index b01cc5d..bf845bb 100644 --- a/src/subdivide_segments.js +++ b/src/subdivide_segments.js @@ -96,8 +96,8 @@ function _renderSweepLine(sweepLine, pos, event) { window.sws = []; sweepLine.forEach(function (e) { var poly = L.polyline([ - e.point.slice().reverse(), - e.otherEvent.point.slice().reverse() + e.key.point.slice().reverse(), + e.key.otherEvent.point.slice().reverse() ], {color: 'green'}).addTo(map); window.sws.push(poly); }); From 1bb3c2cdaf218c5f4d1f186ad95db8b835e6adbc Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Sun, 29 Oct 2017 22:51:55 +1100 Subject: [PATCH 22/42] Add visual debug --- src/connect_edges.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/connect_edges.js b/src/connect_edges.js index 99dac2e..7d2f481 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -95,7 +95,7 @@ function nextPos(pos, resultEvents, processed, origIndex) { module.exports = function (sortedEvents, operation) { var i, len; var resultEvents = orderEvents(sortedEvents); - + _renderPoints(resultEvents, 'inResult') // "false"-filled array var processed = {}; var result = []; @@ -171,3 +171,24 @@ module.exports = function (sortedEvents, operation) { // if (result.length === 1) result = result[0]; return result; }; + + +/* eslint-disable no-unused-vars, no-debugger, no-undef */ +function _renderPoints(possiblePoints, prop) { + var map = window.map; + if (!map) return; + if (points !== undefined) points.clearLayers(); + + var points = L.layerGroup([]).addTo(map); + possiblePoints.forEach(function (e) { + var point = L.circleMarker([e.point[1], e.point[0]], { + radius: 20, + color: getColor(e[prop]) + }).addTo(points); + }); +} +/* eslint-enable no-unused-vars, no-debugger, no-undef */ + +function getColor(prop) { + return prop ? 'green' : 'red' +} \ No newline at end of file From 4c89c2ddee4d8de96c20dc7045c0c813c8f3777b Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Sun, 29 Oct 2017 22:55:49 +1100 Subject: [PATCH 23/42] Fix linting --- src/connect_edges.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/connect_edges.js b/src/connect_edges.js index 7d2f481..29eaacc 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -95,7 +95,7 @@ function nextPos(pos, resultEvents, processed, origIndex) { module.exports = function (sortedEvents, operation) { var i, len; var resultEvents = orderEvents(sortedEvents); - _renderPoints(resultEvents, 'inResult') + _renderPoints(resultEvents, 'inResult'); // "false"-filled array var processed = {}; var result = []; @@ -173,12 +173,12 @@ module.exports = function (sortedEvents, operation) { }; -/* eslint-disable no-unused-vars, no-debugger, no-undef */ +/* eslint-disable no-unused-vars, no-debugger, no-undef, no-use-before-define */ function _renderPoints(possiblePoints, prop) { var map = window.map; if (!map) return; if (points !== undefined) points.clearLayers(); - + var points = L.layerGroup([]).addTo(map); possiblePoints.forEach(function (e) { var point = L.circleMarker([e.point[1], e.point[0]], { @@ -190,5 +190,5 @@ function _renderPoints(possiblePoints, prop) { /* eslint-enable no-unused-vars, no-debugger, no-undef */ function getColor(prop) { - return prop ? 'green' : 'red' -} \ No newline at end of file + return prop ? 'green' : 'red'; +} From 70a619fe2390b64f087792e3296fdf23252cd5f8 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Sun, 3 Dec 2017 21:52:03 +1100 Subject: [PATCH 24/42] Fix for difference. Fixes #holecut difference operation. --- src/compute_fields.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compute_fields.js b/src/compute_fields.js index fa326e9..613da18 100644 --- a/src/compute_fields.js +++ b/src/compute_fields.js @@ -51,8 +51,10 @@ function inResult(event, operation) { case UNION: return event.otherInOut; case DIFFERENCE: - return (event.isSubject && event.otherInOut) || - (!event.isSubject && !event.otherInOut); + return (event.isSubject && !event.otherInOut) || + (!event.isSubject && event.otherInOut); + // return (event.isSubject && event.otherInOut) || + // (!event.isSubject && !event.otherInOut); case XOR: return true; } From bf566d9bd0d56c2bf5aa0dddb18f9d24ff9da0ff Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Sun, 3 Dec 2017 22:24:23 +1100 Subject: [PATCH 25/42] Partial fix for overlapping edges... --- src/connect_edges.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/connect_edges.js b/src/connect_edges.js index 29eaacc..61cf2f0 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -60,6 +60,7 @@ function orderEvents(sortedEvents) { function nextPos(pos, resultEvents, processed, origIndex) { var newPos = pos + 1; var length = resultEvents.length; + if (newPos > length - 1) return pos - 1; var p = resultEvents[pos].point; var p1 = resultEvents[newPos].point; @@ -151,6 +152,7 @@ module.exports = function (sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } + // _renderPoints(resultEvents, 'resultInOut'); for (i = 0, len = result.length; i < len; i++) { var polygon = result[i]; @@ -182,7 +184,7 @@ function _renderPoints(possiblePoints, prop) { var points = L.layerGroup([]).addTo(map); possiblePoints.forEach(function (e) { var point = L.circleMarker([e.point[1], e.point[0]], { - radius: 20, + radius: getRandomSize(), color: getColor(e[prop]) }).addTo(points); }); @@ -192,3 +194,7 @@ function _renderPoints(possiblePoints, prop) { function getColor(prop) { return prop ? 'green' : 'red'; } + +function getRandomSize() { + return Math.floor(Math.random() * 30); +} From 9cac37834a971055d21364c9d246ec72ea69fc87 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Mon, 4 Dec 2017 23:40:19 +0100 Subject: [PATCH 26/42] new test cases --- demo/js/booleanopcontrol.js | 5 +- demo/js/bundle.js | 2868 +++++++++-------- demo/js/index.js | 86 +- src/compute_fields.js | 8 +- src/connect_edges.js | 13 +- src/divide_segment.js | 2 +- test/edge_cases.test.js | 10 + test/fixtures/disjoint_boxes.geojson | 16 + test/fixtures/overlapping_segments.geojson | 4 +- .../overlapping_segments_complex.geojson | 22 + test/fixtures/states_result.geojson | 1 + test/fixtures/states_source.geojson | 1 + 12 files changed, 1586 insertions(+), 1450 deletions(-) create mode 100644 test/fixtures/disjoint_boxes.geojson create mode 100644 test/fixtures/overlapping_segments_complex.geojson create mode 100644 test/fixtures/states_result.geojson create mode 100644 test/fixtures/states_source.geojson diff --git a/demo/js/booleanopcontrol.js b/demo/js/booleanopcontrol.js index 3228465..2b215e5 100644 --- a/demo/js/booleanopcontrol.js +++ b/demo/js/booleanopcontrol.js @@ -12,7 +12,8 @@ L.BooleanControl = L.Control.extend({ '
    ', '
  • ','', '
  • ', '
  • ','', '
  • ', - '
  • ','', '
  • ', + '
  • ','', '
  • ', + '
  • ','', '
  • ', '
  • ','', '
  • ', '
', '', '', @@ -41,4 +42,4 @@ L.BooleanControl = L.Control.extend({ return this._container; } -}); \ No newline at end of file +}); diff --git a/demo/js/bundle.js b/demo/js/bundle.js index e6a922e..349c3ae 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -1,307 +1,331 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o', - '
    ', - '
  • ','', '
  • ', - '
  • ','', '
  • ', - '
  • ','', '
  • ', - '
  • ','', '
  • ', - '
', - '', '', - ''].join(''); - var form = container.querySelector('form'); - L.DomEvent - .on(form, 'submit', function (evt) { - L.DomEvent.stop(evt); - var radios = Array.prototype.slice.call( - form.querySelectorAll('input[type=radio]')); - for (var i = 0, len = radios.length; i < len; i++) { - if (radios[i].checked) { - this.options.callback(parseInt(radios[i].value)); - break; - } - } - }, this) - .on(form['clear'], 'click', function(evt) { - L.DomEvent.stop(evt); - this.options.clear(); - }, this); - - L.DomEvent - .disableClickPropagation(this._container) - .disableScrollPropagation(this._container); - return this._container; - } - +L.BooleanControl = L.Control.extend({ + options: { + position: 'topright' + }, + + onAdd: function(map) { + var container = this._container = L.DomUtil.create('div', 'leaflet-bar'); + this._container.style.background = '#ffffff'; + this._container.style.padding = '10px'; + container.innerHTML = [ + '
', + '
    ', + '
  • ','', '
  • ', + '
  • ','', '
  • ', + '
  • ','', '
  • ', + '
  • ','', '
  • ', + '
  • ','', '
  • ', + '
', + '', '', + '
'].join(''); + var form = container.querySelector('form'); + L.DomEvent + .on(form, 'submit', function (evt) { + L.DomEvent.stop(evt); + var radios = Array.prototype.slice.call( + form.querySelectorAll('input[type=radio]')); + for (var i = 0, len = radios.length; i < len; i++) { + if (radios[i].checked) { + this.options.callback(parseInt(radios[i].value)); + break; + } + } + }, this) + .on(form['clear'], 'click', function(evt) { + L.DomEvent.stop(evt); + this.options.clear(); + }, this); + + L.DomEvent + .disableClickPropagation(this._container) + .disableScrollPropagation(this._container); + return this._container; + } + }); + },{}],2:[function(require,module,exports){ -L.Coordinates = L.Control.extend({ - options: { - position: 'bottomright' - }, - - onAdd: function(map) { - this._container = L.DomUtil.create('div', 'leaflet-bar'); - this._container.style.background = '#ffffff'; - map.on('mousemove', this._onMouseMove, this); - return this._container; - }, - - _onMouseMove: function(e) { - this._container.innerHTML = '' + - e.latlng.lng.toFixed(3) + ', ' + e.latlng.lat.toFixed(3) + ''; - } - +L.Coordinates = L.Control.extend({ + options: { + position: 'bottomright' + }, + + onAdd: function(map) { + this._container = L.DomUtil.create('div', 'leaflet-bar'); + this._container.style.background = '#ffffff'; + map.on('mousemove', this._onMouseMove, this); + return this._container; + }, + + _onMouseMove: function(e) { + this._container.innerHTML = '' + + e.latlng.lng.toFixed(3) + ', ' + e.latlng.lat.toFixed(3) + ''; + } + }); },{}],3:[function(require,module,exports){ -require('./coordinates'); -require('./polygoncontrol'); -require('./booleanopcontrol'); -var martinez = window.martinez = require('../../'); -//var martinez = require('../../dist/martinez.min'); -var xhr = require('superagent'); -var mode = window.location.hash.substring(1); -var path = '../test/fixtures/'; -var file; - -switch (mode) { - case 'geo': - file = 'asia.geojson'; - break; - case 'trapezoid': - file = 'trapezoid-box.geojson'; - break; - case 'canada': - file = 'canada.geojson'; - break; - case 'horseshoe': - file = 'horseshoe.geojson'; - break; - case 'hourglasses': - file = 'hourglasses.geojson'; - break; - case 'edge_overlap': - file = 'polygon_trapezoid_edge_overlap.geojson'; - break; - case 'touching': - file = 'touching_boxes.geojson'; - break; - case 'triangles': - file = 'two_pointed_triangles.geojson'; - break; - case 'holecut': - file = 'hole_cut.geojson'; - break; - case 'overlapping_segments': - file = 'overlapping_segments.geojson'; - break; - default: - file = 'hole_hole.geojson'; - break; -} - -console.log(mode); - - -var OPERATIONS = { - INTERSECTION: 0, - UNION: 1, - DIFFERENCE: 2, - XOR: 3 -}; - -var div = document.createElement('div'); -div.id = 'image-map'; -div.style.width = div.style.height = '100%'; -document.body.appendChild(div); - -// create the slippy map -var map = window.map = L.map('image-map', { - minZoom: 1, - maxZoom: 20, - center: [0, 0], - zoom: 2, - crs: mode === 'geo' ? L.CRS.EPSG4326 : L.extend({}, L.CRS.Simple, { - transformation: new L.Transformation(0.5, 0, -0.5, 0) - }), - editable: true -}); - -map.addControl(new L.NewPolygonControl({ - callback: map.editTools.startPolygon -})); -map.addControl(new L.Coordinates()); -map.addControl(new L.BooleanControl({ - callback: run, - clear: clear -})); - -var drawnItems = window.drawnItems = L.geoJson().addTo(map); - -function loadData(path) { - console.log(path); - // var two_triangles = require('../../test/fixtures/two_shapes.geojson'); - // var oneInside = require('../../test/fixtures/one_inside.geojson'); - // var twoPointedTriangles = require('../../test/fixtures/two_pointed_triangles.geojson'); - // var selfIntersecting = require('../../test/fixtures/self_intersecting.geojson'); - // var holes = require('../../test/fixtures/hole_hole.geojson'); - //var data = require('../../test/fixtures/indonesia.geojson'); - xhr - .get(path) - .accept('json') - .end(function(e, r) { - if (!e) { - drawnItems.addData(JSON.parse(r.text)); - map.fitBounds(drawnItems.getBounds().pad(0.05), { animate: false }); - } - }); -} - -function clear() { - drawnItems.clearLayers(); - results.clearLayers(); -} - -var reader = new jsts.io.GeoJSONReader(); -var writer = new jsts.io.GeoJSONWriter(); - -function run (op) { - var layers = drawnItems.getLayers(); - if (layers.length < 2) return; - var subject = layers[0].toGeoJSON(); - var clipping = layers[1].toGeoJSON(); - - console.log('input', subject, clipping, op); - - subject = JSON.parse(JSON.stringify(subject)); - clipping = JSON.parse(JSON.stringify(clipping)); - - var operation; - if (op === OPERATIONS.INTERSECTION) { - operation = martinez.intersection; - } else if (op === OPERATIONS.UNION) { - operation = martinez.union; - } else if (op === OPERATIONS.DIFFERENCE) { - operation = martinez.diff; - } else { - operation = martinez.xor; - } - - console.time('martinez'); - var result = operation(subject.geometry.coordinates, clipping.geometry.coordinates); - console.timeEnd('martinez'); - - //if (op === OPERATIONS.UNION) result = result[0]; - console.log('result', result); - console.log(JSON.stringify(result)) - results.clearLayers(); - results.addData({ - 'type': 'Feature', - 'geometry': { - 'type': 'MultiPolygon', - 'coordinates': result - } - }); - - setTimeout(function() { - console.time('jsts'); - var s = reader.read(subject); - var c = reader.read(clipping); - var res; - if (op === OPERATIONS.INTERSECTION) { - res = s.geometry.intersection(c.geometry); - } else if (op === OPERATIONS.UNION) { - res = s.geometry.union(c.geometry); - } else if (op === OPERATIONS.DIFFERENCE) { - res = s.geometry.difference(c.geometry); - } else { - res = s.geometry.symDifference(c.geometry); - } - res = writer.write(res); - console.timeEnd('jsts'); - }, 500); -} - -//drawnItems.addData(oneInside); -//drawnItems.addData(twoPointedTriangles); -//drawnItems.addData(selfIntersecting); -//drawnItems.addData(holes); -//drawnItems.addData(data); - -map.on('editable:created', function(evt) { - drawnItems.addLayer(evt.layer); - evt.layer.on('click', function(e) { - if ((e.originalEvent.ctrlKey || e.originalEvent.metaKey) && this.editEnabled()) { - this.editor.newHole(e.latlng); - } - }); -}); - -var results = window.results = L.geoJson(null, { - style: function(feature) { - return { - color: 'red', - weight: 1 - }; - } -}).addTo(map); - -loadData(path + file); +require('./coordinates'); +require('./polygoncontrol'); +require('./booleanopcontrol'); +var martinez = window.martinez = require('../../'); +//var martinez = require('../../dist/martinez.min'); +var xhr = require('superagent'); +var mode = window.location.hash.substring(1); +var path = '../test/fixtures/'; +var ext = '.geojson'; +var file; + +var files = [ + 'asia', 'trapezoid-box', 'canada', 'horseshoe', 'hourglasses', 'overlap_y', + 'polygon_trapezoid_edge_overlap', 'touching_boxes', 'two_pointed_triangles', + 'hole_cut', 'overlapping_segments', 'overlap_loop', 'disjoint_boxes' +]; + +switch (mode) { + case 'geo': + file = 'asia.geojson'; + break; + case 'states': + file = 'states_source.geojson'; + break; + case 'trapezoid': + file = 'trapezoid-box.geojson'; + break; + case 'canada': + file = 'canada.geojson'; + break; + case 'horseshoe': + file = 'horseshoe.geojson'; + break; + case 'hourglasses': + file = 'hourglasses.geojson'; + break; + case 'edge_overlap': + file = 'polygon_trapezoid_edge_overlap.geojson'; + break; + case 'touching_boxes': + file = 'touching_boxes.geojson'; + break; + case 'triangles': + file = 'two_pointed_triangles.geojson'; + break; + case 'holecut': + file = 'hole_cut.geojson'; + break; + case 'overlapping_segments': + file = 'overlapping_segments.geojson'; + break; + case 'overlap_loop': + file = 'overlap_loop.geojson'; + break; + case 'overlap_y': + file = 'overlap_y.geojson'; + break; + case 'disjoint_boxes': + file = 'disjoint_boxes.geojson'; + break; + default: + file = 'hole_hole.geojson'; + break; +} + +console.log(mode); + + +var OPERATIONS = { + INTERSECTION: 0, + UNION: 1, + DIFFERENCE: 2, + XOR: 3 +}; + +var div = document.createElement('div'); +div.id = 'image-map'; +div.style.width = div.style.height = '100%'; +document.body.appendChild(div); + +// create the slippy map +var map = window.map = L.map('image-map', { + minZoom: 1, + maxZoom: 20, + center: [0, 0], + zoom: 2, + crs: mode === 'geo' ? L.CRS.EPSG4326 : L.extend({}, L.CRS.Simple, { + transformation: new L.Transformation(0.5, 0, -0.5, 0) + }), + editable: true +}); + +map.addControl(new L.NewPolygonControl({ + callback: map.editTools.startPolygon +})); +map.addControl(new L.Coordinates()); +map.addControl(new L.BooleanControl({ + callback: run, + clear: clear +})); + +var drawnItems = window.drawnItems = L.geoJson().addTo(map); + +function loadData(path) { + console.log(path); + xhr + .get(path) + .accept('json') + .end(function(e, r) { + if (!e) { + drawnItems.addData(JSON.parse(r.text)); + map.fitBounds(drawnItems.getBounds().pad(0.05), { animate: false }); + } + }); +} + +function clear() { + drawnItems.clearLayers(); + results.clearLayers(); +} + +var reader = new jsts.io.GeoJSONReader(); +var writer = new jsts.io.GeoJSONWriter(); + +function run (op) { + var layers = drawnItems.getLayers(); + if (layers.length < 2) return; + var subject = layers[0].toGeoJSON(); + var clipping = layers[1].toGeoJSON(); + + console.log('input', subject, clipping, op); + + subject = JSON.parse(JSON.stringify(subject)); + clipping = JSON.parse(JSON.stringify(clipping)); + + var operation; + if (op === OPERATIONS.INTERSECTION) { + operation = martinez.intersection; + } else if (op === OPERATIONS.UNION) { + operation = martinez.union; + } else if (op === OPERATIONS.DIFFERENCE) { + operation = martinez.diff; + } else if (op === 5) { // B - A + operation = martinez.diff; + + var temp = subject; + subject = clipping; + clipping = temp; + } else { + operation = martinez.xor; + } + + console.time('martinez'); + var result = operation(subject.geometry.coordinates, clipping.geometry.coordinates); + console.timeEnd('martinez'); + + //if (op === OPERATIONS.UNION) result = result[0]; + console.log('result', result); + console.log(JSON.stringify(result)) + results.clearLayers(); + + if (result !== null) { + results.addData({ + 'type': 'Feature', + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': result + } + }); + + setTimeout(function() { + console.time('jsts'); + var s = reader.read(subject); + var c = reader.read(clipping); + var res; + if (op === OPERATIONS.INTERSECTION) { + res = s.geometry.intersection(c.geometry); + } else if (op === OPERATIONS.UNION) { + res = s.geometry.union(c.geometry); + } else if (op === OPERATIONS.DIFFERENCE) { + res = s.geometry.difference(c.geometry); + } else { + res = s.geometry.symDifference(c.geometry); + } + res = writer.write(res); + console.timeEnd('jsts'); + }, 500); + } +} + +//drawnItems.addData(oneInside); +//drawnItems.addData(twoPointedTriangles); +//drawnItems.addData(selfIntersecting); +//drawnItems.addData(holes); +//drawnItems.addData(data); + +map.on('editable:created', function(evt) { + drawnItems.addLayer(evt.layer); + evt.layer.on('click', function(e) { + if ((e.originalEvent.ctrlKey || e.originalEvent.metaKey) && this.editEnabled()) { + this.editor.newHole(e.latlng); + } + }); +}); + +var results = window.results = L.geoJson(null, { + style: function(feature) { + return { + color: 'red', + weight: 1 + }; + } +}).addTo(map); + +loadData(path + file); },{"../../":5,"./booleanopcontrol":1,"./coordinates":2,"./polygoncontrol":4,"superagent":8}],4:[function(require,module,exports){ -L.EditControl = L.Control.extend({ - - options: { - position: 'topleft', - callback: null, - kind: '', - html: '' - }, - - onAdd: function (map) { - var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'), - link = L.DomUtil.create('a', '', container); - - link.href = '#'; - link.title = 'Create a new ' + this.options.kind; - link.innerHTML = this.options.html; - L.DomEvent.on(link, 'click', L.DomEvent.stop) - .on(link, 'click', function () { - window.LAYER = this.options.callback.call(map.editTools); - }, this); - - return container; - } - -}); - -L.NewPolygonControl = L.EditControl.extend({ - options: { - position: 'topleft', - kind: 'polygon', - html: 'â–°' - } +L.EditControl = L.Control.extend({ + + options: { + position: 'topleft', + callback: null, + kind: '', + html: '' + }, + + onAdd: function (map) { + var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'), + link = L.DomUtil.create('a', '', container); + + link.href = '#'; + link.title = 'Create a new ' + this.options.kind; + link.innerHTML = this.options.html; + L.DomEvent.on(link, 'click', L.DomEvent.stop) + .on(link, 'click', function () { + window.LAYER = this.options.callback.call(map.editTools); + }, this); + + return container; + } + +}); + +L.NewPolygonControl = L.EditControl.extend({ + options: { + position: 'topleft', + kind: 'polygon', + html: 'â–°' + } }); },{}],5:[function(require,module,exports){ -'use strict'; - -var martinez = require('./src/index'); - -module.exports = { - union: martinez.union, - diff: martinez.diff, - xor: martinez.xor, - intersection: martinez.intersection -}; +'use strict'; + +var martinez = require('./src/index'); + +module.exports = { + union: martinez.union, + diff: martinez.diff, + xor: martinez.xor, + intersection: martinez.intersection +}; },{"./src/index":21}],6:[function(require,module,exports){ (function (global, factory) { @@ -2676,1134 +2700,1168 @@ function swap(data, i, j) { } },{}],13:[function(require,module,exports){ -'use strict'; - -var signedArea = require('./signed_area'); -// var equals = require('./equals'); - -/** - * @param {SweepEvent} e1 - * @param {SweepEvent} e2 - * @return {Number} - */ -module.exports = function compareEvents(e1, e2) { - var p1 = e1.point; - var p2 = e2.point; - - // Different x-coordinate - if (p1[0] > p2[0]) return 1; - if (p1[0] < p2[0]) return -1; - - // Different points, but same x-coordinate - // Event with lower y-coordinate is processed first - if (p1[1] !== p2[1]) return p1[1] > p2[1] ? 1 : -1; - - return specialCases(e1, e2, p1, p2); -}; - - -/* eslint-disable no-unused-vars */ -function specialCases(e1, e2, p1, p2) { - // Same coordinates, but one is a left endpoint and the other is - // a right endpoint. The right endpoint is processed first - if (e1.left !== e2.left) - return e1.left ? 1 : -1; - - // var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; - // var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) - // Same coordinates, both events - // are left endpoints or right endpoints. - // not collinear - if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) { - // the event associate to the bottom segment is processed first - return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; - } - - // uncomment this if you want to play with multipolygons - // if (e1.isSubject === e2.isSubject) { - // if(equals(e1.point, e2.point) && e1.contourId === e2.contourId) { - // return 0; - // } else { - // return e1.contourId > e2.contourId ? 1 : -1; - // } - // } - - return (!e1.isSubject && e2.isSubject) ? 1 : -1; -} -/* eslint-enable no-unused-vars */ +'use strict'; -},{"./signed_area":25}],14:[function(require,module,exports){ -'use strict'; - -var signedArea = require('./signed_area'); -var compareEvents = require('./compare_events'); -var equals = require('./equals'); - - -/** - * @param {SweepEvent} le1 - * @param {SweepEvent} le2 - * @return {Number} - */ -module.exports = function compareSegments(le1, le2) { - if (le1 === le2) return 0; - - // Segments are not collinear - if (signedArea(le1.point, le1.otherEvent.point, le2.point) !== 0 || - signedArea(le1.point, le1.otherEvent.point, le2.otherEvent.point) !== 0) { - - // If they share their left endpoint use the right endpoint to sort - if (equals(le1.point, le2.point)) return le1.isBelow(le2.otherEvent.point) ? -1 : 1; - - // Different left endpoint: use the left endpoint to sort - if (le1.point[0] === le2.point[0]) return le1.point[1] < le2.point[1] ? -1 : 1; - - // has the line segment associated to e1 been inserted - // into S after the line segment associated to e2 ? - if (compareEvents(le1, le2) === 1) return le2.isAbove(le1.point) ? -1 : 1; - - // The line segment associated to e2 has been inserted - // into S after the line segment associated to e1 - return le1.isBelow(le2.point) ? -1 : 1; - } - - if (le1.isSubject === le2.isSubject) { // same polygon - var p1 = le1.point, p2 = le2.point; - if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) { - p1 = le1.otherEvent.point; p2 = le2.otherEvent.point; - if (p1[0] === p2[0] && p1[1] === p2[1]) return 0; - else return le1.contourId > le2.contourId ? 1 : -1; - } - } else { // Segments are collinear, but belong to separate polygons - return le1.isSubject ? -1 : 1; - } - - return compareEvents(le1, le2) === 1 ? 1 : -1; -}; +var signedArea = require('./signed_area'); +// var equals = require('./equals'); -},{"./compare_events":13,"./equals":19,"./signed_area":25}],15:[function(require,module,exports){ -'use strict'; - -var edgeType = require('./edge_type'); - -var INTERSECTION = 0; -var UNION = 1; -var DIFFERENCE = 2; -var XOR = 3; - -/** - * @param {SweepEvent} event - * @param {SweepEvent} prev - * @param {Operation} operation - */ -module.exports = function computeFields(event, prev, operation) { - // compute inOut and otherInOut fields - if (prev === null) { - event.inOut = false; - event.otherInOut = true; - - // previous line segment in sweepline belongs to the same polygon - } else { - if (event.isSubject === prev.isSubject) { - event.inOut = !prev.inOut; - event.otherInOut = prev.otherInOut; - - // previous line segment in sweepline belongs to the clipping polygon - } else { - event.inOut = !prev.otherInOut; - event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut; - } - - // compute prevInResult field - if (prev) { - event.prevInResult = (!inResult(prev, operation) || prev.isVertical()) ? - prev.prevInResult : prev; - } - } - - // check if the line segment belongs to the Boolean operation - event.inResult = inResult(event, operation); -}; - - -function inResult(event, operation) { - switch (event.type) { - case edgeType.NORMAL: - switch (operation) { - case INTERSECTION: - return !event.otherInOut; - case UNION: - return event.otherInOut; - case DIFFERENCE: - return (event.isSubject && event.otherInOut) || - (!event.isSubject && !event.otherInOut); - case XOR: - return true; - } - break; - case edgeType.SAME_TRANSITION: - return operation === INTERSECTION || operation === UNION; - case edgeType.DIFFERENT_TRANSITION: - return operation === DIFFERENCE; - case edgeType.NON_CONTRIBUTING: - return false; - } - return false; -} +/** + * @param {SweepEvent} e1 + * @param {SweepEvent} e2 + * @return {Number} + */ +module.exports = function compareEvents(e1, e2) { + var p1 = e1.point; + var p2 = e2.point; -},{"./edge_type":18}],16:[function(require,module,exports){ -'use strict'; - -// var equals = require('./equals'); -var compareEvents = require('./compare_events'); -var operationType = require('./operation'); - -/** - * @param {Array.} sortedEvents - * @return {Array.} - */ -function orderEvents(sortedEvents) { - var event, i, len, tmp; - var resultEvents = []; - for (i = 0, len = sortedEvents.length; i < len; i++) { - event = sortedEvents[i]; - if ((event.left && event.inResult) || - (!event.left && event.otherEvent.inResult)) { - resultEvents.push(event); - } - } - - // Due to overlapping edges the resultEvents array can be not wholly sorted - var sorted = false; - while (!sorted) { - sorted = true; - for (i = 0, len = resultEvents.length; i < len; i++) { - if ((i + 1) < len && - compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) { - tmp = resultEvents[i]; - resultEvents[i] = resultEvents[i + 1]; - resultEvents[i + 1] = tmp; - sorted = false; - } - } - } - - for (i = 0, len = resultEvents.length; i < len; i++) { - resultEvents[i].pos = i; - } - - for (i = 0, len = resultEvents.length; i < len; i++) { - event = resultEvents[i]; - if (!event.left) { - tmp = event.pos; - event.pos = event.otherEvent.pos; - event.otherEvent.pos = tmp; - } - } - - return resultEvents; -} - - -/** - * @param {Number} pos - * @param {Array.} resultEvents - * @param {Object>} processed - * @return {Number} - */ -function nextPos(pos, resultEvents, processed, origIndex) { - var newPos = pos + 1; - var length = resultEvents.length; - var p = resultEvents[pos].point; - var p1 = resultEvents[newPos].point; - - // if (newPos < length && - // p1[0] !== p[0] || p1[1] !== p[1] && - // !processed[newPos]) return newPos; - // else return pos - 1; - - - // while in range and not the current one by value - while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { - if (!processed[newPos]) { - // console.log(pos, newPos, length); - return newPos; - } else newPos++; - p1 = resultEvents[newPos].point; - } - - newPos = pos - 1; - - while (processed[newPos] && newPos >= origIndex) { - newPos--; - } - // console.log('other', pos, newPos, length); - return newPos; -} - - -/** - * @param {Array.} sortedEvents - * @return {Array.<*>} polygons - */ -module.exports = function (sortedEvents, operation) { - var i, len; - var resultEvents = orderEvents(sortedEvents); - - // "false"-filled array - var processed = {}; - var result = []; - var event; - - for (i = 0, len = resultEvents.length; i < len; i++) { - if (processed[i]) continue; - var contour = [[]]; - - if (!resultEvents[i].isExteriorRing) { - if (result.length === 0) { - result.push([[contour]]); - } else if (operation === operationType.UNION || operation === operationType.XOR) { - result[result.length - 1].push(contour[0]); - } else { - result[result.length - 1].push(contour); - } - } else { - result.push(contour); - } - - var ringId = result.length - 1; - var pos = i; - - var initial = resultEvents[i].point; - // initial.push(resultEvents[i].isExteriorRing); - contour[0].push(initial); - - while (pos >= i) { - event = resultEvents[pos]; - processed[pos] = true; - - if (event.left) { - event.resultInOut = false; - event.contourId = ringId; - } else { - event.otherEvent.resultInOut = true; - event.otherEvent.contourId = ringId; - } - - pos = event.pos; - processed[pos] = true; - // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); - - contour[0].push(resultEvents[pos].point); - pos = nextPos(pos, resultEvents, processed, i); - } - - pos = pos === -1 ? i : pos; - - event = resultEvents[pos]; - processed[pos] = processed[event.pos] = true; - event.otherEvent.resultInOut = true; - event.otherEvent.contourId = ringId; - } - - for (i = 0, len = result.length; i < len; i++) { - var polygon = result[i]; - for (var j = 0, jj = polygon.length; j < jj; j++) { - var polygonContour = polygon[j]; - for (var k = 0, kk = polygonContour.length; k < kk; k++) { - var coords = polygonContour[k]; - if (typeof coords[0] !== 'number') { - polygon.push(coords[0]); - polygon.splice(j, 1); - } - } - } - } - - // Handle if the result is a polygon (eg not multipoly) - // Commented it again, let's see what do we mean by that - // if (result.length === 1) result = result[0]; - return result; -}; + // Different x-coordinate + if (p1[0] > p2[0]) return 1; + if (p1[0] < p2[0]) return -1; -},{"./compare_events":13,"./operation":22}],17:[function(require,module,exports){ -'use strict'; - -var SweepEvent = require('./sweep_event'); -var equals = require('./equals'); -var compareEvents = require('./compare_events'); - -/** - * @param {SweepEvent} se - * @param {Array.} p - * @param {Queue} queue - * @return {Queue} - */ -module.exports = function divideSegment(se, p, queue) { - var r = new SweepEvent(p, false, se, se.isSubject); - var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); - - if (equals(se.point, se.otherEvent.point)) { - console.warn('what is that?', se); - } - - r.contourId = l.contourId = se.contourId; - - // avoid a rounding error. The left event would be processed after the right event - if (compareEvents(l, se.otherEvent) > 0) { - se.otherEvent.left = true; - l.left = false; - } - - // avoid a rounding error. The left event would be processed after the right event - // if (compareEvents(se, r) > 0) {} - - se.otherEvent.otherEvent = l; - se.otherEvent = r; - - queue.push(l); - queue.push(r); - - return queue; -}; + // Different points, but same x-coordinate + // Event with lower y-coordinate is processed first + if (p1[1] !== p2[1]) return p1[1] > p2[1] ? 1 : -1; -},{"./compare_events":13,"./equals":19,"./sweep_event":27}],18:[function(require,module,exports){ -'use strict'; - -module.exports = { - NORMAL: 0, - NON_CONTRIBUTING: 1, - SAME_TRANSITION: 2, - DIFFERENT_TRANSITION: 3 -}; + return specialCases(e1, e2, p1, p2); +}; -},{}],19:[function(require,module,exports){ -'use strict'; - -// var EPSILON = 1e-9; -// var abs = Math.abs; - -module.exports = function equals(p1, p2) { - if (p1[0] === p2[0]) { - if (p1[1] === p2[1]) { - return true; - } else { - return false; - } - } - return false; -}; - -// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164 -// Precision problem. -// -// module.exports = function equals(p1, p2) { -// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON; -// }; -},{}],20:[function(require,module,exports){ -'use strict'; - -var Queue = require('tinyqueue'); -var SweepEvent = require('./sweep_event'); -var compareEvents = require('./compare_events'); - -var max = Math.max; -var min = Math.min; - -var contourId = 0; - - -function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { - var i, len, s1, s2, e1, e2; - // var d = depth + 1; - for (i = 0, len = contourOrHole.length - 1; i < len; i++) { - s1 = contourOrHole[i]; - s2 = contourOrHole[i + 1]; - //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); - e1 = new SweepEvent(s1, false, undefined, isSubject); - e2 = new SweepEvent(s2, false, e1, isSubject); - e1.otherEvent = e2; - - e1.contourId = e2.contourId = depth; - if (!isExteriorRing) { - e1.isExteriorRing = false; - e2.isExteriorRing = false; - } - if (compareEvents(e1, e2) > 0) { - e2.left = true; - } else { - e1.left = true; - } - - var x = s1[0], y = s1[1]; - bbox[0] = min(bbox[0], x); - bbox[1] = min(bbox[1], y); - bbox[2] = max(bbox[2], x); - bbox[3] = max(bbox[3], y); - - // Pushing it so the queue is sorted from left to right, - // with object on the left having the highest priority. - Q.push(e1); - Q.push(e2); - } -} - - -module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { - var eventQueue = new Queue(null, compareEvents); - var polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk; - - for (i = 0, ii = subject.length; i < ii; i++) { - polygonSet = subject[i]; - for (j = 0, jj = polygonSet.length; j < jj; j++) { - isExteriorRing = j === 0; - if (isExteriorRing) contourId++; - processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing); - } - } - - for (i = 0, ii = clipping.length; i < ii; i++) { - polygonSet = clipping[i]; - for (j = 0, jj = polygonSet.length; j < jj; j++) { - isExteriorRing = j === 0; - if (isExteriorRing) contourId++; - processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing); - } - } - - return eventQueue; -}; +/* eslint-disable no-unused-vars */ +function specialCases(e1, e2, p1, p2) { + // Same coordinates, but one is a left endpoint and the other is + // a right endpoint. The right endpoint is processed first + if (e1.left !== e2.left) + return e1.left ? 1 : -1; + + // var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; + // var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) + // Same coordinates, both events + // are left endpoints or right endpoints. + // not collinear + if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) { + // the event associate to the bottom segment is processed first + return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; + } + + // uncomment this if you want to play with multipolygons + // if (e1.isSubject === e2.isSubject) { + // if(equals(e1.point, e2.point) && e1.contourId === e2.contourId) { + // return 0; + // } else { + // return e1.contourId > e2.contourId ? 1 : -1; + // } + // } + + return (!e1.isSubject && e2.isSubject) ? 1 : -1; +} +/* eslint-enable no-unused-vars */ + +},{"./signed_area":25}],14:[function(require,module,exports){ +'use strict'; + +var signedArea = require('./signed_area'); +var compareEvents = require('./compare_events'); +var equals = require('./equals'); + + +/** + * @param {SweepEvent} le1 + * @param {SweepEvent} le2 + * @return {Number} + */ +module.exports = function compareSegments(le1, le2) { + if (le1 === le2) return 0; + + // Segments are not collinear + if (signedArea(le1.point, le1.otherEvent.point, le2.point) !== 0 || + signedArea(le1.point, le1.otherEvent.point, le2.otherEvent.point) !== 0) { + + // If they share their left endpoint use the right endpoint to sort + if (equals(le1.point, le2.point)) return le1.isBelow(le2.otherEvent.point) ? -1 : 1; + + // Different left endpoint: use the left endpoint to sort + if (le1.point[0] === le2.point[0]) return le1.point[1] < le2.point[1] ? -1 : 1; + + // has the line segment associated to e1 been inserted + // into S after the line segment associated to e2 ? + if (compareEvents(le1, le2) === 1) return le2.isAbove(le1.point) ? -1 : 1; + + // The line segment associated to e2 has been inserted + // into S after the line segment associated to e1 + return le1.isBelow(le2.point) ? -1 : 1; + } + + if (le1.isSubject === le2.isSubject) { // same polygon + var p1 = le1.point, p2 = le2.point; + if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) { + p1 = le1.otherEvent.point; p2 = le2.otherEvent.point; + if (p1[0] === p2[0] && p1[1] === p2[1]) return 0; + else return le1.contourId > le2.contourId ? 1 : -1; + } + } else { // Segments are collinear, but belong to separate polygons + return le1.isSubject ? -1 : 1; + } + + return compareEvents(le1, le2) === 1 ? 1 : -1; +}; + +},{"./compare_events":13,"./equals":19,"./signed_area":25}],15:[function(require,module,exports){ +'use strict'; + +var edgeType = require('./edge_type'); + +var INTERSECTION = 0; +var UNION = 1; +var DIFFERENCE = 2; +var XOR = 3; + +/** + * @param {SweepEvent} event + * @param {SweepEvent} prev + * @param {Operation} operation + */ +module.exports = function computeFields(event, prev, operation) { + // compute inOut and otherInOut fields + if (prev === null) { + event.inOut = false; + event.otherInOut = true; + + // previous line segment in sweepline belongs to the same polygon + } else { + if (event.isSubject === prev.isSubject) { + event.inOut = !prev.inOut; + event.otherInOut = prev.otherInOut; + + // previous line segment in sweepline belongs to the clipping polygon + } else { + event.inOut = !prev.otherInOut; + event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut; + } + + // compute prevInResult field + if (prev) { + event.prevInResult = (!inResult(prev, operation) || prev.isVertical()) ? + prev.prevInResult : prev; + } + } + + // check if the line segment belongs to the Boolean operation + event.inResult = inResult(event, operation); +}; + + +function inResult(event, operation) { + switch (event.type) { + case edgeType.NORMAL: + switch (operation) { + case INTERSECTION: + return !event.otherInOut; + case UNION: + return event.otherInOut; + case DIFFERENCE: + // return (event.isSubject && !event.otherInOut) || + // (!event.isSubject && event.otherInOut); + return (event.isSubject && event.otherInOut) || + (!event.isSubject && !event.otherInOut); + case XOR: + return true; + } + break; + case edgeType.SAME_TRANSITION: + return operation === INTERSECTION || operation === UNION; + case edgeType.DIFFERENT_TRANSITION: + return operation === DIFFERENCE; + case edgeType.NON_CONTRIBUTING: + return false; + } + return false; +} + +},{"./edge_type":18}],16:[function(require,module,exports){ +'use strict'; + +// var equals = require('./equals'); +var compareEvents = require('./compare_events'); +var operationType = require('./operation'); + +/** + * @param {Array.} sortedEvents + * @return {Array.} + */ +function orderEvents(sortedEvents) { + var event, i, len, tmp; + var resultEvents = []; + for (i = 0, len = sortedEvents.length; i < len; i++) { + event = sortedEvents[i]; + if ((event.left && event.inResult) || + (!event.left && event.otherEvent.inResult)) { + resultEvents.push(event); + } + } + + // Due to overlapping edges the resultEvents array can be not wholly sorted + var sorted = false; + while (!sorted) { + sorted = true; + for (i = 0, len = resultEvents.length; i < len; i++) { + if ((i + 1) < len && + compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) { + tmp = resultEvents[i]; + resultEvents[i] = resultEvents[i + 1]; + resultEvents[i + 1] = tmp; + sorted = false; + } + } + } + + for (i = 0, len = resultEvents.length; i < len; i++) { + resultEvents[i].pos = i; + } + + for (i = 0, len = resultEvents.length; i < len; i++) { + event = resultEvents[i]; + if (!event.left) { + tmp = event.pos; + event.pos = event.otherEvent.pos; + event.otherEvent.pos = tmp; + } + } + + return resultEvents; +} + + +/** + * @param {Number} pos + * @param {Array.} resultEvents + * @param {Object>} processed + * @return {Number} + */ +function nextPos(pos, resultEvents, processed, origIndex) { + var newPos = pos + 1; + var length = resultEvents.length; + if (newPos > length - 1) return pos - 1; + var p = resultEvents[pos].point; + var p1 = resultEvents[newPos].point; + + // if (newPos < length && + // p1[0] !== p[0] || p1[1] !== p[1] && + // !processed[newPos]) return newPos; + // else return pos - 1; + + + // while in range and not the current one by value + while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { + if (!processed[newPos]) { + // console.log(pos, newPos, length); + return newPos; + } else { + newPos++; + } + p1 = resultEvents[newPos].point; + } + + newPos = pos - 1; + + while (processed[newPos] && newPos >= origIndex) { + newPos--; + } + // console.log('other', pos, newPos, length); + return newPos; +} + + +/** + * @param {Array.} sortedEvents + * @return {Array.<*>} polygons + */ +module.exports = function (sortedEvents, operation) { + var i, len; + var resultEvents = orderEvents(sortedEvents); + //_renderPoints(sortedEvents, 'inResult'); + + // "false"-filled array + var processed = {}; + var result = []; + var event; + + for (i = 0, len = resultEvents.length; i < len; i++) { + if (processed[i]) continue; + var contour = [[]]; + + if (!resultEvents[i].isExteriorRing) { + if (result.length === 0) { + result.push([[contour]]); + } else if (operation === operationType.UNION || operation === operationType.XOR) { + result[result.length - 1].push(contour[0]); + } else { + result[result.length - 1].push(contour); + } + } else { + result.push(contour); + } + + var ringId = result.length - 1; + var pos = i; + + var initial = resultEvents[i].point; + // initial.push(resultEvents[i].isExteriorRing); + contour[0].push(initial); + + while (pos >= i) { + event = resultEvents[pos]; + processed[pos] = true; + + if (event.left) { + event.resultInOut = false; + event.contourId = ringId; + } else { + event.otherEvent.resultInOut = true; + event.otherEvent.contourId = ringId; + } + + pos = event.pos; + processed[pos] = true; + // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); + + contour[0].push(resultEvents[pos].point); + pos = nextPos(pos, resultEvents, processed, i); + } + + pos = pos === -1 ? i : pos; + + event = resultEvents[pos]; + processed[pos] = processed[event.pos] = true; + event.otherEvent.resultInOut = true; + event.otherEvent.contourId = ringId; + } + // _renderPoints(resultEvents, 'resultInOut'); + + for (i = 0, len = result.length; i < len; i++) { + var polygon = result[i]; + for (var j = 0, jj = polygon.length; j < jj; j++) { + var polygonContour = polygon[j]; + for (var k = 0, kk = polygonContour.length; k < kk; k++) { + var coords = polygonContour[k]; + if (typeof coords[0] !== 'number') { + polygon.push(coords[0]); + polygon.splice(j, 1); + } + } + } + } + + // Handle if the result is a polygon (eg not multipoly) + // Commented it again, let's see what do we mean by that + // if (result.length === 1) result = result[0]; + return result; +}; + + +/* eslint-disable no-unused-vars, no-debugger, no-undef, no-use-before-define */ +function _renderPoints(possiblePoints, prop) { + var map = window.map; + if (!map) return; + if (points !== undefined) points.clearLayers(); + + var points = L.layerGroup([]).addTo(map); + possiblePoints.forEach(function (e) { + var point = L.circleMarker([e.point[1], e.point[0]], { + radius: getRandomSize(), + color: getColor(e[prop]), + weight: 1 + }).addTo(points); + }); +} + +/* eslint-enable no-unused-vars, no-debugger, no-undef */ + +function getColor(prop) { + return prop ? 'green' : 'red'; +} + +function getRandomSize() { + return Math.floor(5 + Math.random() * 10); +} + +},{"./compare_events":13,"./operation":22}],17:[function(require,module,exports){ +'use strict'; + +var SweepEvent = require('./sweep_event'); +var equals = require('./equals'); +var compareEvents = require('./compare_events'); + +/** + * @param {SweepEvent} se + * @param {Array.} p + * @param {Queue} queue + * @return {Queue} + */ +module.exports = function divideSegment(se, p, queue) { + var r = new SweepEvent(p, false, se, se.isSubject); + var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); + + if (equals(se.point, se.otherEvent.point)) { + console.warn('what is that, a collapsed segment?', se); + } + + r.contourId = l.contourId = se.contourId; + + // avoid a rounding error. The left event would be processed after the right event + if (compareEvents(l, se.otherEvent) > 0) { + se.otherEvent.left = true; + l.left = false; + } + + // avoid a rounding error. The left event would be processed after the right event + // if (compareEvents(se, r) > 0) {} + + se.otherEvent.otherEvent = l; + se.otherEvent = r; + + queue.push(l); + queue.push(r); + + return queue; +}; + +},{"./compare_events":13,"./equals":19,"./sweep_event":27}],18:[function(require,module,exports){ +'use strict'; + +module.exports = { + NORMAL: 0, + NON_CONTRIBUTING: 1, + SAME_TRANSITION: 2, + DIFFERENT_TRANSITION: 3 +}; + +},{}],19:[function(require,module,exports){ +'use strict'; + +// var EPSILON = 1e-9; +// var abs = Math.abs; + +module.exports = function equals(p1, p2) { + if (p1[0] === p2[0]) { + if (p1[1] === p2[1]) { + return true; + } else { + return false; + } + } + return false; +}; + +// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164 +// Precision problem. +// +// module.exports = function equals(p1, p2) { +// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON; +// }; + +},{}],20:[function(require,module,exports){ +'use strict'; + +var Queue = require('tinyqueue'); +var SweepEvent = require('./sweep_event'); +var compareEvents = require('./compare_events'); + +var max = Math.max; +var min = Math.min; + +var contourId = 0; + + +function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { + var i, len, s1, s2, e1, e2; + // var d = depth + 1; + for (i = 0, len = contourOrHole.length - 1; i < len; i++) { + s1 = contourOrHole[i]; + s2 = contourOrHole[i + 1]; + //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); + e1 = new SweepEvent(s1, false, undefined, isSubject); + e2 = new SweepEvent(s2, false, e1, isSubject); + e1.otherEvent = e2; + + e1.contourId = e2.contourId = depth; + if (!isExteriorRing) { + e1.isExteriorRing = false; + e2.isExteriorRing = false; + } + if (compareEvents(e1, e2) > 0) { + e2.left = true; + } else { + e1.left = true; + } + + var x = s1[0], y = s1[1]; + bbox[0] = min(bbox[0], x); + bbox[1] = min(bbox[1], y); + bbox[2] = max(bbox[2], x); + bbox[3] = max(bbox[3], y); + + // Pushing it so the queue is sorted from left to right, + // with object on the left having the highest priority. + Q.push(e1); + Q.push(e2); + } +} + + +module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { + var eventQueue = new Queue(null, compareEvents); + var polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk; + + for (i = 0, ii = subject.length; i < ii; i++) { + polygonSet = subject[i]; + for (j = 0, jj = polygonSet.length; j < jj; j++) { + isExteriorRing = j === 0; + if (isExteriorRing) contourId++; + processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing); + } + } + + for (i = 0, ii = clipping.length; i < ii; i++) { + polygonSet = clipping[i]; + for (j = 0, jj = polygonSet.length; j < jj; j++) { + isExteriorRing = j === 0; + if (isExteriorRing) contourId++; + processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing); + } + } + + return eventQueue; +}; },{"./compare_events":13,"./sweep_event":27,"tinyqueue":12}],21:[function(require,module,exports){ -'use strict'; - -var subdivideSegments = require('./subdivide_segments'); -var connectEdges = require('./connect_edges'); -var fillQueue = require('./fill_queue'); -var operations = require('./operation'); - -var EMPTY = []; - - -function trivialOperation(subject, clipping, operation) { - var result = null; - if (subject.length * clipping.length === 0) { - if (operation === operations.INTERSECTION) { - result = EMPTY; - } else if (operation === operations.DIFFERENCE) { - result = subject; - } else if (operation === operations.UNION || - operation === operations.XOR) { - result = (subject.length === 0) ? clipping : subject; - } - } - return result; -} - - -function compareBBoxes(subject, clipping, sbbox, cbbox, operation) { - var result = null; - if (sbbox[0] > cbbox[2] || - cbbox[0] > sbbox[2] || - sbbox[1] > cbbox[3] || - cbbox[1] > sbbox[3]) { - if (operation === operations.INTERSECTION) { - result = EMPTY; - } else if (operation === operations.DIFFERENCE) { - result = subject; - } else if (operation === operations.UNION || - operation === operations.XOR) { - result = subject.concat(clipping); - } - } - return result; -} - - -function boolean(subject, clipping, operation) { - if (typeof subject[0][0][0] === 'number') { - subject = [subject]; - } - if (typeof clipping[0][0][0] === 'number') { - clipping = [clipping]; - } - var trivial = trivialOperation(subject, clipping, operation); - if (trivial) { - return trivial === EMPTY ? null : trivial; - } - var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; - var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; - - //console.time('fill'); - var eventQueue = fillQueue(subject, clipping, sbbox, cbbox); - //console.timeEnd('fill'); - - trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation); - if (trivial) { - return trivial === EMPTY ? null : trivial; - } - //console.time('subdiv'); - var sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); - //console.timeEnd('subdiv'); - //console.time('connect'); - var result = connectEdges(sortedEvents, operation); - //console.timeEnd('connect'); - return result; -} - - -module.exports = boolean; - - -module.exports.union = function (subject, clipping) { - return boolean(subject, clipping, operations.UNION); -}; - - -module.exports.diff = function (subject, clipping) { - return boolean(subject, clipping, operations.DIFFERENCE); -}; - - -module.exports.xor = function (subject, clipping) { - return boolean(subject, clipping, operations.XOR); -}; - - -module.exports.intersection = function (subject, clipping) { - return boolean(subject, clipping, operations.INTERSECTION); -}; - - -/** - * @enum {Number} - */ -module.exports.operations = operations; +'use strict'; + +var subdivideSegments = require('./subdivide_segments'); +var connectEdges = require('./connect_edges'); +var fillQueue = require('./fill_queue'); +var operations = require('./operation'); + +var EMPTY = []; + + +function trivialOperation(subject, clipping, operation) { + var result = null; + if (subject.length * clipping.length === 0) { + if (operation === operations.INTERSECTION) { + result = EMPTY; + } else if (operation === operations.DIFFERENCE) { + result = subject; + } else if (operation === operations.UNION || + operation === operations.XOR) { + result = (subject.length === 0) ? clipping : subject; + } + } + return result; +} + + +function compareBBoxes(subject, clipping, sbbox, cbbox, operation) { + var result = null; + if (sbbox[0] > cbbox[2] || + cbbox[0] > sbbox[2] || + sbbox[1] > cbbox[3] || + cbbox[1] > sbbox[3]) { + if (operation === operations.INTERSECTION) { + result = EMPTY; + } else if (operation === operations.DIFFERENCE) { + result = subject; + } else if (operation === operations.UNION || + operation === operations.XOR) { + result = subject.concat(clipping); + } + } + return result; +} + + +function boolean(subject, clipping, operation) { + if (typeof subject[0][0][0] === 'number') { + subject = [subject]; + } + if (typeof clipping[0][0][0] === 'number') { + clipping = [clipping]; + } + var trivial = trivialOperation(subject, clipping, operation); + if (trivial) { + return trivial === EMPTY ? null : trivial; + } + var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; + var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; + + //console.time('fill'); + var eventQueue = fillQueue(subject, clipping, sbbox, cbbox); + //console.timeEnd('fill'); + + trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation); + if (trivial) { + return trivial === EMPTY ? null : trivial; + } + //console.time('subdiv'); + var sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); + //console.timeEnd('subdiv'); + //console.time('connect'); + var result = connectEdges(sortedEvents, operation); + //console.timeEnd('connect'); + return result; +} + + +module.exports = boolean; + + +module.exports.union = function (subject, clipping) { + return boolean(subject, clipping, operations.UNION); +}; + + +module.exports.diff = function (subject, clipping) { + return boolean(subject, clipping, operations.DIFFERENCE); +}; + + +module.exports.xor = function (subject, clipping) { + return boolean(subject, clipping, operations.XOR); +}; + + +module.exports.intersection = function (subject, clipping) { + return boolean(subject, clipping, operations.INTERSECTION); +}; + + +/** + * @enum {Number} + */ +module.exports.operations = operations; + +},{"./connect_edges":16,"./fill_queue":20,"./operation":22,"./subdivide_segments":26}],22:[function(require,module,exports){ +'use strict'; + +module.exports = { + INTERSECTION: 0, + UNION: 1, + DIFFERENCE: 2, + XOR: 3 +}; + +},{}],23:[function(require,module,exports){ +'use strict'; + +var divideSegment = require('./divide_segment'); +var intersection = require('./segment_intersection'); +var equals = require('./equals'); +var compareEvents = require('./compare_events'); +var edgeType = require('./edge_type'); + +/** + * @param {SweepEvent} se1 + * @param {SweepEvent} se2 + * @param {Queue} queue + * @return {Number} + */ +module.exports = function possibleIntersection(se1, se2, queue) { + // that disallows self-intersecting polygons, + // did cost us half a day, so I'll leave it + // out of respect + // if (se1.isSubject === se2.isSubject) return; + var inter = intersection( + se1.point, se1.otherEvent.point, + se2.point, se2.otherEvent.point + ); + + var nintersections = inter ? inter.length : 0; + if (nintersections === 0) return 0; // no intersection + + // the line segments intersect at an endpoint of both line segments + if ((nintersections === 1) && + (equals(se1.point, se2.point) || + equals(se1.otherEvent.point, se2.otherEvent.point))) { + return 0; + } + + if (nintersections === 2 && se1.isSubject === se2.isSubject) { + // if(se1.contourId === se2.contourId){ + // console.warn('Edges of the same polygon overlap', + // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point); + // } + //throw new Error('Edges of the same polygon overlap'); + return 0; + } + + // The line segments associated to se1 and se2 intersect + if (nintersections === 1) { + + // if the intersection point is not an endpoint of se1 + if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) { + divideSegment(se1, inter[0], queue); + } + + // if the intersection point is not an endpoint of se2 + if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) { + divideSegment(se2, inter[0], queue); + } + return 1; + } -},{"./connect_edges":16,"./fill_queue":20,"./operation":22,"./subdivide_segments":26}],22:[function(require,module,exports){ -'use strict'; - -module.exports = { - INTERSECTION: 0, - UNION: 1, - DIFFERENCE: 2, - XOR: 3 -}; + // The line segments associated to se1 and se2 overlap + var events = []; + var leftCoincide = false; + var rightCoincide = false; -},{}],23:[function(require,module,exports){ -'use strict'; - -var divideSegment = require('./divide_segment'); -var intersection = require('./segment_intersection'); -var equals = require('./equals'); -var compareEvents = require('./compare_events'); -var edgeType = require('./edge_type'); - -/** - * @param {SweepEvent} se1 - * @param {SweepEvent} se2 - * @param {Queue} queue - * @return {Number} - */ -module.exports = function possibleIntersection(se1, se2, queue) { - // that disallows self-intersecting polygons, - // did cost us half a day, so I'll leave it - // out of respect - // if (se1.isSubject === se2.isSubject) return; - var inter = intersection( - se1.point, se1.otherEvent.point, - se2.point, se2.otherEvent.point - ); - - var nintersections = inter ? inter.length : 0; - if (nintersections === 0) return 0; // no intersection - - // the line segments intersect at an endpoint of both line segments - if ((nintersections === 1) && - (equals(se1.point, se2.point) || - equals(se1.otherEvent.point, se2.otherEvent.point))) { - return 0; - } - - if (nintersections === 2 && se1.isSubject === se2.isSubject) { - // if(se1.contourId === se2.contourId){ - // console.warn('Edges of the same polygon overlap', - // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point); - // } - //throw new Error('Edges of the same polygon overlap'); - return 0; - } - - // The line segments associated to se1 and se2 intersect - if (nintersections === 1) { - - // if the intersection point is not an endpoint of se1 - if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) { - divideSegment(se1, inter[0], queue); - } - - // if the intersection point is not an endpoint of se2 - if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) { - divideSegment(se2, inter[0], queue); - } - return 1; - } - - // The line segments associated to se1 and se2 overlap - var events = []; - var leftCoincide = false; - var rightCoincide = false; - - if (equals(se1.point, se2.point)) { - leftCoincide = true; // linked - } else if (compareEvents(se1, se2) === 1) { - events.push(se2, se1); - } else { - events.push(se1, se2); - } - - if (equals(se1.otherEvent.point, se2.otherEvent.point)) { - rightCoincide = true; - } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) { - events.push(se2.otherEvent, se1.otherEvent); - } else { - events.push(se1.otherEvent, se2.otherEvent); - } - - if ((leftCoincide && rightCoincide) || leftCoincide) { - // both line segments are equal or share the left endpoint - se1.type = edgeType.NON_CONTRIBUTING; - se2.type = (se1.inOut === se2.inOut) ? - edgeType.SAME_TRANSITION : - edgeType.DIFFERENT_TRANSITION; - - if (leftCoincide && !rightCoincide) { - // honestly no idea, but changing events selection from [2, 1] - // to [0, 1] fixes the overlapping self-intersecting polygons issue - divideSegment(events[1].otherEvent, events[0].point, queue); - } - return 2; - } - - // the line segments share the right endpoint - if (rightCoincide) { - divideSegment(events[0], events[1].point, queue); - return 3; - } - - // no line segment includes totally the other one - if (events[0] !== events[3].otherEvent) { - divideSegment(events[0], events[1].point, queue); - divideSegment(events[1], events[2].point, queue); - return 3; - } - - // one line segment includes the other one - divideSegment(events[0], events[1].point, queue); - divideSegment(events[3].otherEvent, events[2].point, queue); - - return 3; -}; + if (equals(se1.point, se2.point)) { + leftCoincide = true; // linked + } else if (compareEvents(se1, se2) === 1) { + events.push(se2, se1); + } else { + events.push(se1, se2); + } + + if (equals(se1.otherEvent.point, se2.otherEvent.point)) { + rightCoincide = true; + } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) { + events.push(se2.otherEvent, se1.otherEvent); + } else { + events.push(se1.otherEvent, se2.otherEvent); + } + + if ((leftCoincide && rightCoincide) || leftCoincide) { + // both line segments are equal or share the left endpoint + se1.type = edgeType.NON_CONTRIBUTING; + se2.type = (se1.inOut === se2.inOut) ? + edgeType.SAME_TRANSITION : + edgeType.DIFFERENT_TRANSITION; + + if (leftCoincide && !rightCoincide) { + // honestly no idea, but changing events selection from [2, 1] + // to [0, 1] fixes the overlapping self-intersecting polygons issue + divideSegment(events[1].otherEvent, events[0].point, queue); + } + return 2; + } + + // the line segments share the right endpoint + if (rightCoincide) { + divideSegment(events[0], events[1].point, queue); + return 3; + } + + // no line segment includes totally the other one + if (events[0] !== events[3].otherEvent) { + divideSegment(events[0], events[1].point, queue); + divideSegment(events[1], events[2].point, queue); + return 3; + } + + // one line segment includes the other one + divideSegment(events[0], events[1].point, queue); + divideSegment(events[3].otherEvent, events[2].point, queue); + + return 3; +}; },{"./compare_events":13,"./divide_segment":17,"./edge_type":18,"./equals":19,"./segment_intersection":24}],24:[function(require,module,exports){ -'use strict'; - -var EPSILON = 1e-9; - -/** - * Finds the magnitude of the cross product of two vectors (if we pretend - * they're in three dimensions) - * - * @param {Object} a First vector - * @param {Object} b Second vector - * @private - * @returns {Number} The magnitude of the cross product - */ -function crossProduct(a, b) { - return a[0] * b[1] - a[1] * b[0]; -} - -/** - * Finds the dot product of two vectors. - * - * @param {Object} a First vector - * @param {Object} b Second vector - * @private - * @returns {Number} The dot product - */ -function dotProduct(a, b) { - return a[0] * b[0] + a[1] * b[1]; -} - -/** - * Finds the intersection (if any) between two line segments a and b, given the - * line segments' end points a1, a2 and b1, b2. - * - * This algorithm is based on Schneider and Eberly. - * http://www.cimec.org.ar/~ncalvo/Schneider_Eberly.pdf - * Page 244. - * - * @param {Array.} a1 point of first line - * @param {Array.} a2 point of first line - * @param {Array.} b1 point of second line - * @param {Array.} b2 point of second line - * @param {Boolean=} noEndpointTouch whether to skip single touchpoints - * (meaning connected segments) as - * intersections - * @returns {Array.>|Null} If the lines intersect, the point of - * intersection. If they overlap, the two end points of the overlapping segment. - * Otherwise, null. - */ -module.exports = function (a1, a2, b1, b2, noEndpointTouch) { - // The algorithm expects our lines in the form P + sd, where P is a point, - // s is on the interval [0, 1], and d is a vector. - // We are passed two points. P can be the first point of each pair. The - // vector, then, could be thought of as the distance (in x and y components) - // from the first point to the second point. - // So first, let's make our vectors: - var va = [a2[0] - a1[0], a2[1] - a1[1]]; - var vb = [b2[0] - b1[0], b2[1] - b1[1]]; - // We also define a function to convert back to regular point form: - - /* eslint-disable arrow-body-style */ - - function toPoint(p, s, d) { - return [ - p[0] + s * d[0], - p[1] + s * d[1] - ]; - } - - /* eslint-enable arrow-body-style */ - - // The rest is pretty much a straight port of the algorithm. - var e = [b1[0] - a1[0], b1[1] - a1[1]]; - var kross = crossProduct(va, vb); - var sqrKross = kross * kross; - var sqrLenA = dotProduct(va, va); - var sqrLenB = dotProduct(vb, vb); - - // Check for line intersection. This works because of the properties of the - // cross product -- specifically, two vectors are parallel if and only if the - // cross product is the 0 vector. The full calculation involves relative error - // to account for possible very small line segments. See Schneider & Eberly - // for details. - if (sqrKross > EPSILON * sqrLenA * sqrLenB) { - // If they're not parallel, then (because these are line segments) they - // still might not actually intersect. This code checks that the - // intersection point of the lines is actually on both line segments. - var s = crossProduct(e, vb) / kross; - if (s < 0 || s > 1) { - // not on line segment a - return null; - } - var t = crossProduct(e, va) / kross; - if (t < 0 || t > 1) { - // not on line segment b - return null; - } - return noEndpointTouch ? null : [toPoint(a1, s, va)]; - } - - // If we've reached this point, then the lines are either parallel or the - // same, but the segments could overlap partially or fully, or not at all. - // So we need to find the overlap, if any. To do that, we can use e, which is - // the (vector) difference between the two initial points. If this is parallel - // with the line itself, then the two lines are the same line, and there will - // be overlap. - var sqrLenE = dotProduct(e, e); - kross = crossProduct(e, va); - sqrKross = kross * kross; - - if (sqrKross > EPSILON * sqrLenA * sqrLenE) { - // Lines are just parallel, not the same. No overlap. - return null; - } - - var sa = dotProduct(va, e) / sqrLenA; - var sb = sa + dotProduct(va, vb) / sqrLenA; - var smin = Math.min(sa, sb); - var smax = Math.max(sa, sb); - - // this is, essentially, the FindIntersection acting on floats from - // Schneider & Eberly, just inlined into this function. - if (smin <= 1 && smax >= 0) { - - // overlap on an end point - if (smin === 1) { - return noEndpointTouch ? null : [toPoint(a1, smin > 0 ? smin : 0, va)]; - } - - if (smax === 0) { - return noEndpointTouch ? null : [toPoint(a1, smax < 1 ? smax : 1, va)]; - } - - if (noEndpointTouch && smin === 0 && smax === 1) return null; - - // There's overlap on a segment -- two points of intersection. Return both. - return [ - toPoint(a1, smin > 0 ? smin : 0, va), - toPoint(a1, smax < 1 ? smax : 1, va), - ]; - } - - return null; -}; +'use strict'; + +var EPSILON = 1e-9; + +/** + * Finds the magnitude of the cross product of two vectors (if we pretend + * they're in three dimensions) + * + * @param {Object} a First vector + * @param {Object} b Second vector + * @private + * @returns {Number} The magnitude of the cross product + */ +function crossProduct(a, b) { + return a[0] * b[1] - a[1] * b[0]; +} + +/** + * Finds the dot product of two vectors. + * + * @param {Object} a First vector + * @param {Object} b Second vector + * @private + * @returns {Number} The dot product + */ +function dotProduct(a, b) { + return a[0] * b[0] + a[1] * b[1]; +} + +/** + * Finds the intersection (if any) between two line segments a and b, given the + * line segments' end points a1, a2 and b1, b2. + * + * This algorithm is based on Schneider and Eberly. + * http://www.cimec.org.ar/~ncalvo/Schneider_Eberly.pdf + * Page 244. + * + * @param {Array.} a1 point of first line + * @param {Array.} a2 point of first line + * @param {Array.} b1 point of second line + * @param {Array.} b2 point of second line + * @param {Boolean=} noEndpointTouch whether to skip single touchpoints + * (meaning connected segments) as + * intersections + * @returns {Array.>|Null} If the lines intersect, the point of + * intersection. If they overlap, the two end points of the overlapping segment. + * Otherwise, null. + */ +module.exports = function (a1, a2, b1, b2, noEndpointTouch) { + // The algorithm expects our lines in the form P + sd, where P is a point, + // s is on the interval [0, 1], and d is a vector. + // We are passed two points. P can be the first point of each pair. The + // vector, then, could be thought of as the distance (in x and y components) + // from the first point to the second point. + // So first, let's make our vectors: + var va = [a2[0] - a1[0], a2[1] - a1[1]]; + var vb = [b2[0] - b1[0], b2[1] - b1[1]]; + // We also define a function to convert back to regular point form: + + /* eslint-disable arrow-body-style */ + + function toPoint(p, s, d) { + return [ + p[0] + s * d[0], + p[1] + s * d[1] + ]; + } + + /* eslint-enable arrow-body-style */ + + // The rest is pretty much a straight port of the algorithm. + var e = [b1[0] - a1[0], b1[1] - a1[1]]; + var kross = crossProduct(va, vb); + var sqrKross = kross * kross; + var sqrLenA = dotProduct(va, va); + var sqrLenB = dotProduct(vb, vb); + + // Check for line intersection. This works because of the properties of the + // cross product -- specifically, two vectors are parallel if and only if the + // cross product is the 0 vector. The full calculation involves relative error + // to account for possible very small line segments. See Schneider & Eberly + // for details. + if (sqrKross > EPSILON * sqrLenA * sqrLenB) { + // If they're not parallel, then (because these are line segments) they + // still might not actually intersect. This code checks that the + // intersection point of the lines is actually on both line segments. + var s = crossProduct(e, vb) / kross; + if (s < 0 || s > 1) { + // not on line segment a + return null; + } + var t = crossProduct(e, va) / kross; + if (t < 0 || t > 1) { + // not on line segment b + return null; + } + return noEndpointTouch ? null : [toPoint(a1, s, va)]; + } + + // If we've reached this point, then the lines are either parallel or the + // same, but the segments could overlap partially or fully, or not at all. + // So we need to find the overlap, if any. To do that, we can use e, which is + // the (vector) difference between the two initial points. If this is parallel + // with the line itself, then the two lines are the same line, and there will + // be overlap. + var sqrLenE = dotProduct(e, e); + kross = crossProduct(e, va); + sqrKross = kross * kross; + + if (sqrKross > EPSILON * sqrLenA * sqrLenE) { + // Lines are just parallel, not the same. No overlap. + return null; + } + + var sa = dotProduct(va, e) / sqrLenA; + var sb = sa + dotProduct(va, vb) / sqrLenA; + var smin = Math.min(sa, sb); + var smax = Math.max(sa, sb); + + // this is, essentially, the FindIntersection acting on floats from + // Schneider & Eberly, just inlined into this function. + if (smin <= 1 && smax >= 0) { + + // overlap on an end point + if (smin === 1) { + return noEndpointTouch ? null : [toPoint(a1, smin > 0 ? smin : 0, va)]; + } + + if (smax === 0) { + return noEndpointTouch ? null : [toPoint(a1, smax < 1 ? smax : 1, va)]; + } + + if (noEndpointTouch && smin === 0 && smax === 1) return null; + + // There's overlap on a segment -- two points of intersection. Return both. + return [ + toPoint(a1, smin > 0 ? smin : 0, va), + toPoint(a1, smax < 1 ? smax : 1, va), + ]; + } + + return null; +}; },{}],25:[function(require,module,exports){ -'use strict'; - -/** - * Signed area of the triangle (p0, p1, p2) - * @param {Array.} p0 - * @param {Array.} p1 - * @param {Array.} p2 - * @return {Number} - */ -module.exports = function signedArea(p0, p1, p2) { - return (p0[0] - p2[0]) * (p1[1] - p2[1]) - (p1[0] - p2[0]) * (p0[1] - p2[1]); -}; +'use strict'; + +/** + * Signed area of the triangle (p0, p1, p2) + * @param {Array.} p0 + * @param {Array.} p1 + * @param {Array.} p2 + * @return {Number} + */ +module.exports = function signedArea(p0, p1, p2) { + return (p0[0] - p2[0]) * (p1[1] - p2[1]) - (p1[0] - p2[0]) * (p0[1] - p2[1]); +}; },{}],26:[function(require,module,exports){ -'use strict'; - -var Tree = require('avl'); -var computeFields = require('./compute_fields'); -var possibleIntersection = require('./possible_intersection'); -var compareSegments = require('./compare_segments'); -var operations = require('./operation'); - - -module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) { - var sweepLine = new Tree(compareSegments); - var sortedEvents = []; - - var rightbound = Math.min(sbbox[2], cbbox[2]); - - var prev, next, begin; - - var INTERSECTION = operations.INTERSECTION; - var DIFFERENCE = operations.DIFFERENCE; - - while (eventQueue.length) { - var event = eventQueue.pop(); - sortedEvents.push(event); - - // optimization by bboxes for intersection and difference goes here - if ((operation === INTERSECTION && event.point[0] > rightbound) || - (operation === DIFFERENCE && event.point[0] > sbbox[2])) { - break; - } - - if (event.left) { - next = prev = sweepLine.insert(event); - //_renderSweepLine(sweepLine, event.point, event); - begin = sweepLine.minNode(); - - if (prev !== begin) prev = sweepLine.prev(prev); - else prev = null; - - next = sweepLine.next(next); - - var prevEvent = prev ? prev.key : null; - var prevprevEvent; - computeFields(event, prevEvent, operation); - if (next) { - if (possibleIntersection(event, next.key, eventQueue) === 2) { - computeFields(event, prevEvent, operation); - computeFields(event, next.key, operation); - } - } - if (prev) { - if (possibleIntersection(prev.key, event, eventQueue) === 2) { - var prevprev = prev; - if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); - else prevprev = null; - - prevprevEvent = prevprev ? prevprev.key : null; - computeFields(prevEvent, prevprevEvent, operation); - computeFields(event, prevEvent, operation); - } - } - } else { - event = event.otherEvent; - next = prev = sweepLine.find(event); - - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - - if (prev && next) { - - if (prev !== begin) prev = sweepLine.prev(prev); - else prev = null; - - next = sweepLine.next(next); - sweepLine.remove(event); - - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - - if (next && prev) { - //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { - possibleIntersection(prev.key, next.key, eventQueue); - //} - } - } - } - } - return sortedEvents; -}; - - -/* eslint-disable no-unused-vars, no-debugger, no-undef */ -function _renderSweepLine(sweepLine, pos, event) { - var map = window.map; - if (!map) return; - if (window.sws) window.sws.forEach(function (p) { - map.removeLayer(p); - }); - window.sws = []; - sweepLine.forEach(function (e) { - var poly = L.polyline([ - e.point.slice().reverse(), - e.otherEvent.point.slice().reverse() - ], {color: 'green'}).addTo(map); - window.sws.push(poly); - }); - - if (window.vt) map.removeLayer(window.vt); - var v = pos.slice(); - var b = map.getBounds(); - window.vt = L.polyline([ - [b.getNorth(), v[0]], - [b.getSouth(), v[0]] - ], {color: 'green', weight: 1}).addTo(map); - - if (window.ps) map.removeLayer(window.ps); - window.ps = L.polyline([ - event.point.slice().reverse(), - event.otherEvent.point.slice().reverse() - ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); - debugger; -} -/* eslint-enable no-unused-vars, no-debugger, no-undef */ +'use strict'; + +var Tree = require('avl'); +var computeFields = require('./compute_fields'); +var possibleIntersection = require('./possible_intersection'); +var compareSegments = require('./compare_segments'); +var operations = require('./operation'); + + +module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) { + var sweepLine = new Tree(compareSegments); + var sortedEvents = []; + + var rightbound = Math.min(sbbox[2], cbbox[2]); + + var prev, next, begin; + + var INTERSECTION = operations.INTERSECTION; + var DIFFERENCE = operations.DIFFERENCE; + + while (eventQueue.length) { + var event = eventQueue.pop(); + sortedEvents.push(event); + + // optimization by bboxes for intersection and difference goes here + if ((operation === INTERSECTION && event.point[0] > rightbound) || + (operation === DIFFERENCE && event.point[0] > sbbox[2])) { + break; + } + + if (event.left) { + next = prev = sweepLine.insert(event); + //_renderSweepLine(sweepLine, event.point, event); + begin = sweepLine.minNode(); + + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; + + next = sweepLine.next(next); + + var prevEvent = prev ? prev.key : null; + var prevprevEvent; + computeFields(event, prevEvent, operation); + if (next) { + if (possibleIntersection(event, next.key, eventQueue) === 2) { + computeFields(event, prevEvent, operation); + computeFields(event, next.key, operation); + } + } + if (prev) { + if (possibleIntersection(prev.key, event, eventQueue) === 2) { + var prevprev = prev; + if (prevprev !== begin) prevprev = sweepLine.prev(prevprev); + else prevprev = null; + + prevprevEvent = prevprev ? prevprev.key : null; + computeFields(prevEvent, prevprevEvent, operation); + computeFields(event, prevEvent, operation); + } + } + } else { + event = event.otherEvent; + next = prev = sweepLine.find(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); + + if (prev && next) { + + if (prev !== begin) prev = sweepLine.prev(prev); + else prev = null; + + next = sweepLine.next(next); + sweepLine.remove(event); + + // _renderSweepLine(sweepLine, event.otherEvent.point, event); + + if (next && prev) { + //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + possibleIntersection(prev.key, next.key, eventQueue); + //} + } + } + } + } + return sortedEvents; +}; + + +/* eslint-disable no-unused-vars, no-debugger, no-undef */ +function _renderSweepLine(sweepLine, pos, event) { + var map = window.map; + if (!map) return; + if (window.sws) window.sws.forEach(function (p) { + map.removeLayer(p); + }); + window.sws = []; + sweepLine.forEach(function (e) { + var poly = L.polyline([ + e.key.point.slice().reverse(), + e.key.otherEvent.point.slice().reverse() + ], {color: 'green'}).addTo(map); + window.sws.push(poly); + }); + + if (window.vt) map.removeLayer(window.vt); + var v = pos.slice(); + var b = map.getBounds(); + window.vt = L.polyline([ + [b.getNorth(), v[0]], + [b.getSouth(), v[0]] + ], {color: 'green', weight: 1}).addTo(map); + + if (window.ps) map.removeLayer(window.ps); + window.ps = L.polyline([ + event.point.slice().reverse(), + event.otherEvent.point.slice().reverse() + ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); + debugger; +} +/* eslint-enable no-unused-vars, no-debugger, no-undef */ },{"./compare_segments":14,"./compute_fields":15,"./operation":22,"./possible_intersection":23,"avl":6}],27:[function(require,module,exports){ -'use strict'; - -//var signedArea = require('./signed_area'); -var EdgeType = require('./edge_type'); - -/** - * Sweepline event - * - * @param {Array.} point - * @param {Boolean} left - * @param {SweepEvent=} otherEvent - * @param {Boolean} isSubject - * @param {Number} edgeType - */ -function SweepEvent(point, left, otherEvent, isSubject, edgeType) { - - /** - * Is left endpoint? - * @type {Boolean} - */ - this.left = left; - - /** - * @type {Array.} - */ - this.point = point; - - /** - * Other edge reference - * @type {SweepEvent} - */ - this.otherEvent = otherEvent; - - /** - * Belongs to source or clipping polygon - * @type {Boolean} - */ - this.isSubject = isSubject; - - /** - * Edge contribution type - * @type {Number} - */ - this.type = edgeType || EdgeType.NORMAL; - - - /** - * In-out transition for the sweepline crossing polygon - * @type {Boolean} - */ - this.inOut = false; - - - /** - * @type {Boolean} - */ - this.otherInOut = false; - - /** - * Previous event in result? - * @type {SweepEvent} - */ - this.prevInResult = null; - - /** - * Does event belong to result? - * @type {Boolean} - */ - this.inResult = false; - - - // connection step - - /** - * @type {Boolean} - */ - this.resultInOut = false; - - this.isExteriorRing = true; -} - - -SweepEvent.prototype = { - - /** - * @param {Array.} p - * @return {Boolean} - */ - isBelow: function (p) { - var p0 = this.point, p1 = this.otherEvent.point; - return this.left ? - (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0 : - // signedArea(this.point, this.otherEvent.point, p) > 0 : - (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0; - //signedArea(this.otherEvent.point, this.point, p) > 0; - }, - - - /** - * @param {Array.} p - * @return {Boolean} - */ - isAbove: function (p) { - return !this.isBelow(p); - }, - - - /** - * @return {Boolean} - */ - isVertical: function () { - return this.point[0] === this.otherEvent.point[0]; - } -}; - -module.exports = SweepEvent; +'use strict'; + +//var signedArea = require('./signed_area'); +var EdgeType = require('./edge_type'); + +/** + * Sweepline event + * + * @param {Array.} point + * @param {Boolean} left + * @param {SweepEvent=} otherEvent + * @param {Boolean} isSubject + * @param {Number} edgeType + */ +function SweepEvent(point, left, otherEvent, isSubject, edgeType) { + + /** + * Is left endpoint? + * @type {Boolean} + */ + this.left = left; + + /** + * @type {Array.} + */ + this.point = point; + + /** + * Other edge reference + * @type {SweepEvent} + */ + this.otherEvent = otherEvent; + + /** + * Belongs to source or clipping polygon + * @type {Boolean} + */ + this.isSubject = isSubject; + + /** + * Edge contribution type + * @type {Number} + */ + this.type = edgeType || EdgeType.NORMAL; + + + /** + * In-out transition for the sweepline crossing polygon + * @type {Boolean} + */ + this.inOut = false; + + + /** + * @type {Boolean} + */ + this.otherInOut = false; + + /** + * Previous event in result? + * @type {SweepEvent} + */ + this.prevInResult = null; + + /** + * Does event belong to result? + * @type {Boolean} + */ + this.inResult = false; + + + // connection step + + /** + * @type {Boolean} + */ + this.resultInOut = false; + + this.isExteriorRing = true; +} + + +SweepEvent.prototype = { + + /** + * @param {Array.} p + * @return {Boolean} + */ + isBelow: function (p) { + var p0 = this.point, p1 = this.otherEvent.point; + return this.left ? + (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0 : + // signedArea(this.point, this.otherEvent.point, p) > 0 : + (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0; + //signedArea(this.otherEvent.point, this.point, p) > 0; + }, + + + /** + * @param {Array.} p + * @return {Boolean} + */ + isAbove: function (p) { + return !this.isBelow(p); + }, + + + /** + * @return {Boolean} + */ + isVertical: function () { + return this.point[0] === this.otherEvent.point[0]; + } +}; + +module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvbGliL2lzLW9iamVjdC5qcyIsIm5vZGVfbW9kdWxlcy9zdXBlcmFnZW50L2xpYi9yZXF1ZXN0LWJhc2UuanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvcmVxdWVzdC5qcyIsIm5vZGVfbW9kdWxlcy90aW55cXVldWUvaW5kZXguanMiLCJzcmMvY29tcGFyZV9ldmVudHMuanMiLCJzcmMvY29tcGFyZV9zZWdtZW50cy5qcyIsInNyYy9jb21wdXRlX2ZpZWxkcy5qcyIsInNyYy9jb25uZWN0X2VkZ2VzLmpzIiwic3JjL2RpdmlkZV9zZWdtZW50L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ICAgICByZXR1cm4gZmFsc2U7XG4gIH1cbn1cblxuLyoqXG4gKiBTZW5kIGBkYXRhYCBhcyB0aGUgcmVxdWVzdCBib2R5LCBkZWZhdWx0aW5nIHRoZSBgLnR5cGUoKWAgdG8gXCJqc29uXCIgd2hlblxuICogYW4gb2JqZWN0IGlzIGdpdmVuLlxuICpcbiAqIEV4YW1wbGVzOlxuICpcbiAqICAgICAgIC8vIG1hbnVhbCBqc29uXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2pzb24nKVxuICogICAgICAgICAuc2VuZCgne1wibmFtZVwiOlwidGpcIn0nKVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGF1dG8ganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIG1hbnVhbCB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKCduYW1lPXRqJylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdmb3JtJylcbiAqICAgICAgICAgLnNlbmQoeyBuYW1lOiAndGonIH0pXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gZGVmYXVsdHMgdG8geC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgIC5zZW5kK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cy5sZW5ndGgtLTtcbiAgICAgICAgdGhpcy5kYXRhLnBvcCgpO1xuICAgICAgICB0aGlzLl9kb3duKDApO1xuICAgICAgICByZXR1cm4gdG9wO1xuICAgIH0sXG5cbiAgICBwZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRhdGFbMF07XG4gICAgfSxcblxuICAgIF91cDogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmU7XG5cbiAgICAgICAgd2hpbGUgKHBvcyA+IDApIHtcbiAgICAgICAgICAgIHZhciBwYXJlbnQgPSBNYXRoLmZsb29yKChwb3MgLSAxKSAvIDIpO1xuICAgICAgICAgICAgaWYgKGNvbXBhcmUoZGF0YVtwb3NdLCBkYXRhW3BhcmVudF0pIDwgMCkge1xuICAgICAgICAgICAgICAgIHN3YXAoZGF0YSwgcGFyZW50LCBwb3MpO1xuICAgICAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcblxuICAgICAgICAgICAgfSBlbHNlIGJyZWFrO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhLFxuICAgICAgICAgICAgY29tcGFyZSA9IHRoaXMuY29tcGFyZSxcbiAgICAgICAgICAgIGxlbiA9IHRoaXMubGVuZ3RoO1xuXG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICB2YXIgbGVmdCA9IDIgKiBwb3MgKyAxLFxuICAgICAgICAgICAgICAgIHJpZ2h0ID0gbGVmdCArIDEsXG4gICAgICAgICAgICAgICAgbWluID0gcG9zO1xuXG4gICAgICAgICAgICBpZiAobGVmdCA8IGxlbiAmJiBjb21wYXJlKGRhdGFbbGVmdF0sIGRhdGFbbWluXSkgPCAwKSBtaW4gPSBsZWZ0O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ElGRkVSRU5DRSkge1xyXG4gICAgICByZXN1bHQgPSBzdWJqZWN0O1xyXG4gICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09IG9wZXJhdGlvbnMuVU5JT04gfHxcclxuICAgICAgICAgICAgICAgb3BlcmF0aW9uID09PSBvcGVyYXRpb25zLlhPUikge1xyXG4gICAgICByZXN1bHQgPSAoc3ViamVjdC5sZW5ndGggPT09IDApID8gY2xpcHBpbmcgOiBzdWJqZWN0O1xyXG4gICAgfVxyXG4gIH1cclxuICByZXR1cm4gcmVzdWx0O1xyXG59XHJcblxyXG5cclxuZnVuY3Rpb24gY29tcGFyZUJCb3hlcyhzdWJqZWN0LCBjbGlwcGluZywgc2Jib3gsIGNiYm94LCBvcGVyYXRpb24pIHtcclxuICB2YXIgcmVzdWx0ID0gbnVsbDtcclxuICBpZiAoc2Jib3hbMF0gPiBjYmJveFsyXSB8fFxyXG4gICAgICBjYmJveFswXSA+IHNiYm94WzJdIHx8XHJcbiAgICAgIHNiYm94WzFdID4gY2Jib3hbM10gfHxcclxuICAgICAgY2Jib3hbMV0gPiBzYmJveFszXSkge1xyXG4gICAgaWYgICAgICAgIChvcGVyYXRpb24gPT09IG9wZXJhdGlvbnMuSU5URVJTRUNUSU9OKSB7XHJcbiAgICAgIHJlc3VsdCA9IEVNUFRZO1xyXG4gICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09IG9wZXJhdGlvbnMuRElGRkVSRU5DRSkge1xyXG4gICAgICByZXN1bHQgPSBzdWJqZWN0O1xyXG4gICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09IG9wZXJhdGlvbnMuVU5JT04gfHxcclxuICAgICAgICAgICAgICAgb3BlcmF0aW9uID09PSBvcGVyYXRpb25zLlhPUikge1xyXG4gICAgICByZXN1bHQgPSBzdWJqZWN0LmNvbmNhdChjbGlwcGluZyk7XHJcbiAgICB9XHJcbiAgfVxyXG4gIHJldHVybiByZXN1bHQ7XHJcbn1cclxuXHJcblxyXG5md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cclxuICAgIGlmICgob3BlcmF0aW9uID09PSBJTlRFUlNFQ1RJT04gJiYgZXZlbnQucG9pbnRbMF0gPiByaWdodGJvdW5kKSB8fFxyXG4gICAgICAgIChvcGVyYXRpb24gPT09IERJRkZFUkVOQ0UgICAmJiBldmVudC5wb2ludFswXSA+IHNiYm94WzJdKSkge1xyXG4gICAgICBicmVhaztcclxuICAgIH1cclxuXHJcbiAgICBpZiAoZXZlbnQubGVmdCkge1xyXG4gICAgICBuZXh0ICA9IHByZXYgPSBzd2VlcExpbmUuaW5zZXJ0KGV2ZW50KTtcclxuICAgICAgLy9fcmVuZGVyU3dlZXBMaW5lKHN3ZWVwTGluZSwgZXZlbnQucG9pbnQsIGV2ZW50KTtcclxuICAgICAgYmVnaW4gPSBzd2VlcExpbmUubWluTm9kZSgpO1xyXG5cclxuICAgICAgaWYgKHByZXYgIT09IGJlZ2luKSBwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldik7XHJcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XHJcblxyXG4gICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XHJcblxyXG4gICAgICB2YXIgcHJldkV2ZW50ID0gcHJldiA/IHByZXYua2V5IDogbnVsbDtcclxuICAgICAgdmFyIHByZXZwcmV2RXZlbnQ7XHJcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcclxuICAgICAgaWYgKG5leHQpIHtcclxuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xyXG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xyXG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgbmV4dC5rZXksIG9wZXJhdGlvbik7XHJcbiAgICAgICAgfVxyXG4gICAgICB9XHJcbiAgICAgIGlmIChwcmV2KSB7XHJcbiAgICAgICAgaWYgKHBvc3NpYmxlSW50ZXJzZWN0aW9uKHByZXYua2V5LCBldmVudCwgZXZlbnRRdWV1ZSkgPT09IDIpIHtcclxuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XHJcbiAgICAgICAgICBpZiAocHJldnByZXYgIT09IGJlZ2luKSBwcmV2cHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXZwcmV2KTtcclxuICAgICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgIHByZXZwcmV2ID0gbnVsbDtcclxuXHJcbiAgICAgICAgICBwcmV2cHJldkV2ZW50ID0gcHJldnByZXYgPyBwcmV2cHJldi5rZXkgOiBudWxsO1xyXG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhwcmV2RXZlbnQsIHByZXZwcmV2RXZlbnQsIG9wZXJhdGlvbik7XHJcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW50LCAgICAgb3BlcmF0aW9uKTtcclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgIH0gZWxzZSB7XHJcbiAgICAgIGV2ZW50ID0gZXZlbnQub3RoZXJFdmVudDtcclxuICAgICAgbmV4dCA9IHByZXYgPSBzd2VlcExpbmUuZmluZChldmVudCk7XHJcblxyXG4gICAgICAvLyBfcmVuZGVyU3dlZXBMaW5lKHN3ZWVwTGluZSwgZXZlbnQub3RoZXJFdmVudC5wb2ludCwgZXZlbnQpO1xyXG5cclxuICAgICAgaWYgKHByZXYgJiYgbmV4dCkge1xyXG5cclxuICAgICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcclxuICAgICAgICBlbHNlICAgICAgICAgICAgICAgIHByZXYgPSBudWxsO1xyXG5cclxuICAgICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XHJcbiAgICAgICAgc3dlZX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ocDBbMV0gLSBwWzFdKSA+IDAgOlxyXG4gICAgICAvLyBzaWduZWRBcmVhKHRoaXMucG9pbnQsIHRoaXMub3RoZXJFdmVudC5wb2ludCwgcCkgPiAwIDpcclxuICAgICAgKHAxWzBdIC0gcFswXSkgKiAocDBbMV0gLSBwWzFdKSAtIChwMFswXSAtIHBbMF0pICogKHAxWzFdIC0gcFsxXSkgPiAwO1xyXG4gICAgICAvL3NpZ25lZEFyZWEodGhpcy5vdGhlckV2ZW50LnBvaW50LCB0aGlzLnBvaW50LCBwKSA+IDA7XHJcbiAgfSxcclxuXHJcblxyXG4gIC8qKlxyXG4gICAqIEBwYXJhbSAge0FycmF5LjxOdW1iZXI+fSAgcFxyXG4gICAqIEByZXR1cm4ge0Jvb2xlYW59XHJcbiAgICovXHJcbiAgaXNBYm92ZTogZnVuY3Rpb24gKHApIHtcclxuICAgIHJldHVybiAhdGhpcy5pc0JlbG93KHApO1xyXG4gIH0sXHJcblxyXG5cclxuICAvKipcclxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxyXG4gICAqL1xyXG4gIGlzVmVydGljYWw6IGZ1bmN0aW9uICgpIHtcclxuICAgIHJldHVybiB0aGlzLnBvaW50WzBdID09PSB0aGlzLm90aGVyRXZlbnQucG9pbnRbMF07XHJcbiAgfVxyXG59O1xyXG5cclxubW9kdWxlLmV4cG9ydHMgPSBTd2VlcEV2ZW50O1xyXG4iXX0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanM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PSBNYXRoLmZsb29yKChwb3MgLSAxKSAvIDIpO1xuICAgICAgICAgICAgaWYgKGNvbXBhcmUoZGF0YVtwb3NdLCBkYXRhW3BhcmVudF0pIDwgMCkge1xuICAgICAgICAgICAgICAgIHN3YXAoZGF0YSwgcGFyZW50LCBwb3MpO1xuICAgICAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcblxuICAgICAgICAgICAgfSBlbHNlIGJyZWFrO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhLFxuICAgICAgICAgICAgY29tcGFyZSA9IHRoaXMuY29tcGFyZSxcbiAgICAgICAgICAgIGxlbiA9IHRoaXMubGVuZ3RoO1xuXG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICB2YXIgbGVmdCA9IDIgKiBwb3MgKyAxLFxuICAgICAgICAgICAgICAgIHJpZ2h0ID0gbGVmdCArIDEsXG4gICAgICAgICAgICAgICAgbWluID0gcG9zO1xuXG4gICAgICAgICAgICBpZiAobGVmdCA8IGxlbiAmJiBjb21wYXJlKGRhdGFbbGVmdF0sIGRhdGFbbWluXSkgPCAwKSBtaW4gPSBsZWZ0O1xuICAgICAgICAgICAgaWYgKHJpZ2h0IDwgbGVuICYmIGNvbXBhcmUoZGF0YVtyaWdodF0sIGRhdGFbbWluXSkgPCAwKSBtaW4gPSByaWdodDtcblxuICAgICAgICAgICAgaWYgKG1pbiA9PT0gcG9zKSByZXR1cm47XG5cbiAgICAgICAgICAgIHN3YXAoZGF0YSwgbWluLCBwb3MpO1xuICAgICAgICAgICAgcG9zID0gbWluO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuZnVuY3Rpb24gc3dhcChkYXRhLCBpLCBqKSB7XG4gICAgdmFyIHRtcCA9IGRhdGFbaV07XG4gICAgZGF0YVtpXSA9IGRhdGFbal07XG4gICAgZGF0YVtqXSA9IHRtcDtcb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hbMl0pKSB7XG4gICAgICBicmVhaztcbiAgICB9XG5cbiAgICBpZiAoZXZlbnQubGVmdCkge1xuICAgICAgbmV4dCAgPSBwcmV2ID0gc3dlZXBMaW5lLmluc2VydChldmVudCk7XG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5wb2ludCwgZXZlbnQpO1xuICAgICAgYmVnaW4gPSBzd2VlcExpbmUubWluTm9kZSgpO1xuXG4gICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW50LCAgICAgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBldmVudCA9IGV2ZW50Lm90aGVyRXZlbnQ7XG4gICAgICBuZXh0ID0gcHJldiA9IHN3ZWVwTGluZS5maW5kKGV2ZW50KTtcblxuICAgICAgLy8gX3JlbmRlclN3ZWVwTGluZShzd2VlcExpbmUsIGV2ZW50Lm90aGVyRXZlbnQucG9pbnQsIGV2ZW50KTtcblxuICAgICAgaWYgKHByZXYgJiYgbmV4dCkge1xuXG4gICAgICAgIGlmIChwcmV2ICE9PSBiZWdpbikgcHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXYpO1xuICAgICAgICBlbHNlICAgICAgICAgICAgICAgIHByZXYgPSBudWxsO1xuXG4gICAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcbiAgICAgICAgc3dlZXBMaW5lLnJlbW92ZShldmVudCk7XG5cbiAgICAgICAgLy8gX3JlbmRlclN3ZWVwTGluZShzd2VlcExpbmUsIGV2ZW50Lm90aGVyRXZlbnQucG9pbnQsIGV2ZW50KTtcblxuICAgICAgICBpZiAobmV4dCAmJiBwcmV2KSB7XG4gICAgICAgICAgLy9pZiAodHlwZW9mIHByZXYgIT09ICd1bmRlZmluZWQnICYmIHR5cGVvZiBuZXh0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgIHBvc3NpYmxlSW50ZXJzZWN0aW9uKHByZXYua2V5LC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C5wb2ludFswXTtcbiAgfVxufTtcblxubW9kdWxlLmV4cG9ydHMgPSBTd2VlcEV2ZW50O1xuIl19 diff --git a/demo/js/index.js b/demo/js/index.js index 9bcaf8e..9d3e8e2 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -3,15 +3,25 @@ require('./polygoncontrol'); require('./booleanopcontrol'); var martinez = window.martinez = require('../../'); //var martinez = require('../../dist/martinez.min'); -var xhr = require('superagent'); +var xhr = require('superagent'); var mode = window.location.hash.substring(1); var path = '../test/fixtures/'; +var ext = '.geojson'; var file; +var files = [ + 'asia', 'trapezoid-box', 'canada', 'horseshoe', 'hourglasses', 'overlap_y', + 'polygon_trapezoid_edge_overlap', 'touching_boxes', 'two_pointed_triangles', + 'hole_cut', 'overlapping_segments', 'overlap_loop', 'disjoint_boxes' +]; + switch (mode) { case 'geo': file = 'asia.geojson'; break; + case 'states': + file = 'states_source.geojson'; + break; case 'trapezoid': file = 'trapezoid-box.geojson'; break; @@ -27,7 +37,7 @@ switch (mode) { case 'edge_overlap': file = 'polygon_trapezoid_edge_overlap.geojson'; break; - case 'touching': + case 'touching_boxes': file = 'touching_boxes.geojson'; break; case 'triangles': @@ -39,6 +49,15 @@ switch (mode) { case 'overlapping_segments': file = 'overlapping_segments.geojson'; break; + case 'overlap_loop': + file = 'overlap_loop.geojson'; + break; + case 'overlap_y': + file = 'overlap_y.geojson'; + break; + case 'disjoint_boxes': + file = 'disjoint_boxes.geojson'; + break; default: file = 'hole_hole.geojson'; break; @@ -84,12 +103,6 @@ var drawnItems = window.drawnItems = L.geoJson().addTo(map); function loadData(path) { console.log(path); - // var two_triangles = require('../../test/fixtures/two_shapes.geojson'); - // var oneInside = require('../../test/fixtures/one_inside.geojson'); - // var twoPointedTriangles = require('../../test/fixtures/two_pointed_triangles.geojson'); - // var selfIntersecting = require('../../test/fixtures/self_intersecting.geojson'); - // var holes = require('../../test/fixtures/hole_hole.geojson'); - //var data = require('../../test/fixtures/indonesia.geojson'); xhr .get(path) .accept('json') @@ -127,6 +140,12 @@ function run (op) { operation = martinez.union; } else if (op === OPERATIONS.DIFFERENCE) { operation = martinez.diff; + } else if (op === 5) { // B - A + operation = martinez.diff; + + var temp = subject; + subject = clipping; + clipping = temp; } else { operation = martinez.xor; } @@ -139,31 +158,34 @@ function run (op) { console.log('result', result); console.log(JSON.stringify(result)) results.clearLayers(); - results.addData({ - 'type': 'Feature', - 'geometry': { - 'type': 'MultiPolygon', - 'coordinates': result - } - }); - setTimeout(function() { - console.time('jsts'); - var s = reader.read(subject); - var c = reader.read(clipping); - var res; - if (op === OPERATIONS.INTERSECTION) { - res = s.geometry.intersection(c.geometry); - } else if (op === OPERATIONS.UNION) { - res = s.geometry.union(c.geometry); - } else if (op === OPERATIONS.DIFFERENCE) { - res = s.geometry.difference(c.geometry); - } else { - res = s.geometry.symDifference(c.geometry); - } - res = writer.write(res); - console.timeEnd('jsts'); - }, 500); + if (result !== null) { + results.addData({ + 'type': 'Feature', + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': result + } + }); + + setTimeout(function() { + console.time('jsts'); + var s = reader.read(subject); + var c = reader.read(clipping); + var res; + if (op === OPERATIONS.INTERSECTION) { + res = s.geometry.intersection(c.geometry); + } else if (op === OPERATIONS.UNION) { + res = s.geometry.union(c.geometry); + } else if (op === OPERATIONS.DIFFERENCE) { + res = s.geometry.difference(c.geometry); + } else { + res = s.geometry.symDifference(c.geometry); + } + res = writer.write(res); + console.timeEnd('jsts'); + }, 500); + } } //drawnItems.addData(oneInside); diff --git a/src/compute_fields.js b/src/compute_fields.js index 613da18..242fbd2 100644 --- a/src/compute_fields.js +++ b/src/compute_fields.js @@ -51,10 +51,10 @@ function inResult(event, operation) { case UNION: return event.otherInOut; case DIFFERENCE: - return (event.isSubject && !event.otherInOut) || - (!event.isSubject && event.otherInOut); - // return (event.isSubject && event.otherInOut) || - // (!event.isSubject && !event.otherInOut); + // return (event.isSubject && !event.otherInOut) || + // (!event.isSubject && event.otherInOut); + return (event.isSubject && event.otherInOut) || + (!event.isSubject && !event.otherInOut); case XOR: return true; } diff --git a/src/connect_edges.js b/src/connect_edges.js index 61cf2f0..5b7d603 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -75,7 +75,9 @@ function nextPos(pos, resultEvents, processed, origIndex) { if (!processed[newPos]) { // console.log(pos, newPos, length); return newPos; - } else newPos++; + } else { + newPos++; + } p1 = resultEvents[newPos].point; } @@ -96,7 +98,8 @@ function nextPos(pos, resultEvents, processed, origIndex) { module.exports = function (sortedEvents, operation) { var i, len; var resultEvents = orderEvents(sortedEvents); - _renderPoints(resultEvents, 'inResult'); + //_renderPoints(sortedEvents, 'inResult'); + // "false"-filled array var processed = {}; var result = []; @@ -185,10 +188,12 @@ function _renderPoints(possiblePoints, prop) { possiblePoints.forEach(function (e) { var point = L.circleMarker([e.point[1], e.point[0]], { radius: getRandomSize(), - color: getColor(e[prop]) + color: getColor(e[prop]), + weight: 1 }).addTo(points); }); } + /* eslint-enable no-unused-vars, no-debugger, no-undef */ function getColor(prop) { @@ -196,5 +201,5 @@ function getColor(prop) { } function getRandomSize() { - return Math.floor(Math.random() * 30); + return Math.floor(5 + Math.random() * 10); } diff --git a/src/divide_segment.js b/src/divide_segment.js index 485b35b..07c2694 100644 --- a/src/divide_segment.js +++ b/src/divide_segment.js @@ -15,7 +15,7 @@ module.exports = function divideSegment(se, p, queue) { var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); if (equals(se.point, se.otherEvent.point)) { - console.warn('what is that?', se); + console.warn('what is that, a collapsed segment?', se); } r.contourId = l.contourId = se.contourId; diff --git a/test/edge_cases.test.js b/test/edge_cases.test.js index 26914a7..ec63178 100644 --- a/test/edge_cases.test.js +++ b/test/edge_cases.test.js @@ -42,6 +42,16 @@ tap.test('Edge cases', function(main) { t.end(); }); + t.test('difference 2', function(t) { + var result = martinez.diff( + clipping.geometry.coordinates, + subject.geometry.coordinates + ); + t.deepEqual(result, [[[[0,1],[0.25,0.75],[0.5,1],[0,1.5],[0,1]]],[[[0.5,1],[0.75,0.75],[1,1],[1,1.5],[0.5,1]]]]); + + t.end(); + }); + t.end(); }); diff --git a/test/fixtures/disjoint_boxes.geojson b/test/fixtures/disjoint_boxes.geojson new file mode 100644 index 0000000..f407cc5 --- /dev/null +++ b/test/fixtures/disjoint_boxes.geojson @@ -0,0 +1,16 @@ +{ + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]] + } + },{ + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [[[4, 1], [5, 1], [5, 2], [4, 2], [4, 1]]] + } + }] +} diff --git a/test/fixtures/overlapping_segments.geojson b/test/fixtures/overlapping_segments.geojson index af9c9b6..c0a182a 100644 --- a/test/fixtures/overlapping_segments.geojson +++ b/test/fixtures/overlapping_segments.geojson @@ -7,7 +7,7 @@ "type": "Polygon", "coordinates": [ [ - [-25, -25], [25, -25], [25, 25], [18, 25], [18, 27], [11, 27], [11, 25], [-25, 25], [-25, -25] + [-25, -25], [-25, 25], [11, 25], [25, 25], [25, -25], [-25, -25] ] ] } @@ -19,4 +19,4 @@ "coordinates": [[[23, -18], [23,-25], [27, -25], [27, -18], [23, -18]]] } }] -} \ No newline at end of file +} diff --git a/test/fixtures/overlapping_segments_complex.geojson b/test/fixtures/overlapping_segments_complex.geojson new file mode 100644 index 0000000..7160eab --- /dev/null +++ b/test/fixtures/overlapping_segments_complex.geojson @@ -0,0 +1,22 @@ +{ + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-25, -25], [25, -25], [25, 25], [18, 25], [18, 27], [11, 27], [11, 25], [-25, 25], [-25, -25] + ] + ] + } + },{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [[[23, -18], [23,-25], [27, -25], [27, -18], [23, -18]]] + } + }] +} diff --git a/test/fixtures/states_result.geojson b/test/fixtures/states_result.geojson new file mode 100644 index 0000000..aac3bdd --- /dev/null +++ b/test/fixtures/states_result.geojson @@ -0,0 +1 @@ +{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-136.125,57.69819141730159],[-136.075961,57.64751],[-135.99316,57.631884],[-135.949959,57.611049],[-135.99316,57.600631],[-136.061561,57.600631],[-136.02916,57.567643],[-135.95356,57.531181],[-135.895959,57.510346],[-135.838358,57.484302],[-135.795158,57.459995],[-135.780758,57.433951],[-135.805958,57.437424],[-135.863559,57.468676],[-135.885159,57.48083],[-135.906759,57.496456],[-135.96796,57.517291],[-136.00036,57.517291],[-135.95356,57.468676],[-135.834758,57.387072],[-135.730357,57.366237],[-135.687157,57.362765],[-135.600756,57.414852],[-135.546755,57.465204],[-135.553956,57.534654],[-135.571956,57.585005],[-135.687157,57.642301],[-135.802358,57.760367],[-135.751958,57.753422],[-135.730357,57.748213],[-135.697957,57.736059],[-135.665557,57.723905],[-135.643956,57.713488],[-135.622356,57.704807],[-135.564756,57.671818],[-135.456755,57.630148],[-135.273153,57.558961],[-135.118351,57.498192],[-135.085951,57.477357],[-135.060751,57.459995],[-134.98875,57.451314],[-134.855549,57.458259],[-134.844748,57.597159],[-134.913149,57.749949],[-134.931149,57.75863],[-134.95635,57.760367],[-135.04635,57.751685],[-135.100351,57.743004],[-135.168752,57.727378],[-135.233552,57.720433],[-135.298353,57.73085],[-135.316353,57.756894],[-135.359554,57.796828],[-135.381154,57.807246],[-135.557556,57.869751],[-135.647556,57.901003],[-135.726757,57.916629],[-135.795158,57.930519],[-135.881559,57.993025],[-135.845558,57.989552],[-135.820358,57.980871],[-135.719557,57.94441],[-135.557556,57.902739],[-135.337953,57.824608],[-135.265953,57.791619],[-135.229952,57.779465],[-135.197552,57.775993],[-135.121951,57.774257],[-135.089551,57.781202],[-135.04635,57.779465],[-135.00675,57.779465],[-134.96355,57.808982],[-135.02115,57.852388],[-135.04995,57.868014],[-135.082351,57.874959],[-135.121951,57.881904],[-135.143551,57.894058],[-135.197552,57.937465],[-135.168752,57.935728],[-135.01755,57.888849],[-134.97075,57.885377],[-134.909549,57.920102],[-134.905949,57.982607],[-134.920349,58.017332],[-134.934749,58.031222],[-135.100351,58.093727],[-135.406354,58.137134],[-135.453155,58.119771],[-135.489155,58.067684],[-135.543155,58.012123],[-135.557556,57.99997],[-135.618756,57.961772],[-135.647556,57.961772],[-135.708757,57.979135],[-135.780758,58.043376],[-135.701557,58.05553],[-135.658357,58.045112],[-135.611556,58.04164],[-135.514355,58.104145],[-135.481955,58.157969],[-135.507155,58.175331],[-135.586356,58.196166],[-135.741157,58.256935],[-135.780758,58.274298],[-135.813158,58.274298],[-135.924759,58.229155],[-135.96076,58.201375],[-136.125,58.21952778707878],[-136.125,57.90272503749965],[-136.101161,57.888849],[-136.061561,57.868014],[-136.03276,57.847179],[-136.054361,57.845443],[-136.125,57.8825395831322],[-136.125,57.69819141730159]]],[[[-136.125,58.33228766900267],[-136.083161,58.340275],[-136.050761,58.36111],[-136.02916,58.385418],[-136.04356,58.427088],[-136.079561,58.512164],[-136.122761,58.564252],[-136.125,58.56599172452586],[-136.125,58.33228766900267]]],[[[-136.125,58.788065308253984],[-136.104761,58.829899],[-136.093961,58.862888],[-136.108361,58.928865],[-136.125,58.96898948630555],[-136.125,58.788065308253984]]],[[[-136.125,59.022744376412035],[-136.101161,59.012205],[-136.086761,58.984425],[-136.068761,58.944491],[-136.04716,58.890668],[-135.95716,58.888931],[-135.928359,58.901085],[-135.834758,58.909766],[-135.802358,58.909766],[-135.766358,58.895876],[-135.852759,58.876778],[-135.946359,58.861151],[-136.065161,58.817745],[-135.928359,58.656273],[-135.888759,58.612867],[-135.870759,58.60245],[-135.834758,58.538208],[-135.849158,58.468758],[-135.888759,58.451395],[-135.910359,58.381945],[-135.755558,58.395835],[-135.607956,58.420143],[-135.510755,58.475703],[-135.471155,58.472231],[-135.406354,58.381945],[-135.402754,58.34722],[-135.366754,58.29166],[-135.345153,58.265616],[-135.319953,58.24999],[-135.273153,58.234364],[-135.157952,58.206584],[-135.085951,58.232628],[-135.04995,58.303814],[-135.04995,58.340275],[-135.071551,58.397572],[-135.093151,58.437505],[-135.165152,58.543417],[-135.179552,58.560779],[-135.186752,58.623285],[-135.168752,58.645856],[-135.186752,58.663218],[-135.244352,58.720515],[-135.312753,58.848998],[-135.327153,58.86636],[-135.388354,58.961854],[-135.395554,59.071238],[-135.445954,59.128534],[-135.546755,59.225764],[-135.489155,59.224028],[-135.467555,59.218819],[-135.417154,59.199721],[-135.395554,59.180622],[-135.384754,59.158051],[-135.366754,59.126798],[-135.301953,59.092073],[-135.345153,59.189303],[-135.359554,59.210138],[-135.427954,59.257017],[-135.460355,59.290006],[-135.399154,59.368137],[-135.348753,59.463631],[-135.327153,59.453214],[-135.334353,59.394181],[-135.348753,59.366401],[-135.355954,59.32994],[-135.359554,59.262226],[-135.316353,59.222292],[-135.283953,59.203193],[-135.233552,59.128534],[-135.132751,58.881986],[-135.147151,58.843789],[-135.060751,58.751767],[-135.02835,58.74135],[-135.01755,58.777811],[-134.99955,58.805591],[-134.95275,58.814272],[-134.931149,58.777811],[-134.920349,58.687526],[-134.97435,58.645856],[-134.949149,58.631966],[-134.772748,58.460077],[-134.772748,58.435769],[-134.758348,58.381945],[-134.639546,58.355902],[-134.574746,58.352429],[-134.538745,58.359374],[-134.517145,58.355902],[-134.488345,58.34722],[-134.383944,58.286451],[-134.239942,58.20832],[-134.182342,58.197903],[-134.149941,58.199639],[-134.099541,58.239573],[-134.04554,58.392363],[-133.97354,58.498274],[-133.923139,58.512164],[-133.879939,58.520846],[-133.858339,58.520846],[-133.775538,58.515637],[-133.793538,58.506956],[-133.818738,58.503483],[-133.858339,58.508692],[-133.879939,58.508692],[-133.901539,58.505219],[-133.926739,58.491329],[-134.00954,58.390627],[-133.99514,58.340275],[-134.052741,58.253463],[-134.085141,58.189221],[-134.070741,58.100672],[-134.059941,58.078101],[-134.01314,58.039903],[-133.97714,58.01386],[-133.912339,57.980871],[-133.879939,57.991288],[-133.829538,58.008651],[-133.807938,58.046848],[-133.750338,58.133661],[-133.681937,58.145815],[-133.696337,58.104145],[-133.761138,58.029486],[-133.811538,57.97219],[-133.804338,57.897531],[-133.699937,57.791619],[-133.660337,57.784674],[-133.631536,57.796828],[-133.620736,57.824608],[-133.642336,57.871487],[-133.591936,57.911421],[-133.555936,57.923574],[-133.527135,57.923574],[-133.444334,57.918366],[-133.185132,57.890586],[-133.131131,57.854124],[-133.264333,57.874959],[-133.429934,57.906212],[-133.545135,57.907948],[-133.555936,57.824608],[-133.545135,57.769048],[-133.516335,57.746477],[-133.357934,57.677027],[-133.321933,57.6614],[-133.199532,57.61973],[-133.181532,57.616258],[-133.134731,57.586741],[-133.00513,57.513819],[-133.04113,57.503401],[-133.084331,57.519027],[-133.120331,57.543335],[-133.167132,57.572851],[-133.559536,57.708279],[-133.642336,57.696125],[-133.660337,57.628411],[-133.599136,57.574588],[-133.548735,57.565906],[-133.505535,57.571115],[-133.480335,57.576324],[-133.447934,57.583269],[-133.357934,57.59195],[-133.318333,57.590214],[-133.332733,57.576324],[-133.411934,57.557225],[-133.437134,57.555489],[-133.462335,57.541599],[-133.505535,57.484302],[-133.440734,57.35582],[-133.408334,57.338457],[-133.350734,57.32804],[-133.228332,57.31415],[-133.113131,57.32804],[-133.066331,57.347138],[-133.084331,57.321095],[-133.242732,57.275952],[-133.289533,57.275952],[-133.318333,57.281161],[-133.444334,57.282897],[-133.469535,57.281161],[-133.498335,57.255117],[-133.509135,57.194348],[-133.487535,57.166568],[-133.437134,57.140524],[-133.401134,57.135315],[-133.386734,57.12837],[-133.339933,57.111008],[-133.314733,57.102327],[-133.282333,57.098854],[-133.257133,57.116217],[-133.167132,57.163096],[-133.123931,57.150942],[-133.141931,57.116217],[-133.127531,57.079755],[-132.904329,57.032877],[-132.846728,57.060657],[-132.803528,57.083228],[-132.763928,56.982525],[-132.778328,56.958218],[-132.843128,56.966899],[-132.857529,56.932174],[-132.767528,56.843625],[-132.688327,56.8089],[-132.641526,56.788065],[-132.573126,56.765494],[-132.533525,56.755076],[-132.497525,56.749867],[-132.457925,56.782856],[-132.421924,56.810636],[-132.385924,56.82279],[-132.364324,56.817581],[-132.414724,56.772439],[-132.465125,56.746395],[-132.504725,56.72556],[-132.522725,56.715142],[-132.551526,56.637011],[-132.522725,56.617912],[-132.493925,56.610967],[-132.439924,56.604022],[-132.407524,56.609231],[-132.364324,56.624857],[-132.317523,56.633538],[-132.339123,56.598813],[-132.349923,56.543253],[-132.342723,56.524154],[-132.187922,56.423452],[-132.065521,56.378309],[-132.03672,56.3731],[-131.99352,56.357474],[-131.96832,56.326221],[-131.96112,56.296705],[-131.932319,56.258508],[-131.917919,56.239409],[-131.899919,56.227255],[-131.824318,56.213365],[-131.770318,56.197739],[-131.95752,56.16475],[-131.96832,56.08141],[-131.96112,56.055366],[-131.939519,56.010223],[-131.946719,55.965081],[-131.97552,55.956399],[-132.02232,55.956399],[-132.054721,55.942509],[-132.072721,55.862642],[-132.04752,55.822708],[-132.105121,55.805345],[-132.169922,55.800137],[-132.245522,55.723742],[-132.187922,55.605676],[-132.166322,55.584841],[-132.144721,55.567479],[-132.112321,55.555325],[-132.061921,55.543171],[-132.02592,55.527545],[-131.96112,55.498029],[-131.95392,55.501501],[-131.925119,55.53449],[-131.838718,55.635193],[-131.817118,55.662973],[-131.759518,55.814027],[-131.820718,55.831389],[-131.853119,55.834862],[-131.874719,55.838334],[-131.899919,55.855697],[-131.881919,55.864378],[-131.802718,55.881741],[-131.755918,55.880004],[-131.734317,55.885213],[-131.547115,55.951191],[-131.478715,55.975498],[-131.403114,55.994597],[-131.370714,55.961608],[-131.327513,55.965081],[-131.208712,56.01196],[-131.172712,56.032795],[-131.143911,56.050157],[-131.075511,56.093563],[-131.01431,56.105717],[-131.057511,56.057102],[-131.093511,56.022377],[-131.140311,56.003278],[-131.165512,55.985916],[-131.169112,55.942509],[-131.115111,55.900839],[-131.02511,55.834862],[-130.913509,55.741104],[-130.884709,55.708115],[-130.870309,55.60394],[-130.866709,55.577896],[-130.870309,55.546644],[-130.873909,55.510182],[-130.873909,55.412952],[-130.870309,55.336557],[-130.859509,55.310513],[-130.715507,55.307041],[-130.686707,55.338293],[-130.657907,55.345238],[-130.614706,55.294887],[-130.643506,55.287942],[-130.794708,55.286206],[-130.881109,55.289678],[-130.931509,55.284469],[-131.050311,55.204602],[-131.064711,55.187239],[-131.057511,55.128207],[-131.05375252834676,55.125],[-130.85288437448165,55.125],[-130.812708,55.142097],[-130.726307,55.12647],[-130.600306,55.215019],[-130.585906,55.228909],[-130.564306,55.267107],[-130.549905,55.282733],[-130.503105,55.315722],[-130.474305,55.32614],[-130.553506,55.223701],[-130.69105761172483,55.125],[-130.16579056037958,55.125],[-130.164702,55.12647],[-130.135901,55.171613],[-130.103501,55.206338],[-130.078301,55.225437],[-129.9919,55.280997],[-130.0459,55.379963],[-130.143101,55.541435],[-130.175502,55.75673],[-130.135901,55.808818],[-130.103501,55.820972],[-130.0279,55.895631],[-130.0135,55.909521],[-130.0135,56.024113],[-130.053101,56.076201],[-130.089101,56.117871],[-130.229502,56.090091],[-130.366304,56.12308],[-130.449104,56.20642],[-130.463505,56.235936],[-130.485105,56.239409],[-130.531905,56.246354],[-130.560706,56.249826],[-130.625506,56.258508],[-130.719107,56.326221],[-130.755108,56.352265],[-130.773108,56.366155],[-130.848708,56.374837],[-130.920709,56.381782],[-131.061111,56.40088],[-131.125911,56.423452],[-131.143911,56.433869],[-131.165512,56.446023],[-131.212312,56.468594],[-131.291513,56.499847],[-131.313113,56.510264],[-131.547115,56.598813],[-131.579516,56.604022],[-131.611916,56.602286],[-131.824318,56.598813],[-131.856719,56.718615],[-131.860319,56.79501],[-132.101521,56.866196],[-132.090721,56.893976],[-132.061921,56.959954],[-132.03672,57.013778],[-132.02592,57.036349],[-132.220322,57.067602],[-132.324723,57.088437],[-132.259923,57.168304],[-132.227522,57.204766],[-132.353524,57.354083],[-132.375124,57.374918],[-132.450725,57.435687],[-132.472325,57.451314],[-132.497525,57.470412],[-132.619926,57.583269],[-132.763928,57.720433],[-132.785528,57.751685],[-132.796328,57.770784],[-132.814328,57.798564],[-132.879129,57.859333],[-132.933129,57.909684],[-132.96553,57.933992],[-132.99433,57.951355],[-133.03753,57.982607],[-133.055531,57.996497],[-133.069931,58.012123],[-133.091531,58.039903],[-133.109531,58.085046],[-133.138331,58.135397],[-133.188732,58.18054],[-133.210332,58.196166],[-133.231932,58.211793],[-133.307533,58.256935],[-133.361534,58.281243],[-133.429934,58.359374],[-133.408334,58.401044],[-133.386734,58.411462],[-133.429934,58.458341],[-133.559536,58.527791],[-133.735937,58.64412],[-133.807938,58.710097],[-133.825938,58.725724],[-134.088741,58.809064],[-134.239942,58.854206],[-134.326343,58.925393],[-134.326343,58.970535],[-134.383944,59.053875],[-134.466745,59.128534],[-134.531545,59.132007],[-134.567546,59.130271],[-134.650347,59.185831],[-134.671947,59.206666],[-134.686347,59.243127],[-134.740347,59.250072],[-134.95275,59.279588],[-135.093151,59.42717],[-135.078751,59.444532],[-135.064351,59.458422],[-135.02835,59.46884],[-135.01755,59.498356],[-135.01395,59.540026],[-135.01395,59.567806],[-135.096751,59.62163],[-135.125551,59.62163],[-135.154352,59.626839],[-135.175952,59.637257],[-135.334353,59.725805],[-135.474755,59.802201],[-135.507155,59.793519],[-135.823958,59.70497],[-135.949959,59.668509],[-136.072361,59.658092],[-136.119161,59.651147],[-136.125,59.650378954975885],[-136.125,59.022744376412035]]],[[[-135.845558,57.319358],[-135.820358,57.175249],[-135.805958,57.168304],[-135.748357,57.164832],[-135.712357,57.163096],[-135.715957,57.140524],[-135.751958,57.111008],[-135.762758,57.105799],[-135.784358,57.10059],[-135.816758,57.088437],[-135.823958,57.079755],[-135.838358,56.991206],[-135.827558,56.985998],[-135.795158,56.985998],[-135.719557,56.992943],[-135.625956,57.006833],[-135.568356,57.081492],[-135.546755,57.131843],[-135.553956,57.227337],[-135.575556,57.249908],[-135.589956,57.263798],[-135.611556,57.279424],[-135.625956,57.288106],[-135.643956,57.295051],[-135.701557,57.317622],[-135.708757,57.322831],[-135.759158,57.331512],[-135.834758,57.326303],[-135.845558,57.319358]]],[[[-135.669157,57.345402],[-135.636756,57.31415],[-135.550356,57.256853],[-135.503555,57.242963],[-135.456755,57.248172],[-135.337953,57.244699],[-135.363154,57.192612],[-135.406354,57.164832],[-135.377554,57.098854],[-135.355954,57.071074],[-135.355954,56.958218],[-135.366754,56.831471],[-135.298353,56.786329],[-135.262353,56.784592],[-135.222752,56.801955],[-135.201152,56.8089],[-135.154352,56.824526],[-135.125551,56.827999],[-135.154352,56.741186],[-135.175952,56.718615],[-135.201152,56.685626],[-135.107551,56.595341],[-135.089551,56.593604],[-135.053551,56.607494],[-134.877149,56.685626],[-134.848348,56.68389],[-134.938349,56.600549],[-134.99955,56.584923],[-135.02835,56.574506],[-135.04635,56.531099],[-134.99595,56.466858],[-134.884349,56.34532],[-134.761948,56.222046],[-134.653947,56.166486],[-134.621546,56.249826],[-134.621546,56.385254],[-134.621546,56.472067],[-134.625146,56.538044],[-134.610746,56.576242],[-134.607146,56.602286],[-134.610746,56.682153],[-134.617946,56.729032],[-134.643146,56.796746],[-134.682747,56.897449],[-134.725947,56.98947],[-134.783548,57.119689],[-134.797948,57.166568],[-134.837548,57.249908],[-134.945549,57.364501],[-134.97435,57.385336],[-135.157952,57.475621],[-135.352354,57.548544],[-135.391954,57.553753],[-135.417154,57.552016],[-135.438754,57.545071],[-135.514355,57.505137],[-135.546755,57.413116],[-135.478355,57.364501],[-135.517955,57.350611],[-135.618756,57.364501],[-135.643956,57.364501],[-135.669157,57.345402]]],[[[-134.97435,57.409643],[-134.862749,57.329776],[-134.823148,57.303732],[-134.808748,57.296787],[-134.794348,57.30026],[-134.787148,57.343666],[-134.808748,57.361028],[-134.823148,57.390545],[-134.819548,57.400962],[-134.812348,57.414852],[-134.877149,57.427006],[-134.887949,57.428742],[-134.941949,57.421797],[-134.97435,57.409643]]],[[[-134.97075,58.366319],[-134.95275,58.298605],[-134.913149,58.204848],[-134.787148,58.105881],[-134.700747,57.826344],[-134.697147,57.779465],[-134.711547,57.741268],[-134.704347,57.71696],[-134.657547,57.602368],[-134.632346,57.579796],[-134.610746,57.562434],[-134.589146,57.538126],[-134.574746,57.505137],[-134.553146,57.50861],[-134.502745,57.520764],[-134.466745,57.532917],[-134.383944,57.548544],[-134.351544,57.541599],[-134.509945,57.487775],[-134.549545,57.487775],[-134.571146,57.487775],[-134.556746,57.472149],[-134.527945,57.442632],[-134.459545,57.390545],[-134.383944,57.380127],[-134.344343,57.387072],[-134.315543,57.331512],[-134.344343,57.32804],[-134.495545,57.371446],[-134.614346,57.225601],[-134.621546,57.111008],[-134.592746,57.036349],[-134.574746,57.027668],[-134.477545,57.029404],[-134.164342,57.189139],[-134.077941,57.269007],[-134.099541,57.296787],[-134.171542,57.380127],[-134.063541,57.354083],[-134.04194,57.329776],[-133.97354,57.30026],[-133.944739,57.303732],[-133.861939,57.366237],[-133.890739,57.423534],[-133.98794,57.45305],[-134.056341,57.465204],[-134.04914,57.491247],[-134.00234,57.487775],[-133.865539,57.458259],[-133.872739,57.489511],[-133.894339,57.505137],[-133.923139,57.532917],[-133.930339,57.562434],[-134.00594,57.64751],[-134.182342,57.814191],[-134.247142,57.857597],[-134.272343,57.873223],[-134.319143,58.031222],[-134.290343,58.076365],[-134.239942,58.065947],[-134.175142,58.01386],[-134.153542,57.991288],[-134.139141,57.954827],[-134.110341,57.876696],[-134.092341,57.848916],[-134.067141,57.829817],[-133.99514,57.769048],[-133.98074,57.734323],[-133.95914,57.683972],[-133.894339,57.654455],[-133.876339,57.673554],[-133.894339,57.756894],[-133.912339,57.812454],[-134.00234,57.935728],[-134.077941,58.008651],[-134.135541,58.052057],[-134.160742,58.12498],[-134.171542,58.159705],[-134.200342,58.163177],[-134.297543,58.15276],[-134.333543,58.144079],[-134.355144,58.145815],[-134.398344,58.157969],[-134.452345,58.177067],[-134.556746,58.185749],[-134.599946,58.171859],[-134.635946,58.161441],[-134.668347,58.159705],[-134.693547,58.168386],[-134.704347,58.215265],[-134.797948,58.309023],[-134.949149,58.406253],[-134.97075,58.366319]]],[[[-134.682747,58.300341],[-134.653947,58.270825],[-134.639546,58.256935],[-134.628746,58.248254],[-134.607146,58.237836],[-134.581946,58.225683],[-134.556746,58.220474],[-134.509945,58.217001],[-134.495545,58.220474],[-134.477545,58.223946],[-134.452345,58.223946],[-134.437944,58.22221],[-134.427144,58.220474],[-134.365944,58.206584],[-134.275943,58.190957],[-134.261543,58.197903],[-134.275943,58.211793],[-134.455945,58.312495],[-134.473945,58.324649],[-134.506345,58.336803],[-134.517145,58.338539],[-134.556746,58.340275],[-134.567546,58.340275],[-134.585546,58.338539],[-134.653947,58.315968],[-134.671947,58.312495],[-134.682747,58.300341]]],[[[-134.409144,56.829735],[-134.394744,56.722087],[-134.391144,56.71167],[-134.304743,56.558879],[-134.175142,56.536308],[-134.088741,56.538044],[-134.070741,56.555407],[-134.063541,56.548462],[-134.052741,56.503319],[-134.03114,56.418243],[-134.03474,56.376573],[-134.04914,56.362683],[-134.056341,56.3731],[-134.063541,56.383518],[-134.085141,56.397408],[-134.175142,56.435605],[-134.232742,56.419979],[-134.283143,56.348793],[-134.250743,56.315804],[-134.225542,56.307123],[-134.203942,56.298441],[-134.221942,56.277606],[-134.257943,56.263716],[-134.265143,56.253299],[-134.221942,56.06752],[-134.160742,56.022377],[-134.124741,55.99807],[-134.110341,55.996333],[-134.103141,56.01196],[-134.088741,56.083146],[-134.095941,56.131761],[-134.067141,56.301914],[-134.056341,56.312331],[-134.03834,56.305386],[-134.02754,56.274134],[-134.01314,56.190794],[-134.03834,56.114399],[-134.03474,56.103981],[-134.01674,56.0953],[-133.97714,56.083146],[-133.95914,56.083146],[-133.944739,56.088355],[-133.915939,56.149124],[-133.887139,56.22031],[-133.890739,56.2342],[-133.897939,56.253299],[-133.901539,56.265453],[-133.912339,56.274134],[-133.923139,56.279343],[-133.944739,56.281079],[-133.95554,56.27587],[-133.97354,56.265453],[-133.98434,56.268925],[-133.97714,56.288024],[-133.96994,56.30365],[-133.96634,56.31754],[-133.97354,56.343584],[-133.96994,56.35921],[-133.948339,56.350529],[-133.915939,56.319276],[-133.894339,56.300178],[-133.861939,56.277606],[-133.851139,56.281079],[-133.847538,56.291496],[-133.840338,56.34532],[-133.851139,56.352265],[-133.883539,56.437342],[-133.876339,56.524154],[-133.915939,56.602286],[-133.919539,56.610967],[-133.912339,56.616176],[-133.890739,56.614439],[-133.833138,56.609231],[-133.818738,56.607494],[-133.793538,56.593604],[-133.786338,56.579714],[-133.782738,56.565824],[-133.771938,56.557143],[-133.764738,56.555407],[-133.750338,56.555407],[-133.739537,56.560616],[-133.692737,56.597077],[-133.725137,56.652637],[-133.717937,56.768966],[-133.732337,56.775911],[-133.829538,56.796746],[-133.865539,56.789801],[-133.854739,56.774175],[-133.854739,56.760285],[-133.854739,56.749867],[-133.854739,56.737713],[-133.861939,56.723823],[-133.872739,56.709933],[-133.915939,56.666527],[-133.944739,56.645692],[-133.95914,56.640483],[-133.97354,56.635275],[-134.00594,56.64222],[-134.02394,56.649165],[-134.01314,56.650901],[-133.98074,56.650901],[-133.96634,56.657846],[-133.923139,56.715142],[-133.905139,56.749867],[-133.926739,56.801955],[-133.99154,56.873141],[-134.00954,56.880086],[-134.03474,56.888768],[-134.128341,56.913075],[-134.193142,56.930438],[-134.247142,56.939119],[-134.261543,56.939119],[-134.214742,56.900921],[-134.196742,56.895713],[-134.171542,56.893976],[-134.146341,56.888768],[-134.135541,56.883559],[-134.106741,56.845361],[-134.121141,56.841889],[-134.157142,56.848834],[-134.178742,56.859251],[-134.221942,56.883559],[-134.243542,56.893976],[-134.265143,56.899185],[-134.275943,56.899185],[-134.297543,56.900921],[-134.319143,56.895713],[-134.398344,56.854042],[-134.405544,56.847097],[-134.409144,56.829735]]],[[[-134.340743,55.912993],[-134.315543,55.852224],[-134.293943,55.831389],[-134.250743,55.817499],[-134.236342,55.836598],[-134.221942,55.850488],[-134.207542,55.859169],[-134.175142,55.874796],[-134.135541,55.893894],[-134.121141,55.899103],[-134.113941,55.899103],[-134.099541,55.914729],[-134.117541,55.921674],[-134.322743,55.923411],[-134.340743,55.912993]]],[[[-134.01674,57.015514],[-133.887139,56.951273],[-133.739537,56.895713],[-133.750338,56.874877],[-133.807938,56.876614],[-133.833138,56.881822],[-133.883539,56.897449],[-133.869139,56.869669],[-133.739537,56.807164],[-133.699937,56.829735],[-133.681937,56.79501],[-133.692737,56.749867],[-133.707137,56.68389],[-133.692737,56.650901],[-133.667537,56.638747],[-133.635136,56.597077],[-133.663937,56.522418],[-133.656737,56.463385],[-133.638736,56.439078],[-133.573936,56.433869],[-133.505535,56.435605],[-133.465935,56.452968],[-133.426334,56.473803],[-133.303933,56.472067],[-133.188732,56.451232],[-133.156332,56.45644],[-133.131131,56.47033],[-133.084331,56.532836],[-133.087931,56.553671],[-133.095131,56.614439],[-133.113131,56.621384],[-133.185132,56.637011],[-133.303933,56.730768],[-133.332733,56.762021],[-133.347133,56.838416],[-133.242732,56.805427],[-133.217532,56.78112],[-133.203132,56.751603],[-133.188732,56.716878],[-133.127531,56.666527],[-133.00873,56.600549],[-132.96913,56.609231],[-132.933129,56.630066],[-132.925929,56.659582],[-132.943929,56.742922],[-132.925929,56.852306],[-132.97273,56.925229],[-133.051931,56.977316],[-133.080731,56.992943],[-133.167132,57.001624],[-133.296733,56.998151],[-133.318333,56.994679],[-133.437134,57.013778],[-133.498335,57.027668],[-133.627936,57.050239],[-133.761138,57.069338],[-133.843938,57.081492],[-133.908739,57.079755],[-134.00954,57.053712],[-134.01674,57.015514]]],[[[-133.793538,55.932092],[-133.786338,55.918202],[-133.699937,55.895631],[-133.638736,55.933828],[-133.609936,55.958136],[-133.458735,56.003278],[-133.361534,56.010223],[-133.314733,56.08141],[-133.285933,56.128289],[-133.278733,56.138706],[-133.303933,56.149124],[-133.314733,56.149124],[-133.390334,56.154332],[-133.401134,56.154332],[-133.570336,56.126552],[-133.609936,56.105717],[-133.681937,56.064047],[-133.775538,55.975498],[-133.786338,55.963344],[-133.793538,55.947718],[-133.793538,55.932092]]],[[[-133.757538,55.487611],[-133.746737,55.46504],[-133.728737,55.468512],[-133.714337,55.46504],[-133.667537,55.45115],[-133.645936,55.440732],[-133.635136,55.444205],[-133.577536,55.501501],[-133.577536,55.527545],[-133.584736,55.536226],[-133.692737,55.550116],[-133.703537,55.551852],[-133.717937,55.54838],[-133.725137,55.541435],[-133.757538,55.487611]]],[[[-133.685537,55.308777],[-133.653137,55.267107],[-133.645936,55.258426],[-133.606336,55.232382],[-133.595536,55.235854],[-133.559536,55.313986],[-133.501935,55.348711],[-133.444334,55.371282],[-133.447934,55.400798],[-133.447934,55.40948],[-133.563136,55.419897],[-133.573936,55.421633],[-133.588336,55.416425],[-133.638736,55.383436],[-133.649536,55.371282],[-133.685537,55.308777]]],[[[-133.678337,55.775829],[-133.645936,55.744577],[-133.635136,55.735895],[-133.617136,55.725478],[-133.602736,55.718533],[-133.591936,55.711588],[-133.570336,55.702906],[-133.534335,55.692489],[-133.523535,55.690753],[-133.505535,55.692489],[-133.483935,55.699434],[-133.318333,55.765412],[-133.300333,55.791455],[-133.303933,55.796664],[-133.325533,55.801873],[-133.541535,55.827917],[-133.552336,55.829653],[-133.617136,55.827917],[-133.635136,55.820972],[-133.674737,55.786247],[-133.678337,55.775829]]],[[[-133.631536,56.274134],[-133.609936,56.204684],[-133.563136,56.17864],[-133.419134,56.16475],[-133.365134,56.171695],[-133.321933,56.169959],[-133.264333,56.154332],[-133.257133,55.947718],[-133.239132,55.902576],[-133.228332,55.886949],[-133.177932,55.860906],[-133.145531,55.880004],[-133.141931,55.815763],[-133.242732,55.744577],[-133.264333,55.741104],[-133.372334,55.722005],[-133.383134,55.640401],[-133.365134,55.616094],[-133.260733,55.574424],[-133.199532,55.577896],[-133.120331,55.60394],[-133.059131,55.623039],[-132.96553,55.638665],[-132.922329,55.624775],[-132.96193,55.623039],[-132.98353,55.619566],[-133.00513,55.609149],[-133.051931,55.577896],[-133.116731,55.515391],[-133.127531,55.491084],[-133.113131,55.46504],[-133.03033,55.397326],[-133.00153,55.379963],[-132.98713,55.373018],[-132.96553,55.373018],[-132.943929,55.369546],[-132.889929,55.359128],[-132.868329,55.35392],[-132.900729,55.345238],[-132.96913,55.350447],[-133.04113,55.362601],[-133.116731,55.378227],[-133.210332,55.3817],[-133.260733,55.336557],[-133.213932,55.277524],[-133.02673,55.267107],[-132.96913,55.270579],[-132.911529,55.275788],[-132.98713,55.228909],[-133.02673,55.215019],[-133.00153,55.202866],[-132.943929,55.208074],[-132.807128,55.248008],[-132.803528,55.209811],[-132.778328,55.18203],[-132.695527,55.142097],[-132.655927,55.138624],[-132.623526,55.147305],[-132.609126,55.169877],[-132.630726,55.188975],[-132.648726,55.206338],[-132.652327,55.244536],[-132.53149926318025,55.125],[-132.075,55.125],[-131.98947204256544,55.125],[-131.96832,55.178558],[-131.96832,55.220228],[-131.98632,55.260162],[-132.01512,55.268843],[-132.058321,55.235854],[-132.069121,55.213283],[-132.101521,55.197657],[-132.234722,55.192448],[-132.249122,55.211547],[-132.234722,55.249744],[-132.202322,55.248008],[-132.169922,55.242799],[-132.133921,55.239327],[-132.087121,55.267107],[-132.281523,55.458095],[-132.501125,55.511919],[-132.562326,55.567479],[-132.544325,55.621303],[-132.511925,55.614358],[-132.475925,55.591786],[-132.454325,55.558797],[-132.432724,55.544907],[-132.407524,55.536226],[-132.378724,55.531017],[-132.216722,55.475457],[-132.159122,55.444205],[-132.144721,55.452886],[-132.141121,55.475457],[-132.166322,55.501501],[-132.180722,55.511919],[-132.205922,55.527545],[-132.227522,55.537962],[-132.245522,55.541435],[-132.403924,55.657764],[-132.443524,55.68728],[-132.465125,55.775829],[-132.497525,55.820972],[-132.511925,55.834862],[-132.623526,55.919938],[-132.821528,56.029322],[-132.900729,56.048421],[-132.947529,56.058838],[-133.04473,56.048421],[-133.073531,56.051893],[-133.123931,56.117871],[-133.087931,56.105717],[-133.062731,56.117871],[-133.02313,56.171695],[-133.055531,56.237673],[-133.181532,56.327958],[-133.249932,56.33143],[-133.347133,56.329694],[-133.487535,56.336639],[-133.584736,56.350529],[-133.609936,56.348793],[-133.631536,56.274134]]],[[[-133.599136,55.449413],[-133.577536,55.438996],[-133.537935,55.430315],[-133.516335,55.426842],[-133.505535,55.426842],[-133.458735,55.432051],[-133.444334,55.435523],[-133.429934,55.438996],[-133.422734,55.447677],[-133.415534,55.463304],[-133.419134,55.477194],[-133.422734,55.485875],[-133.476735,55.515391],[-133.498335,55.5206],[-133.512735,55.518864],[-133.599136,55.449413]]],[[[-133.451535,55.251481],[-133.447934,55.234118],[-133.440734,55.221964],[-133.437134,55.211547],[-133.426334,55.202866],[-133.415534,55.199393],[-133.321933,55.194184],[-133.249932,55.209811],[-133.242732,55.215019],[-133.224732,55.249744],[-133.231932,55.265371],[-133.296733,55.331348],[-133.311133,55.334821],[-133.325533,55.334821],[-133.429934,55.310513],[-133.437134,55.305304],[-133.451535,55.251481]]],[[[-133.433534,55.524072],[-133.347133,55.447677],[-133.289533,55.475457],[-133.271533,55.487611],[-133.267933,55.496292],[-133.271533,55.527545],[-133.278733,55.536226],[-133.303933,55.553589],[-133.339933,55.557061],[-133.375934,55.557061],[-133.393934,55.553589],[-133.419134,55.544907],[-133.433534,55.524072]]],[[[-133.332733,55.873059],[-133.311133,55.820972],[-133.260733,55.777565],[-133.246332,55.775829],[-133.231932,55.789719],[-133.213932,55.82618],[-133.210332,55.84007],[-133.210332,55.853961],[-133.213932,55.862642],[-133.267933,55.899103],[-133.285933,55.900839],[-133.332733,55.873059]]],[[[-133.20951201299584,55.125],[-132.9928055337653,55.125],[-133.069931,55.199393],[-133.102331,55.246272],[-133.113131,55.251481],[-133.188732,55.234118],[-133.195932,55.227173],[-133.20951201299584,55.125]]],[[[-133.055531,56.348793],[-133.04473,56.33143],[-132.911529,56.260244],[-132.861129,56.237673],[-132.846728,56.232464],[-132.835928,56.230727],[-132.817928,56.2342],[-132.760328,56.246354],[-132.699127,56.258508],[-132.677527,56.265453],[-132.648726,56.27587],[-132.641526,56.282815],[-132.634326,56.298441],[-132.612726,56.393935],[-132.630726,56.425188],[-132.637926,56.435605],[-132.655927,56.444287],[-132.684727,56.452968],[-132.702727,56.45644],[-132.720727,56.458177],[-132.731527,56.458177],[-132.886329,56.454704],[-132.922329,56.452968],[-132.940329,56.447759],[-132.99073,56.421715],[-133.055531,56.348793]]],[[[-132.95473,56.593604],[-132.943929,56.515473],[-132.929529,56.505056],[-132.904329,56.498111],[-132.893529,56.498111],[-132.792728,56.494638],[-132.774728,56.494638],[-132.684727,56.520682],[-132.576726,56.553671],[-132.562326,56.558879],[-132.537125,56.571033],[-132.529925,56.581451],[-132.529925,56.591868],[-132.537125,56.600549],[-132.551526,56.605758],[-132.612726,56.645692],[-132.666727,56.678681],[-132.731527,56.72556],[-132.803528,56.786329],[-132.871929,56.796746],[-132.918729,56.748131],[-132.922329,56.702988],[-132.897129,56.65611],[-132.882729,56.635275],[-132.897129,56.621384],[-132.922329,56.619648],[-132.95473,56.593604]]],[[[-132.86524267896922,55.125],[-132.71901530607838,55.125],[-132.731527,55.14036],[-132.814328,55.185503],[-132.825128,55.192448],[-132.853929,55.159459],[-132.864729,55.14036],[-132.86524267896922,55.125]]],[[[-132.717127,56.15086],[-132.713527,56.135234],[-132.695527,56.107454],[-132.688327,56.098772],[-132.634326,56.048421],[-132.623526,56.048421],[-132.609126,56.062311],[-132.609126,56.074465],[-132.598326,56.08141],[-132.447124,56.05363],[-132.418324,56.027586],[-132.411124,55.996333],[-132.421924,55.968553],[-132.425524,55.956399],[-132.317523,55.912993],[-132.274323,55.916466],[-132.144721,55.925147],[-132.130321,55.926883],[-132.119521,55.935564],[-132.115921,55.947718],[-132.137521,56.06752],[-132.094321,56.100508],[-132.108721,56.116135],[-132.180722,56.168222],[-132.213122,56.17864],[-132.396724,56.222046],[-132.371524,56.268925],[-132.378724,56.312331],[-132.385924,56.33143],[-132.400324,56.347056],[-132.418324,56.350529],[-132.436324,56.350529],[-132.493925,56.343584],[-132.515525,56.338375],[-132.529925,56.33143],[-132.565926,56.28976],[-132.573126,56.277606],[-132.684727,56.225519],[-132.695527,56.218574],[-132.717127,56.15086]]],[[[-132.375124,56.475539],[-132.367924,56.454704],[-132.349923,56.437342],[-132.328323,56.402617],[-132.328323,56.326221],[-132.328323,56.315804],[-132.331923,56.305386],[-132.346323,56.281079],[-132.346323,56.270661],[-132.331923,56.256771],[-132.313923,56.239409],[-132.303123,56.232464],[-132.274323,56.213365],[-132.252723,56.202947],[-132.223922,56.194266],[-132.213122,56.19253],[-132.202322,56.190794],[-132.191522,56.189057],[-132.169922,56.185585],[-132.108721,56.166486],[-132.097921,56.161277],[-132.054721,56.110926],[-132.01152,56.133497],[-131.946719,56.232464],[-131.98992,56.319276],[-131.99352,56.327958],[-132.00792,56.338375],[-132.04392,56.355738],[-132.072721,56.35921],[-132.090721,56.352265],[-132.108721,56.343584],[-132.126721,56.343584],[-132.159122,56.352265],[-132.213122,56.388727],[-132.216722,56.399144],[-132.223922,56.421715],[-132.231122,56.439078],[-132.256323,56.452968],[-132.353524,56.489429],[-132.371524,56.487693],[-132.375124,56.475539]]],[[[-131.856719,55.359128],[-131.849518,55.296623],[-131.838718,55.267107],[-131.824318,55.211547],[-131.817118,55.201129],[-131.813518,55.192448],[-131.809918,55.18203],[-131.737917,55.135152],[-131.723517,55.136888],[-131.615516,55.275788],[-131.622716,55.293151],[-131.629916,55.300096],[-131.647916,55.312249],[-131.676717,55.331348],[-131.748717,55.369546],[-131.820718,55.412952],[-131.827918,55.419897],[-131.842318,55.419897],[-131.853119,55.411216],[-131.856719,55.359128]]],[[[-131.820718,55.452886],[-131.712717,55.36781],[-131.687517,55.35392],[-131.665917,55.345238],[-131.543515,55.291414],[-131.518315,55.294887],[-131.464315,55.369546],[-131.471515,55.393853],[-131.496715,55.421633],[-131.514715,55.480666],[-131.493115,55.504974],[-131.428314,55.5206],[-131.464315,55.471985],[-131.471515,55.447677],[-131.446314,55.407743],[-131.421114,55.385172],[-131.421114,55.364337],[-131.457115,55.32614],[-131.399514,55.348711],[-131.327513,55.425106],[-131.316713,55.458095],[-131.327513,55.508446],[-131.352714,55.555325],[-131.359914,55.574424],[-131.367114,55.624775],[-131.349113,55.643874],[-131.280713,55.489347],[-131.273513,55.433787],[-131.291513,55.411216],[-131.367114,55.338293],[-131.428314,55.313986],[-131.457115,55.300096],[-131.453515,55.279261],[-131.417514,55.261898],[-131.399514,55.256689],[-131.388714,55.254953],[-131.345513,55.256689],[-131.291513,55.275788],[-131.255513,55.319194],[-131.273513,55.352183],[-131.269913,55.383436],[-131.219512,55.402535],[-131.194312,55.393853],[-131.190712,55.360865],[-131.219512,55.300096],[-131.233912,55.282733],[-131.255513,55.265371],[-131.284313,55.246272],[-131.280713,55.227173],[-131.248312,55.201129],[-131.205112,55.187239],[-131.140311,55.199393],[-131.136711,55.228909],[-131.100711,55.234118],[-131.075511,55.246272],[-131.057511,55.258426],[-130.96751,55.388645],[-130.938709,55.56227],[-130.935109,55.636929],[-131.057511,55.807082],[-131.068311,55.820972],[-131.143911,55.886949],[-131.208712,55.937301],[-131.230312,55.954663],[-131.259113,55.959872],[-131.291513,55.958136],[-131.439114,55.930356],[-131.478715,55.919938],[-131.529115,55.900839],[-131.539915,55.852224],[-131.683917,55.829653],[-131.683917,55.793192],[-131.622716,55.781038],[-131.629916,55.730687],[-131.694717,55.671654],[-131.705517,55.624775],[-131.691117,55.609149],[-131.701917,55.525809],[-131.820718,55.452886]]],[[[-131.586716,55.228909],[-131.583116,55.215019],[-131.565116,55.171613],[-131.57269629113824,55.125],[-131.35087892785285,55.125],[-131.374314,55.197657],[-131.388714,55.211547],[-131.406714,55.208074],[-131.421114,55.209811],[-131.453515,55.221964],[-131.464315,55.232382],[-131.467915,55.235854],[-131.471515,55.248008],[-131.521915,55.263634],[-131.547115,55.267107],[-131.583116,55.254953],[-131.586716,55.228909]]]]}} diff --git a/test/fixtures/states_source.geojson b/test/fixtures/states_source.geojson new file mode 100644 index 0000000..f2f5e9f --- /dev/null +++ b/test/fixtures/states_source.geojson @@ -0,0 +1 @@ +{"type": "FeatureCollection", "features": [{"type":"Feature","properties":{"FID_Last2":247,"FID_MidLas":247,"CNTRY_NAME":"United States","FIRST_FIRS":"North America"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-137.25,58.45176071716887],[-137.14877148771487,58.41667042708022],[-137.05517055170552,58.39583538718688],[-137.0191701917019,58.40278040048466],[-136.99036990369905,58.40278040048466],[-136.95076950769507,58.39583538718688],[-136.86076860768605,58.380209107266836],[-136.83556835568356,58.35590156072459],[-136.7059670596706,58.23783633466215],[-136.6879668796688,58.22741881471546],[-136.6591665916659,58.21700129476878],[-136.61956619566195,58.21700129476878],[-136.5979659796598,58.22047380141768],[-136.57276572765727,58.2395725879866],[-136.56196561965618,58.26214388120442],[-136.60156601566015,58.303813960991164],[-136.63036630366304,58.3159677342623],[-136.64836648366483,58.33506652083122],[-136.58356583565836,58.35069280075123],[-136.53316533165332,58.33333026750677],[-136.4971649716497,58.30902272096449],[-136.36756367563675,58.29860520101781],[-136.35316353163532,58.33680277415564],[-136.38556385563857,58.35069280075123],[-136.41076410764106,58.36458282734682],[-136.44676446764467,58.3680553339957],[-136.47916479164792,58.359374067373466],[-136.47916479164792,58.338539027480095],[-136.5367653676537,58.359374067373466],[-136.47916479164792,58.41667042708022],[-136.30276302763028,58.38194536059129],[-136.27036270362703,58.35763781404901],[-136.27756277562776,58.32638525420899],[-136.25596255962557,58.30728646764004],[-136.08316083160832,58.34027528080455],[-136.05076050760508,58.36111032069792],[-136.02916029160292,58.38541786724019],[-136.04356043560435,58.427087947026905],[-136.07956079560796,58.51216435992484],[-136.12276122761227,58.564251959658264],[-136.18756187561874,58.61460330606724],[-136.25596255962557,58.64932837255617],[-136.28836288362882,58.66148214582731],[-136.3279632796328,58.64238335925839],[-136.37836378363784,58.619812066040566],[-136.4611646116461,58.59550451949829],[-136.48636486364865,58.59376826617387],[-136.51876518765187,58.61113079941833],[-136.48996489964898,58.60939454609388],[-136.46476464764646,58.61460330606724],[-136.34236342363423,58.680580932396225],[-136.37836378363784,58.71877850553406],[-136.48996489964898,58.74655855872521],[-136.58356583565836,58.769129851943035],[-136.6339663396634,58.81427243837865],[-136.58356583565836,58.80906367840532],[-136.56556565565654,58.79343739848531],[-136.54756547565475,58.77260235859194],[-136.50436504365044,58.78822863851195],[-136.5367653676537,58.82295370500091],[-136.5583655836558,58.831634971623146],[-136.57636576365763,58.838579984920926],[-136.73476734767348,58.86809629143653],[-136.90756907569076,58.8889313313299],[-136.98676986769868,58.88719507800545],[-137.029970299703,58.873305051409886],[-137.04437044370442,58.86115127813875],[-137.11997119971198,58.82295370500091],[-137.11277112771126,58.84726125154316],[-137.0407704077041,58.906293864574366],[-137.00477004770048,58.93060141111664],[-136.9759697596976,58.98963402414785],[-137.05157051570515,59.034776610583464],[-137.06597065970658,59.06255666377464],[-137.03717037170372,59.06776542374797],[-136.88236882368824,58.9913702774723],[-136.7671676716767,58.941018931063326],[-136.68436684366844,58.91150262454772],[-136.65556655566556,58.967062730930024],[-136.579965799658,58.9149751311966],[-136.46836468364683,58.82989871829869],[-136.23796237962378,58.75176731869857],[-136.16596165961658,58.755239825347445],[-136.129961299613,58.77781111856527],[-136.10476104761045,58.82989871829869],[-136.0939609396094,58.8628875314632],[-136.10836108361082,58.92886515779219],[-136.14436144361443,59.015677824014546],[-136.16236162361622,59.02783159728568],[-136.14436144361443,59.03130410393459],[-136.10116101161012,59.01220531736567],[-136.08676086760866,58.98442526417449],[-136.06876068760687,58.9444914377122],[-136.0471604716047,58.89066758465435],[-135.9571595715957,58.8889313313299],[-135.92835928359284,58.90108510460104],[-135.83475834758346,58.90976637122327],[-135.8023580235802,58.90976637122327],[-135.76635766357663,58.89587634462768],[-135.85275852758525,58.87677755805876],[-135.94635946359463,58.86115127813875],[-136.0651606516065,58.817744945027556],[-135.92835928359284,58.65627338585395],[-135.88875888758886,58.612867052742786],[-135.87075870758707,58.6024495327961],[-135.83475834758346,58.53820815979154],[-135.84915849158492,58.468758026813646],[-135.88875888758886,58.45139549356918],[-135.91035910359102,58.38194536059129],[-135.75555755557554,58.39583538718688],[-135.60795607956078,58.420142933729124],[-135.51075510755106,58.475703040111455],[-135.47115471154711,58.47223053346255],[-135.40635406354062,58.38194536059129],[-135.40275402754025,58.34722029410233],[-135.36675366753667,58.291660187720026],[-135.34515345153451,58.26561638785333],[-135.319953199532,58.249990107933286],[-135.27315273152732,58.23436382801327],[-135.15795157951578,58.20658377482212],[-135.08595085950859,58.23262757468882],[-135.04995049950497,58.303813960991164],[-135.04995049950497,58.34027528080455],[-135.07155071550716,58.3975716405113],[-135.0931509315093,58.43750546697359],[-135.1651516515165,58.543416919764894],[-135.17955179551794,58.56077945300936],[-135.18675186751867,58.62328457268947],[-135.16875168751687,58.645855865907265],[-135.18675186751867,58.66321839915176],[-135.24435244352443,58.72051475885851],[-135.31275312753127,58.84899750486761],[-135.32715327153272,58.86636003811208],[-135.38835388353883,58.961853970956696],[-135.39555395553955,59.071237930396876],[-135.4459544595446,59.12853429010363],[-135.54675546755468,59.22576447627267],[-135.4891548915489,59.22402822294822],[-135.46755467554675,59.21881946297489],[-135.4171541715417,59.199720676405974],[-135.39555395553955,59.180621889837056],[-135.38475384753846,59.15805059661923],[-135.36675366753667,59.12679803677918],[-135.30195301953017,59.092072970290246],[-135.34515345153451,59.18930315645929],[-135.35955359553594,59.21013819635266],[-135.4279542795428,59.25701703611273],[-135.46035460354602,59.290005849277236],[-135.3991539915399,59.36813724887736],[-135.34875348753485,59.46363118172195],[-135.32715327153272,59.453213661775266],[-135.33435334353342,59.39418104874406],[-135.34875348753485,59.36640099555291],[-135.35595355953558,59.329939675739524],[-135.35955359553594,59.26222579608606],[-135.31635316353163,59.2222919696238],[-135.28395283952838,59.20319318305485],[-135.23355233552334,59.12853429010363],[-135.13275132751326,58.88198631803212],[-135.1471514715147,58.84378874489428],[-135.06075060750607,58.75176731869857],[-135.02835028350282,58.741349798751884],[-135.01755017550175,58.77781111856527],[-134.99954999549993,58.80559117175642],[-134.95274952749526,58.81427243837865],[-134.9311493114931,58.77781111856527],[-134.92034920349204,58.687525945694006],[-134.97434974349744,58.645855865907265],[-134.9491494914949,58.631965839311704],[-134.77274772747728,58.46007676019141],[-134.77274772747728,58.435769213649166],[-134.75834758347582,58.38194536059129],[-134.63954639546395,58.35590156072459],[-134.57474574745746,58.352429054075685],[-134.53874538745387,58.359374067373466],[-134.51714517145172,58.35590156072459],[-134.48834488344883,58.34722029410233],[-134.3839438394384,58.2864514277467],[-134.23994239942397,58.208320028146545],[-134.18234182341823,58.19790250819986],[-134.14994149941498,58.19963876152431],[-134.09954099540994,58.2395725879866],[-134.04554045540453,58.39236288053797],[-133.97353973539734,58.49827433332925],[-133.9231392313923,58.51216435992484],[-133.879938799388,58.52084562654707],[-133.85833858338583,58.52084562654707],[-133.77553775537754,58.515636866573715],[-133.79353793537933,58.50695559995148],[-133.81873818738185,58.503483093302606],[-133.85833858338583,58.508691853275934],[-133.879938799388,58.508691853275934],[-133.90153901539014,58.50521934662706],[-133.92673926739266,58.49132932003147],[-134.00954009540095,58.39062662721352],[-133.9951399513995,58.34027528080455],[-134.05274052740526,58.25346261458219],[-134.0851408514085,58.18922124157763],[-134.07074070740705,58.10067232203082],[-134.059940599406,58.078101028812995],[-134.01314013140131,58.03990345567516],[-133.9771397713977,58.01385965580846],[-133.91233912339123,57.98087084264395],[-133.879938799388,57.99128836259064],[-133.82953829538295,58.0086508958351],[-133.8079380793808,58.04684846897297],[-133.75033750337502,58.133661135195325],[-133.6819368193682,58.14581490846646],[-133.69633696336962,58.10414482867972],[-133.7611376113761,58.029485935728474],[-133.81153811538115,57.97218957602172],[-133.80433804338043,57.8975306830705],[-133.69993699936998,57.791619230279196],[-133.66033660336603,57.784674216981415],[-133.63153631536315,57.79682799025255],[-133.62073620736206,57.8246080434437],[-133.6423364233642,57.87148688320377],[-133.59193591935917,57.91142070966606],[-133.5559355593556,57.9235744829372],[-133.5271352713527,57.9235744829372],[-133.44433444334442,57.91836572296384],[-133.1851318513185,57.89058566977269],[-133.13113131131308,57.85412434995931],[-133.2643326433264,57.87495938985268],[-133.429934299343,57.90621194969273],[-133.5451354513545,57.907948203017185],[-133.5559355593556,57.8246080434437],[-133.5451354513545,57.76904793706137],[-133.5163351633516,57.74647664384358],[-133.3579335793358,57.67702651086569],[-133.32193321933218,57.661400230945645],[-133.19953199531994,57.619730151158905],[-133.18153181531812,57.61625764451003],[-133.13473134731345,57.586741337994425],[-133.0051300513005,57.51381869836763],[-133.0411304113041,57.503401178420944],[-133.0843308433084,57.519027458340986],[-133.12033120331202,57.54333500488323],[-133.1671316713167,57.572851311398836],[-133.55953559535595,57.70827907070574],[-133.6423364233642,57.696125297434605],[-133.66033660336603,57.628411417781166],[-133.5991359913599,57.57458756472329],[-133.54873548735486,57.565906298101055],[-133.50553505535055,57.57111505807438],[-133.48033480334803,57.57632381804774],[-133.44793447934478,57.58326883134552],[-133.3579335793358,57.591950097967754],[-133.31833318333182,57.5902138446433],[-133.33273332733324,57.57632381804774],[-133.4119341193412,57.55722503147882],[-133.4371343713437,57.55548877815437],[-133.46233462334624,57.54159875155878],[-133.50553505535055,57.484302391852026],[-133.44073440734405,57.35581964584293],[-133.40833408334083,57.33845711259846],[-133.35073350733506,57.32803959265178],[-133.22833228332283,57.31414956605619],[-133.1131311313113,57.32803959265178],[-133.06633066330662,57.347138379220695],[-133.0843308433084,57.32109457935397],[-133.24273242732426,57.27595199291835],[-133.28953289532893,57.27595199291835],[-133.31833318333182,57.28116075289168],[-133.44433444334442,57.28289700621613],[-133.46953469534694,57.28116075289168],[-133.49833498334982,57.25511695302498],[-133.5091350913509,57.19434808666932],[-133.48753487534873,57.16656803347817],[-133.4371343713437,57.14052423361147],[-133.4011340113401,57.135315473638116],[-133.38673386733865,57.128370460340335],[-133.33993339933397,57.11100792709587],[-133.31473314733145,57.10232666047361],[-133.2823328233282,57.09885415382473],[-133.2571325713257,57.1162166870692],[-133.1671316713167,57.16309552682927],[-133.12393123931238,57.15094175355816],[-133.14193141931418,57.1162166870692],[-133.12753127531275,57.079755367255814],[-132.90432904329043,57.032876527495716],[-132.84672846728466,57.060656580686896],[-132.80352803528035,57.08322787390469],[-132.76392763927637,56.98252518108674],[-132.7783277832778,56.958217634544496],[-132.8431284312843,56.96689890116673],[-132.85752857528576,56.9321738346778],[-132.76752767527674,56.84362491513096],[-132.68832688326881,56.80889984864203],[-132.64152641526414,56.78806480874866],[-132.5731257312573,56.765493515530835],[-132.53352533525333,56.75507599558415],[-132.49752497524975,56.74986723561082],[-132.45792457924577,56.78285604877533],[-132.4219242192422,56.81063610196648],[-132.38592385923857,56.82278987523762],[-132.36432364323642,56.81758111526426],[-132.41472414724146,56.772438528828644],[-132.4651246512465,56.74639472896192],[-132.50472504725047,56.72555968906855],[-132.52272522725227,56.71514216912186],[-132.55152551525515,56.63701076952174],[-132.52272522725227,56.61791198295282],[-132.49392493924938,56.61096696965504],[-132.43992439924398,56.60402195635726],[-132.40752407524073,56.609230716330586],[-132.36432364323642,56.6248569962506],[-132.31752317523174,56.63353826287286],[-132.3391233912339,56.5988131963839],[-132.349923499235,56.5432530900016],[-132.34272342723426,56.52415430343268],[-132.18792187921878,56.423451610614734],[-132.06552065520654,56.37830902417909],[-132.03672036720366,56.37310026420576],[-131.99351993519934,56.35747398428572],[-131.96831968319682,56.32622142444566],[-131.9611196111961,56.29670511793006],[-131.9323193231932,56.258507544792224],[-131.91791917919178,56.239408758223306],[-131.89991899919,56.22725498495217],[-131.8243182431824,56.21336495835661],[-131.770317703177,56.197738678436565],[-131.95751957519573,56.164749865272086],[-131.96831968319682,56.081409705698604],[-131.9611196111961,56.055365905831906],[-131.93951939519394,56.01022331939626],[-131.94671946719467,55.965080732960644],[-131.97551975519752,55.95639946633841],[-132.0223202232022,55.95639946633841],[-132.05472054720545,55.94250943974282],[-132.07272072720724,55.862641786818244],[-132.04752047520475,55.822707960355956],[-132.1051210512105,55.80534542711149],[-132.16992169921699,55.80013666713813],[-132.24552245522455,55.72374152086246],[-132.18792187921878,55.60567629480005],[-132.16632166321662,55.58484125490668],[-132.14472144721447,55.56747872166221],[-132.11232112321122,55.555324948391075],[-132.06192061920618,55.54317117511994],[-132.02592025920256,55.527544895199924],[-131.9611196111961,55.49802858868432],[-131.95391953919537,55.5015010953332],[-131.92511925119248,55.534489908497704],[-131.83871838718386,55.63519260131565],[-131.8171181711817,55.6629726545068],[-131.75951759517594,55.81402669373372],[-131.82071820718204,55.83138922697819],[-131.8531185311853,55.83486173362709],[-131.87471874718744,55.83833424027597],[-131.89991899919,55.855696773520464],[-131.88191881918817,55.8643780401427],[-131.80271802718025,55.88174057338716],[-131.75591755917557,55.88000432006271],[-131.73431734317342,55.88521308003607],[-131.5471154711547,55.951190706365054],[-131.47871478714785,55.97549825290733],[-131.4031140311403,55.99459703947625],[-131.37071370713704,55.96160822631174],[-131.32751327513273,55.965080732960644],[-131.20871208712086,56.01195957272071],[-131.17271172711725,56.03279461261408],[-131.1439114391144,56.05015714585855],[-131.07551075510753,56.09356347896974],[-131.01431014310143,56.10571725224088],[-131.05751057510574,56.05710215915633],[-131.09351093510935,56.0223770926674],[-131.14031140311403,56.00327830609848],[-131.16551165511655,55.985915772854014],[-131.16911169111688,55.94250943974282],[-131.1151111511115,55.90083935995608],[-131.0251102511025,55.83486173362709],[-130.91350913509135,55.74110405410693],[-130.88470884708846,55.70811524094245],[-130.870308703087,55.603940041475596],[-130.86670866708664,55.5778962416089],[-130.870308703087,55.54664368176884],[-130.87390873908737,55.51018236195543],[-130.87390873908737,55.41295217578639],[-130.870308703087,55.336557029510715],[-130.85950859508594,55.31051322964399],[-130.71550715507152,55.30704072299511],[-130.68670686706866,55.33829328283517],[-130.65790657906578,55.34523829613295],[-130.61470614706144,55.294886949723974],[-130.64350643506432,55.28794193642619],[-130.79470794707944,55.28620568310174],[-130.8811088110881,55.289678189750646],[-130.93150931509314,55.28446942977729],[-131.050310503105,55.20460177685271],[-131.06471064710647,55.187239243608246],[-131.05751057510574,55.12820663057704],[-131.01071010710106,55.08827280411475],[-130.96390963909639,55.08480029746585],[-130.92070920709205,55.08827280411475],[-130.89550895508953,55.096954070736984],[-130.87390873908737,55.1160528573059],[-130.81270812708127,55.1420966571726],[-130.7263072630726,55.12647037725259],[-130.60030600306,55.2150192967994],[-130.58590585905858,55.22890932339499],[-130.5643056430564,55.26710689653282],[-130.54990549905497,55.28273317645284],[-130.5031050310503,55.315721989617344],[-130.4743047430474,55.32613950956403],[-130.55350553505534,55.22370056342163],[-130.7011070110701,55.117789110630355],[-130.80190801908017,55.10737159068367],[-130.83430834308342,55.103899084034765],[-130.96390963909639,55.062229004248024],[-130.98190981909818,55.05181148430134],[-131.0071100711007,54.99972388456794],[-130.98550985509854,54.98930636462126],[-130.9351093510935,54.9580538047812],[-130.92790927909277,54.932010004914474],[-130.93150931509314,54.871241138558844],[-130.93870938709387,54.8556148586388],[-130.93150931509314,54.822626045474294],[-130.90990909909098,54.79137348563427],[-130.89550895508953,54.78095596568758],[-130.870308703087,54.77227469906535],[-130.83790837908379,54.76706593909199],[-130.8091080910809,54.77227469906535],[-130.75150751507513,54.82088979214987],[-130.7371073710737,54.8521423519899],[-130.75150751507513,54.87297739188327],[-130.7443074430744,54.9545812981323],[-130.70470704707046,54.84519733869212],[-130.71910719107188,54.79831849893205],[-130.70830708307082,54.76706593909199],[-130.57870578705786,54.796582245607595],[-130.49950499504993,54.831307312096556],[-130.3663036630366,54.90422995172332],[-130.27630276302762,54.9840976046479],[-130.24390243902437,55.02576768443464],[-130.21870218702185,55.05354773762579],[-130.16470164701644,55.12647037725259],[-130.1359013590136,55.171612963688204],[-130.10350103501034,55.206338030177164],[-130.07830078300782,55.22543681674608],[-129.99189991899917,55.280996923128384],[-130.04590045900457,55.37996336262188],[-130.1431014310143,55.541434921795485],[-130.17550175501754,55.75673033402697],[-130.1359013590136,55.808817933760366],[-130.10350103501034,55.820971707031504],[-130.02790027900278,55.89563059998275],[-130.01350013500132,55.90952062657831],[-130.01350013500132,56.02411334599185],[-130.0531005310053,56.076200945725276],[-130.08910089100888,56.11787102551199],[-130.22950229502294,56.09009097232084],[-130.3663036630366,56.123079785485345],[-130.4491044910449,56.2064199450588],[-130.46350463504632,56.2359362515744],[-130.4851048510485,56.239408758223306],[-130.53190531905318,56.246353771521086],[-130.56070560705606,56.24982627816999],[-130.62550625506253,56.258507544792224],[-130.71910719107188,56.32622142444566],[-130.7551075510755,56.35226522431239],[-130.7731077310773,56.36615525090795],[-130.84870848708485,56.37483651753021],[-130.92070920709205,56.38178153082799],[-131.0611106111061,56.40088031739691],[-131.12591125911257,56.423451610614734],[-131.1439114391144,56.43386913056142],[-131.16551165511655,56.44602290383253],[-131.21231212312122,56.46859419705035],[-131.29151291512915,56.499846756890406],[-131.3131131311313,56.51026427683709],[-131.5471154711547,56.5988131963839],[-131.57951579515793,56.60402195635726],[-131.61191611916118,56.602285703032805],[-131.8243182431824,56.5988131963839],[-131.85671856718565,56.718614675770766],[-131.86031860318602,56.79500982204644],[-132.10152101521015,56.86619620834878],[-132.09072090720906,56.89397626153993],[-132.06192061920618,56.95995388786895],[-132.03672036720366,57.0137777409268],[-132.02592025920256,57.03634903414462],[-132.22032220322203,57.067601593984676],[-132.32472324723244,57.08843663387805],[-132.25992259922597,57.16830428680262],[-132.22752227522273,57.20476560661601],[-132.35352353523535,57.354083392518476],[-132.37512375123748,57.374918432411846],[-132.45072450724507,57.435687298767505],[-132.47232472324723,57.45131357868752],[-132.49752497524975,57.470412365256436],[-132.61992619926198,57.58326883134552],[-132.76392763927637,57.72043284397685],[-132.78552785527853,57.75168540381691],[-132.79632796327962,57.770784190385825],[-132.81432814328141,57.798564243577005],[-132.87912879128788,57.859333109932635],[-132.9331293312933,57.90968445634161],[-132.96552965529654,57.93399200288388],[-132.99432994329942,57.95135453612835],[-133.03753037530373,57.982607095968405],[-133.05553055530555,57.996497122563994],[-133.06993069930698,58.01212340248401],[-133.09153091530914,58.03990345567516],[-133.10953109531096,58.085046042110804],[-133.1383313833138,58.13539738851978],[-133.18873188731885,58.180539974955394],[-133.21033210332104,58.196166254875436],[-133.23193231932316,58.21179253479545],[-133.30753307533075,58.256935121231066],[-133.36153361533616,58.28124266777334],[-133.429934299343,58.359374067373466],[-133.40833408334083,58.401044147160206],[-133.38673386733865,58.41146166710689],[-133.429934299343,58.45834050686696],[-133.55953559535595,58.52779063984485],[-133.73593735937357,58.64411961258284],[-133.8079380793808,58.71009723891183],[-133.82593825938258,58.72572351883184],[-134.08874088740885,58.80906367840532],[-134.23994239942397,58.85420626484094],[-134.32634326343262,58.925392651143284],[-134.32634326343262,58.97053523757893],[-134.3839438394384,59.05387539715238],[-134.46674466744668,59.12853429010363],[-134.53154531545314,59.132006796752535],[-134.56754567545676,59.13027054342808],[-134.65034650346502,59.185830649810384],[-134.6719467194672,59.206665689703755],[-134.68634686346863,59.24312700951714],[-134.74034740347403,59.25007202281495],[-134.95274952749526,59.27958832933055],[-135.0931509315093,59.42716986190857],[-135.07875078750786,59.44453239515303],[-135.06435064350643,59.45842242174862],[-135.02835028350282,59.46883994169531],[-135.01755017550175,59.49835624821091],[-135.0139501395014,59.54002632799765],[-135.0139501395014,59.5678063811888],[-135.09675096750965,59.62163023424665],[-135.12555125551256,59.62163023424665],[-135.15435154351542,59.62683899422001],[-135.1759517595176,59.637256514166694],[-135.33435334353342,59.725805433713504],[-135.47475474754748,59.802200579989176],[-135.5071550715507,59.79351931336694],[-135.8239582395824,59.70497039382013],[-135.949959499595,59.66850907400675],[-136.07236072360723,59.658091554060064],[-136.1191611916119,59.651146540762255],[-136.15876158761586,59.64593778078893],[-136.2091620916209,59.638992767491146],[-136.30996309963098,59.61294896762442],[-136.3459634596346,59.60079519435328],[-136.2991629916299,59.583432661108816],[-136.23796237962378,59.56086136789099],[-136.23436234362345,59.52613630140206],[-136.29556295562955,59.474048701668636],[-136.3711637116371,59.453213661775266],[-136.46476464764646,59.47057619501976],[-136.46476464764646,59.41501608863743],[-136.4611646116461,59.371609755526265],[-136.4611646116461,59.295214609250564],[-136.48636486364865,59.255280782788276],[-136.5583655836558,59.185830649810384],[-136.58356583565836,59.16325935659256],[-136.61236612366122,59.164995609917014],[-136.72036720367203,59.164995609917014],[-136.81036810368101,59.164995609917014],[-136.88956889568897,59.132006796752535],[-136.94356943569434,59.10943550353471],[-136.96876968769686,59.09901798358803],[-137.03357033570336,59.07818294369466],[-137.25,59.006313797119844],[-137.25,58.45176071716887]]],[[[-136.55476554765548,58.017332162457365],[-136.54756547565475,57.96003580275058],[-136.53316533165332,57.91836572296384],[-136.4431644316443,57.845443083337074],[-136.4251642516425,57.85412434995931],[-136.41436414364142,57.86454186990599],[-136.3819638196382,57.914893216314965],[-136.38556385563857,57.956563296101706],[-136.37476374763747,57.98434334929286],[-136.35316353163532,58.00170588253732],[-136.33156331563316,58.00691464251068],[-136.33876338763386,58.01906841578179],[-136.39276392763927,58.04684846897297],[-136.4539645396454,58.08851854875968],[-136.4719647196472,58.09372730873304],[-136.48996489964898,58.091991055408585],[-136.54036540365402,58.064211002217434],[-136.55476554765548,58.017332162457365]]],[[[-136.43236432364324,58.1110898419775],[-136.41796417964179,58.09025480208413],[-136.39636396363963,58.06941976219076],[-136.37476374763747,58.05379348227075],[-136.20556205562053,57.9496182828039],[-136.10116101161012,57.88884941644824],[-136.06156061560614,57.868014376554896],[-136.03276032760328,57.847179336661526],[-136.0543605436054,57.845443083337074],[-136.21636216362162,57.93051949623498],[-136.3063630636306,57.98607960261731],[-136.33876338763386,57.989552109266185],[-136.36036360363602,57.96698081604839],[-136.35676356763565,57.93746450953279],[-136.40356403564036,57.82287179011925],[-136.37476374763747,57.83676181671484],[-136.35316353163532,57.833289310065936],[-136.2019620196202,57.74647664384358],[-136.12636126361264,57.69959780408348],[-136.0759607596076,57.647510204350084],[-135.9931599315993,57.63188392443004],[-135.949959499595,57.61104888453667],[-135.9931599315993,57.60063136458999],[-136.06156061560614,57.60063136458999],[-136.02916029160292,57.56764255142551],[-135.95355953559533,57.531181231612095],[-135.8959589595896,57.510346191718725],[-135.83835838358382,57.484302391852026],[-135.7951579515795,57.45999484530978],[-135.78075780757808,57.43395104544305],[-135.80595805958058,57.43742355209196],[-135.86355863558634,57.46867611193201],[-135.8851588515885,57.48082988520312],[-135.90675906759066,57.49645616512316],[-135.9679596795968,57.517291205016534],[-136.00036000360004,57.517291205016534],[-135.95355953559533,57.46867611193201],[-135.83475834758346,57.38707220568298],[-135.73035730357304,57.36623716578961],[-135.6871568715687,57.36276465914071],[-135.60075600756005,57.414852258874134],[-135.54675546755468,57.46520360528311],[-135.55395553955537,57.534653738261],[-135.5719557195572,57.58500508466997],[-135.6871568715687,57.64230144437673],[-135.8023580235802,57.76036667043914],[-135.75195751957517,57.75342165714136],[-135.73035730357304,57.74821289716803],[-135.6979569795698,57.736059123896894],[-135.66555665556655,57.723905350625756],[-135.6439564395644,57.71348783067907],[-135.62235622356224,57.70480656405684],[-135.56475564755647,57.67181775089233],[-135.45675456754566,57.63014767110559],[-135.27315273152732,57.558961284803274],[-135.11835118351183,57.498192418447616],[-135.08595085950859,57.477357378554245],[-135.06075060750607,57.45999484530978],[-134.98874988749887,57.45131357868752],[-134.85554855548554,57.45825859198533],[-134.84474844748445,57.59715885794111],[-134.9131491314913,57.749949150492455],[-134.9311493114931,57.758630417114716],[-134.95634956349562,57.76036667043914],[-135.0463504635046,57.75168540381691],[-135.10035100351,57.743004137194674],[-135.16875168751687,57.72737785727466],[-135.23355233552334,57.72043284397685],[-135.2983529835298,57.73085036392354],[-135.31635316353163,57.756894163790264],[-135.35955359553594,57.79682799025255],[-135.3811538115381,57.80724551019924],[-135.55755557555574,57.86975062987932],[-135.64755647556476,57.901003189719376],[-135.72675726757268,57.91662946963942],[-135.7951579515795,57.93051949623498],[-135.88155881558816,57.99302461591509],[-135.84555845558455,57.989552109266185],[-135.82035820358203,57.98087084264395],[-135.71955719557195,57.94440952283057],[-135.55755557555574,57.90273944304383],[-135.3379533795338,57.8246080434437],[-135.2659526595266,57.791619230279196],[-135.22995229952298,57.77946545700806],[-135.19755197551973,57.77599295035918],[-135.1219512195122,57.77425669703473],[-135.08955089550895,57.78120171033251],[-135.0463504635046,57.77946545700806],[-135.00675006750066,57.77946545700806],[-134.96354963549635,57.80898176352366],[-135.02115021150212,57.852388096634854],[-135.04995049950497,57.868014376554896],[-135.08235082350822,57.87495938985268],[-135.1219512195122,57.88190440315046],[-135.14355143551435,57.894058176421595],[-135.19755197551973,57.93746450953279],[-135.16875168751687,57.935728256208336],[-135.01755017550175,57.88884941644824],[-134.97074970749708,57.88537690979936],[-134.90954909549095,57.920101976288294],[-134.90594905949058,57.982607095968405],[-134.92034920349204,58.017332162457365],[-134.93474934749347,58.031222189052926],[-135.10035100351,58.09372730873304],[-135.40635406354062,58.13713364184423],[-135.4531545315453,58.119771108599735],[-135.4891548915489,58.06768350886631],[-135.5431554315543,58.01212340248401],[-135.55755557555574,57.99996962921287],[-135.61875618756187,57.961772056075034],[-135.64755647556476,57.961772056075034],[-135.70875708757086,57.9791345893195],[-135.78075780757808,58.04337596232406],[-135.70155701557013,58.0555297355952],[-135.65835658356582,58.045112215648516],[-135.61155611556114,58.04163970899961],[-135.51435514355143,58.10414482867972],[-135.48195481954818,58.15796868173757],[-135.5071550715507,58.175331214982066],[-135.58635586355862,58.196166254875436],[-135.7411574115741,58.256935121231066],[-135.78075780757808,58.27429765447556],[-135.8131581315813,58.27429765447556],[-135.92475924759248,58.229155068039915],[-135.96075960759606,58.201375014848765],[-136.13356133561336,58.22047380141768],[-136.18036180361804,58.175331214982066],[-136.16596165961658,58.09719981538194],[-136.22716227162272,58.14928741511534],[-136.27036270362703,58.21700129476878],[-136.34956349563495,58.22047380141768],[-136.43236432364324,58.1110898419775]]],[[[-135.84555845558455,57.319358326029544],[-135.82035820358203,57.175249300100404],[-135.80595805958058,57.16830428680262],[-135.74835748357484,57.16483178015372],[-135.71235712357122,57.16309552682927],[-135.7159571595716,57.14052423361147],[-135.75195751957517,57.11100792709587],[-135.76275762757626,57.10579916712251],[-135.78435784357842,57.100590407149184],[-135.81675816758167,57.08843663387805],[-135.8239582395824,57.079755367255814],[-135.83835838358382,56.991206447709004],[-135.82755827558276,56.98599768773565],[-135.7951579515795,56.98599768773565],[-135.71955719557195,56.99294270103343],[-135.6259562595626,57.00683272762902],[-135.56835568355683,57.081491620580266],[-135.54675546755468,57.13184296698921],[-135.55395553955537,57.22733689983383],[-135.57555575555756,57.24990819305165],[-135.589955899559,57.263798219647214],[-135.61155611556114,57.279424499567256],[-135.6259562595626,57.28810576618949],[-135.6439564395644,57.29505077948727],[-135.70155701557013,57.31762207270509],[-135.70875708757086,57.32283083267842],[-135.7591575915759,57.33151209930065],[-135.83475834758346,57.326303339327325],[-135.84555845558455,57.319358326029544]]],[[[-135.6691566915669,57.34540212589624],[-135.63675636756366,57.31414956605619],[-135.550355503555,57.25685320634943],[-135.50355503555033,57.24296317975384],[-135.45675456754566,57.2481719397272],[-135.3379533795338,57.244699433078296],[-135.3631536315363,57.19261183334487],[-135.40635406354062,57.16483178015372],[-135.37755377553776,57.09885415382473],[-135.35595355953558,57.07107410063358],[-135.35595355953558,56.958217634544496],[-135.36675366753667,56.83147114185985],[-135.2983529835298,56.786328555424205],[-135.26235262352623,56.78459230209975],[-135.22275222752228,56.80195483534425],[-135.2011520115201,56.80889984864203],[-135.15435154351542,56.82452612856204],[-135.12555125551256,56.827998635210946],[-135.15435154351542,56.74118596898859],[-135.1759517595176,56.718614675770766],[-135.2011520115201,56.68562586260626],[-135.10755107551074,56.595340689734996],[-135.08955089550895,56.59360443641057],[-135.05355053550534,56.607494463006134],[-134.8771487714877,56.68562586260626],[-134.8483484834848,56.683889609281806],[-134.93834938349383,56.60054944970835],[-134.99954999549993,56.58492316978831],[-135.02835028350282,56.574505649841626],[-135.0463504635046,56.53109931673046],[-134.99594995949957,56.4668579437259],[-134.88434884348843,56.34532021101461],[-134.7619476194762,56.22204622497884],[-134.65394653946538,56.16648611859651],[-134.62154621546216,56.24982627816999],[-134.62154621546216,56.38525403747687],[-134.62154621546216,56.472066703699255],[-134.6251462514625,56.53804433002824],[-134.61074610746107,56.57624190316608],[-134.6071460714607,56.602285703032805],[-134.61074610746107,56.68215335595738],[-134.6179461794618,56.72903219571745],[-134.6431464314643,56.79674607537089],[-134.68274682746826,56.89744876818884],[-134.72594725947258,56.98947019438455],[-134.78354783547834,57.1196891937181],[-134.79794797947977,57.16656803347817],[-134.83754837548375,57.24990819305165],[-134.94554945549453,57.36450091246516],[-134.97434974349744,57.38533595235853],[-135.15795157951578,57.47562112522979],[-135.3523535235352,57.54854376485659],[-135.3919539195392,57.55375252482992],[-135.4171541715417,57.552016271505465],[-135.43875438754387,57.545071258207685],[-135.51435514355143,57.505137431745396],[-135.54675546755468,57.41311600554968],[-135.47835478354784,57.36450091246516],[-135.5179551795518,57.3506108858696],[-135.61875618756187,57.36450091246516],[-135.6439564395644,57.36450091246516],[-135.6691566915669,57.34540212589624]]],[[[-134.97434974349744,57.409643498900806],[-134.86274862748627,57.32977584597623],[-134.82314823148232,57.3037320461095],[-134.80874808748086,57.29678703281172],[-134.7943479434794,57.300259539460626],[-134.7871478714787,57.34366587257179],[-134.80874808748086,57.361028405816256],[-134.82314823148232,57.39054471233189],[-134.81954819548196,57.400962232278545],[-134.81234812348123,57.414852258874134],[-134.8771487714877,57.42700603214527],[-134.8879488794888,57.428742285469724],[-134.9419494194942,57.421797272171915],[-134.97434974349744,57.409643498900806]]],[[[-134.97074970749708,58.366319080671246],[-134.95274952749526,58.29860520101781],[-134.9131491314913,58.20484752149767],[-134.7871478714787,58.105881082004174],[-134.70074700747006,57.826344296768156],[-134.6971469714697,57.77946545700806],[-134.71154711547115,57.74126788387022],[-134.70434704347042,57.716960337327976],[-134.65754657546574,57.60236761791444],[-134.63234632346322,57.579796324696616],[-134.61074610746107,57.56243379145215],[-134.5891458914589,57.538126244909904],[-134.57474574745746,57.505137431745396],[-134.5531455314553,57.5086099383943],[-134.50274502745026,57.52076371166541],[-134.46674466744668,57.53291748493655],[-134.3839438394384,57.54854376485659],[-134.35154351543514,57.54159875155878],[-134.509945099451,57.48777489850093],[-134.54954549545494,57.48777489850093],[-134.57114571145712,57.48777489850093],[-134.55674556745566,57.47214861858089],[-134.52794527945278,57.442632312065285],[-134.45954459544595,57.39054471233189],[-134.3839438394384,57.3801271923852],[-134.3443434434344,57.38707220568298],[-134.31554315543156,57.33151209930065],[-134.3443434434344,57.32803959265178],[-134.49554495544953,57.37144592576294],[-134.61434614346143,57.22560064650938],[-134.62154621546216,57.11100792709587],[-134.59274592745925,57.03634903414462],[-134.57474574745746,57.02766776752239],[-134.47754477544774,57.02940402084684],[-134.16434164341644,57.189139326695994],[-134.07794077940778,57.26900697962057],[-134.09954099540994,57.29678703281172],[-134.17154171541713,57.3801271923852],[-134.06354063540635,57.354083392518476],[-134.04194041940417,57.32977584597623],[-133.97353973539734,57.300259539460626],[-133.94473944739445,57.3037320461095],[-133.8619386193862,57.36623716578961],[-133.89073890738905,57.42353352549637],[-133.98793987939877,57.45304983201197],[-134.05634056340563,57.46520360528311],[-134.0491404914049,57.49124740514981],[-134.00234002340022,57.48777489850093],[-133.86553865538656,57.45825859198533],[-133.87273872738726,57.48951115182538],[-133.8943389433894,57.505137431745396],[-133.9231392313923,57.53291748493655],[-133.93033930339303,57.56243379145215],[-134.0059400594006,57.647510204350084],[-134.18234182341823,57.81419052349702],[-134.2471424714247,57.85759685660821],[-134.27234272342722,57.873223136528225],[-134.31914319143192,58.031222189052926],[-134.290342903429,58.07636477548857],[-134.23994239942397,58.065947255541886],[-134.1751417514175,58.01385965580846],[-134.15354153541534,57.99128836259064],[-134.1391413914139,57.954827042777254],[-134.11034110341103,57.87669564317713],[-134.0923409234092,57.84891558998595],[-134.06714067140672,57.82981680341703],[-133.9951399513995,57.76904793706137],[-133.98073980739807,57.73432287057244],[-133.9591395913959,57.68397152416347],[-133.8943389433894,57.654455217647865],[-133.87633876338762,57.67355400421678],[-133.8943389433894,57.756894163790264],[-133.91233912339123,57.812454270172566],[-134.00234002340022,57.935728256208336],[-134.07794077940778,58.0086508958351],[-134.13554135541355,58.052057228946296],[-134.16074160741607,58.12497986857309],[-134.17154171541713,58.159704935062024],[-134.20034200342002,58.16317744171093],[-134.29754297542974,58.15275992176424],[-134.33354333543335,58.14407865514201],[-134.3551435514355,58.14581490846646],[-134.39834398343982,58.15796868173757],[-134.45234452344522,58.17706746830652],[-134.55674556745566,58.18574873492875],[-134.59994599945998,58.17185870833316],[-134.6359463594636,58.161441188386476],[-134.66834668346684,58.159704935062024],[-134.69354693546933,58.16838620168426],[-134.70434704347042,58.215265041444354],[-134.79794797947977,58.30902272096449],[-134.9491494914949,58.406252907133535],[-134.97074970749708,58.366319080671246]]],[[[-134.68274682746826,58.30034145434226],[-134.65394653946538,58.270825147826656],[-134.63954639546395,58.256935121231066],[-134.62874628746286,58.24825385460883],[-134.6071460714607,58.23783633466215],[-134.58194581945818,58.22568256139104],[-134.55674556745566,58.22047380141768],[-134.509945099451,58.21700129476878],[-134.49554495544953,58.22047380141768],[-134.47754477544774,58.22394630806659],[-134.45234452344522,58.22394630806659],[-134.4379443794438,58.222210054742135],[-134.4271442714427,58.22047380141768],[-134.3659436594366,58.20658377482212],[-134.27594275942758,58.19095749490208],[-134.26154261542615,58.19790250819986],[-134.27594275942758,58.21179253479545],[-134.45594455944558,58.3124952276134],[-134.47394473944738,58.324649000884534],[-134.50634506345062,58.33680277415564],[-134.51714517145172,58.338539027480095],[-134.55674556745566,58.34027528080455],[-134.56754567545676,58.34027528080455],[-134.58554585545855,58.338539027480095],[-134.65394653946538,58.3159677342623],[-134.6719467194672,58.3124952276134],[-134.68274682746826,58.30034145434226]]],[[[-134.4091440914409,56.8297348885354],[-134.39474394743945,56.72208718241967],[-134.3911439114391,56.711669662472985],[-134.30474304743046,56.55887936992161],[-134.1751417514175,56.53630807670379],[-134.08874088740885,56.53804433002824],[-134.07074070740705,56.55540686327271],[-134.06354063540635,56.54846184997493],[-134.05274052740526,56.50331926353931],[-134.0311403114031,56.41824285064138],[-134.03474034740347,56.37657277085464],[-134.0491404914049,56.362682744259075],[-134.05634056340563,56.37310026420576],[-134.06354063540635,56.383517784152446],[-134.0851408514085,56.39740781074801],[-134.1751417514175,56.43560538388584],[-134.23274232742327,56.41997910396583],[-134.2831428314283,56.348792717663486],[-134.25074250742506,56.31580390449898],[-134.22554225542254,56.307122637876745],[-134.20394203942038,56.29844137125451],[-134.22194221942217,56.27760633136114],[-134.2579425794258,56.26371630476558],[-134.26514265142652,56.253298784818895],[-134.22194221942217,56.067519679103015],[-134.16074160741607,56.0223770926674],[-134.12474124741246,55.99806954612512],[-134.11034110341103,55.9963332928007],[-134.1031410314103,56.01195957272071],[-134.08874088740885,56.08314595902306],[-134.09594095940957,56.13176105210758],[-134.06714067140672,56.30191387790342],[-134.05634056340563,56.3123313978501],[-134.0383403834038,56.30538638455232],[-134.02754027540274,56.274133824712266],[-134.01314013140131,56.190793665138784],[-134.0383403834038,56.11439851886311],[-134.03474034740347,56.10398099891643],[-134.01674016740168,56.095299732294194],[-133.9771397713977,56.08314595902306],[-133.9591395913959,56.08314595902306],[-133.94473944739445,56.088354718996385],[-133.9159391593916,56.149123585352044],[-133.8871388713887,56.22030997165439],[-133.89073890738905,56.23419999824998],[-133.89793897938978,56.253298784818895],[-133.90153901539014,56.26545255809003],[-133.91233912339123,56.274133824712266],[-133.9231392313923,56.279342584685594],[-133.94473944739445,56.281078838010046],[-133.95553955539555,56.27587007803669],[-133.97353973539734,56.26545255809003],[-133.98433984339843,56.26892506473891],[-133.9771397713977,56.28802385130783],[-133.96993969939697,56.30365013122787],[-133.96633966339664,56.31754015782343],[-133.97353973539734,56.34358395769016],[-133.96993969939697,56.35921023761017],[-133.94833948339482,56.35052897098794],[-133.9159391593916,56.31927641114788],[-133.8943389433894,56.300177624578964],[-133.8619386193862,56.27760633136114],[-133.8511385113851,56.281078838010046],[-133.84753847538474,56.29149635795673],[-133.840338403384,56.34532021101461],[-133.8511385113851,56.35226522431239],[-133.88353883538835,56.437341637210295],[-133.87633876338762,56.52415430343268],[-133.9159391593916,56.602285703032805],[-133.91953919539193,56.61096696965504],[-133.91233912339123,56.61617572962837],[-133.89073890738905,56.614439476303914],[-133.8331383313833,56.609230716330586],[-133.81873818738185,56.607494463006134],[-133.79353793537933,56.59360443641057],[-133.7863378633786,56.57971440981498],[-133.78273782737827,56.56582438321939],[-133.77193771937718,56.55714311659716],[-133.76473764737648,56.55540686327271],[-133.75033750337502,56.55540686327271],[-133.73953739537393,56.560615623246065],[-133.69273692736925,56.59707694305945],[-133.7251372513725,56.65263704944178],[-133.71793717937177,56.76896602217974],[-133.73233732337323,56.77591103547752],[-133.82953829538295,56.79674607537089],[-133.86553865538656,56.78980106207311],[-133.85473854738547,56.77417478215307],[-133.85473854738547,56.76028475555751],[-133.85473854738547,56.74986723561082],[-133.85473854738547,56.737713462339684],[-133.8619386193862,56.723823435744094],[-133.87273872738726,56.70993340914853],[-133.9159391593916,56.66652707603734],[-133.94473944739445,56.64569203614397],[-133.9591395913959,56.64048327617064],[-133.97353973539734,56.635274516197285],[-134.0059400594006,56.642219529495094],[-134.02394023940238,56.649164542792874],[-134.01314013140131,56.65090079611733],[-133.98073980739807,56.65090079611733],[-133.96633966339664,56.65784580941511],[-133.9231392313923,56.71514216912186],[-133.9051390513905,56.74986723561082],[-133.92673926739266,56.80195483534425],[-133.99153991539913,56.87314122164656],[-134.00954009540095,56.88008623494437],[-134.03474034740347,56.888767501566605],[-134.12834128341282,56.91307504810885],[-134.1931419314193,56.930437581353345],[-134.2471424714247,56.93911884797558],[-134.26154261542615,56.93911884797558],[-134.21474214742148,56.90092127483774],[-134.19674196741965,56.895712514864385],[-134.17154171541713,56.89397626153993],[-134.14634146341461,56.888767501566605],[-134.13554135541355,56.88355874159325],[-134.10674106741067,56.84536116845541],[-134.1211412114121,56.841888661806536],[-134.1571415714157,56.848833675104316],[-134.17874178741786,56.859251195051],[-134.22194221942217,56.88355874159325],[-134.24354243542433,56.89397626153993],[-134.26514265142652,56.89918502151329],[-134.27594275942758,56.89918502151329],[-134.29754297542974,56.90092127483774],[-134.31914319143192,56.895712514864385],[-134.39834398343982,56.854042435077645],[-134.40554405544054,56.847097421779864],[-134.4091440914409,56.8297348885354]]],[[[-134.34074340743405,55.91299313322722],[-134.31554315543156,55.85222426687156],[-134.29394293942937,55.83138922697819],[-134.25074250742506,55.81749920038263],[-134.23634236342363,55.836597986951546],[-134.22194221942217,55.85048801354711],[-134.20754207542075,55.85916928016934],[-134.1751417514175,55.87479556008938],[-134.13554135541355,55.8938943466583],[-134.1211412114121,55.89910310663163],[-134.1139411394114,55.89910310663163],[-134.09954099540994,55.91472938655167],[-134.11754117541176,55.92167439984945],[-134.32274322743226,55.9234106531739],[-134.34074340743405,55.91299313322722]]],[[[-134.01674016740168,57.01551399425125],[-133.8871388713887,56.951272621246716],[-133.73953739537393,56.895712514864385],[-133.75033750337502,56.874877474971015],[-133.8079380793808,56.87661372829547],[-133.8331383313833,56.881822488268824],[-133.88353883538835,56.89744876818884],[-133.8691386913869,56.86966871499769],[-133.73953739537393,56.807163595317576],[-133.69993699936998,56.8297348885354],[-133.6819368193682,56.79500982204644],[-133.69273692736925,56.74986723561082],[-133.7071370713707,56.683889609281806],[-133.69273692736925,56.65090079611733],[-133.66753667536673,56.63874702284619],[-133.63513635136349,56.59707694305945],[-133.6639366393664,56.52241805010823],[-133.65673656736567,56.46338543707702],[-133.63873638736385,56.43907789053475],[-133.57393573935738,56.43386913056142],[-133.50553505535055,56.43560538388584],[-133.46593465934657,56.45296791713034],[-133.42633426334262,56.47380295702371],[-133.3039330393304,56.472066703699255],[-133.18873188731885,56.451231663805885],[-133.15633156331563,56.45644042377921],[-133.13113131131308,56.4703304503748],[-133.0843308433084,56.532835570054914],[-133.08793087930877,56.553670609948284],[-133.0951309513095,56.614439476303914],[-133.1131311313113,56.62138448960172],[-133.1851318513185,56.63701076952174],[-133.3039330393304,56.7307684490419],[-133.33273332733324,56.76202100888196],[-133.3471334713347,56.83841615515763],[-133.24273242732426,56.80542734199312],[-133.21753217532174,56.78111979545088],[-133.2031320313203,56.751603488935274],[-133.18873188731885,56.716878422446314],[-133.12753127531275,56.66652707603734],[-133.00873008730088,56.60054944970835],[-132.9691296912969,56.609230716330586],[-132.9331293312933,56.630065756223956],[-132.9259292592926,56.65958206273956],[-132.94392943929438,56.74292222231304],[-132.9259292592926,56.85230618175322],[-132.97272972729726,56.92522882137999],[-133.0519305193052,56.977316421113414],[-133.08073080730804,56.99294270103343],[-133.1671316713167,57.00162396765569],[-133.29673296732966,56.998151461006785],[-133.31833318333182,56.99467895435788],[-133.4371343713437,57.0137777409268],[-133.49833498334982,57.02766776752239],[-133.62793627936279,57.05023906074021],[-133.7611376113761,57.06933784730913],[-133.84393843938437,57.081491620580266],[-133.90873908739087,57.079755367255814],[-134.00954009540095,57.05371156738909],[-134.01674016740168,57.01551399425125]]],[[[-133.79353793537933,55.932091919796136],[-133.7863378633786,55.918201893200546],[-133.69993699936998,55.89563059998275],[-133.63873638736385,55.93382817312059],[-133.609936099361,55.958135719662835],[-133.45873458734587,56.00327830609848],[-133.36153361533616,56.01022331939626],[-133.31473314733145,56.081409705698604],[-133.28593285932857,56.12828854545867],[-133.27873278732787,56.13870606540536],[-133.3039330393304,56.149123585352044],[-133.31473314733145,56.149123585352044],[-133.390333903339,56.1543323453254],[-133.4011340113401,56.1543323453254],[-133.57033570335702,56.12655229213422],[-133.609936099361,56.10571725224088],[-133.6819368193682,56.06404717245414],[-133.77553775537754,55.97549825290733],[-133.7863378633786,55.96334447963619],[-133.79353793537933,55.94771819971615],[-133.79353793537933,55.932091919796136]]],[[[-133.75753757537575,55.487611068737635],[-133.74673746737466,55.46503977551981],[-133.72873728737287,55.46851228216872],[-133.71433714337144,55.46503977551981],[-133.66753667536673,55.45114974892422],[-133.64593645936458,55.44073222897754],[-133.63513635136349,55.44420473562644],[-133.57753577535775,55.5015010953332],[-133.57753577535775,55.527544895199924],[-133.58473584735844,55.53622616182216],[-133.69273692736925,55.55011618841772],[-133.70353703537035,55.55185244174217],[-133.71793717937177,55.548379935093294],[-133.7251372513725,55.541434921795485],[-133.75753757537575,55.487611068737635]]],[[[-133.68553685536853,55.308776976319564],[-133.6531365313653,55.26710689653282],[-133.64593645936458,55.25842562991059],[-133.60633606336063,55.23238183004386],[-133.59553595535954,55.23585433669277],[-133.55953559535595,55.31398573629289],[-133.50193501935019,55.34871080278185],[-133.44433444334442,55.371282095999646],[-133.44793447934478,55.40079840251525],[-133.44793447934478,55.40947966913751],[-133.56313563135632,55.41989718908417],[-133.57393573935738,55.42163344240862],[-133.5883358833588,55.41642468243529],[-133.63873638736385,55.383435869270784],[-133.64953649536494,55.371282095999646],[-133.68553685536853,55.308776976319564]]],[[[-133.67833678336783,55.77582912059589],[-133.64593645936458,55.74457656075583],[-133.63513635136349,55.7358952941336],[-133.6171361713617,55.72547777418691],[-133.60273602736027,55.718532760889104],[-133.59193591935917,55.711587747591324],[-133.57033570335702,55.70290648096909],[-133.5343353433534,55.692488961022406],[-133.52353523535234,55.69075270769795],[-133.50553505535055,55.692488961022406],[-133.48393483934836,55.699433974320186],[-133.31833318333182,55.7654116006492],[-133.30033300333002,55.7914554005159],[-133.3039330393304,55.79666416048926],[-133.32553325533254,55.801872920462586],[-133.54153541535413,55.827916720329284],[-133.55233552335523,55.82965297365374],[-133.6171361713617,55.827916720329284],[-133.63513635136349,55.820971707031504],[-133.67473674736746,55.78624664054257],[-133.67833678336783,55.77582912059589]]],[[[-133.63153631536315,56.274133824712266],[-133.609936099361,56.204683691734374],[-133.56313563135632,56.17863989186765],[-133.4191341913419,56.164749865272086],[-133.3651336513365,56.171694878569866],[-133.32193321933218,56.169958625245414],[-133.2643326433264,56.1543323453254],[-133.2571325713257,55.94771819971615],[-133.2391323913239,55.90257561328053],[-133.22833228332283,55.88694933336052],[-133.1779317793178,55.86090553349379],[-133.14553145531454,55.88000432006271],[-133.14193141931418,55.815762947058175],[-133.24273242732426,55.74457656075583],[-133.2643326433264,55.74110405410693],[-133.37233372333722,55.72200526753801],[-133.38313383133828,55.64040136128898],[-133.3651336513365,55.61609381474673],[-133.26073260732608,55.57442373495999],[-133.19953199531994,55.5778962416089],[-133.12033120331202,55.603940041475596],[-133.05913059130592,55.623038828044514],[-132.96552965529654,55.63866510796453],[-132.92232922329222,55.624775081368966],[-132.96192961929617,55.623038828044514],[-132.98352983529833,55.61956632139561],[-133.0051300513005,55.609148801448924],[-133.0519305193052,55.5778962416089],[-133.11673116731166,55.515391121928786],[-133.12753127531275,55.49108357538651],[-133.1131311313113,55.46503977551981],[-133.030330303303,55.39732589586637],[-133.00153001530015,55.37996336262188],[-132.9871298712987,55.3730183493241],[-132.96552965529654,55.3730183493241],[-132.94392943929438,55.36954584267522],[-132.88992889928898,55.35912832272854],[-132.86832868328682,55.35391956275518],[-132.90072900729007,55.34523829613295],[-132.9691296912969,55.350447056106276],[-133.0411304113041,55.36260082937741],[-133.11673116731166,55.378227109297455],[-133.21033210332104,55.38169961594633],[-133.26073260732608,55.336557029510715],[-133.21393213932137,55.27752441647951],[-133.02673026730267,55.26710689653282],[-132.9691296912969,55.2705794031817],[-132.91152911529113,55.275788163155056],[-132.9871298712987,55.22890932339499],[-133.02673026730267,55.2150192967994],[-133.00153001530015,55.20286552352826],[-132.94392943929438,55.20807428350162],[-132.80712807128072,55.248008109963905],[-132.80352803528035,55.20981053682607],[-132.7783277832778,55.18203048363489],[-132.69552695526954,55.1420966571726],[-132.6559265592656,55.138624150523725],[-132.62352623526235,55.14730541714596],[-132.6091260912609,55.16987671036378],[-132.63072630726305,55.1889754969327],[-132.64872648726487,55.206338030177164],[-132.65232652326523,55.244535603315],[-132.51192511925117,55.10563533735922],[-132.51552515525154,55.05181148430134],[-132.5479254792548,55.04486647100356],[-132.5731257312573,55.03444895105687],[-132.59472594725946,54.968471324727886],[-132.5731257312573,54.94937253815897],[-132.54432544325442,54.933746258238926],[-132.51552515525154,54.93895501821228],[-132.5011250112501,54.952845044807844],[-132.49032490324902,54.97715259135012],[-132.3283232832328,54.88165865850553],[-132.2851228512285,54.85387860531435],[-132.22032220322203,54.810472272203185],[-132.2131221312213,54.79137348563427],[-132.22032220322203,54.78442847233646],[-132.2563225632256,54.78442847233646],[-132.28872288722886,54.768802192416445],[-132.29592295922959,54.74449464587417],[-132.2851228512285,54.713242086034114],[-132.12672126721264,54.68893453949187],[-132.00792007920077,54.69067079281632],[-131.95031950319503,54.78790097898536],[-131.97191971919716,55.029240191083545],[-132.02952029520293,55.022295177785736],[-132.0583205832058,54.99798763124349],[-132.0871208712087,54.97715259135012],[-132.13752137521374,54.96499881807898],[-132.2131221312213,54.994515124594585],[-132.17352173521732,55.00493264454127],[-132.14472144721447,55.0136139111635],[-132.0763207632076,55.041393964354654],[-132.08352083520833,55.06743776422138],[-132.04392043920438,55.07959153749252],[-131.9971199711997,55.10563533735922],[-131.96831968319682,55.17855797698601],[-131.96831968319682,55.220228056772754],[-131.98631986319862,55.26016188323504],[-132.0151201512015,55.268843149857275],[-132.0583205832058,55.23585433669277],[-132.0691206912069,55.213283043474945],[-132.10152101521015,55.19765676355493],[-132.23472234722345,55.192448003581575],[-132.2491224912249,55.21154679015049],[-132.23472234722345,55.24974436328836],[-132.20232202322023,55.248008109963905],[-132.16992169921699,55.24279934999055],[-132.13392133921337,55.23932684334167],[-132.0871208712087,55.26710689653282],[-132.28152281522813,55.45809476222203],[-132.5011250112501,55.51191861527988],[-132.5623256232562,55.56747872166221],[-132.54432544325442,55.62130257472006],[-132.51192511925117,55.61435756142228],[-132.47592475924756,55.59178626820446],[-132.45432454324543,55.55879745503998],[-132.43272432724325,55.54490742844439],[-132.40752407524073,55.53622616182216],[-132.37872378723785,55.5310174018488],[-132.21672216722166,55.4754572954665],[-132.1591215912159,55.44420473562644],[-132.14472144721447,55.452886002248675],[-132.1411214112141,55.4754572954665],[-132.16632166321662,55.5015010953332],[-132.18072180721805,55.51191861527988],[-132.20592205922057,55.527544895199924],[-132.22752227522273,55.53796241514661],[-132.24552245522455,55.541434921795485],[-132.4039240392404,55.657763894533474],[-132.44352443524434,55.68728020104908],[-132.4651246512465,55.77582912059589],[-132.49752497524975,55.820971707031504],[-132.51192511925117,55.83486173362709],[-132.62352623526235,55.919938146525],[-132.82152821528214,56.02932210596518],[-132.90072900729007,56.0484208925341],[-132.94752947529474,56.05883841248078],[-133.04473044730446,56.0484208925341],[-133.07353073530734,56.051893399183],[-133.12393123931238,56.11787102551199],[-133.08793087930877,56.10571725224088],[-133.06273062730625,56.11787102551199],[-133.0231302313023,56.171694878569866],[-133.05553055530555,56.23767250489885],[-133.18153181531812,56.327957677770115],[-133.24993249932498,56.33143018441902],[-133.3471334713347,56.32969393109457],[-133.48753487534873,56.33663894439235],[-133.58473584735844,56.35052897098794],[-133.609936099361,56.348792717663486],[-133.63153631536315,56.274133824712266]]],[[[-133.5991359913599,55.44941349559977],[-133.57753577535775,55.438995975653114],[-133.53793537935377,55.43031470903085],[-133.5163351633516,55.42684220238198],[-133.50553505535055,55.42684220238198],[-133.45873458734587,55.432050962355305],[-133.44433444334442,55.43552346900421],[-133.429934299343,55.438995975653114],[-133.42273422734226,55.44767724227535],[-133.41553415534153,55.46330352219536],[-133.4191341913419,55.47719354879095],[-133.42273422734226,55.48587481541318],[-133.47673476734766,55.515391121928786],[-133.49833498334982,55.520599881902115],[-133.51273512735128,55.51886362857769],[-133.5991359913599,55.44941349559977]]],[[[-133.45153451534514,55.25148061661278],[-133.44793447934478,55.234118083368315],[-133.44073440734405,55.22196431009718],[-133.4371343713437,55.21154679015049],[-133.42633426334262,55.20286552352826],[-133.41553415534153,55.199393016879384],[-133.32193321933218,55.19418425690603],[-133.24993249932498,55.20981053682607],[-133.24273242732426,55.2150192967994],[-133.22473224732246,55.24974436328836],[-133.23193231932316,55.26537064320837],[-133.29673296732966,55.33134826953736],[-133.31113311133112,55.33482077618626],[-133.32553325533254,55.33482077618626],[-133.429934299343,55.31051322964399],[-133.4371343713437,55.30530446967066],[-133.45153451534514,55.25148061661278]]],[[[-133.43353433534332,55.52407238855102],[-133.3471334713347,55.44767724227535],[-133.28953289532893,55.4754572954665],[-133.27153271532714,55.487611068737635],[-133.26793267932678,55.49629233535987],[-133.27153271532714,55.527544895199924],[-133.27873278732787,55.53622616182216],[-133.3039330393304,55.55358869506662],[-133.33993339933397,55.55706120171553],[-133.37593375933758,55.55706120171553],[-133.39393393933938,55.55358869506662],[-133.4191341913419,55.54490742844439],[-133.43353433534332,55.52407238855102]]],[[[-133.33273332733324,55.87305930676493],[-133.31113311133112,55.820971707031504],[-133.26073260732608,55.77756537392034],[-133.24633246332462,55.77582912059589],[-133.23193231932316,55.78971914719145],[-133.21393213932137,55.82618046700486],[-133.21033210332104,55.84007049360042],[-133.21033210332104,55.85396052019601],[-133.21393213932137,55.862641786818244],[-133.26793267932678,55.89910310663163],[-133.28593285932857,55.90083935995608],[-133.33273332733324,55.87305930676493]]],[[[-133.21393213932137,55.09174531076363],[-133.19593195931958,55.04660272432801],[-133.12393123931238,54.93895501821228],[-133.0051300513005,54.84519733869212],[-132.98352983529833,54.8295710587721],[-132.97272972729726,54.8260985521232],[-132.93672936729365,54.80526351222983],[-132.86472864728646,54.72539585930525],[-132.83952839528393,54.69067079281632],[-132.6811268112681,54.666363246274045],[-132.66672666726666,54.67851701954518],[-132.68472684726845,54.71845084600747],[-132.72432724327243,54.78442847233646],[-132.75672756727568,54.822626045474294],[-132.83952839528393,54.89033992512776],[-132.8539285392854,54.892076178452186],[-132.87192871928718,54.89728493842554],[-132.8971289712897,54.91117496502113],[-132.99792997929978,55.05875649759915],[-133.0051300513005,55.08827280411475],[-132.99072990729906,55.09521781741253],[-132.99072990729906,55.12299787060368],[-133.06993069930698,55.199393016879384],[-133.10233102331023,55.24627185663945],[-133.1131311313113,55.25148061661278],[-133.18873188731885,55.234118083368315],[-133.19593195931958,55.227173070070535],[-133.21393213932137,55.09174531076363]]],[[[-133.05553055530555,56.348792717663486],[-133.04473044730446,56.33143018441902],[-132.91152911529113,56.260243798116676],[-132.8611286112861,56.23767250489885],[-132.84672846728466,56.232463744925525],[-132.83592835928357,56.23072749160107],[-132.81792817928178,56.23419999824998],[-132.760327603276,56.246353771521086],[-132.6991269912699,56.258507544792224],[-132.67752677526772,56.26545255809003],[-132.64872648726487,56.27587007803669],[-132.64152641526414,56.2828150913345],[-132.6343263432634,56.29844137125451],[-132.61272612726125,56.39393530409913],[-132.63072630726305,56.42518786393916],[-132.63792637926377,56.43560538388584],[-132.6559265592656,56.444286650508104],[-132.68472684726845,56.45296791713034],[-132.70272702727027,56.45644042377921],[-132.72072720727206,56.458176677103665],[-132.73152731527313,56.458176677103665],[-132.8863288632886,56.45470417045479],[-132.92232922329222,56.45296791713034],[-132.94032940329402,56.44775915715698],[-132.99072990729906,56.42171535729028],[-133.05553055530555,56.348792717663486]]],[[[-132.95472954729547,56.59360443641057],[-132.94392943929438,56.51547303681042],[-132.92952929529292,56.505055516863735],[-132.90432904329043,56.498110503565954],[-132.89352893528934,56.498110503565954],[-132.79272792727926,56.49463799691708],[-132.77472774727747,56.49463799691708],[-132.68472684726845,56.52068179678378],[-132.57672576725764,56.553670609948284],[-132.5623256232562,56.55887936992161],[-132.5371253712537,56.57103314319275],[-132.52992529925297,56.581450663139435],[-132.52992529925297,56.59186818308612],[-132.5371253712537,56.60054944970835],[-132.55152551525515,56.60575820968168],[-132.61272612726125,56.64569203614397],[-132.66672666726666,56.67868084930848],[-132.73152731527313,56.72555968906855],[-132.80352803528035,56.786328555424205],[-132.87192871928718,56.79674607537089],[-132.91872918729186,56.74813098228637],[-132.92232922329222,56.70298839585075],[-132.8971289712897,56.656109556090655],[-132.88272882728825,56.635274516197285],[-132.8971289712897,56.62138448960172],[-132.92232922329222,56.61964823627727],[-132.95472954729547,56.59360443641057]]],[[[-132.86832868328682,55.03271269773242],[-132.79992799928,55.00666889786572],[-132.73152731527313,55.00319639121682],[-132.67032670326702,55.03792145770578],[-132.69192691926918,55.09174531076363],[-132.73152731527313,55.14036040384818],[-132.81432814328141,55.185502990283794],[-132.8251282512825,55.192448003581575],[-132.8539285392854,55.159459190417095],[-132.86472864728646,55.14036040384818],[-132.86832868328682,55.03271269773242]]],[[[-132.7891278912789,54.90422995172332],[-132.78192781927817,54.86776863190994],[-132.77472774727747,54.857351111963254],[-132.6631266312663,54.75838467246976],[-132.64872648726487,54.75143965917198],[-132.6343263432634,54.74970340584753],[-132.61992619926198,54.754912165820855],[-132.6091260912609,54.7705384457409],[-132.61272612726125,54.878186151856625],[-132.61632616326162,54.89033992512776],[-132.61992619926198,54.89554868510109],[-132.62712627126268,54.90249369839887],[-132.70992709927097,54.940691271536735],[-132.7783277832778,54.926801244941146],[-132.7891278912789,54.90422995172332]]],[[[-132.7171271712717,56.150859838676496],[-132.71352713527133,56.13523355875648],[-132.69552695526954,56.1074535055653],[-132.68832688326881,56.09877223894307],[-132.6343263432634,56.0484208925341],[-132.62352623526235,56.0484208925341],[-132.6091260912609,56.062310919129686],[-132.6091260912609,56.074464692400824],[-132.59832598325983,56.081409705698604],[-132.4471244712447,56.05362965250745],[-132.41832418324182,56.027585852640726],[-132.4111241112411,55.9963332928007],[-132.4219242192422,55.96855323960952],[-132.42552425524252,55.95639946633841],[-132.31752317523174,55.91299313322722],[-132.2743227432274,55.91646563987612],[-132.14472144721447,55.925146906498355],[-132.130321303213,55.92688315982281],[-132.11952119521195,55.93556442644504],[-132.11592115921158,55.94771819971615],[-132.13752137521374,56.067519679103015],[-132.09432094320942,56.10050849226752],[-132.10872108721085,56.116134772187564],[-132.18072180721805,56.16822237192096],[-132.2131221312213,56.17863989186765],[-132.39672396723967,56.22204622497884],[-132.37152371523715,56.26892506473891],[-132.37872378723785,56.3123313978501],[-132.38592385923857,56.33143018441902],[-132.40032400324003,56.34705646433903],[-132.41832418324182,56.35052897098794],[-132.4363243632436,56.35052897098794],[-132.49392493924938,56.34358395769016],[-132.51552515525154,56.3383751977168],[-132.52992529925297,56.33143018441902],[-132.56592565925658,56.28976010463228],[-132.5731257312573,56.27760633136114],[-132.68472684726845,56.225518731627744],[-132.69552695526954,56.218573718329935],[-132.7171271712717,56.150859838676496]]],[[[-132.37512375123748,56.47553921034813],[-132.36792367923678,56.45470417045479],[-132.349923499235,56.437341637210295],[-132.3283232832328,56.402616570721364],[-132.3283232832328,56.32622142444566],[-132.3283232832328,56.31580390449898],[-132.33192331923317,56.30538638455232],[-132.34632346323463,56.281078838010046],[-132.34632346323463,56.27066131806336],[-132.33192331923317,56.25677129146777],[-132.31392313923138,56.239408758223306],[-132.3031230312303,56.232463744925525],[-132.2743227432274,56.21336495835661],[-132.25272252722527,56.20294743840992],[-132.22392223922236,56.19426617178769],[-132.2131221312213,56.19252991846324],[-132.20232202322023,56.190793665138784],[-132.19152191521914,56.18905741181433],[-132.16992169921699,56.185584905165456],[-132.10872108721085,56.16648611859651],[-132.0979209792098,56.16127735862318],[-132.05472054720545,56.11092601221421],[-132.01152011520114,56.13349730543203],[-131.94671946719467,56.232463744925525],[-131.98991989919898,56.31927641114788],[-131.99351993519934,56.327957677770115],[-132.00792007920077,56.3383751977168],[-132.04392043920438,56.355737730961266],[-132.07272072720724,56.35921023761017],[-132.09072090720906,56.35226522431239],[-132.10872108721085,56.34358395769016],[-132.12672126721264,56.34358395769016],[-132.1591215912159,56.35226522431239],[-132.2131221312213,56.388726544125774],[-132.21672216722166,56.39914406407246],[-132.22392223922236,56.42171535729028],[-132.2311223112231,56.43907789053475],[-132.2563225632256,56.45296791713034],[-132.35352353523535,56.48942923694372],[-132.37152371523715,56.48769298361927],[-132.37512375123748,56.47553921034813]]],[[[-131.85671856718565,55.35912832272854],[-131.84951849518495,55.296623203048426],[-131.83871838718386,55.26710689653282],[-131.8243182431824,55.21154679015049],[-131.8171181711817,55.20112927020381],[-131.81351813518134,55.192448003581575],[-131.80991809918098,55.18203048363489],[-131.73791737917378,55.13515164387482],[-131.72351723517232,55.13688789719927],[-131.61551615516154,55.275788163155056],[-131.62271622716224,55.29315069639952],[-131.62991629916297,55.3000957096973],[-131.6479164791648,55.31224948296844],[-131.67671676716765,55.33134826953736],[-131.74871748717487,55.36954584267522],[-131.82071820718204,55.41295217578639],[-131.82791827918277,55.41989718908417],[-131.84231842318422,55.41989718908417],[-131.8531185311853,55.411215922461935],[-131.85671856718565,55.35912832272854]]],[[[-131.82071820718204,55.452886002248675],[-131.71271712717126,55.36780958935077],[-131.68751687516874,55.35391956275518],[-131.66591665916658,55.34523829613295],[-131.54351543515435,55.29141444307507],[-131.5183151831518,55.294886949723974],[-131.46431464314642,55.36954584267522],[-131.47151471514712,55.39385338921747],[-131.49671496714967,55.42163344240862],[-131.51471514715146,55.480666055439826],[-131.4931149311493,55.5049736019821],[-131.4283142831428,55.520599881902115],[-131.46431464314642,55.47198478881759],[-131.47151471514712,55.44767724227535],[-131.44631446314463,55.40774341581306],[-131.42111421114208,55.385172122595236],[-131.42111421114208,55.364337082701866],[-131.4571145711457,55.32613950956403],[-131.39951399513993,55.34871080278185],[-131.32751327513273,55.425105949057524],[-131.31671316713164,55.45809476222203],[-131.32751327513273,55.508446108631006],[-131.35271352713525,55.555324948391075],[-131.35991359913598,55.57442373495999],[-131.36711367113668,55.624775081368966],[-131.3491134911349,55.643873867937884],[-131.28071280712805,55.48934732206206],[-131.27351273512733,55.43378721567976],[-131.29151291512915,55.411215922461935],[-131.36711367113668,55.33829328283517],[-131.4283142831428,55.31398573629289],[-131.4571145711457,55.3000957096973],[-131.45351453514533,55.27926066980396],[-131.41751417514172,55.261898136559466],[-131.39951399513993,55.25668937658614],[-131.38871388713886,55.254953123261686],[-131.34551345513455,55.25668937658614],[-131.29151291512915,55.275788163155056],[-131.25551255512553,55.31919449626625],[-131.27351273512733,55.35218330943073],[-131.26991269912696,55.383435869270784],[-131.21951219512192,55.4025346558397],[-131.19431194311943,55.39385338921747],[-131.19071190711907,55.36086457605296],[-131.21951219512192,55.3000957096973],[-131.23391233912338,55.28273317645284],[-131.25551255512553,55.26537064320837],[-131.28431284312842,55.24627185663945],[-131.28071280712805,55.227173070070535],[-131.2483124831248,55.20112927020381],[-131.2051120511205,55.187239243608246],[-131.14031140311403,55.199393016879384],[-131.13671136711366,55.22890932339499],[-131.10071100711005,55.234118083368315],[-131.07551075510753,55.24627185663945],[-131.05751057510574,55.25842562991059],[-130.96750967509672,55.38864462924414],[-130.93870938709387,55.562269961688855],[-130.9351093510935,55.636928854640104],[-131.05751057510574,55.80708168043594],[-131.0683106831068,55.820971707031504],[-131.1439114391144,55.88694933336052],[-131.20871208712086,55.937300679769464],[-131.23031230312301,55.95466321301396],[-131.2591125911259,55.95987197298729],[-131.29151291512915,55.958135719662835],[-131.4391143911439,55.930355666471684],[-131.47871478714785,55.919938146525],[-131.5291152911529,55.90083935995608],[-131.53991539915398,55.85222426687156],[-131.68391683916838,55.82965297365374],[-131.68391683916838,55.79319165384035],[-131.62271622716224,55.781037880569215],[-131.62991629916297,55.73068653416024],[-131.69471694716947,55.671653921129035],[-131.70551705517053,55.624775081368966],[-131.6911169111691,55.609148801448924],[-131.70191701917017,55.52580864187547],[-131.82071820718204,55.452886002248675]]],[[[-131.62271622716224,55.02576768443464],[-131.61911619116188,55.0136139111635],[-131.5939159391594,54.994515124594585],[-131.57951579515793,54.99104261794571],[-131.3851138511385,55.008405151190175],[-131.3743137431374,55.01187765783905],[-131.35631356313561,55.036185204381326],[-131.34551345513455,55.0604927509236],[-131.3491134911349,55.11952536395481],[-131.3743137431374,55.19765676355493],[-131.38871388713886,55.21154679015049],[-131.40671406714065,55.20807428350162],[-131.42111421114208,55.20981053682607],[-131.45351453514533,55.22196431009718],[-131.46431464314642,55.23238183004386],[-131.46791467914676,55.23585433669277],[-131.47151471514712,55.248008109963905],[-131.52191521915216,55.26363438988392],[-131.5471154711547,55.26710689653282],[-131.5831158311583,55.254953123261686],[-131.58671586715866,55.22890932339499],[-131.5831158311583,55.2150192967994],[-131.5651156511565,55.171612963688204],[-131.57951579515793,55.083064044141395],[-131.62271622716224,55.02576768443464]]],[[[-131.48231482314822,54.92159248496782],[-131.4751147511475,54.91117496502113],[-131.37791377913777,54.864296125261035],[-131.34551345513455,54.857351111963254],[-131.3311133111331,54.8556148586388],[-131.23391233912338,54.87644989853217],[-131.19071190711907,54.90770245837223],[-131.20151201512013,54.91811997831891],[-131.22671226712265,54.92506499161669],[-131.2411124111241,54.932010004914474],[-131.2411124111241,54.97715259135012],[-131.23751237512374,54.98583385797235],[-131.23751237512374,54.99277887127013],[-131.25191251912517,54.99972388456794],[-131.44991449914497,54.952845044807844],[-131.47151471514712,54.94416377818561],[-131.48231482314822,54.933746258238926],[-131.48231482314822,54.92159248496782]]],[[[-124.71424714247141,48.396752491694826],[-124.70704707047068,48.37070869182813],[-124.68184681846816,48.252643465765686],[-124.68544685446852,48.18492958611225],[-124.68184681846816,48.12589697308104],[-124.67104671046708,48.06339185340093],[-124.66744667446672,48.03908430685868],[-124.65664656646564,47.99741422707194],[-124.64584645846456,47.97310668052967],[-124.61704617046168,47.92449158744515],[-124.57744577445771,47.88455776098286],[-124.54864548645483,47.882821507658434],[-124.52704527045267,47.8706677343873],[-124.49824498244979,47.85156894781838],[-124.4622446224462,47.8237888946272],[-124.39384393843936,47.73003121510706],[-124.35784357843576,47.66752609542695],[-124.32544325443251,47.53557084276895],[-124.30744307443072,47.43313189662658],[-124.30024300243,47.37236303027092],[-124.26784267842676,47.34111047043086],[-124.2282422824228,47.31333041723971],[-124.210242102421,47.27860535075075],[-124.18504185041849,47.221308991044],[-124.15264152641524,47.09108999171045],[-124.14904149041487,47.061573685194844],[-124.14904149041487,47.03379363200369],[-124.15264152641524,47.007749832136966],[-124.1562415624156,46.97649727229694],[-124.16344163441632,46.946980965781336],[-124.15264152641524,46.94177220580798],[-124.10944109441093,46.97476101897249],[-124.12384123841235,47.000804818839185],[-124.13464134641345,47.042474898625926],[-124.11304113041128,47.05983743187039],[-124.07344073440731,47.0667824451682],[-124.05184051840516,47.061573685194844],[-124.02304023040227,47.047683658599254],[-124.00144001440012,47.02337611205701],[-123.99063990639904,47.000804818839185],[-123.96183961839616,46.98865104556805],[-123.90783907839077,46.9903872988925],[-123.79983799837996,46.97649727229694],[-123.87183871838715,46.953925979079116],[-123.940239402394,46.938299699159074],[-123.97263972639723,46.933090939185746],[-124.08064080640804,46.88621209942568],[-124.09864098640983,46.8619045528834],[-124.07704077040768,46.74904808679432],[-124.05184051840516,46.735158060198756],[-123.9582395823958,46.72300428692762],[-123.9042390423904,46.740366820172085],[-123.87543875438752,46.754256846767674],[-123.84663846638463,46.747311833469894],[-123.760237602376,46.68480671378978],[-123.78903789037888,46.677861700492],[-123.81063810638103,46.69696048706092],[-123.8322383223832,46.714323020305386],[-123.89343893438931,46.686542967114235],[-123.940239402394,46.63619162070526],[-123.9222392223922,46.618829087460796],[-123.90783907839077,46.60667531418966],[-123.88263882638824,46.56500523440292],[-123.87903879038788,46.53201642123841],[-123.90063900639004,46.4434675016916],[-123.940239402394,46.39311615528263],[-123.98343983439833,46.39311615528263],[-124.0122401224012,46.49902760807393],[-124.0122401224012,46.542433941185095],[-124.00504005040048,46.57368650102515],[-124.01944019440191,46.65702666059863],[-124.03744037440372,46.65702666059863],[-124.0482404824048,46.625774100758576],[-124.03744037440372,46.41047868852709],[-124.00144001440012,46.323666022304735],[-123.89343893438931,46.26636966259798],[-123.85743857438572,46.261160902624624],[-123.82143821438211,46.27331467589576],[-123.73863738637384,46.29414971578913],[-123.69183691836915,46.30109472908691],[-123.65583655836556,46.29241346246468],[-123.61983619836195,46.276787182544666],[-123.59103591035907,46.27331467589576],[-123.54783547835476,46.275050929220214],[-123.51903519035187,46.281995942517995],[-123.48663486634864,46.28720470249135],[-123.46143461434612,46.288940955815804],[-123.42903429034288,46.28720470249135],[-123.40743407434071,46.27331467589576],[-123.39303393033927,46.242062116055706],[-123.37143371433712,46.22296332948679],[-123.29583295832956,46.17782074305117],[-123.25983259832596,46.17087572975339],[-123.16263162631623,46.19518327629564],[-123.2022320223202,46.160458209806706],[-123.24183241832415,46.146568183211116],[-123.2634326343263,46.144831929886664],[-123.36783367833675,46.16219446313113],[-123.40023400234,46.17434823640227],[-123.41823418234179,46.186502009673404],[-123.42903429034288,46.20907330289123],[-123.47583475834756,46.24727087602906],[-123.50463504635044,46.25074338267797],[-123.53703537035368,46.24032586273128],[-123.55503555035548,46.22469958281124],[-123.59463594635943,46.20212828959342],[-123.70263702637024,46.18823826299786],[-123.82863828638284,46.18997451632231],[-123.92583925839256,46.214282062864555],[-123.95103951039508,46.18129324970005],[-123.92583925839256,46.132678156615526],[-123.91863918639183,46.09621683680214],[-123.91143911439111,46.06496427696209],[-123.90783907839077,46.030239210473155],[-123.91503915039148,45.99725039730865],[-123.93663936639363,45.89481145116625],[-123.95103951039508,45.80626253161944],[-123.95103951039508,45.76632870515715],[-123.92943929439292,45.73160363866822],[-123.9042390423904,45.709032345450396],[-123.90063900639004,45.674307278961436],[-123.92943929439292,45.592703372712435],[-123.89343893438931,45.571868332819065],[-123.87183871838715,45.52846199970787],[-123.94383943839435,45.51978073308564],[-123.94383943839435,45.46074812005443],[-123.95463954639544,45.215936401307346],[-123.94383943839435,45.17947508149396],[-123.99423994239939,44.97806969585807],[-124.00144001440012,44.948553389342464],[-124.02304023040227,44.887784522986806],[-124.05544055440552,44.83743317657783],[-124.05904059040589,44.79055433681776],[-124.0482404824048,44.76971929692439],[-124.04104041040408,44.73846673708434],[-124.0482404824048,44.62561027099528],[-124.05904059040589,44.59783021780413],[-124.06984069840695,44.52317132485288],[-124.10944109441093,44.15161311342115],[-124.13104131041308,43.92069142126968],[-124.15264152641524,43.793944928585006],[-124.13464134641345,43.75401110212272],[-124.11664116641164,43.724494795607114],[-124.18864188641884,43.67414344919814],[-124.20304203042028,43.635945876060305],[-124.21384213842136,43.596012049598016],[-124.22104221042207,43.56302323643351],[-124.27864278642784,43.43974925039777],[-124.29304293042928,43.410232943882164],[-124.30384303843036,43.39981542393548],[-124.28584285842857,43.40328793058438],[-124.2642426424264,43.41544170385549],[-124.23904239042388,43.438012997073315],[-124.19584195841955,43.45537553031778],[-124.14184141841416,43.37203537074433],[-124.18864188641884,43.37898038404211],[-124.20664206642064,43.3928704106377],[-124.24984249842495,43.396342917286574],[-124.33264332643324,43.354672837499834],[-124.37944379443792,43.31821151768645],[-124.37224372243719,43.28869521117085],[-124.36864368643684,43.26438766462857],[-124.38664386643865,43.18972877167735],[-124.4262442624426,43.040410985774884],[-124.47304473044727,42.96401583949921],[-124.48744487444873,42.94144454628139],[-124.50544505445052,42.925818266361375],[-124.5162451624516,42.904983226468005],[-124.52344523445231,42.86678565333014],[-124.52344523445231,42.828588080192304],[-124.48093692363588,42.75],[-123.75,42.75],[-121.05,42.75],[-118.35,42.75],[-115.65,42.75],[-112.95,42.75],[-110.25,42.75],[-110.25,48.99923239527803],[-110.30330303303029,48.99923239527803],[-110.36810368103676,48.99923239527803],[-110.50130501305009,48.99923239527803],[-110.66690666906665,48.99923239527803],[-110.76770767707673,48.99923239527803],[-111.36891368913685,48.99923239527803],[-111.80091800918005,48.99923239527803],[-112.03492034920345,48.99923239527803],[-112.16812168121677,48.99923239527803],[-112.2365223652236,48.99923239527803],[-112.33372333723332,48.99923239527803],[-112.4345243452434,48.99923239527803],[-112.53532535325348,48.99923239527803],[-112.60012600125997,48.99923239527803],[-112.93492934929345,48.99923239527803],[-113.03573035730354,48.99923239527803],[-113.23373233732333,48.99923239527803],[-113.36693366933665,48.99923239527803],[-113.5685356853568,48.99923239527803],[-114.03294032940326,48.99923239527803],[-114.05814058140578,49.00096864860248],[-114.33534335343349,48.99923239527803],[-114.46854468544682,48.99923239527803],[-114.5333453334533,48.99923239527803],[-114.63414634146338,48.99923239527803],[-114.90054900549002,48.99923239527803],[-115.03375033750334,48.99923239527803],[-115.16695166951665,48.99923239527803],[-115.36855368553681,48.99923239527803],[-115.46935469354689,48.99923239527803],[-115.56655566555662,48.99923239527803],[-115.60255602556022,48.99923239527803],[-115.73575735757353,48.99923239527803],[-116.04896048960487,48.99923239527803],[-117.00297002970026,48.99923239527803],[-117.0353703537035,49.00270490192693],[-117.06777067770673,48.99923239527803],[-117.20097200972006,48.99923239527803],[-117.23337233372331,48.99923239527803],[-117.30177301773014,48.99923239527803],[-117.56817568175678,48.99923239527803],[-117.83457834578343,48.99923239527803],[-117.86697866978666,48.99923239527803],[-118.00018000179998,48.99923239527803],[-118.1333813338133,48.99923239527803],[-118.36738367383671,48.99923239527803],[-118.76698766987667,48.99923239527803],[-118.96858968589683,48.99923239527803],[-119.13419134191338,48.99923239527803],[-119.26739267392671,48.99923239527803],[-119.46899468994687,48.99923239527803],[-119.86859868598683,48.99923239527803],[-119.93339933399331,48.99923239527803],[-120.03420034200339,48.99923239527803],[-120.53460534605344,48.99923239527803],[-121.08541085410852,48.99923239527803],[-122.10062100621003,48.99923239527803],[-122.33462334623343,48.99923239527803],[-122.43182431824314,48.99923239527803],[-122.56502565025647,48.99923239527803],[-122.6982269822698,48.99923239527803],[-122.7594275942759,48.99923239527803],[-122.75222752227519,48.9940236353047],[-122.73422734227339,48.962771075464644],[-122.770227702277,48.9645073287891],[-122.80982809828095,48.943672288895726],[-122.680226802268,48.79609075631771],[-122.64782647826476,48.764838196477655],[-122.60822608226079,48.75268442320652],[-122.58662586625863,48.771783209775435],[-122.56502565025647,48.77525571642434],[-122.52182521825216,48.76136568982875],[-122.50022500224999,48.744003156584284],[-122.43542435424351,48.59121286403291],[-122.48582485824855,48.45231259807713],[-122.5182251822518,48.45231259807713],[-122.53622536225359,48.46793887799717],[-122.55062550625503,48.485301411241636],[-122.61902619026188,48.511345211108335],[-122.6982269822698,48.49398267786387],[-122.680226802268,48.4175875315882],[-122.65862658626583,48.40543375831706],[-122.62622626226259,48.40369750499261],[-122.60822608226079,48.410642518290416],[-122.590225902259,48.42626879821043],[-122.3922239222392,48.30993982547247],[-122.37782377823775,48.28389602560574],[-122.39582395823956,48.238753439170125],[-122.41742417424172,48.24743470579236],[-122.43542435424351,48.25437971909014],[-122.45702457024566,48.25437971909014],[-122.49662496624964,48.25090721244126],[-122.52182521825216,48.23528093252122],[-122.53262532625322,48.20576462600562],[-122.52902529025287,48.183193332787795],[-122.50022500224999,48.129369479729945],[-122.44982449824495,48.115479453134355],[-122.4282242822428,48.11895195978326],[-122.4462244622446,48.13284198637882],[-122.47142471424712,48.16930330619223],[-122.44262442624424,48.224863412574535],[-122.37422374223739,48.2127096393034],[-122.320223202232,48.073809373347615],[-122.29142291422912,47.957480400609654],[-122.37422374223739,47.83247016124946],[-122.41742417424172,47.67273485540031],[-122.39942399423991,47.58592218917792],[-122.38502385023847,47.54598836271563],[-122.35262352623523,47.48521949636],[-122.30942309423091,47.405351843435426],[-122.31302313023127,47.37236303027092],[-122.41742417424172,47.315066670564164],[-122.46062460624603,47.29770413731967],[-122.52542525425251,47.275132844101876],[-122.56502565025647,47.2247814976929],[-122.590225902259,47.19352893785285],[-122.60822608226079,47.172693897959476],[-122.64062640626403,47.151858858066106],[-122.7162271622716,47.12060629822605],[-122.79182791827915,47.18311141790616],[-122.84582845828456,47.17443015128393],[-122.8854288542885,47.157067618039434],[-122.87822878228779,47.063309938519296],[-122.89982899828996,47.0667824451682],[-122.950229502295,47.13449632482164],[-123.02583025830256,47.124078804874955],[-123.06543065430651,47.11366128492827],[-123.06183061830615,47.15533136471501],[-123.02583025830256,47.16922139131057],[-122.97902979029787,47.17963891125726],[-122.93942939429391,47.205682711123984],[-122.92862928629283,47.2508252975596],[-122.91782917829175,47.28381411072411],[-122.90342903429031,47.29944039064412],[-122.84582845828456,47.31333041723971],[-122.81342813428131,47.36715427029756],[-122.79902799027988,47.39493432348874],[-122.770227702277,47.37236303027092],[-122.76662766627663,47.32027543053749],[-122.79542795427952,47.29249537734634],[-122.80982809828095,47.26992408412852],[-122.79182791827915,47.22304524436845],[-122.770227702277,47.20221020447508],[-122.74862748627484,47.19005643120394],[-122.72702727027267,47.212627724421765],[-122.71262712627123,47.25256155088405],[-122.74142741427411,47.29075912402189],[-122.70902709027087,47.35500049702645],[-122.61902619026188,47.42097812335544],[-122.61542615426151,47.39493432348874],[-122.6442264422644,47.34805548372864],[-122.67302673026728,47.322011683861945],[-122.5722257222572,47.27860535075075],[-122.54702547025468,47.287286617372985],[-122.5074250742507,47.500845776280016],[-122.53622536225359,47.59286720247573],[-122.57582575825755,47.57897717588014],[-122.60102601026007,47.561614642635675],[-122.66222662226619,47.54598836271563],[-122.680226802268,47.6397460422358],[-122.66942669426692,47.65884482880472],[-122.65502655026548,47.63800978891135],[-122.63702637026367,47.61891100234243],[-122.59742597425972,47.608493482395744],[-122.59382593825936,47.6397460422358],[-122.59742597425972,47.70745992188924],[-122.54342543425432,47.7421849883782],[-122.46062460624603,47.76302002827157],[-122.51462514625143,47.92275533412072],[-122.56502565025647,47.938381614040736],[-122.72702727027267,47.74739374835153],[-122.73782737827375,47.72134994848483],[-122.83502835028347,47.657108575480265],[-122.90342903429031,47.63453728226247],[-122.94302943029427,47.608493482395744],[-123.00063000630004,47.54598836271563],[-123.08343083430832,47.44354941657326],[-123.09783097830976,47.40014308346207],[-123.02583025830256,47.3793080435687],[-122.99702997029968,47.389725563515384],[-122.95382953829535,47.410560603408754],[-122.91782917829175,47.42618688332877],[-122.86742867428671,47.445285669897714],[-122.8422284222842,47.44702192322214],[-122.87462874628744,47.41576936338208],[-122.90342903429031,47.403615590110974],[-123.00783007830076,47.368890523622014],[-123.10503105031047,47.356736750350876],[-123.13023130231299,47.36020925699978],[-123.1482314823148,47.37236303027092],[-123.10503105031047,47.46959321643996],[-123.01863018630183,47.57029590925791],[-122.98262982629824,47.603284722422416],[-122.96462964629643,47.61891100234243],[-122.91422914229139,47.65884482880472],[-122.89262892628923,47.677943615373636],[-122.87462874628744,47.70398741524036],[-122.84942849428492,47.75086625500043],[-122.8422284222842,47.78385506816494],[-122.84942849428492,47.806426361382734],[-122.84942849428492,47.83073390792501],[-122.79542795427952,47.86025021444061],[-122.78462784627843,47.83247016124946],[-122.78102781027808,47.81163512135609],[-122.78822788227879,47.76475628159599],[-122.74862748627484,47.76302002827157],[-122.67302673026728,47.85677770779171],[-122.62982629826296,47.915810320822914],[-122.680226802268,47.98699670712526],[-122.71262712627123,48.00956800034308],[-122.77742777427771,48.08943565326766],[-122.77742777427771,48.11027069316103],[-122.74862748627484,48.12763322640549],[-122.74862748627484,48.15367702627219],[-122.78102781027808,48.15888578624555],[-122.8242282422824,48.14673201297441],[-122.84582845828456,48.136314493027726],[-122.86742867428671,48.11200694648548],[-122.9682296822968,48.1137431998099],[-123.11223112231119,48.190138346085604],[-123.1482314823148,48.17972082613892],[-123.18783187831875,48.15888578624555],[-123.20943209432092,48.14152325300108],[-123.24183241832415,48.129369479729945],[-123.35343353433532,48.129369479729945],[-123.40023400234,48.1311057330544],[-123.5082350823508,48.14846826629886],[-123.67383673836736,48.171039559516686],[-123.75663756637564,48.16583079954333],[-123.78543785437851,48.16583079954333],[-123.80703807038068,48.16583079954333],[-123.89703897038967,48.17277581284111],[-123.93303933039329,48.176248319490014],[-124.01584015840156,48.18840209276115],[-124.04104041040408,48.19361085273448],[-124.0842408424084,48.210973385978974],[-124.09864098640983,48.231808425872345],[-124.14544145441451,48.25090721244126],[-124.23184231842316,48.27521475898351],[-124.31104311043109,48.28389602560574],[-124.41544415444152,48.31688483877025],[-124.480244802448,48.34292863863695],[-124.54504545045448,48.37244494515255],[-124.56664566645664,48.37938995845036],[-124.63864638646385,48.40022499834373],[-124.71424714247141,48.396752491694826]]],[[[-123.17703177031768,48.55127903757062],[-123.15543155431551,48.511345211108335],[-123.1482314823148,48.50092769116165],[-123.14103141031407,48.49398267786387],[-123.12303123031228,48.485301411241636],[-123.0942309423094,48.47488389129495],[-123.00423004230039,48.44536758477935],[-122.96102961029607,48.45231259807713],[-122.99342993429931,48.53044399767728],[-123.03663036630363,48.56169655751731],[-123.10143101431012,48.60336663730405],[-123.10503105031047,48.61204790392628],[-123.14103141031407,48.61899291722409],[-123.15183151831516,48.61725666389964],[-123.17703177031768,48.59121286403291],[-123.17703177031768,48.55127903757062]]],[[[-123.0942309423094,48.99923239527803],[-123.08703087030867,48.97145234208688],[-123.04743047430472,48.976661102060234],[-123.03303033030328,48.99923239527803],[-123.0942309423094,48.99923239527803]]],[[[-123.0222302223022,48.62420167719742],[-123.0114301143011,48.6051028906285],[-123.00063000630004,48.59989413065517],[-122.92142921429212,48.587740357384035],[-122.89982899828996,48.58600410405958],[-122.87822878228779,48.587740357384035],[-122.8062280622806,48.6051028906285],[-122.75222752227519,48.648509223739694],[-122.74862748627484,48.6606629970108],[-122.78102781027808,48.676289276930845],[-122.84582845828456,48.70059682347309],[-122.86022860228599,48.70580558344645],[-122.88182881828816,48.71101434341978],[-122.8962289622896,48.71101434341978],[-122.92502925029248,48.71101434341978],[-122.93942939429391,48.704069330121996],[-123.01863018630183,48.63635545046856],[-123.0222302223022,48.62420167719742]]],[[[-122.93582935829355,48.45578510472603],[-122.86022860228599,48.42106003823707],[-122.83862838628383,48.4175875315882],[-122.82782827828275,48.415851278263744],[-122.81342813428131,48.4175875315882],[-122.8062280622806,48.42800505153488],[-122.8062280622806,48.44189507813044],[-122.80982809828095,48.45404885140158],[-122.81342813428131,48.46793887799717],[-122.85662856628564,48.52349898437947],[-122.86742867428671,48.553015290895075],[-122.87102871028708,48.559960304192884],[-122.91782917829175,48.53738901097506],[-122.93582935829355,48.49224642453942],[-122.93582935829355,48.47488389129495],[-122.93582935829355,48.45578510472603]]],[[[-122.75582755827556,48.231808425872345],[-122.74862748627484,48.21965465260121],[-122.74142741427411,48.210973385978974],[-122.60822608226079,48.087699399943205],[-122.56142561425611,48.02172177361422],[-122.53262532625322,47.98178794715193],[-122.42462424624243,47.9262278407696],[-122.37062370623704,47.92101908079627],[-122.34182341823416,47.95400789396075],[-122.33462334623343,47.96789792055634],[-122.33822338223379,47.98178794715193],[-122.36702367023668,48.03734805353423],[-122.48582485824855,48.101589426538794],[-122.58302583025826,48.19361085273448],[-122.59382593825936,48.20055586603229],[-122.60822608226079,48.210973385978974],[-122.62262622626224,48.21965465260121],[-122.64782647826476,48.22659966589899],[-122.66222662226619,48.24396219914345],[-122.61542615426151,48.301258558850236],[-122.58662586625863,48.301258558850236],[-122.5722257222572,48.29604979887688],[-122.56142561425611,48.285632278930194],[-122.55062550625503,48.28389602560574],[-122.52542525425251,48.29084103890355],[-122.51462514625143,48.29604979887688],[-122.5074250742507,48.30820357214802],[-122.52182521825216,48.327302358716935],[-122.58662586625863,48.39154373172147],[-122.59742597425972,48.40543375831706],[-122.66222662226619,48.37765370512591],[-122.75222752227519,48.24917095911681],[-122.75582755827556,48.231808425872345]]],[[[-122.5182251822518,47.37236303027092],[-122.50382503825035,47.353264243702],[-122.49302493024928,47.34631923040419],[-122.48222482224818,47.34805548372864],[-122.41022410224099,47.38798931019093],[-122.3814238142381,47.39493432348874],[-122.41382413824135,47.42271437667989],[-122.42102421024208,47.431395643302125],[-122.44262442624424,47.49042825633333],[-122.44982449824495,47.51647205620003],[-122.49662496624964,47.46091194981773],[-122.51102511025107,47.4088243500843],[-122.5182251822518,47.37236303027092]]]]}}, {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-136.125,68.625],[-134.775,68.625],[-133.425,68.625],[-132.075,68.625],[-130.725,68.625],[-129.375,68.625],[-128.025,68.625],[-126.675,68.625],[-125.325,68.625],[-123.975,68.625],[-122.625,68.625],[-122.625,55.125],[-123.975,55.125],[-125.325,55.125],[-126.675,55.125],[-128.025,55.125],[-129.375,55.125],[-130.725,55.125],[-132.075,55.125],[-133.425,55.125],[-134.775,55.125],[-136.125,55.125],[-136.125,68.625]]]}}]} From 1f0649835f7252fa94831865599479aa376a9c41 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Tue, 5 Dec 2017 00:41:57 +0100 Subject: [PATCH 27/42] attempts --- bench.js | 12 +++ demo/js/bundle.js | 86 +++++++++++----------- src/compute_fields.js | 51 ++++++------- src/connect_edges.js | 24 +++--- src/subdivide_segments.js | 7 +- test/fixtures/overlapping_segments.geojson | 4 +- test/fixtures/states_result.geojson | 1 - 7 files changed, 94 insertions(+), 91 deletions(-) delete mode 100644 test/fixtures/states_result.geojson diff --git a/bench.js b/bench.js index c08f610..2a17229 100644 --- a/bench.js +++ b/bench.js @@ -46,3 +46,15 @@ new Benchmark.Suite('Asia union', options) }) .add('JSTS', () => jstsUnion(asia.features[0], unionPoly)) .run(); + +const states = load.sync('./test/fixtures/states_source.geojson'); +new Benchmark.Suite('States clip', options) + .add('Martinez', () => { + martinez.union( + states.features[0].geometry.coordinates, + states.features[1].geometry.coordinates); + }) + .add('JSTS', () => { + jstsUnion(states.features[0], states.features[1]); + }) + .run(); diff --git a/demo/js/bundle.js b/demo/js/bundle.js index 349c3ae..3f65f8b 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -2809,11 +2809,12 @@ module.exports = function compareSegments(le1, le2) { 'use strict'; var edgeType = require('./edge_type'); +var operationType = require('./operation'); -var INTERSECTION = 0; -var UNION = 1; -var DIFFERENCE = 2; -var XOR = 3; +var INTERSECTION = operationType.INTERSECTION; +var UNION = operationType.UNION; +var DIFFERENCE = operationType.DIFFERENCE; +var XOR = operationType.XOR; /** * @param {SweepEvent} event @@ -2852,32 +2853,32 @@ module.exports = function computeFields(event, prev, operation) { function inResult(event, operation) { switch (event.type) { - case edgeType.NORMAL: - switch (operation) { - case INTERSECTION: - return !event.otherInOut; - case UNION: - return event.otherInOut; - case DIFFERENCE: - // return (event.isSubject && !event.otherInOut) || - // (!event.isSubject && event.otherInOut); - return (event.isSubject && event.otherInOut) || - (!event.isSubject && !event.otherInOut); - case XOR: - return true; - } - break; - case edgeType.SAME_TRANSITION: - return operation === INTERSECTION || operation === UNION; - case edgeType.DIFFERENT_TRANSITION: - return operation === DIFFERENCE; - case edgeType.NON_CONTRIBUTING: - return false; + case edgeType.NORMAL: + switch (operation) { + case INTERSECTION: + return !event.otherInOut; + case UNION: + return event.otherInOut; + case DIFFERENCE: + // return (event.isSubject && !event.otherInOut) || + // (!event.isSubject && event.otherInOut); + return (event.isSubject && event.otherInOut) || + (!event.isSubject && !event.otherInOut); + case XOR: + return true; + } + break; + case edgeType.SAME_TRANSITION: + return operation === INTERSECTION || operation === UNION; + case edgeType.DIFFERENT_TRANSITION: + return operation === DIFFERENCE; + case edgeType.NON_CONTRIBUTING: + return false; } return false; } -},{"./edge_type":18}],16:[function(require,module,exports){ +},{"./edge_type":18,"./operation":22}],16:[function(require,module,exports){ 'use strict'; // var equals = require('./equals'); @@ -2975,10 +2976,10 @@ function nextPos(pos, resultEvents, processed, origIndex) { * @param {Array.} sortedEvents * @return {Array.<*>} polygons */ -module.exports = function (sortedEvents, operation) { +module.exports = function connectEdges(sortedEvents, operation) { var i, len; var resultEvents = orderEvents(sortedEvents); - //_renderPoints(sortedEvents, 'inResult'); + //_renderPoints(resultEvents, 'inResult'); // "false"-filled array var processed = {}; @@ -3005,7 +3006,6 @@ module.exports = function (sortedEvents, operation) { var pos = i; var initial = resultEvents[i].point; - // initial.push(resultEvents[i].isExteriorRing); contour[0].push(initial); while (pos >= i) { @@ -3019,6 +3019,7 @@ module.exports = function (sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } + //new L.Marker(event.point.slice().reverse()).addTo(map); pos = event.pos; processed[pos] = true; @@ -3035,7 +3036,7 @@ module.exports = function (sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } - // _renderPoints(resultEvents, 'resultInOut'); + //_renderPoints(resultEvents, 'resultInOut'); for (i = 0, len = result.length; i < len; i++) { var polygon = result[i]; @@ -3061,14 +3062,16 @@ module.exports = function (sortedEvents, operation) { /* eslint-disable no-unused-vars, no-debugger, no-undef, no-use-before-define */ function _renderPoints(possiblePoints, prop) { var map = window.map; + var points = window.points; if (!map) return; if (points !== undefined) points.clearLayers(); - var points = L.layerGroup([]).addTo(map); + points = window.points = L.layerGroup([]).addTo(map); possiblePoints.forEach(function (e) { var point = L.circleMarker([e.point[1], e.point[0]], { - radius: getRandomSize(), - color: getColor(e[prop]), + radius: Math.floor(5 + Math.random() * 10), + color: e[prop] ? 'green' : 'gray', + opacity: e[prop] ? 0.5 : 0.1, weight: 1 }).addTo(points); }); @@ -3076,14 +3079,6 @@ function _renderPoints(possiblePoints, prop) { /* eslint-enable no-unused-vars, no-debugger, no-undef */ -function getColor(prop) { - return prop ? 'green' : 'red'; -} - -function getRandomSize() { - return Math.floor(5 + Math.random() * 10); -} - },{"./compare_events":13,"./operation":22}],17:[function(require,module,exports){ 'use strict'; @@ -3673,6 +3668,7 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, computeFields(event, next.key, operation); } } + if (prev) { if (possibleIntersection(prev.key, event, eventQueue) === 2) { var prevprev = prev; @@ -3688,7 +3684,7 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, event = event.otherEvent; next = prev = sweepLine.find(event); - // _renderSweepLine(sweepLine, event.otherEvent.point, event); + //_renderSweepLine(sweepLine, event.otherEvent.point, event); if (prev && next) { @@ -3701,9 +3697,9 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, // _renderSweepLine(sweepLine, event.otherEvent.point, event); if (next && prev) { - //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + // if (typeof prev !== 'undefined' && typeof next !== 'undefined') { possibleIntersection(prev.key, next.key, eventQueue); - //} + // } } } } @@ -3864,4 +3860,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub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XRoLmZsb29yKChwb3MgLSAxKSAvIDIpO1xuICAgICAgICAgICAgaWYgKGNvbXBhcmUoZGF0YVtwb3NdLCBkYXRhW3BhcmVudF0pIDwgMCkge1xuICAgICAgICAgICAgICAgIHN3YXAoZGF0YSwgcGFyZW50LCBwb3MpO1xuICAgICAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcblxuICAgICAgICAgICAgfSBlbHNlIGJyZWFrO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhLFxuICAgICAgICAgICAgY29tcGFyZSA9IHRoaXMuY29tcGFyZSxcbiAgICAgICAgICAgIGxlbiA9IHRoaXMubGVuZ3RoO1xuXG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICB2YXIgbGVmdCA9IDIgKiBwb3MgKyAxLFxuICAgICAgICAgICAgICAgIHJpZ2h0ID0gbGVmdCArIDEsXG4gICAgICAgICAgICAgICAgbWluID0gcG9zO1xuXG4gICAgICAgICAgICBpZiAobGVmdCA8IGxlbiAmJiBjb21wYXJlKGRhdGFbbGVmdF0sIGRhdGFbbWluXSkgPCAwKSBtaW4gPSBsZWZ0O1xuICAgICAgICAgICAgaWYgKHJpZ2h0IDwgbGVuICYmIGNvbXBhcmUoZGF0YVtyaWdodF0sIGRhdGFbbWluXSkgPCAwKSBtaW4gPSByaWdodDtcblxuICAgICAgICAgICAgaWYgKG1pbiA9PT0gcG9zKSByZXR1cm47XG5cbiAgICAgICAgICAgIHN3YXAoZGF0YSwgbWluLCBwb3MpO1xuICAgICAgICAgICAgcG9zID0gbWluO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuZnVuY3Rpb24gc3dhcChkYXRhLCBpLCBqKSB7XG4gICAgdmFyIHRtcCA9IGRhdGFbaV07XG4gICAgZGF0YVtpXSA9IGRhdGFbal07XG4gICAgZGF0YVtqXSA9IHRtcDtcbn1cbi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pKSB7XG4gICAgICBicmVhaztcbiAgICB9XG5cbiAgICBpZiAoZXZlbnQubGVmdCkge1xuICAgICAgbmV4dCAgPSBwcmV2ID0gc3dlZXBMaW5lLmluc2VydChldmVudCk7XG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5wb2ludCwgZXZlbnQpO1xuICAgICAgYmVnaW4gPSBzd2VlcExpbmUubWluTm9kZSgpO1xuXG4gICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW50LCAgICAgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBldmVudCA9IGV2ZW50Lm90aGVyRXZlbnQ7XG4gICAgICBuZXh0ID0gcHJldiA9IHN3ZWVwTGluZS5maW5kKGV2ZW50KTtcblxuICAgICAgLy8gX3JlbmRlclN3ZWVwTGluZShzd2VlcExpbmUsIGV2ZW50Lm90aGVyRXZlbnQucG9pbnQsIGV2ZW50KTtcblxuICAgICAgaWYgKHByZXYgJiYgbmV4dCkge1xuXG4gICAgICAgIGlmIChwcmV2ICE9PSBiZWdpbikgcHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXYpO1xuICAgICAgICBlbHNlICAgICAgICAgICAgICAgIHByZXYgPSBudWxsO1xuXG4gICAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcbiAgICAgICAgc3dlZXBMaW5lLnJlbW92ZShldmVudCk7XG5cbiAgICAgICAgLy8gX3JlbmRlclN3ZWVwTGluZShzd2VlcExpbmUsIGV2ZW50Lm90aGVyRXZlbnQucG9pbnQsIGV2ZW50KTtcblxuICAgICAgICBpZiAobmV4dCAmJiBwcmV2KSB7XG4gICAgICAgICAgLy9pZiAodHlwZW9mIHByZXYgIT09ICd1bmRlZmluZWQnICYmIHR5cGVvZiBuZXh0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgIHBvc3NpYmxlSW50ZXJzZWN0aW9uKHByZXYua2V5LCBuZXh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JzpcbiAgICBjYXNlICdbb2JqZWN0IEJsb2JdJzpcbiAgICBjYXNlICdbb2JqZWN0IEZvcm1EYXRhXSc6XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICBkZWZhdWx0OlxuICAgICAgcmV0dXJuIGZhbHNlO1xuICB9XG59XG5cbi8qKlxuICogU2VuZCBgZGF0YWAgYXMgdGhlIHJlcXVlc3QgYm9keSwgZGVmYXVsdGluZyB0aGUgYC50eXBlKClgIHRvIFwianNvblwiIHdoZW5cbiAqIGFuIG9iamVjdCBpcyBnaXZlbi5cbiAqXG4gKiBFeGFtcGxlczpcbiAqXG4gKiAgICAgICAvLyBtYW51YWwganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxu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HRvcCA9IHRoaXMuZGF0YVswXTtcbiAgICAgICAgdGhpcy5kYXRhWzBdID0gdGhpcy5kYXRhW3RoaXMubGVuZ3RoIC0gMV07XG4gICAgICAgIHRoaXMubGVuZ3RoLS07XG4gICAgICAgIHRoaXMuZGF0YS5wb3AoKTtcbiAgICAgICAgdGhpcy5fZG93bigwKTtcbiAgICAgICAgcmV0dXJuIHRvcDtcbiAgICB9LFxuXG4gICAgcGVlazogZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kYXRhWzBdO1xuICAgIH0sXG5cbiAgICBfdXA6IGZ1bmN0aW9uIChwb3MpIHtcbiAgICAgICAgdmFyIGRhdGEgPSB0aGlzLmRhdGEsXG4gICAgICAgICAgICBjb21wYXJlID0gdGhpcy5jb21wYXJlO1xuXG4gICAgICAgIHdoaWxlIChwb3MgPiAwKSB7XG4gICAgICAgICAgICB2YXIgcGFyZW50ID0gTWF0aC5mbG9vcigocG9zIC0gMSkgLyAyKTtcbiAgICAgICAgICAgIGlmIChjb21wYXJlKGRhdGFbcG9zXSwgZGF0YVtwYXJlbnRdKSA8IDApIHtcbiAgICAgICAgICAgICAgICBzd2FwKGRhdGEsIHBhcmVudCwgcG9zKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBwYXJlbnQ7XG5cbiAgICAgICAgICAgIH0gZWxzZSBicmVhaztcbiAgICAgICAgfVxuICAgIH0sXG5cbiAgICBfZG93bjogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmUsXG4gICAgICAgICAgICBsZW4gPSB0aGlzLmxlbmd0aDtcblxuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgdmFyIGxlZnQgPSAyICogcG9zICsgMSxcbiAgICAgICAgICAgICAgICByaWdodCA9IGxlZnQgKyAxLFxuICAgICAgICAgICAgICAgIG1pbiA9I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JldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChwcmV2KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgZXZlbnQsIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgdmFyIHByZXZwcmV2ID0gcHJldjtcbiAgICAgICAgICBpZiAocHJldnByZXYgIT09IGJlZ2luKSBwcmV2cHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXZwcmV2KTtcbiAgICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICBwcmV2cHJldiA9IG51bGw7XG5cbiAgICAgICAgICBwcmV2cHJldkV2ZW50ID0gcHJldnByZXYgPyBwcmV2cHJldi5rZXkgOiBudWxsO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMocHJldkV2ZW50LCBwcmV2cHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsICAgICBwcmV2RXZlbnQsICAgICBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBl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XG4gICAgcmV0dXJuIHRoaXMubGVmdCA/XG4gICAgICAocDBbMF0gLSBwWzBdKSAqIChwMVsxXSAtIHBbMV0pIC0gKHAxWzBdIC0gcFswXSkgKiAocDBbMV0gLSBwWzFdKSA+IDAgOlxuICAgICAgLy8gc2lnbmVkQXJlYSh0aGlzLnBvaW50LCB0aGlzLm90aGVyRXZlbnQucG9pbnQsIHApID4gMCA6XG4gICAgICAocDFbMF0gLSBwWzBdKSAqIChwMFsxXSAtIHBbMV0pIC0gKHAwWzBdIC0gcFswXSkgKiAocDFbMV0gLSBwWzFdKSA+IDA7XG4gICAgICAvL3NpZ25lZEFyZWEodGhpcy5vdGhlckV2ZW50LnBvaW50LCB0aGlzLnBvaW50LCBwKSA+IDA7XG4gIH0sXG5cblxuICAvKipcbiAgICogQHBhcmFtICB7QXJyYXkuPE51bWJlcj59ICBwXG4gICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAqL1xuICBpc0Fib3ZlOiBmdW5jdGlvbiAocCkge1xuICAgIHJldHVybiAhdGhpcy5pc0JlbG93KHApO1xuICB9LFxuXG5cbiAgLyoqXG4gICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAqL1xuICBpc1ZlcnRpY2FsOiBmdW5jdGlvbiAoKSB7XG4gICAgcmV0dXJuIHRoaXMucG9pbnRbMF0gPT09IHRoaXMub3RoZXJFdmVudC5wb2ludFswXTtcbiAgfVxufTtcblxubW9kdWxlLmV4cG9ydHMgPSBTd2VlcEV2ZW50O1xuIl19 diff --git a/src/compute_fields.js b/src/compute_fields.js index 242fbd2..d5d5ce2 100644 --- a/src/compute_fields.js +++ b/src/compute_fields.js @@ -1,11 +1,12 @@ 'use strict'; var edgeType = require('./edge_type'); +var operationType = require('./operation'); -var INTERSECTION = 0; -var UNION = 1; -var DIFFERENCE = 2; -var XOR = 3; +var INTERSECTION = operationType.INTERSECTION; +var UNION = operationType.UNION; +var DIFFERENCE = operationType.DIFFERENCE; +var XOR = operationType.XOR; /** * @param {SweepEvent} event @@ -44,27 +45,27 @@ module.exports = function computeFields(event, prev, operation) { function inResult(event, operation) { switch (event.type) { - case edgeType.NORMAL: - switch (operation) { - case INTERSECTION: - return !event.otherInOut; - case UNION: - return event.otherInOut; - case DIFFERENCE: - // return (event.isSubject && !event.otherInOut) || - // (!event.isSubject && event.otherInOut); - return (event.isSubject && event.otherInOut) || - (!event.isSubject && !event.otherInOut); - case XOR: - return true; - } - break; - case edgeType.SAME_TRANSITION: - return operation === INTERSECTION || operation === UNION; - case edgeType.DIFFERENT_TRANSITION: - return operation === DIFFERENCE; - case edgeType.NON_CONTRIBUTING: - return false; + case edgeType.NORMAL: + switch (operation) { + case INTERSECTION: + return !event.otherInOut; + case UNION: + return event.otherInOut; + case DIFFERENCE: + // return (event.isSubject && !event.otherInOut) || + // (!event.isSubject && event.otherInOut); + return (event.isSubject && event.otherInOut) || + (!event.isSubject && !event.otherInOut); + case XOR: + return true; + } + break; + case edgeType.SAME_TRANSITION: + return operation === INTERSECTION || operation === UNION; + case edgeType.DIFFERENT_TRANSITION: + return operation === DIFFERENCE; + case edgeType.NON_CONTRIBUTING: + return false; } return false; } diff --git a/src/connect_edges.js b/src/connect_edges.js index 5b7d603..177a80d 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -95,10 +95,10 @@ function nextPos(pos, resultEvents, processed, origIndex) { * @param {Array.} sortedEvents * @return {Array.<*>} polygons */ -module.exports = function (sortedEvents, operation) { +module.exports = function connectEdges(sortedEvents, operation) { var i, len; var resultEvents = orderEvents(sortedEvents); - //_renderPoints(sortedEvents, 'inResult'); + //_renderPoints(resultEvents, 'inResult'); // "false"-filled array var processed = {}; @@ -125,7 +125,6 @@ module.exports = function (sortedEvents, operation) { var pos = i; var initial = resultEvents[i].point; - // initial.push(resultEvents[i].isExteriorRing); contour[0].push(initial); while (pos >= i) { @@ -139,6 +138,7 @@ module.exports = function (sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } + //new L.Marker(event.point.slice().reverse()).addTo(map); pos = event.pos; processed[pos] = true; @@ -155,7 +155,7 @@ module.exports = function (sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } - // _renderPoints(resultEvents, 'resultInOut'); + //_renderPoints(resultEvents, 'resultInOut'); for (i = 0, len = result.length; i < len; i++) { var polygon = result[i]; @@ -181,25 +181,19 @@ module.exports = function (sortedEvents, operation) { /* eslint-disable no-unused-vars, no-debugger, no-undef, no-use-before-define */ function _renderPoints(possiblePoints, prop) { var map = window.map; + var points = window.points; if (!map) return; if (points !== undefined) points.clearLayers(); - var points = L.layerGroup([]).addTo(map); + points = window.points = L.layerGroup([]).addTo(map); possiblePoints.forEach(function (e) { var point = L.circleMarker([e.point[1], e.point[0]], { - radius: getRandomSize(), - color: getColor(e[prop]), + radius: Math.floor(5 + Math.random() * 10), + color: e[prop] ? 'green' : 'gray', + opacity: e[prop] ? 0.5 : 0.1, weight: 1 }).addTo(points); }); } /* eslint-enable no-unused-vars, no-debugger, no-undef */ - -function getColor(prop) { - return prop ? 'green' : 'red'; -} - -function getRandomSize() { - return Math.floor(5 + Math.random() * 10); -} diff --git a/src/subdivide_segments.js b/src/subdivide_segments.js index bf845bb..a0929a9 100644 --- a/src/subdivide_segments.js +++ b/src/subdivide_segments.js @@ -47,6 +47,7 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, computeFields(event, next.key, operation); } } + if (prev) { if (possibleIntersection(prev.key, event, eventQueue) === 2) { var prevprev = prev; @@ -62,7 +63,7 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, event = event.otherEvent; next = prev = sweepLine.find(event); - // _renderSweepLine(sweepLine, event.otherEvent.point, event); + //_renderSweepLine(sweepLine, event.otherEvent.point, event); if (prev && next) { @@ -75,9 +76,9 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, // _renderSweepLine(sweepLine, event.otherEvent.point, event); if (next && prev) { - //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + // if (typeof prev !== 'undefined' && typeof next !== 'undefined') { possibleIntersection(prev.key, next.key, eventQueue); - //} + // } } } } diff --git a/test/fixtures/overlapping_segments.geojson b/test/fixtures/overlapping_segments.geojson index c0a182a..a93e2bf 100644 --- a/test/fixtures/overlapping_segments.geojson +++ b/test/fixtures/overlapping_segments.geojson @@ -7,7 +7,7 @@ "type": "Polygon", "coordinates": [ [ - [-25, -25], [-25, 25], [11, 25], [25, 25], [25, -25], [-25, -25] + [-25, -25], [-25, 25], [25, 25], [25, -25], [-25, -25] ] ] } @@ -16,7 +16,7 @@ "properties": {}, "geometry": { "type": "Polygon", - "coordinates": [[[23, -18], [23,-25], [27, -25], [27, -18], [23, -18]]] + "coordinates": [[[23,-25], [23, -18], [27, -18], [27, -25], [23, -25]]] } }] } diff --git a/test/fixtures/states_result.geojson b/test/fixtures/states_result.geojson deleted file mode 100644 index aac3bdd..0000000 --- a/test/fixtures/states_result.geojson +++ /dev/null @@ -1 +0,0 @@ -{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-136.125,57.69819141730159],[-136.075961,57.64751],[-135.99316,57.631884],[-135.949959,57.611049],[-135.99316,57.600631],[-136.061561,57.600631],[-136.02916,57.567643],[-135.95356,57.531181],[-135.895959,57.510346],[-135.838358,57.484302],[-135.795158,57.459995],[-135.780758,57.433951],[-135.805958,57.437424],[-135.863559,57.468676],[-135.885159,57.48083],[-135.906759,57.496456],[-135.96796,57.517291],[-136.00036,57.517291],[-135.95356,57.468676],[-135.834758,57.387072],[-135.730357,57.366237],[-135.687157,57.362765],[-135.600756,57.414852],[-135.546755,57.465204],[-135.553956,57.534654],[-135.571956,57.585005],[-135.687157,57.642301],[-135.802358,57.760367],[-135.751958,57.753422],[-135.730357,57.748213],[-135.697957,57.736059],[-135.665557,57.723905],[-135.643956,57.713488],[-135.622356,57.704807],[-135.564756,57.671818],[-135.456755,57.630148],[-135.273153,57.558961],[-135.118351,57.498192],[-135.085951,57.477357],[-135.060751,57.459995],[-134.98875,57.451314],[-134.855549,57.458259],[-134.844748,57.597159],[-134.913149,57.749949],[-134.931149,57.75863],[-134.95635,57.760367],[-135.04635,57.751685],[-135.100351,57.743004],[-135.168752,57.727378],[-135.233552,57.720433],[-135.298353,57.73085],[-135.316353,57.756894],[-135.359554,57.796828],[-135.381154,57.807246],[-135.557556,57.869751],[-135.647556,57.901003],[-135.726757,57.916629],[-135.795158,57.930519],[-135.881559,57.993025],[-135.845558,57.989552],[-135.820358,57.980871],[-135.719557,57.94441],[-135.557556,57.902739],[-135.337953,57.824608],[-135.265953,57.791619],[-135.229952,57.779465],[-135.197552,57.775993],[-135.121951,57.774257],[-135.089551,57.781202],[-135.04635,57.779465],[-135.00675,57.779465],[-134.96355,57.808982],[-135.02115,57.852388],[-135.04995,57.868014],[-135.082351,57.874959],[-135.121951,57.881904],[-135.143551,57.894058],[-135.197552,57.937465],[-135.168752,57.935728],[-135.01755,57.888849],[-134.97075,57.885377],[-134.909549,57.920102],[-134.905949,57.982607],[-134.920349,58.017332],[-134.934749,58.031222],[-135.100351,58.093727],[-135.406354,58.137134],[-135.453155,58.119771],[-135.489155,58.067684],[-135.543155,58.012123],[-135.557556,57.99997],[-135.618756,57.961772],[-135.647556,57.961772],[-135.708757,57.979135],[-135.780758,58.043376],[-135.701557,58.05553],[-135.658357,58.045112],[-135.611556,58.04164],[-135.514355,58.104145],[-135.481955,58.157969],[-135.507155,58.175331],[-135.586356,58.196166],[-135.741157,58.256935],[-135.780758,58.274298],[-135.813158,58.274298],[-135.924759,58.229155],[-135.96076,58.201375],[-136.125,58.21952778707878],[-136.125,57.90272503749965],[-136.101161,57.888849],[-136.061561,57.868014],[-136.03276,57.847179],[-136.054361,57.845443],[-136.125,57.8825395831322],[-136.125,57.69819141730159]]],[[[-136.125,58.33228766900267],[-136.083161,58.340275],[-136.050761,58.36111],[-136.02916,58.385418],[-136.04356,58.427088],[-136.079561,58.512164],[-136.122761,58.564252],[-136.125,58.56599172452586],[-136.125,58.33228766900267]]],[[[-136.125,58.788065308253984],[-136.104761,58.829899],[-136.093961,58.862888],[-136.108361,58.928865],[-136.125,58.96898948630555],[-136.125,58.788065308253984]]],[[[-136.125,59.022744376412035],[-136.101161,59.012205],[-136.086761,58.984425],[-136.068761,58.944491],[-136.04716,58.890668],[-135.95716,58.888931],[-135.928359,58.901085],[-135.834758,58.909766],[-135.802358,58.909766],[-135.766358,58.895876],[-135.852759,58.876778],[-135.946359,58.861151],[-136.065161,58.817745],[-135.928359,58.656273],[-135.888759,58.612867],[-135.870759,58.60245],[-135.834758,58.538208],[-135.849158,58.468758],[-135.888759,58.451395],[-135.910359,58.381945],[-135.755558,58.395835],[-135.607956,58.420143],[-135.510755,58.475703],[-135.471155,58.472231],[-135.406354,58.381945],[-135.402754,58.34722],[-135.366754,58.29166],[-135.345153,58.265616],[-135.319953,58.24999],[-135.273153,58.234364],[-135.157952,58.206584],[-135.085951,58.232628],[-135.04995,58.303814],[-135.04995,58.340275],[-135.071551,58.397572],[-135.093151,58.437505],[-135.165152,58.543417],[-135.179552,58.560779],[-135.186752,58.623285],[-135.168752,58.645856],[-135.186752,58.663218],[-135.244352,58.720515],[-135.312753,58.848998],[-135.327153,58.86636],[-135.388354,58.961854],[-135.395554,59.071238],[-135.445954,59.128534],[-135.546755,59.225764],[-135.489155,59.224028],[-135.467555,59.218819],[-135.417154,59.199721],[-135.395554,59.180622],[-135.384754,59.158051],[-135.366754,59.126798],[-135.301953,59.092073],[-135.345153,59.189303],[-135.359554,59.210138],[-135.427954,59.257017],[-135.460355,59.290006],[-135.399154,59.368137],[-135.348753,59.463631],[-135.327153,59.453214],[-135.334353,59.394181],[-135.348753,59.366401],[-135.355954,59.32994],[-135.359554,59.262226],[-135.316353,59.222292],[-135.283953,59.203193],[-135.233552,59.128534],[-135.132751,58.881986],[-135.147151,58.843789],[-135.060751,58.751767],[-135.02835,58.74135],[-135.01755,58.777811],[-134.99955,58.805591],[-134.95275,58.814272],[-134.931149,58.777811],[-134.920349,58.687526],[-134.97435,58.645856],[-134.949149,58.631966],[-134.772748,58.460077],[-134.772748,58.435769],[-134.758348,58.381945],[-134.639546,58.355902],[-134.574746,58.352429],[-134.538745,58.359374],[-134.517145,58.355902],[-134.488345,58.34722],[-134.383944,58.286451],[-134.239942,58.20832],[-134.182342,58.197903],[-134.149941,58.199639],[-134.099541,58.239573],[-134.04554,58.392363],[-133.97354,58.498274],[-133.923139,58.512164],[-133.879939,58.520846],[-133.858339,58.520846],[-133.775538,58.515637],[-133.793538,58.506956],[-133.818738,58.503483],[-133.858339,58.508692],[-133.879939,58.508692],[-133.901539,58.505219],[-133.926739,58.491329],[-134.00954,58.390627],[-133.99514,58.340275],[-134.052741,58.253463],[-134.085141,58.189221],[-134.070741,58.100672],[-134.059941,58.078101],[-134.01314,58.039903],[-133.97714,58.01386],[-133.912339,57.980871],[-133.879939,57.991288],[-133.829538,58.008651],[-133.807938,58.046848],[-133.750338,58.133661],[-133.681937,58.145815],[-133.696337,58.104145],[-133.761138,58.029486],[-133.811538,57.97219],[-133.804338,57.897531],[-133.699937,57.791619],[-133.660337,57.784674],[-133.631536,57.796828],[-133.620736,57.824608],[-133.642336,57.871487],[-133.591936,57.911421],[-133.555936,57.923574],[-133.527135,57.923574],[-133.444334,57.918366],[-133.185132,57.890586],[-133.131131,57.854124],[-133.264333,57.874959],[-133.429934,57.906212],[-133.545135,57.907948],[-133.555936,57.824608],[-133.545135,57.769048],[-133.516335,57.746477],[-133.357934,57.677027],[-133.321933,57.6614],[-133.199532,57.61973],[-133.181532,57.616258],[-133.134731,57.586741],[-133.00513,57.513819],[-133.04113,57.503401],[-133.084331,57.519027],[-133.120331,57.543335],[-133.167132,57.572851],[-133.559536,57.708279],[-133.642336,57.696125],[-133.660337,57.628411],[-133.599136,57.574588],[-133.548735,57.565906],[-133.505535,57.571115],[-133.480335,57.576324],[-133.447934,57.583269],[-133.357934,57.59195],[-133.318333,57.590214],[-133.332733,57.576324],[-133.411934,57.557225],[-133.437134,57.555489],[-133.462335,57.541599],[-133.505535,57.484302],[-133.440734,57.35582],[-133.408334,57.338457],[-133.350734,57.32804],[-133.228332,57.31415],[-133.113131,57.32804],[-133.066331,57.347138],[-133.084331,57.321095],[-133.242732,57.275952],[-133.289533,57.275952],[-133.318333,57.281161],[-133.444334,57.282897],[-133.469535,57.281161],[-133.498335,57.255117],[-133.509135,57.194348],[-133.487535,57.166568],[-133.437134,57.140524],[-133.401134,57.135315],[-133.386734,57.12837],[-133.339933,57.111008],[-133.314733,57.102327],[-133.282333,57.098854],[-133.257133,57.116217],[-133.167132,57.163096],[-133.123931,57.150942],[-133.141931,57.116217],[-133.127531,57.079755],[-132.904329,57.032877],[-132.846728,57.060657],[-132.803528,57.083228],[-132.763928,56.982525],[-132.778328,56.958218],[-132.843128,56.966899],[-132.857529,56.932174],[-132.767528,56.843625],[-132.688327,56.8089],[-132.641526,56.788065],[-132.573126,56.765494],[-132.533525,56.755076],[-132.497525,56.749867],[-132.457925,56.782856],[-132.421924,56.810636],[-132.385924,56.82279],[-132.364324,56.817581],[-132.414724,56.772439],[-132.465125,56.746395],[-132.504725,56.72556],[-132.522725,56.715142],[-132.551526,56.637011],[-132.522725,56.617912],[-132.493925,56.610967],[-132.439924,56.604022],[-132.407524,56.609231],[-132.364324,56.624857],[-132.317523,56.633538],[-132.339123,56.598813],[-132.349923,56.543253],[-132.342723,56.524154],[-132.187922,56.423452],[-132.065521,56.378309],[-132.03672,56.3731],[-131.99352,56.357474],[-131.96832,56.326221],[-131.96112,56.296705],[-131.932319,56.258508],[-131.917919,56.239409],[-131.899919,56.227255],[-131.824318,56.213365],[-131.770318,56.197739],[-131.95752,56.16475],[-131.96832,56.08141],[-131.96112,56.055366],[-131.939519,56.010223],[-131.946719,55.965081],[-131.97552,55.956399],[-132.02232,55.956399],[-132.054721,55.942509],[-132.072721,55.862642],[-132.04752,55.822708],[-132.105121,55.805345],[-132.169922,55.800137],[-132.245522,55.723742],[-132.187922,55.605676],[-132.166322,55.584841],[-132.144721,55.567479],[-132.112321,55.555325],[-132.061921,55.543171],[-132.02592,55.527545],[-131.96112,55.498029],[-131.95392,55.501501],[-131.925119,55.53449],[-131.838718,55.635193],[-131.817118,55.662973],[-131.759518,55.814027],[-131.820718,55.831389],[-131.853119,55.834862],[-131.874719,55.838334],[-131.899919,55.855697],[-131.881919,55.864378],[-131.802718,55.881741],[-131.755918,55.880004],[-131.734317,55.885213],[-131.547115,55.951191],[-131.478715,55.975498],[-131.403114,55.994597],[-131.370714,55.961608],[-131.327513,55.965081],[-131.208712,56.01196],[-131.172712,56.032795],[-131.143911,56.050157],[-131.075511,56.093563],[-131.01431,56.105717],[-131.057511,56.057102],[-131.093511,56.022377],[-131.140311,56.003278],[-131.165512,55.985916],[-131.169112,55.942509],[-131.115111,55.900839],[-131.02511,55.834862],[-130.913509,55.741104],[-130.884709,55.708115],[-130.870309,55.60394],[-130.866709,55.577896],[-130.870309,55.546644],[-130.873909,55.510182],[-130.873909,55.412952],[-130.870309,55.336557],[-130.859509,55.310513],[-130.715507,55.307041],[-130.686707,55.338293],[-130.657907,55.345238],[-130.614706,55.294887],[-130.643506,55.287942],[-130.794708,55.286206],[-130.881109,55.289678],[-130.931509,55.284469],[-131.050311,55.204602],[-131.064711,55.187239],[-131.057511,55.128207],[-131.05375252834676,55.125],[-130.85288437448165,55.125],[-130.812708,55.142097],[-130.726307,55.12647],[-130.600306,55.215019],[-130.585906,55.228909],[-130.564306,55.267107],[-130.549905,55.282733],[-130.503105,55.315722],[-130.474305,55.32614],[-130.553506,55.223701],[-130.69105761172483,55.125],[-130.16579056037958,55.125],[-130.164702,55.12647],[-130.135901,55.171613],[-130.103501,55.206338],[-130.078301,55.225437],[-129.9919,55.280997],[-130.0459,55.379963],[-130.143101,55.541435],[-130.175502,55.75673],[-130.135901,55.808818],[-130.103501,55.820972],[-130.0279,55.895631],[-130.0135,55.909521],[-130.0135,56.024113],[-130.053101,56.076201],[-130.089101,56.117871],[-130.229502,56.090091],[-130.366304,56.12308],[-130.449104,56.20642],[-130.463505,56.235936],[-130.485105,56.239409],[-130.531905,56.246354],[-130.560706,56.249826],[-130.625506,56.258508],[-130.719107,56.326221],[-130.755108,56.352265],[-130.773108,56.366155],[-130.848708,56.374837],[-130.920709,56.381782],[-131.061111,56.40088],[-131.125911,56.423452],[-131.143911,56.433869],[-131.165512,56.446023],[-131.212312,56.468594],[-131.291513,56.499847],[-131.313113,56.510264],[-131.547115,56.598813],[-131.579516,56.604022],[-131.611916,56.602286],[-131.824318,56.598813],[-131.856719,56.718615],[-131.860319,56.79501],[-132.101521,56.866196],[-132.090721,56.893976],[-132.061921,56.959954],[-132.03672,57.013778],[-132.02592,57.036349],[-132.220322,57.067602],[-132.324723,57.088437],[-132.259923,57.168304],[-132.227522,57.204766],[-132.353524,57.354083],[-132.375124,57.374918],[-132.450725,57.435687],[-132.472325,57.451314],[-132.497525,57.470412],[-132.619926,57.583269],[-132.763928,57.720433],[-132.785528,57.751685],[-132.796328,57.770784],[-132.814328,57.798564],[-132.879129,57.859333],[-132.933129,57.909684],[-132.96553,57.933992],[-132.99433,57.951355],[-133.03753,57.982607],[-133.055531,57.996497],[-133.069931,58.012123],[-133.091531,58.039903],[-133.109531,58.085046],[-133.138331,58.135397],[-133.188732,58.18054],[-133.210332,58.196166],[-133.231932,58.211793],[-133.307533,58.256935],[-133.361534,58.281243],[-133.429934,58.359374],[-133.408334,58.401044],[-133.386734,58.411462],[-133.429934,58.458341],[-133.559536,58.527791],[-133.735937,58.64412],[-133.807938,58.710097],[-133.825938,58.725724],[-134.088741,58.809064],[-134.239942,58.854206],[-134.326343,58.925393],[-134.326343,58.970535],[-134.383944,59.053875],[-134.466745,59.128534],[-134.531545,59.132007],[-134.567546,59.130271],[-134.650347,59.185831],[-134.671947,59.206666],[-134.686347,59.243127],[-134.740347,59.250072],[-134.95275,59.279588],[-135.093151,59.42717],[-135.078751,59.444532],[-135.064351,59.458422],[-135.02835,59.46884],[-135.01755,59.498356],[-135.01395,59.540026],[-135.01395,59.567806],[-135.096751,59.62163],[-135.125551,59.62163],[-135.154352,59.626839],[-135.175952,59.637257],[-135.334353,59.725805],[-135.474755,59.802201],[-135.507155,59.793519],[-135.823958,59.70497],[-135.949959,59.668509],[-136.072361,59.658092],[-136.119161,59.651147],[-136.125,59.650378954975885],[-136.125,59.022744376412035]]],[[[-135.845558,57.319358],[-135.820358,57.175249],[-135.805958,57.168304],[-135.748357,57.164832],[-135.712357,57.163096],[-135.715957,57.140524],[-135.751958,57.111008],[-135.762758,57.105799],[-135.784358,57.10059],[-135.816758,57.088437],[-135.823958,57.079755],[-135.838358,56.991206],[-135.827558,56.985998],[-135.795158,56.985998],[-135.719557,56.992943],[-135.625956,57.006833],[-135.568356,57.081492],[-135.546755,57.131843],[-135.553956,57.227337],[-135.575556,57.249908],[-135.589956,57.263798],[-135.611556,57.279424],[-135.625956,57.288106],[-135.643956,57.295051],[-135.701557,57.317622],[-135.708757,57.322831],[-135.759158,57.331512],[-135.834758,57.326303],[-135.845558,57.319358]]],[[[-135.669157,57.345402],[-135.636756,57.31415],[-135.550356,57.256853],[-135.503555,57.242963],[-135.456755,57.248172],[-135.337953,57.244699],[-135.363154,57.192612],[-135.406354,57.164832],[-135.377554,57.098854],[-135.355954,57.071074],[-135.355954,56.958218],[-135.366754,56.831471],[-135.298353,56.786329],[-135.262353,56.784592],[-135.222752,56.801955],[-135.201152,56.8089],[-135.154352,56.824526],[-135.125551,56.827999],[-135.154352,56.741186],[-135.175952,56.718615],[-135.201152,56.685626],[-135.107551,56.595341],[-135.089551,56.593604],[-135.053551,56.607494],[-134.877149,56.685626],[-134.848348,56.68389],[-134.938349,56.600549],[-134.99955,56.584923],[-135.02835,56.574506],[-135.04635,56.531099],[-134.99595,56.466858],[-134.884349,56.34532],[-134.761948,56.222046],[-134.653947,56.166486],[-134.621546,56.249826],[-134.621546,56.385254],[-134.621546,56.472067],[-134.625146,56.538044],[-134.610746,56.576242],[-134.607146,56.602286],[-134.610746,56.682153],[-134.617946,56.729032],[-134.643146,56.796746],[-134.682747,56.897449],[-134.725947,56.98947],[-134.783548,57.119689],[-134.797948,57.166568],[-134.837548,57.249908],[-134.945549,57.364501],[-134.97435,57.385336],[-135.157952,57.475621],[-135.352354,57.548544],[-135.391954,57.553753],[-135.417154,57.552016],[-135.438754,57.545071],[-135.514355,57.505137],[-135.546755,57.413116],[-135.478355,57.364501],[-135.517955,57.350611],[-135.618756,57.364501],[-135.643956,57.364501],[-135.669157,57.345402]]],[[[-134.97435,57.409643],[-134.862749,57.329776],[-134.823148,57.303732],[-134.808748,57.296787],[-134.794348,57.30026],[-134.787148,57.343666],[-134.808748,57.361028],[-134.823148,57.390545],[-134.819548,57.400962],[-134.812348,57.414852],[-134.877149,57.427006],[-134.887949,57.428742],[-134.941949,57.421797],[-134.97435,57.409643]]],[[[-134.97075,58.366319],[-134.95275,58.298605],[-134.913149,58.204848],[-134.787148,58.105881],[-134.700747,57.826344],[-134.697147,57.779465],[-134.711547,57.741268],[-134.704347,57.71696],[-134.657547,57.602368],[-134.632346,57.579796],[-134.610746,57.562434],[-134.589146,57.538126],[-134.574746,57.505137],[-134.553146,57.50861],[-134.502745,57.520764],[-134.466745,57.532917],[-134.383944,57.548544],[-134.351544,57.541599],[-134.509945,57.487775],[-134.549545,57.487775],[-134.571146,57.487775],[-134.556746,57.472149],[-134.527945,57.442632],[-134.459545,57.390545],[-134.383944,57.380127],[-134.344343,57.387072],[-134.315543,57.331512],[-134.344343,57.32804],[-134.495545,57.371446],[-134.614346,57.225601],[-134.621546,57.111008],[-134.592746,57.036349],[-134.574746,57.027668],[-134.477545,57.029404],[-134.164342,57.189139],[-134.077941,57.269007],[-134.099541,57.296787],[-134.171542,57.380127],[-134.063541,57.354083],[-134.04194,57.329776],[-133.97354,57.30026],[-133.944739,57.303732],[-133.861939,57.366237],[-133.890739,57.423534],[-133.98794,57.45305],[-134.056341,57.465204],[-134.04914,57.491247],[-134.00234,57.487775],[-133.865539,57.458259],[-133.872739,57.489511],[-133.894339,57.505137],[-133.923139,57.532917],[-133.930339,57.562434],[-134.00594,57.64751],[-134.182342,57.814191],[-134.247142,57.857597],[-134.272343,57.873223],[-134.319143,58.031222],[-134.290343,58.076365],[-134.239942,58.065947],[-134.175142,58.01386],[-134.153542,57.991288],[-134.139141,57.954827],[-134.110341,57.876696],[-134.092341,57.848916],[-134.067141,57.829817],[-133.99514,57.769048],[-133.98074,57.734323],[-133.95914,57.683972],[-133.894339,57.654455],[-133.876339,57.673554],[-133.894339,57.756894],[-133.912339,57.812454],[-134.00234,57.935728],[-134.077941,58.008651],[-134.135541,58.052057],[-134.160742,58.12498],[-134.171542,58.159705],[-134.200342,58.163177],[-134.297543,58.15276],[-134.333543,58.144079],[-134.355144,58.145815],[-134.398344,58.157969],[-134.452345,58.177067],[-134.556746,58.185749],[-134.599946,58.171859],[-134.635946,58.161441],[-134.668347,58.159705],[-134.693547,58.168386],[-134.704347,58.215265],[-134.797948,58.309023],[-134.949149,58.406253],[-134.97075,58.366319]]],[[[-134.682747,58.300341],[-134.653947,58.270825],[-134.639546,58.256935],[-134.628746,58.248254],[-134.607146,58.237836],[-134.581946,58.225683],[-134.556746,58.220474],[-134.509945,58.217001],[-134.495545,58.220474],[-134.477545,58.223946],[-134.452345,58.223946],[-134.437944,58.22221],[-134.427144,58.220474],[-134.365944,58.206584],[-134.275943,58.190957],[-134.261543,58.197903],[-134.275943,58.211793],[-134.455945,58.312495],[-134.473945,58.324649],[-134.506345,58.336803],[-134.517145,58.338539],[-134.556746,58.340275],[-134.567546,58.340275],[-134.585546,58.338539],[-134.653947,58.315968],[-134.671947,58.312495],[-134.682747,58.300341]]],[[[-134.409144,56.829735],[-134.394744,56.722087],[-134.391144,56.71167],[-134.304743,56.558879],[-134.175142,56.536308],[-134.088741,56.538044],[-134.070741,56.555407],[-134.063541,56.548462],[-134.052741,56.503319],[-134.03114,56.418243],[-134.03474,56.376573],[-134.04914,56.362683],[-134.056341,56.3731],[-134.063541,56.383518],[-134.085141,56.397408],[-134.175142,56.435605],[-134.232742,56.419979],[-134.283143,56.348793],[-134.250743,56.315804],[-134.225542,56.307123],[-134.203942,56.298441],[-134.221942,56.277606],[-134.257943,56.263716],[-134.265143,56.253299],[-134.221942,56.06752],[-134.160742,56.022377],[-134.124741,55.99807],[-134.110341,55.996333],[-134.103141,56.01196],[-134.088741,56.083146],[-134.095941,56.131761],[-134.067141,56.301914],[-134.056341,56.312331],[-134.03834,56.305386],[-134.02754,56.274134],[-134.01314,56.190794],[-134.03834,56.114399],[-134.03474,56.103981],[-134.01674,56.0953],[-133.97714,56.083146],[-133.95914,56.083146],[-133.944739,56.088355],[-133.915939,56.149124],[-133.887139,56.22031],[-133.890739,56.2342],[-133.897939,56.253299],[-133.901539,56.265453],[-133.912339,56.274134],[-133.923139,56.279343],[-133.944739,56.281079],[-133.95554,56.27587],[-133.97354,56.265453],[-133.98434,56.268925],[-133.97714,56.288024],[-133.96994,56.30365],[-133.96634,56.31754],[-133.97354,56.343584],[-133.96994,56.35921],[-133.948339,56.350529],[-133.915939,56.319276],[-133.894339,56.300178],[-133.861939,56.277606],[-133.851139,56.281079],[-133.847538,56.291496],[-133.840338,56.34532],[-133.851139,56.352265],[-133.883539,56.437342],[-133.876339,56.524154],[-133.915939,56.602286],[-133.919539,56.610967],[-133.912339,56.616176],[-133.890739,56.614439],[-133.833138,56.609231],[-133.818738,56.607494],[-133.793538,56.593604],[-133.786338,56.579714],[-133.782738,56.565824],[-133.771938,56.557143],[-133.764738,56.555407],[-133.750338,56.555407],[-133.739537,56.560616],[-133.692737,56.597077],[-133.725137,56.652637],[-133.717937,56.768966],[-133.732337,56.775911],[-133.829538,56.796746],[-133.865539,56.789801],[-133.854739,56.774175],[-133.854739,56.760285],[-133.854739,56.749867],[-133.854739,56.737713],[-133.861939,56.723823],[-133.872739,56.709933],[-133.915939,56.666527],[-133.944739,56.645692],[-133.95914,56.640483],[-133.97354,56.635275],[-134.00594,56.64222],[-134.02394,56.649165],[-134.01314,56.650901],[-133.98074,56.650901],[-133.96634,56.657846],[-133.923139,56.715142],[-133.905139,56.749867],[-133.926739,56.801955],[-133.99154,56.873141],[-134.00954,56.880086],[-134.03474,56.888768],[-134.128341,56.913075],[-134.193142,56.930438],[-134.247142,56.939119],[-134.261543,56.939119],[-134.214742,56.900921],[-134.196742,56.895713],[-134.171542,56.893976],[-134.146341,56.888768],[-134.135541,56.883559],[-134.106741,56.845361],[-134.121141,56.841889],[-134.157142,56.848834],[-134.178742,56.859251],[-134.221942,56.883559],[-134.243542,56.893976],[-134.265143,56.899185],[-134.275943,56.899185],[-134.297543,56.900921],[-134.319143,56.895713],[-134.398344,56.854042],[-134.405544,56.847097],[-134.409144,56.829735]]],[[[-134.340743,55.912993],[-134.315543,55.852224],[-134.293943,55.831389],[-134.250743,55.817499],[-134.236342,55.836598],[-134.221942,55.850488],[-134.207542,55.859169],[-134.175142,55.874796],[-134.135541,55.893894],[-134.121141,55.899103],[-134.113941,55.899103],[-134.099541,55.914729],[-134.117541,55.921674],[-134.322743,55.923411],[-134.340743,55.912993]]],[[[-134.01674,57.015514],[-133.887139,56.951273],[-133.739537,56.895713],[-133.750338,56.874877],[-133.807938,56.876614],[-133.833138,56.881822],[-133.883539,56.897449],[-133.869139,56.869669],[-133.739537,56.807164],[-133.699937,56.829735],[-133.681937,56.79501],[-133.692737,56.749867],[-133.707137,56.68389],[-133.692737,56.650901],[-133.667537,56.638747],[-133.635136,56.597077],[-133.663937,56.522418],[-133.656737,56.463385],[-133.638736,56.439078],[-133.573936,56.433869],[-133.505535,56.435605],[-133.465935,56.452968],[-133.426334,56.473803],[-133.303933,56.472067],[-133.188732,56.451232],[-133.156332,56.45644],[-133.131131,56.47033],[-133.084331,56.532836],[-133.087931,56.553671],[-133.095131,56.614439],[-133.113131,56.621384],[-133.185132,56.637011],[-133.303933,56.730768],[-133.332733,56.762021],[-133.347133,56.838416],[-133.242732,56.805427],[-133.217532,56.78112],[-133.203132,56.751603],[-133.188732,56.716878],[-133.127531,56.666527],[-133.00873,56.600549],[-132.96913,56.609231],[-132.933129,56.630066],[-132.925929,56.659582],[-132.943929,56.742922],[-132.925929,56.852306],[-132.97273,56.925229],[-133.051931,56.977316],[-133.080731,56.992943],[-133.167132,57.001624],[-133.296733,56.998151],[-133.318333,56.994679],[-133.437134,57.013778],[-133.498335,57.027668],[-133.627936,57.050239],[-133.761138,57.069338],[-133.843938,57.081492],[-133.908739,57.079755],[-134.00954,57.053712],[-134.01674,57.015514]]],[[[-133.793538,55.932092],[-133.786338,55.918202],[-133.699937,55.895631],[-133.638736,55.933828],[-133.609936,55.958136],[-133.458735,56.003278],[-133.361534,56.010223],[-133.314733,56.08141],[-133.285933,56.128289],[-133.278733,56.138706],[-133.303933,56.149124],[-133.314733,56.149124],[-133.390334,56.154332],[-133.401134,56.154332],[-133.570336,56.126552],[-133.609936,56.105717],[-133.681937,56.064047],[-133.775538,55.975498],[-133.786338,55.963344],[-133.793538,55.947718],[-133.793538,55.932092]]],[[[-133.757538,55.487611],[-133.746737,55.46504],[-133.728737,55.468512],[-133.714337,55.46504],[-133.667537,55.45115],[-133.645936,55.440732],[-133.635136,55.444205],[-133.577536,55.501501],[-133.577536,55.527545],[-133.584736,55.536226],[-133.692737,55.550116],[-133.703537,55.551852],[-133.717937,55.54838],[-133.725137,55.541435],[-133.757538,55.487611]]],[[[-133.685537,55.308777],[-133.653137,55.267107],[-133.645936,55.258426],[-133.606336,55.232382],[-133.595536,55.235854],[-133.559536,55.313986],[-133.501935,55.348711],[-133.444334,55.371282],[-133.447934,55.400798],[-133.447934,55.40948],[-133.563136,55.419897],[-133.573936,55.421633],[-133.588336,55.416425],[-133.638736,55.383436],[-133.649536,55.371282],[-133.685537,55.308777]]],[[[-133.678337,55.775829],[-133.645936,55.744577],[-133.635136,55.735895],[-133.617136,55.725478],[-133.602736,55.718533],[-133.591936,55.711588],[-133.570336,55.702906],[-133.534335,55.692489],[-133.523535,55.690753],[-133.505535,55.692489],[-133.483935,55.699434],[-133.318333,55.765412],[-133.300333,55.791455],[-133.303933,55.796664],[-133.325533,55.801873],[-133.541535,55.827917],[-133.552336,55.829653],[-133.617136,55.827917],[-133.635136,55.820972],[-133.674737,55.786247],[-133.678337,55.775829]]],[[[-133.631536,56.274134],[-133.609936,56.204684],[-133.563136,56.17864],[-133.419134,56.16475],[-133.365134,56.171695],[-133.321933,56.169959],[-133.264333,56.154332],[-133.257133,55.947718],[-133.239132,55.902576],[-133.228332,55.886949],[-133.177932,55.860906],[-133.145531,55.880004],[-133.141931,55.815763],[-133.242732,55.744577],[-133.264333,55.741104],[-133.372334,55.722005],[-133.383134,55.640401],[-133.365134,55.616094],[-133.260733,55.574424],[-133.199532,55.577896],[-133.120331,55.60394],[-133.059131,55.623039],[-132.96553,55.638665],[-132.922329,55.624775],[-132.96193,55.623039],[-132.98353,55.619566],[-133.00513,55.609149],[-133.051931,55.577896],[-133.116731,55.515391],[-133.127531,55.491084],[-133.113131,55.46504],[-133.03033,55.397326],[-133.00153,55.379963],[-132.98713,55.373018],[-132.96553,55.373018],[-132.943929,55.369546],[-132.889929,55.359128],[-132.868329,55.35392],[-132.900729,55.345238],[-132.96913,55.350447],[-133.04113,55.362601],[-133.116731,55.378227],[-133.210332,55.3817],[-133.260733,55.336557],[-133.213932,55.277524],[-133.02673,55.267107],[-132.96913,55.270579],[-132.911529,55.275788],[-132.98713,55.228909],[-133.02673,55.215019],[-133.00153,55.202866],[-132.943929,55.208074],[-132.807128,55.248008],[-132.803528,55.209811],[-132.778328,55.18203],[-132.695527,55.142097],[-132.655927,55.138624],[-132.623526,55.147305],[-132.609126,55.169877],[-132.630726,55.188975],[-132.648726,55.206338],[-132.652327,55.244536],[-132.53149926318025,55.125],[-132.075,55.125],[-131.98947204256544,55.125],[-131.96832,55.178558],[-131.96832,55.220228],[-131.98632,55.260162],[-132.01512,55.268843],[-132.058321,55.235854],[-132.069121,55.213283],[-132.101521,55.197657],[-132.234722,55.192448],[-132.249122,55.211547],[-132.234722,55.249744],[-132.202322,55.248008],[-132.169922,55.242799],[-132.133921,55.239327],[-132.087121,55.267107],[-132.281523,55.458095],[-132.501125,55.511919],[-132.562326,55.567479],[-132.544325,55.621303],[-132.511925,55.614358],[-132.475925,55.591786],[-132.454325,55.558797],[-132.432724,55.544907],[-132.407524,55.536226],[-132.378724,55.531017],[-132.216722,55.475457],[-132.159122,55.444205],[-132.144721,55.452886],[-132.141121,55.475457],[-132.166322,55.501501],[-132.180722,55.511919],[-132.205922,55.527545],[-132.227522,55.537962],[-132.245522,55.541435],[-132.403924,55.657764],[-132.443524,55.68728],[-132.465125,55.775829],[-132.497525,55.820972],[-132.511925,55.834862],[-132.623526,55.919938],[-132.821528,56.029322],[-132.900729,56.048421],[-132.947529,56.058838],[-133.04473,56.048421],[-133.073531,56.051893],[-133.123931,56.117871],[-133.087931,56.105717],[-133.062731,56.117871],[-133.02313,56.171695],[-133.055531,56.237673],[-133.181532,56.327958],[-133.249932,56.33143],[-133.347133,56.329694],[-133.487535,56.336639],[-133.584736,56.350529],[-133.609936,56.348793],[-133.631536,56.274134]]],[[[-133.599136,55.449413],[-133.577536,55.438996],[-133.537935,55.430315],[-133.516335,55.426842],[-133.505535,55.426842],[-133.458735,55.432051],[-133.444334,55.435523],[-133.429934,55.438996],[-133.422734,55.447677],[-133.415534,55.463304],[-133.419134,55.477194],[-133.422734,55.485875],[-133.476735,55.515391],[-133.498335,55.5206],[-133.512735,55.518864],[-133.599136,55.449413]]],[[[-133.451535,55.251481],[-133.447934,55.234118],[-133.440734,55.221964],[-133.437134,55.211547],[-133.426334,55.202866],[-133.415534,55.199393],[-133.321933,55.194184],[-133.249932,55.209811],[-133.242732,55.215019],[-133.224732,55.249744],[-133.231932,55.265371],[-133.296733,55.331348],[-133.311133,55.334821],[-133.325533,55.334821],[-133.429934,55.310513],[-133.437134,55.305304],[-133.451535,55.251481]]],[[[-133.433534,55.524072],[-133.347133,55.447677],[-133.289533,55.475457],[-133.271533,55.487611],[-133.267933,55.496292],[-133.271533,55.527545],[-133.278733,55.536226],[-133.303933,55.553589],[-133.339933,55.557061],[-133.375934,55.557061],[-133.393934,55.553589],[-133.419134,55.544907],[-133.433534,55.524072]]],[[[-133.332733,55.873059],[-133.311133,55.820972],[-133.260733,55.777565],[-133.246332,55.775829],[-133.231932,55.789719],[-133.213932,55.82618],[-133.210332,55.84007],[-133.210332,55.853961],[-133.213932,55.862642],[-133.267933,55.899103],[-133.285933,55.900839],[-133.332733,55.873059]]],[[[-133.20951201299584,55.125],[-132.9928055337653,55.125],[-133.069931,55.199393],[-133.102331,55.246272],[-133.113131,55.251481],[-133.188732,55.234118],[-133.195932,55.227173],[-133.20951201299584,55.125]]],[[[-133.055531,56.348793],[-133.04473,56.33143],[-132.911529,56.260244],[-132.861129,56.237673],[-132.846728,56.232464],[-132.835928,56.230727],[-132.817928,56.2342],[-132.760328,56.246354],[-132.699127,56.258508],[-132.677527,56.265453],[-132.648726,56.27587],[-132.641526,56.282815],[-132.634326,56.298441],[-132.612726,56.393935],[-132.630726,56.425188],[-132.637926,56.435605],[-132.655927,56.444287],[-132.684727,56.452968],[-132.702727,56.45644],[-132.720727,56.458177],[-132.731527,56.458177],[-132.886329,56.454704],[-132.922329,56.452968],[-132.940329,56.447759],[-132.99073,56.421715],[-133.055531,56.348793]]],[[[-132.95473,56.593604],[-132.943929,56.515473],[-132.929529,56.505056],[-132.904329,56.498111],[-132.893529,56.498111],[-132.792728,56.494638],[-132.774728,56.494638],[-132.684727,56.520682],[-132.576726,56.553671],[-132.562326,56.558879],[-132.537125,56.571033],[-132.529925,56.581451],[-132.529925,56.591868],[-132.537125,56.600549],[-132.551526,56.605758],[-132.612726,56.645692],[-132.666727,56.678681],[-132.731527,56.72556],[-132.803528,56.786329],[-132.871929,56.796746],[-132.918729,56.748131],[-132.922329,56.702988],[-132.897129,56.65611],[-132.882729,56.635275],[-132.897129,56.621384],[-132.922329,56.619648],[-132.95473,56.593604]]],[[[-132.86524267896922,55.125],[-132.71901530607838,55.125],[-132.731527,55.14036],[-132.814328,55.185503],[-132.825128,55.192448],[-132.853929,55.159459],[-132.864729,55.14036],[-132.86524267896922,55.125]]],[[[-132.717127,56.15086],[-132.713527,56.135234],[-132.695527,56.107454],[-132.688327,56.098772],[-132.634326,56.048421],[-132.623526,56.048421],[-132.609126,56.062311],[-132.609126,56.074465],[-132.598326,56.08141],[-132.447124,56.05363],[-132.418324,56.027586],[-132.411124,55.996333],[-132.421924,55.968553],[-132.425524,55.956399],[-132.317523,55.912993],[-132.274323,55.916466],[-132.144721,55.925147],[-132.130321,55.926883],[-132.119521,55.935564],[-132.115921,55.947718],[-132.137521,56.06752],[-132.094321,56.100508],[-132.108721,56.116135],[-132.180722,56.168222],[-132.213122,56.17864],[-132.396724,56.222046],[-132.371524,56.268925],[-132.378724,56.312331],[-132.385924,56.33143],[-132.400324,56.347056],[-132.418324,56.350529],[-132.436324,56.350529],[-132.493925,56.343584],[-132.515525,56.338375],[-132.529925,56.33143],[-132.565926,56.28976],[-132.573126,56.277606],[-132.684727,56.225519],[-132.695527,56.218574],[-132.717127,56.15086]]],[[[-132.375124,56.475539],[-132.367924,56.454704],[-132.349923,56.437342],[-132.328323,56.402617],[-132.328323,56.326221],[-132.328323,56.315804],[-132.331923,56.305386],[-132.346323,56.281079],[-132.346323,56.270661],[-132.331923,56.256771],[-132.313923,56.239409],[-132.303123,56.232464],[-132.274323,56.213365],[-132.252723,56.202947],[-132.223922,56.194266],[-132.213122,56.19253],[-132.202322,56.190794],[-132.191522,56.189057],[-132.169922,56.185585],[-132.108721,56.166486],[-132.097921,56.161277],[-132.054721,56.110926],[-132.01152,56.133497],[-131.946719,56.232464],[-131.98992,56.319276],[-131.99352,56.327958],[-132.00792,56.338375],[-132.04392,56.355738],[-132.072721,56.35921],[-132.090721,56.352265],[-132.108721,56.343584],[-132.126721,56.343584],[-132.159122,56.352265],[-132.213122,56.388727],[-132.216722,56.399144],[-132.223922,56.421715],[-132.231122,56.439078],[-132.256323,56.452968],[-132.353524,56.489429],[-132.371524,56.487693],[-132.375124,56.475539]]],[[[-131.856719,55.359128],[-131.849518,55.296623],[-131.838718,55.267107],[-131.824318,55.211547],[-131.817118,55.201129],[-131.813518,55.192448],[-131.809918,55.18203],[-131.737917,55.135152],[-131.723517,55.136888],[-131.615516,55.275788],[-131.622716,55.293151],[-131.629916,55.300096],[-131.647916,55.312249],[-131.676717,55.331348],[-131.748717,55.369546],[-131.820718,55.412952],[-131.827918,55.419897],[-131.842318,55.419897],[-131.853119,55.411216],[-131.856719,55.359128]]],[[[-131.820718,55.452886],[-131.712717,55.36781],[-131.687517,55.35392],[-131.665917,55.345238],[-131.543515,55.291414],[-131.518315,55.294887],[-131.464315,55.369546],[-131.471515,55.393853],[-131.496715,55.421633],[-131.514715,55.480666],[-131.493115,55.504974],[-131.428314,55.5206],[-131.464315,55.471985],[-131.471515,55.447677],[-131.446314,55.407743],[-131.421114,55.385172],[-131.421114,55.364337],[-131.457115,55.32614],[-131.399514,55.348711],[-131.327513,55.425106],[-131.316713,55.458095],[-131.327513,55.508446],[-131.352714,55.555325],[-131.359914,55.574424],[-131.367114,55.624775],[-131.349113,55.643874],[-131.280713,55.489347],[-131.273513,55.433787],[-131.291513,55.411216],[-131.367114,55.338293],[-131.428314,55.313986],[-131.457115,55.300096],[-131.453515,55.279261],[-131.417514,55.261898],[-131.399514,55.256689],[-131.388714,55.254953],[-131.345513,55.256689],[-131.291513,55.275788],[-131.255513,55.319194],[-131.273513,55.352183],[-131.269913,55.383436],[-131.219512,55.402535],[-131.194312,55.393853],[-131.190712,55.360865],[-131.219512,55.300096],[-131.233912,55.282733],[-131.255513,55.265371],[-131.284313,55.246272],[-131.280713,55.227173],[-131.248312,55.201129],[-131.205112,55.187239],[-131.140311,55.199393],[-131.136711,55.228909],[-131.100711,55.234118],[-131.075511,55.246272],[-131.057511,55.258426],[-130.96751,55.388645],[-130.938709,55.56227],[-130.935109,55.636929],[-131.057511,55.807082],[-131.068311,55.820972],[-131.143911,55.886949],[-131.208712,55.937301],[-131.230312,55.954663],[-131.259113,55.959872],[-131.291513,55.958136],[-131.439114,55.930356],[-131.478715,55.919938],[-131.529115,55.900839],[-131.539915,55.852224],[-131.683917,55.829653],[-131.683917,55.793192],[-131.622716,55.781038],[-131.629916,55.730687],[-131.694717,55.671654],[-131.705517,55.624775],[-131.691117,55.609149],[-131.701917,55.525809],[-131.820718,55.452886]]],[[[-131.586716,55.228909],[-131.583116,55.215019],[-131.565116,55.171613],[-131.57269629113824,55.125],[-131.35087892785285,55.125],[-131.374314,55.197657],[-131.388714,55.211547],[-131.406714,55.208074],[-131.421114,55.209811],[-131.453515,55.221964],[-131.464315,55.232382],[-131.467915,55.235854],[-131.471515,55.248008],[-131.521915,55.263634],[-131.547115,55.267107],[-131.583116,55.254953],[-131.586716,55.228909]]]]}} From 9160a2c89ded7a3babb0f145907c1f192e54cff3 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Wed, 6 Dec 2017 22:51:05 +1100 Subject: [PATCH 28/42] Clone overlapping segments --- src/connect_edges.js | 58 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/src/connect_edges.js b/src/connect_edges.js index 177a80d..865c660 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -18,7 +18,6 @@ function orderEvents(sortedEvents) { resultEvents.push(event); } } - // Due to overlapping edges the resultEvents array can be not wholly sorted var sorted = false; while (!sorted) { @@ -33,8 +32,16 @@ function orderEvents(sortedEvents) { } } } - for (i = 0, len = resultEvents.length; i < len; i++) { + if (i < len - 1) { + if (resultEvents[i].point[0] !== resultEvents[i + 1].point[0] && + resultEvents[i].point[1] !== resultEvents[i + 1].point[1] && + resultEvents[i].point[1] === resultEvents[i + 1].point[1]) { + var currentCloned = deepClone(resultEvents[i + 1]); + resultEvents.splice(i + 1, 0, currentCloned); + len = resultEvents.length; + } + } resultEvents[i].pos = i; } @@ -51,6 +58,44 @@ function orderEvents(sortedEvents) { } +function deepClone(obj) { + var visitedNodes = []; + var clonedCopy = []; + function clone(item) { + if (typeof item === "object" && !Array.isArray(item)) { + if (visitedNodes.indexOf(item) === -1) { + visitedNodes.push(item); + var cloneObject = {}; + clonedCopy.push(cloneObject); + for (var i in item) { + if (item.hasOwnProperty(i)) { + cloneObject[i] = clone(item[i]); + } + } + return cloneObject; + } else { + return clonedCopy[visitedNodes.indexOf(item)]; + } + } + else if (typeof item === "object" && Array.isArray(item)) { + if (visitedNodes.indexOf(item) === -1) { + var cloneArray = []; + visitedNodes.push(item); + clonedCopy.push(cloneArray); + for (var j = 0; j < item.length; j++) { + cloneArray.push(clone(item[j])); + } + return cloneArray; + } else { + return clonedCopy[visitedNodes.indexOf(item)]; + } + } + + return item; // not object, not array, therefore primitive + } + return clone(obj); +} + /** * @param {Number} pos * @param {Array.} resultEvents @@ -63,7 +108,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { if (newPos > length - 1) return pos - 1; var p = resultEvents[pos].point; var p1 = resultEvents[newPos].point; - // if (newPos < length && // p1[0] !== p[0] || p1[1] !== p[1] && // !processed[newPos]) return newPos; @@ -106,6 +150,7 @@ module.exports = function connectEdges(sortedEvents, operation) { var event; for (i = 0, len = resultEvents.length; i < len; i++) { + // console.log('i is ' + i) if (processed[i]) continue; var contour = [[]]; @@ -128,6 +173,8 @@ module.exports = function connectEdges(sortedEvents, operation) { contour[0].push(initial); while (pos >= i) { + // console.log('pos is ' + pos) + event = resultEvents[pos]; processed[pos] = true; @@ -138,12 +185,13 @@ module.exports = function connectEdges(sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } - //new L.Marker(event.point.slice().reverse()).addTo(map); + // new L.Marker(event.point.slice().reverse()).addTo(map); pos = event.pos; processed[pos] = true; // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); - + // new L.circleMarker(resultEvents[pos].point.slice().reverse()).addTo(map); + // console.log(resultEvents[pos].point) contour[0].push(resultEvents[pos].point); pos = nextPos(pos, resultEvents, processed, i); } From fdfa30afbd03151d8dbc13e47ef4161199a38891 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Mon, 11 Dec 2017 23:09:17 +1100 Subject: [PATCH 29/42] And again --- src/connect_edges.js | 66 ++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/connect_edges.js b/src/connect_edges.js index 865c660..0d20077 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -32,11 +32,12 @@ function orderEvents(sortedEvents) { } } } + for (i = 0, len = resultEvents.length; i < len; i++) { if (i < len - 1) { if (resultEvents[i].point[0] !== resultEvents[i + 1].point[0] && resultEvents[i].point[1] !== resultEvents[i + 1].point[1] && - resultEvents[i].point[1] === resultEvents[i + 1].point[1]) { + resultEvents[i].point[1] === resultEvents[i].otherEvent.point[1]) { var currentCloned = deepClone(resultEvents[i + 1]); resultEvents.splice(i + 1, 0, currentCloned); len = resultEvents.length; @@ -59,41 +60,40 @@ function orderEvents(sortedEvents) { function deepClone(obj) { - var visitedNodes = []; - var clonedCopy = []; - function clone(item) { - if (typeof item === "object" && !Array.isArray(item)) { - if (visitedNodes.indexOf(item) === -1) { - visitedNodes.push(item); - var cloneObject = {}; - clonedCopy.push(cloneObject); - for (var i in item) { - if (item.hasOwnProperty(i)) { - cloneObject[i] = clone(item[i]); - } - } - return cloneObject; - } else { - return clonedCopy[visitedNodes.indexOf(item)]; - } + var visitedNodes = []; + var clonedCopy = []; + function clone(item) { + if (typeof item === 'object' && !Array.isArray(item)) { + if (visitedNodes.indexOf(item) === -1) { + visitedNodes.push(item); + var cloneObject = {}; + clonedCopy.push(cloneObject); + for (var i in item) { + if (item.hasOwnProperty(i)) { + cloneObject[i] = clone(item[i]); + } } - else if (typeof item === "object" && Array.isArray(item)) { - if (visitedNodes.indexOf(item) === -1) { - var cloneArray = []; - visitedNodes.push(item); - clonedCopy.push(cloneArray); - for (var j = 0; j < item.length; j++) { - cloneArray.push(clone(item[j])); - } - return cloneArray; - } else { - return clonedCopy[visitedNodes.indexOf(item)]; - } + return cloneObject; + } else { + return clonedCopy[visitedNodes.indexOf(item)]; + } + } else if (typeof item === 'object' && Array.isArray(item)) { + if (visitedNodes.indexOf(item) === -1) { + var cloneArray = []; + visitedNodes.push(item); + clonedCopy.push(cloneArray); + for (var j = 0; j < item.length; j++) { + cloneArray.push(clone(item[j])); } - - return item; // not object, not array, therefore primitive + return cloneArray; + } else { + return clonedCopy[visitedNodes.indexOf(item)]; + } } - return clone(obj); + + return item; // not object, not array, therefore primitive + } + return clone(obj); } /** From 66bbb760882b8f2ee7a5f091ca6167a873e39d38 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Thu, 14 Dec 2017 03:24:01 +0100 Subject: [PATCH 30/42] fixed --- demo/js/bundle.js | 64 +++++++++++++++++++++++++++++++----- src/possible_intersection.js | 4 +-- 2 files changed, 58 insertions(+), 10 deletions(-) diff --git a/demo/js/bundle.js b/demo/js/bundle.js index 3f65f8b..6eb9464 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -2899,7 +2899,6 @@ function orderEvents(sortedEvents) { resultEvents.push(event); } } - // Due to overlapping edges the resultEvents array can be not wholly sorted var sorted = false; while (!sorted) { @@ -2914,8 +2913,16 @@ function orderEvents(sortedEvents) { } } } - for (i = 0, len = resultEvents.length; i < len; i++) { + if (i < len - 1) { + if (resultEvents[i].point[0] !== resultEvents[i + 1].point[0] && + resultEvents[i].point[1] !== resultEvents[i + 1].point[1] && + resultEvents[i].point[1] === resultEvents[i + 1].point[1]) { + var currentCloned = deepClone(resultEvents[i + 1]); + resultEvents.splice(i + 1, 0, currentCloned); + len = resultEvents.length; + } + } resultEvents[i].pos = i; } @@ -2932,6 +2939,44 @@ function orderEvents(sortedEvents) { } +function deepClone(obj) { + var visitedNodes = []; + var clonedCopy = []; + function clone(item) { + if (typeof item === "object" && !Array.isArray(item)) { + if (visitedNodes.indexOf(item) === -1) { + visitedNodes.push(item); + var cloneObject = {}; + clonedCopy.push(cloneObject); + for (var i in item) { + if (item.hasOwnProperty(i)) { + cloneObject[i] = clone(item[i]); + } + } + return cloneObject; + } else { + return clonedCopy[visitedNodes.indexOf(item)]; + } + } + else if (typeof item === "object" && Array.isArray(item)) { + if (visitedNodes.indexOf(item) === -1) { + var cloneArray = []; + visitedNodes.push(item); + clonedCopy.push(cloneArray); + for (var j = 0; j < item.length; j++) { + cloneArray.push(clone(item[j])); + } + return cloneArray; + } else { + return clonedCopy[visitedNodes.indexOf(item)]; + } + } + + return item; // not object, not array, therefore primitive + } + return clone(obj); +} + /** * @param {Number} pos * @param {Array.} resultEvents @@ -2944,7 +2989,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { if (newPos > length - 1) return pos - 1; var p = resultEvents[pos].point; var p1 = resultEvents[newPos].point; - // if (newPos < length && // p1[0] !== p[0] || p1[1] !== p[1] && // !processed[newPos]) return newPos; @@ -2987,6 +3031,7 @@ module.exports = function connectEdges(sortedEvents, operation) { var event; for (i = 0, len = resultEvents.length; i < len; i++) { + // console.log('i is ' + i) if (processed[i]) continue; var contour = [[]]; @@ -3009,6 +3054,8 @@ module.exports = function connectEdges(sortedEvents, operation) { contour[0].push(initial); while (pos >= i) { + // console.log('pos is ' + pos) + event = resultEvents[pos]; processed[pos] = true; @@ -3019,12 +3066,13 @@ module.exports = function connectEdges(sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } - //new L.Marker(event.point.slice().reverse()).addTo(map); + // new L.Marker(event.point.slice().reverse()).addTo(map); pos = event.pos; processed[pos] = true; // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); - + // new L.circleMarker(resultEvents[pos].point.slice().reverse()).addTo(map); + // console.log(resultEvents[pos].point) contour[0].push(resultEvents[pos].point); pos = nextPos(pos, resultEvents, processed, i); } @@ -3426,8 +3474,8 @@ module.exports = function possibleIntersection(se1, se2, queue) { if ((leftCoincide && rightCoincide) || leftCoincide) { // both line segments are equal or share the left endpoint - se1.type = edgeType.NON_CONTRIBUTING; - se2.type = (se1.inOut === se2.inOut) ? + se2.type = edgeType.NON_CONTRIBUTING; + se1.type = (se2.inOut === se1.inOut) ? edgeType.SAME_TRANSITION : edgeType.DIFFERENT_TRANSITION; @@ -3860,4 +3908,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvbGliL2lzLW9iamVjdC5qcyIsIm5vZGVfbW9kdWxlcy9zdXBlcmFnZW50L2xpYi9yZXF1ZXN0LWJhc2UuanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvcmVxdWVzdC5qcyIsIm5vZGVfbW9kdWxlcy90aW55cXVldWUvaW5kZXguanMiLCJzcmMvY29tcGFyZV9ldmVudHMuanMiLCJzcmMvY29tcGFyZV9zZWdtZW50cy5qcyIsInNyYy9jb21wdXRlX2ZpZWxkcy5qcyIsInNyYy9jb25uZWN0X2VkZ2VzLmpzIiwic3JjL2RpdmlkZV9zZWdtZW50LmpzIiwic3JjL2VkZ2VfdHlwZS5qcyIsInNyYy9lcXVhbHMuanMiLCJzcmMvZmlsbF9xdWV1ZS5qcyIsInNyYy9pbmRleC5q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mUubWluTm9kZSgpO1xuXG4gICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChwcmV2KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgZXZlbnQsIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgdmFyIHByZXZwcmV2ID0gcHJldjtcbiAgICAgICAgICBpZiAocHJldnByZXYgIT09IGJlZ2luKSBwcmV2cHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXZwcmV2KTtcbiAgICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICBwcmV2cHJldiA9IG51bGw7XG5cbiAgICAgICAgICBwcmV2cHJldkV2ZW50ID0gcHJldnByZXYgPyBwcmV2cHJldi5rZXkgOiBudWxsO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMocHJldkV2ZW50LCBwcmV2cHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsICAgICBwcmV2RXZlbnQsICAgICBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGV2ZW50ID0gZXZlbnQub3RoZXJFdmVudDtcbiAgICAgIG5leHQgPSBwcmV2ID0gc3dlZXBMaW5lLmZpbmQoZXZlbnQpO1xuXG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgIGlmIChwcmV2ICYmIG5leHQpIHtcblxuICAgICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgICAgZWxzZSAgICAgICAgICAgICAgICBwcmV2ID0gbnVsbDtcblxuICAgICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG4gICAgICAgIHN3ZWVwTGluZS5yZW1vdmUoZXZlbnQpO1xuXG4gICAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgICAgaWYgKG5leHQgJiYgcHJldikge1xuICAgICAgICAgIC8vIGlmICh0eXBlb2YgcHJldiAhPT0gJ3VuZGVmaW5lZCcgJiYgdHlwZW9mIG5leHQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgcG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIG5leHQua2V5LCBldmVudFF1ZXVlKTtcbiAgICAgICAgICAvLyB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cbiAgcmV0dXJuIHNvcnRlZEV2ZW50cztcbn07XG5cblxuLyogZXNsaW50LWRpc2FibGUgbm8tdW51c2VkLXZhcnMsIG5vLWRlYnVnZ2VyLCBuby11bmRlZiAqL1x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Vhbn1cbiAgICovXG4gIGlzQmVsb3c6IGZ1bmN0aW9uIChwKSB7XG4gICAgdmFyIHAwID0gdGhpcy5wb2ludCwgcDEgPSB0aGlzLm90aGVyRXZlbnQucG9pbnQ7XG4gICAgcmV0dXJuIHRoaXMubGVmdCA/XG4gICAgICAocDBbMF0gLSBwWzBdKSAqIChwMVsxXSAtIHBbMV0pIC0gKHAxWzBdIC0gcFswXSkgKiAocDBbMV0gLSBwWzFdKSA+IDAgOlxuICAgICAgLy8gc2lnbmVkQXJlYSh0aGlzLnBvaW50LCB0aGlzLm90aGVyRXZlbnQucG9pbnQsIHApID4gMCA6XG4gICAgICAocDFbMF0gLSBwWzBdKSAqIChwMFsxXSAtIHBbMV0pIC0gKHAwWzBdIC0gcFswXSkgKiAocDFbMV0gLSBwWzFdKSA+IDA7XG4gICAgICAvL3NpZ25lZEFyZWEodGhpcy5vdGhlckV2ZW50LnBvaW50LCB0aGlzLnBvaW50LCBwKSA+IDA7XG4gIH0sXG5cblxuICAvKipcbiAgICogQHBhcmFtICB7QXJyYXkuPE51bWJlcj59ICBwXG4gICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAqL1xuICBpc0Fib3ZlOiBmdW5jdGlvbiAocCkge1xuICAgIHJldHVybiAhdGhpcy5pc0JlbG93KHApO1xuICB9LFxuXG5cbiAgLyoqXG4gICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAqL1xuICBpc1ZlcnRpY2FsOiBmdW5jdGlvbiAoKSB7XG4gICAgcmV0dXJuIHRoaXMucG9pbnRbMF0gPT09IHRoaXMub3RoZXJFdmVudC5wb2ludFswXTtcbiAgfVxufTtcblxubW9kdWxlLmV4cG9ydHMgPSBTd2VlcEV2ZW50O1xuIl19 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2x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YXIgaSBpbiBpdGVtKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpdGVtLmhhc093blByb3BlcnR5KGkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbG9uZU9iamVjdFtpXSA9IGNsb25lKGl0ZW1baV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBjbG9uZU9iamVjdDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNsb25lZENvcHlbdmlzaXRlZE5vZGVzLmluZGV4T2YoaXRlbSldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHR5cGVvZiBpdGVtID09PSBcIm9iamVjdFwiICYmIEFycmF5LmlzQXJyYXkoaXRlbSkpIHtcbiAgICAgICAgICAgIGlmICh2aXNpdGVkTm9kZXMuaW5kZXhPZihpdGVtKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICB2YXIgY2xvbmVBcnJheSA9IFtdO1xuICAgICAgICAgICAgICAgIHZpc2l0ZWROb2Rlcy5wdXNoKGl0ZW0pO1xuICAgICAgICAgICAgICAgIGNsb25lZENvcHkucHVzaChjbG9uZUFycmF5KTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGl0ZW0ubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgY2xvbmVBcnJheS5wdXNoKGNsb25lKGl0ZW1bal0pKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNsb25lQXJyYXk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBjbG9uZWRDb3B5W3Zpc2l0ZWROb2Rlcy5pbmRleE9mKGl0ZW0pXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBpdGVtOy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ICAgICAgKG9wZXJhdGlvbiA9PT0gRElGRkVSRU5DRSAgICYmIGV2ZW50LnBvaW50WzBdID4gc2Jib3hbMl0pKSB7XG4gICAgICBicmVhaztcbiAgICB9XG5cbiAgICBpZiAoZXZlbnQubGVmdCkge1xuICAgICAgbmV4dCAgPSBwcmV2ID0gc3dlZXBMaW5lLmluc2VydChldmVudCk7XG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5wb2ludCwgZXZlbnQpO1xuICAgICAgYmVnaW4gPSBzd2VlcExpbmUubWluTm9kZSgpO1xuXG4gICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChwcmV2KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgZXZlbnQsIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgdmFyIHByZXZwcmV2ID0gcHJldjtcbiAgICAgICAgICBpZiAocHJldnByZXYgIT09IGJlZ2luKSBwcmV2cHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXZwcmV2KTtcbiAgICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICBwcmV2cHJldiA9IG51bGw7XG5cbiAgICAgICAgICBwcmV2cHJldkV2ZW50ID0gcHJldnByZXYgPyBwcmV2cHJldi5rZXkgOiBudWxsO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMocHJldkV2ZW50LCBwcmV2cHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsICAgICBwcmV2RXZlbnQsICAgICBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGV2ZW50ID0gZXZlbnQub3RoZXJFdmVudDtcbiAgICAgIG5leHQgPSBwcmV2ID0gc3dlZXBMaW5lLmZpbmQoZXZlbnQpO1xuXG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgIGlmIChwcmV2ICYmIG5leHQpIHtcblxuICAgICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgICAgZWxzZSAgICAgICAgICAgICAgICBwcmV2ID0gbnVsbDtcblxuICAgICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG4gICAgICAgIHN3ZWVwTGluZS5yZW1vdmUoZXZlbnQpO1xuXG4gICAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgICAgaWYgKG5leHQgJiYgcHJldikge1xuICAgICAgICAgIC8vIGlmICh0eXBlb2YgcHJldiAhPT0gJ3VuZGVmaW5lZCcgJ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c1ZlcnRpY2FsOiBmdW5jdGlvbiAoKSB7XG4gICAgcmV0dXJuIHRoaXMucG9pbnRbMF0gPT09IHRoaXMub3RoZXJFdmVudC5wb2ludFswXTtcbiAgfVxufTtcblxubW9kdWxlLmV4cG9ydHMgPSBTd2VlcEV2ZW50O1xuIl19 diff --git a/src/possible_intersection.js b/src/possible_intersection.js index b857731..8b92486 100644 --- a/src/possible_intersection.js +++ b/src/possible_intersection.js @@ -79,8 +79,8 @@ module.exports = function possibleIntersection(se1, se2, queue) { if ((leftCoincide && rightCoincide) || leftCoincide) { // both line segments are equal or share the left endpoint - se1.type = edgeType.NON_CONTRIBUTING; - se2.type = (se1.inOut === se2.inOut) ? + se2.type = edgeType.NON_CONTRIBUTING; + se1.type = (se2.inOut === se1.inOut) ? edgeType.SAME_TRANSITION : edgeType.DIFFERENT_TRANSITION; From 809211ed2a25f60b46f190a243723f2a084630a1 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Thu, 14 Dec 2017 03:35:18 +0100 Subject: [PATCH 31/42] proper cloning --- demo/js/bundle.js | 63 +++++++++++++------------------------------- src/connect_edges.js | 43 +----------------------------- src/sweep_event.js | 14 ++++++++++ 3 files changed, 33 insertions(+), 87 deletions(-) diff --git a/demo/js/bundle.js b/demo/js/bundle.js index 6eb9464..68bfe72 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -2913,12 +2913,13 @@ function orderEvents(sortedEvents) { } } } + for (i = 0, len = resultEvents.length; i < len; i++) { if (i < len - 1) { if (resultEvents[i].point[0] !== resultEvents[i + 1].point[0] && resultEvents[i].point[1] !== resultEvents[i + 1].point[1] && - resultEvents[i].point[1] === resultEvents[i + 1].point[1]) { - var currentCloned = deepClone(resultEvents[i + 1]); + resultEvents[i].point[1] === resultEvents[i].otherEvent.point[1]) { + var currentCloned = resultEvents[i + 1].clone(); resultEvents.splice(i + 1, 0, currentCloned); len = resultEvents.length; } @@ -2939,44 +2940,6 @@ function orderEvents(sortedEvents) { } -function deepClone(obj) { - var visitedNodes = []; - var clonedCopy = []; - function clone(item) { - if (typeof item === "object" && !Array.isArray(item)) { - if (visitedNodes.indexOf(item) === -1) { - visitedNodes.push(item); - var cloneObject = {}; - clonedCopy.push(cloneObject); - for (var i in item) { - if (item.hasOwnProperty(i)) { - cloneObject[i] = clone(item[i]); - } - } - return cloneObject; - } else { - return clonedCopy[visitedNodes.indexOf(item)]; - } - } - else if (typeof item === "object" && Array.isArray(item)) { - if (visitedNodes.indexOf(item) === -1) { - var cloneArray = []; - visitedNodes.push(item); - clonedCopy.push(cloneArray); - for (var j = 0; j < item.length; j++) { - cloneArray.push(clone(item[j])); - } - return cloneArray; - } else { - return clonedCopy[visitedNodes.indexOf(item)]; - } - } - - return item; // not object, not array, therefore primitive - } - return clone(obj); -} - /** * @param {Number} pos * @param {Array.} resultEvents @@ -2989,10 +2952,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { if (newPos > length - 1) return pos - 1; var p = resultEvents[pos].point; var p1 = resultEvents[newPos].point; - // if (newPos < length && - // p1[0] !== p[0] || p1[1] !== p[1] && - // !processed[newPos]) return newPos; - // else return pos - 1; // while in range and not the current one by value @@ -3902,10 +3861,24 @@ SweepEvent.prototype = { */ isVertical: function () { return this.point[0] === this.otherEvent.point[0]; + }, + + + clone: function () { + var copy = new SweepEvent( + this.point, this.left, this.otherEvent, this.isSubject, this.type); + + copy.inResult = this.inResult; + copy.prevInResult = this.prevInResult; + copy.isExteriorRing = this.isExteriorRing; + copy.inOut = this.inOut; + copy.otherInOut = this.otherInOut; + + return copy; } }; module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzI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PSB7fS50b1N0cmluZy5jYWxsKG9iaik7XG5cbiAgc3dpdGNoIChzdHIpIHtcbiAgICBjYXNlICdbb2JqZWN0IEZpbGVdJzpcbiAgICBjYXNlICdbb2JqZWN0IEJsb2JdJzpcbiAgICBjYXNlICdbb2JqZWN0IEZvcm1EYXRhXSc6XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICBkZWZhdWx0OlxuICAgICAgcmV0dXJuIGZhbHNlO1xuICB9XG59XG5cbi8qKlxuICogU2VuZCBgZGF0YWAgYXMgdGhlIHJlcXVlc3QgYm9keSwgZGVmYXVsdGluZyB0aGUgYC50eXBlKClgIHRvIFwianNvblwiIHdoZW5cbiAqIGFuIG9iamVjdCBpcyBnaXZlbi5cbiAqXG4gKiBFeGFtcGxlczpcbiAqXG4gKiAgICAgICAvLyBtYW51YWwganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZS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mhhc093blByb3BlcnR5KGkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbG9uZU9iamVjdFtpXSA9IGNsb25lKGl0ZW1baV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBjbG9uZU9iamVjdDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNsb25lZENvcHlbdmlzaXRlZE5vZGVzLmluZGV4T2YoaXRlbSldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHR5cGVvZiBpdGVtID09PSBcIm9iamVjdFwiICYmIEFycmF5LmlzQXJyYXkoaXRlbSkpIHtcbiAgICAgICAgICAgIGlmICh2aXNpdGVkTm9kZXMuaW5kZXhPZihpdGVtKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICB2YXIgY2xvbmVBcnJheSA9IFtdO1xuICAgICAgICAgICAgICAgIHZpc2l0ZWROb2Rlcy5wdXNoKGl0ZW0pO1xuICAgICAgICAgICAgICAgIGNsb25lZENvcHkucHVzaChjbG9uZUFycmF5KTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGl0ZW0ubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgY2xvbmVBcnJheS5wdXNoKGNsb25lKGl0ZW1bal0pKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNsb25lQXJyYXk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBjbG9uZWRDb3B5W3Zpc2l0ZWROb2Rlcy5pbmRleE9mKGl0ZW0pXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBpdGVtOyAvLyBub3Qgb2JqZWN0LCBub3QgYXJyYXksIHRoZXJlZm9yZSBwcmltaXR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BvaW50WzBdID4gc2Jib3hbMl0pKSB7XG4gICAgICBicmVhaztcbiAgICB9XG5cbiAgICBpZiAoZXZlbnQubGVmdCkge1xuICAgICAgbmV4dCAgPSBwcmV2ID0gc3dlZXBMaW5lLmluc2VydChldmVudCk7XG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5wb2ludCwgZXZlbnQpO1xuICAgICAgYmVnaW4gPSBzd2VlcExpbmUubWluTm9kZSgpO1xuXG4gICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChwcmV2KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgZXZlbnQsIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgdmFyIHByZXZwcmV2ID0gcHJldjtcbiAgICAgICAgICBpZiAocHJldnByZXYgIT09IGJlZ2luKSBwcmV2cHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXZwcmV2KTtcbiAgICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICBwcmV2cHJldiA9IG51bGw7XG5cbiAgICAgICAgICBwcmV2cHJldkV2ZW50ID0gcHJldnByZXYgPyBwcmV2cHJldi5rZXkgOiBudWxsO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMocHJldkV2ZW50LCBwcmV2cHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsICAgICBwcmV2RXZlbnQsICAgICBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGV2ZW50ID0gZXZlbnQub3RoZXJFdmVudDtcbiAgICAgIG5leHQgPSBwcmV2ID0gc3dlZXBMaW5lLmZpbmQoZXZlbnQpO1xuXG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgIGlmIChwcmV2ICYmIG5leHQpIHtcblxuICAgICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgICAgZWxzZSAgICAgICAgICAgICAgICBwcmV2ID0gbnVsbDtcblxuICAgICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG4gICAgICAgIHN3ZWVwTGluZS5yZW1vdmUoZXZlbnQpO1xuXG4gICAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgICAgaWYgKG5leHQgJiYgcHJldikge1xuICAgICAgICAgIC8vIGlmICh0eXBlb2YgcHJldiAhPT0gJ3VuZGVmaW5lZCcgJiYgdHlwZW9mIG5leHQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgc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IGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW50LCAgICAgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBldmVudCA9IGV2ZW50Lm90aGVyRXZlbnQ7XG4gICAgICBuZXh0ID0gcHJldiA9IHN3ZWVwTGluZS5maW5kKGV2ZW50KTtcblxuICAgICAgLy9fcmVuZGVyU3dlZXBMaW5lKHN3ZWVwTGluZSwgZXZlbnQub3RoZXJFdmVudC5wb2ludCwgZXZlbnQpO1xuXG4gICAgICBpZiAocHJldiAmJiBuZXh0KSB7XG5cbiAgICAgICAgaWYgKHByZXYgIT09IGJlZ2luKSBwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldik7XG4gICAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51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PiAwO1xuICB9LFxuXG5cbiAgLyoqXG4gICAqIEBwYXJhbSAge0FycmF5LjxOdW1iZXI+fSAgcFxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNBYm92ZTogZnVuY3Rpb24gKHApIHtcbiAgICByZXR1cm4gIXRoaXMuaXNCZWxvdyhwKTtcbiAgfSxcblxuXG4gIC8qKlxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNWZXJ0aWNhbDogZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiB0aGlzLnBvaW50WzBdID09PSB0aGlzLm90aGVyRXZlbnQucG9pbnRbMF07XG4gIH0sXG5cblxuICBjbG9uZTogZnVuY3Rpb24gKCkge1xuICAgIHZhciBjb3B5ID0gbmV3IFN3ZWVwRXZlbnQoXG4gICAgICB0aGlzLnBvaW50LCB0aGlzLmxlZnQsIHRoaXMub3RoZXJFdmVudCwgdGhpcy5pc1N1YmplY3QsIHRoaXMudHlwZSk7XG5cbiAgICBjb3B5LmluUmVzdWx0ICAgICAgID0gdGhpcy5pblJlc3VsdDtcbiAgICBjb3B5LnByZXZJblJlc3VsdCAgID0gdGhpcy5wcmV2SW5SZXN1bHQ7XG4gICAgY29weS5pc0V4dGVyaW9yUmluZyA9IHRoaXMuaXNFeHRlcmlvclJpbmc7XG4gICAgY29weS5pbk91dCAgICAgICAgICA9IHRoaXMuaW5PdXQ7XG4gICAgY29weS5vdGhlckluT3V0ICAgICA9IHRoaXMub3RoZXJJbk91dDtcblxuICAgIHJldHVybiBjb3B5O1xuICB9XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IFN3ZWVwRXZlbnQ7XG4iXX0= diff --git a/src/connect_edges.js b/src/connect_edges.js index 0d20077..5b6d73c 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -38,7 +38,7 @@ function orderEvents(sortedEvents) { if (resultEvents[i].point[0] !== resultEvents[i + 1].point[0] && resultEvents[i].point[1] !== resultEvents[i + 1].point[1] && resultEvents[i].point[1] === resultEvents[i].otherEvent.point[1]) { - var currentCloned = deepClone(resultEvents[i + 1]); + var currentCloned = resultEvents[i + 1].clone(); resultEvents.splice(i + 1, 0, currentCloned); len = resultEvents.length; } @@ -59,43 +59,6 @@ function orderEvents(sortedEvents) { } -function deepClone(obj) { - var visitedNodes = []; - var clonedCopy = []; - function clone(item) { - if (typeof item === 'object' && !Array.isArray(item)) { - if (visitedNodes.indexOf(item) === -1) { - visitedNodes.push(item); - var cloneObject = {}; - clonedCopy.push(cloneObject); - for (var i in item) { - if (item.hasOwnProperty(i)) { - cloneObject[i] = clone(item[i]); - } - } - return cloneObject; - } else { - return clonedCopy[visitedNodes.indexOf(item)]; - } - } else if (typeof item === 'object' && Array.isArray(item)) { - if (visitedNodes.indexOf(item) === -1) { - var cloneArray = []; - visitedNodes.push(item); - clonedCopy.push(cloneArray); - for (var j = 0; j < item.length; j++) { - cloneArray.push(clone(item[j])); - } - return cloneArray; - } else { - return clonedCopy[visitedNodes.indexOf(item)]; - } - } - - return item; // not object, not array, therefore primitive - } - return clone(obj); -} - /** * @param {Number} pos * @param {Array.} resultEvents @@ -108,10 +71,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { if (newPos > length - 1) return pos - 1; var p = resultEvents[pos].point; var p1 = resultEvents[newPos].point; - // if (newPos < length && - // p1[0] !== p[0] || p1[1] !== p[1] && - // !processed[newPos]) return newPos; - // else return pos - 1; // while in range and not the current one by value diff --git a/src/sweep_event.js b/src/sweep_event.js index 50881f2..9468aba 100644 --- a/src/sweep_event.js +++ b/src/sweep_event.js @@ -110,6 +110,20 @@ SweepEvent.prototype = { */ isVertical: function () { return this.point[0] === this.otherEvent.point[0]; + }, + + + clone: function () { + var copy = new SweepEvent( + this.point, this.left, this.otherEvent, this.isSubject, this.type); + + copy.inResult = this.inResult; + copy.prevInResult = this.prevInResult; + copy.isExteriorRing = this.isExteriorRing; + copy.inOut = this.inOut; + copy.otherInOut = this.otherInOut; + + return copy; } }; From 5755f870c9c42410211d01b86860e61182fe3c7d Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Thu, 14 Dec 2017 03:42:51 +0100 Subject: [PATCH 32/42] fixed --- demo/js/bundle.js | 8 +- demo/js/index.js | 6 +- dist/martinez.js | 404 +++++++++++++++++++++++++++++----------------- 3 files changed, 263 insertions(+), 155 deletions(-) diff --git a/demo/js/bundle.js b/demo/js/bundle.js index 68bfe72..0acaae2 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -195,7 +195,7 @@ function run (op) { var subject = layers[0].toGeoJSON(); var clipping = layers[1].toGeoJSON(); - console.log('input', subject, clipping, op); + //console.log('input', subject, clipping, op); subject = JSON.parse(JSON.stringify(subject)); clipping = JSON.parse(JSON.stringify(clipping)); @@ -222,8 +222,8 @@ function run (op) { console.timeEnd('martinez'); //if (op === OPERATIONS.UNION) result = result[0]; - console.log('result', result); - console.log(JSON.stringify(result)) + // console.log('result', result); + // console.log(JSON.stringify(result)) results.clearLayers(); if (result !== null) { @@ -3881,4 +3881,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvbG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bmd9XG4gKi9cbmZ1bmN0aW9uIHByaW50IChyb290LCBwcmludE5vZGUpIHtcbiAgaWYgKCBwcmludE5vZGUgPT09IHZvaWQgMCApIHByaW50Tm9kZSA9IGZ1bmN0aW9uIChuKSB7IHJldHVybiBuLmtleTsgfTtcblxuICB2YXIgb3V0ID0gW107XG4gIHJvdyhyb290LCAnJywgdHJ1ZSwgZnVuY3Rpb24gKHYpIHsgcmV0dXJuIG91dC5wdXNoKHYpOyB9LCBwcmludE5vZGUpO1xuICByZXR1cm4gb3V0LmpvaW4oJycpO1xufVxuXG4vKipcbiAqIFByaW50cyBsZXZlbCBvZiB0aGUgdHJlZVxuICogQHBhcmFtICB7Tm9kZX0gICAgICAgICAgICAgICAgICAgICAgICByb290XG4gKiBAcGFyYW0gIHtTdHJpbmd9ICAgICAgICAgICAgICAgICAgICAgIHByZWZpeFxuICogQHBhcmFtICB7Qm9vbGVhbn0gICAgICAgICAgICAgICAgICAgICBpc1RhaWxcbiAqIEBwYXJhbSAge0Z1bmN0aW9uKGluOnN0cmluZyk6dm9pZH0gICAgb3V0XG4gKiBAcGFyYW0gIHtGdW5jdGlvbihub2RlOk5vZGUpOlN0cmluZ30gIHByaW50Tm9kZVxuICovXG5mdW5jdGlvbiByb3cgKHJvb3QsIHByZWZpeCwgaXNUYWlsLCBvdXQsIHByaW50Tm9kZSkge1xuICBpZiAocm9vdCkge1xuICAgIG91dCgoXCJcIiArIHByZWZpeCArIChpc1RhaWwgPyAn4pSU4pSA4pSAICcgOiAn4pSc4pSA4pSAICcpICsgKHByaW50Tm9kZShyb290KSkgKyBcIlxcblwiKSk7XG4gICAgdmFyIGluZGVudCA9IHByZWZpeCArIChpc1RhaWwgPyAnICAgICcgOiAn4pSCICAgJyk7XG4gICAgaWYgKHJvb3QubGVmdCkgIHsgcm93KHJvb3QubGVmdCwgIGluZGVudCwgZmFsc2UsIG91dCwgcHJpbnROb2RlKTsgfVxuICAgIGlmIChyb290LnJpZ2h0KSB7IHJvdyhy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ogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGRlZmF1bHRzIHRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAuc2VuZCgnbmFtZT10b2JpJylcbiAqICAgICAgICAuc2VuZCgnc3BlY2llcz1mZXJyZXQnKVxuICogICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogQHBhcmFtIHtTdHJpbmd8T2JqZWN0fSBkYXRhXG4gKiBAcmV0dXJuIHtSZXF1ZXN0fSBmb3IgY2hhaW5pbmdcbiAqIEBhcGkgcHVibGljXG4gKi9cblxuZXhwb3J0cy5zZW5kID0gZn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dGEgPSB0aGlzLmRhdGEsXG4gICAgICAgICAgICBjb21wYXJlID0gdGhpcy5jb21wYXJlO1xuXG4gICAgICAgIHdoaWxlIChwb3MgPiAwKSB7XG4gICAgICAgICAgICB2YXIgcGFyZW50ID0gTWF0aC5mbG9vcigocG9zIC0gMSkgLyAyKTtcbiAgICAgICAgICAgIGlmIChjb21wYXJlKGRhdGFbcG9zXSwgZGF0YVtwYXJlbnRdKSA8IDApIHtcbiAgICAgICAgICAgICAgICBzd2FwKGRhdGEsIHBhcmVudCwgcG9zKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBwYXJlbnQ7XG5cbiAgICAgICAgICAgIH0gZWxzZSBicmVhaztcbiAgICAgICAgfVxuICAgIH0sXG5cbiAgICBfZG93bjogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmUsXG4gICAgICAgICAgICBsZW4gPSB0aGlzLmxlbmd0aDtcblxuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgdmFyIGxlZnQgPSAyICogcG9zICsgMSxcbiAgICAgICAgICAgICAgICByaWdodCA9IGxlZnQgKyAxLFxuICAgICAgICAgICAgICAgIG1pbiA9IHBvcztcblxuICAgICAgICAgICAgaWYgKGxlZnQgPCBsZW4gJiYgY29tcGFyZShkYXRhW2xlZnRdLCBkYXRhW21pbl0pIDwgMCkgbWluID0gbGVmdDtcbiAgICAgICAgICAgIGlmIChyaWdodCA8IGxlbiAmJiBjb21wYXJlKGRhdGFbcmlnaHRdLCBkYXRhW21pbl0pIDwgMCkgbWluID0gcmlnaHQ7XG5cbiAgICAgICAgICAgIGlmIChtaW4gPT09IHBvcykgcmV0dXJuO1xuXG4gICAgICAgICAgICBzd2FwKGRhdGEsIG1pbiwgcG9zKTtcbiAgICAgICAgICAgIHBvcyA9IG1pbjtcbiAgICAgICAgfVxuICAgIH1cbn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YXNlIGVkZ2VUeXBlLk5PUk1BTDpcbiAgICAgIHN3aXRjaCAob3BlcmF0aW9uKSB7XG4gICAgICAgIGNhc2UgSU5URVJTRUNUSU9OOlxuICAgICAgICAgIHJldHVybiAhZXZlbnQub3RoZXJJbk91dDtcbiAgICAgICAgY2FzZSBVTklPTjpcbiAgICAgICAgICByZXR1cm4gZXZlbnQub3RoZXJJbk91dDtcbiAgICAgICAgY2FzZSBESUZGRVJFTkNFOlxuICAgICAgICAgIC8vIHJldHVybiAoZXZlbnQuaXNTdWJqZWN0ICYmICFldmVudC5vdGhlckluT3V0KSB8fFxuICAgICAgICAgIC8vICAgICAgICAgKCFldmVudC5pc1N1YmplY3QgJiYgZXZlbnQub3RoZXJJbk91dCk7XG4gICAgICAgICAgcmV0dXJuIChldmVudC5pc1N1YmplY3QgJiYgZXZlbnQub3RoZXJJbk91dCkgfHxcbiAgICAgICAgICAgICAgICAgICghZXZlbnQuaXNTdWJqZWN0ICYmICFldmVudC5vdGhlckluT3V0KTtcbiAgICAgICAgY2FzZSBYT1I6XG4gICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9XG4gICAgICBicmVhaztcbiAgICBjYXNlIGVkZ2VUeXBlLlNBTUVfVFJBTlNJVElPTjpcbiAgICAgIHJldHVybiBvcGVyYXRpb24gPT09IElOVEVSU0VDVElPTiB8fCBvcGVyYXRpb24gPT09IFVOSU9OO1xuICAgIGNhc2UgZWRnZVR5cGUuRElGRkVSRU5UX1RSQU5TSVRJT046XG4gICAgICByZXR1cm4gb3BlcmF0aW9uID09PSBESUZGRVJFTkNFO1xuICAgIGNhc2UgZWRnZVR5cGUuTk9OX0NPTlRSSUJVVElORzpcbiAgICAgIHJldHVybiBmYWxzZTtcbiAgfVxuICByZXR1cm4gZmFsc2U7XG59XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vIHZhciBlcXVhbHMgPSByZXF1aXJlKCcuL2VxdWFscycpO1xudmFyIGNvbXBhcmVFdmVudHMgPSByZXF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ZW50KTtcbiAgICAgIGJlZ2luID0gc3dlZXBMaW5lLm1pbk5vZGUoKTtcblxuICAgICAgaWYgKHByZXYgIT09IGJlZ2luKSBwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldik7XG4gICAgICBlbHNlICAgICAgICAgICAgICAgIHByZXYgPSBudWxsO1xuXG4gICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG5cbiAgICAgIHZhciBwcmV2RXZlbnQgPSBwcmV2ID8gcHJldi5rZXkgOiBudWxsO1xuICAgICAgdmFyIHByZXZwcmV2RXZlbnQ7XG4gICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICBpZiAobmV4dCkge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdm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gdG8gdGhlIGNsaXBwaW5nIHBvbHlnb25cbiAgICB9IGVsc2Uge1xuICAgICAgZXZlbnQuaW5PdXQgICAgICA9ICFwcmV2Lm90aGVySW5PdXQ7XG4gICAgICBldmVudC5vdGhlckluT3V0ID0gcHJldi5pc1ZlcnRpY2FsKCkgPyAhcHJldi5pbk91dCA6IHByZXYuaW5PdXQ7XG4gICAgfVxuXG4gICAgLy8gY29tcHV0ZSBwcmV2SW5SZXN1bHQgZmllbGRcbiAgICBpZiAocHJldikge1xuICAgICAgZXZlbnQucHJldkluUmVzdWx0ID0gKCFpblJlc3VsdChwcmV2LCBvcGVyYXRpb24pIHx8IHByZXYuaXNWZXJ0aWNhbCgpKSA/XG4gICAgICAgICBwcmV2LnByZXZJblJlc3VsdCA6IHByZXY7XG4gICAgfVxuICB9XG5cbiAgLy8gY2hlY2sgaWYgdGhlIGxpbmUgc2VnbWVudCBiZWxvbmdzIHRvIHRoZSBCb29sZWFuIG9wZXJhdGlvblxuICBldmVudC5pblJlc3VsdCA9IGluUmVzdWx0KGV2ZW50LCBvcGVyYXRpb24pO1xufTtcblxuXG5mdW5jdGlvbiBpblJlc3VsdChldmVudCwgb3BlcmF0aW9uKSB7XG4gIHN3aXRjaCAoZXZlbnQudHlwZSkge1xuICAgIGNhc2UgZWRnZVR5cGUuTk9STUFMOlxuICAgICAgc3dpdGNoIChvcGVyYXRpb24pIHtcbiAgICAgICAgY2FzZSBJTlRFUlNFQ1RJT046XG4gICAgICAgICAgcmV0dXJuICFldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIFVOSU9OOlxuICAgICAgICAgIHJldHVybiBldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIERJRkZFUkVOQ0U6XG4gICAgICAgICAgLy8gcmV0dXJuIChldmVudC5pc1N1YmplY3QgJiYgIWV2ZW50Lm90aGVySW5PdXQpIHx8XG4gICAgICAgICAgLy8gICAgICAgICAoIWV2ZW50LmlzU3ViamVjdCAmJiBldmVudC5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biAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChwcmV2KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgZXZlbnQsIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgdmFyIHByZXZwcmV2ID0gcHJldjtcbiAgICAgICAgICBpZiAocHJldnByZXYgIT09IGJlZ2luKSBwcmV2cHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXZwcmV2KTtcbiAgICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICBwcmV2cHJldiA9IG51bGw7XG5cbiAgICAgICAgICBwcmV2cHJldkV2ZW50ID0gcHJldnByZXYgPyBwcmV2cHJldi5rZXkgOiBudWxsO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMocHJldkV2ZW50LCBwcmV2cHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsICAgICBwcmV2RXZlbnQsICAgICBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGV2ZW50ID0gZXZlbnQub3RoZXJFdmVudDtcbiAgICAgIG5leHQgPSBwcmV2ID0gc3dlZXBMaW5lLmZpbmQoZXZlbnQpO1xuXG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXB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gICAgcmV0dXJuIGNvcHk7XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzID0gU3dlZXBFdmVudDtcbiJdfQ== diff --git a/demo/js/index.js b/demo/js/index.js index 9d3e8e2..e65a44b 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -128,7 +128,7 @@ function run (op) { var subject = layers[0].toGeoJSON(); var clipping = layers[1].toGeoJSON(); - console.log('input', subject, clipping, op); + //console.log('input', subject, clipping, op); subject = JSON.parse(JSON.stringify(subject)); clipping = JSON.parse(JSON.stringify(clipping)); @@ -155,8 +155,8 @@ function run (op) { console.timeEnd('martinez'); //if (op === OPERATIONS.UNION) result = result[0]; - console.log('result', result); - console.log(JSON.stringify(result)) + // console.log('result', result); + // console.log(JSON.stringify(result)) results.clearLayers(); if (result !== null) { diff --git a/dist/martinez.js b/dist/martinez.js index 341c17f..1985427 100644 --- a/dist/martinez.js +++ b/dist/martinez.js @@ -87,12 +87,12 @@ function height(node) { /** * @typedef {{ - * parent: Node|Null, - * left: Node|Null, - * right: Node|Null, - * balanceFactor: Number, - * key: any, - * data: object? + * parent: ?Node, + * left: ?Node, + * right: ?Node, + * balanceFactor: number, + * key: Key, + * data: Value * }} Node */ @@ -100,10 +100,15 @@ function height(node) { * @typedef {*} Key */ +/** + * @typedef {*} Value + */ + /** * Default comparison function - * @param {*} a - * @param {*} b + * @param {Key} a + * @param {Key} b + * @returns {number} */ function DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; } @@ -187,7 +192,7 @@ function rotateRight (node) { // } -var Tree = function Tree (comparator, noDuplicates) { +var AVLTree = function AVLTree (comparator, noDuplicates) { if ( noDuplicates === void 0 ) noDuplicates = false; this._comparator = comparator || DEFAULT_COMPARE; @@ -201,14 +206,16 @@ var prototypeAccessors = { size: {} }; /** * Clear the tree + * @return {AVLTree} */ -Tree.prototype.destroy = function destroy () { +AVLTree.prototype.destroy = function destroy () { this._root = null; + return this; }; /** * Number of nodes - * @return {Number} + * @return {number} */ prototypeAccessors.size.get = function () { return this._size; @@ -218,9 +225,9 @@ prototypeAccessors.size.get = function () { /** * Whether the tree contains a node with the given key * @param{Key} key - * @return {Boolean} + * @return {boolean} true/false */ -Tree.prototype.contains = function contains (key) { +AVLTree.prototype.contains = function contains (key) { if (this._root){ var node = this._root; var comparator = this._comparator; @@ -240,9 +247,9 @@ Tree.prototype.contains = function contains (key) { /** * Successor node * @param{Node} node - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.next = function next (node) { +AVLTree.prototype.next = function next (node) { var successor = node; if (successor) { if (successor.right) { @@ -262,9 +269,9 @@ Tree.prototype.next = function next (node) { /** * Predecessor node * @param{Node} node - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.prev = function prev (node) { +AVLTree.prototype.prev = function prev (node) { var predecessor = node; if (predecessor) { if (predecessor.left) { @@ -284,10 +291,17 @@ Tree.prototype.prev = function prev (node) { /** - * @param{Function(node:Node):void} fn + * Callback for forEach + * @callback forEachCallback + * @param {Node} node + * @param {number} index + */ + +/** + * @param{forEachCallback} callback * @return {AVLTree} */ -Tree.prototype.forEach = function forEach (fn) { +AVLTree.prototype.forEach = function forEach (callback) { var current = this._root; var s = [], done = false, i = 0; @@ -304,7 +318,7 @@ Tree.prototype.forEach = function forEach (fn) { // empty you are done if (s.length > 0) { current = s.pop(); - fn(current, i++); + callback(current, i++); // We have visited the node and its left // subtree. Now, it's right subtree's turn @@ -320,7 +334,7 @@ Tree.prototype.forEach = function forEach (fn) { * Returns all keys in order * @return {Array} */ -Tree.prototype.keys = function keys () { +AVLTree.prototype.keys = function keys () { var current = this._root; var s = [], r = [], done = false; @@ -342,9 +356,9 @@ Tree.prototype.keys = function keys () { /** * Returns `data` fields of all nodes in order. - * @return {Array<*>} + * @return {Array} */ -Tree.prototype.values = function values () { +AVLTree.prototype.values = function values () { var current = this._root; var s = [], r = [], done = false; @@ -364,9 +378,15 @@ Tree.prototype.values = function values () { }; -Tree.prototype.at = function at (index) { - index = index % this.size; - if (index < 0) { index = this.size - index; } +/** + * Returns node at given index + * @param{number} index + * @return {?Node} + */ +AVLTree.prototype.at = function at (index) { + // removed after a consideration, more misleading than useful + // index = index % this.size; + // if (index < 0) index = this.size - index; var current = this._root; var s = [], done = false, i = 0; @@ -390,9 +410,9 @@ Tree.prototype.at = function at (index) { /** * Returns node with the minimum key - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.minNode = function minNode () { +AVLTree.prototype.minNode = function minNode () { var node = this._root; if (!node) { return null; } while (node.left) { node = node.left; } @@ -402,9 +422,9 @@ Tree.prototype.minNode = function minNode () { /** * Returns node with the max key - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.maxNode = function maxNode () { +AVLTree.prototype.maxNode = function maxNode () { var node = this._root; if (!node) { return null; } while (node.right) { node = node.right; } @@ -414,20 +434,21 @@ Tree.prototype.maxNode = function maxNode () { /** * Min key - * @return {Key} + * @return {?Key} */ -Tree.prototype.min = function min () { +AVLTree.prototype.min = function min () { var node = this._root; if (!node) { return null; } while (node.left) { node = node.left; } return node.key; }; + /** * Max key - * @return {Key|Null} + * @return {?Key} */ -Tree.prototype.max = function max () { +AVLTree.prototype.max = function max () { var node = this._root; if (!node) { return null; } while (node.right) { node = node.right; } @@ -436,18 +457,18 @@ Tree.prototype.max = function max () { /** - * @return {Boolean} + * @return {boolean} true/false */ -Tree.prototype.isEmpty = function isEmpty () { +AVLTree.prototype.isEmpty = function isEmpty () { return !this._root; }; /** * Removes and returns the node with smallest key - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.pop = function pop () { +AVLTree.prototype.pop = function pop () { var node = this._root, returnValue = null; if (node) { while (node.left) { node = node.left; } @@ -461,12 +482,12 @@ Tree.prototype.pop = function pop () { /** * Find node by key * @param{Key} key - * @return {Node|Null} + * @return {?Node} */ -Tree.prototype.find = function find (key) { +AVLTree.prototype.find = function find (key) { var root = this._root; - if (root === null) { return null; } - if (key === root.key) { return root; } + // if (root === null) return null; + // if (key === root.key) return root; var subtree = root, cmp; var compare = this._comparator; @@ -484,10 +505,10 @@ Tree.prototype.find = function find (key) { /** * Insert a node into the tree * @param{Key} key - * @param{*} [data] - * @return {Node|Null} + * @param{Value} [data] + * @return {?Node} */ -Tree.prototype.insert = function insert (key, data) { +AVLTree.prototype.insert = function insert (key, data) { var this$1 = this; if (!this._root) { @@ -522,9 +543,12 @@ Tree.prototype.insert = function insert (key, data) { } var newNode = { - left: null, right: null, balanceFactor: 0, + left: null, + right: null, + balanceFactor: 0, parent: parent, key: key, data: data }; + var newRoot; if (cmp <= 0) { parent.left= newNode; } else { parent.right = newNode; } @@ -535,18 +559,20 @@ Tree.prototype.insert = function insert (key, data) { if (parent.balanceFactor === 0) { break; } else if (parent.balanceFactor < -1) { - //let newRoot = rightBalance(parent); + // inlined + //var newRoot = rightBalance(parent); if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } - var newRoot = rotateLeft(parent); + newRoot = rotateLeft(parent); if (parent === this$1._root) { this$1._root = newRoot; } break; } else if (parent.balanceFactor > 1) { - // let newRoot = leftBalance(parent); + // inlined + // var newRoot = leftBalance(parent); if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } - var newRoot$1 = rotateRight(parent); + newRoot = rotateRight(parent); - if (parent === this$1._root) { this$1._root = newRoot$1; } + if (parent === this$1._root) { this$1._root = newRoot; } break; } parent = parent.parent; @@ -560,27 +586,30 @@ Tree.prototype.insert = function insert (key, data) { /** * Removes the node from the tree. If not found, returns null. * @param{Key} key - * @return {Node:Null} + * @return {?Node} */ -Tree.prototype.remove = function remove (key) { +AVLTree.prototype.remove = function remove (key) { var this$1 = this; if (!this._root) { return null; } var node = this._root; var compare = this._comparator; + var cmp = 0; while (node) { - var cmp = compare(key, node.key); + cmp = compare(key, node.key); if (cmp === 0) { break; } else if (cmp < 0) { node = node.left; } else { node = node.right; } } if (!node) { return null; } + var returnValue = node.key; + var max, min; if (node.left) { - var max = node.left; + max = node.left; while (max.left || max.right) { while (max.right) { max = max.right; } @@ -599,7 +628,7 @@ Tree.prototype.remove = function remove (key) { } if (node.right) { - var min = node.right; + min = node.right; while (min.left || min.right) { while (min.left) { min = min.left; } @@ -619,25 +648,28 @@ Tree.prototype.remove = function remove (key) { var parent = node.parent; var pp = node; + var newRoot; while (parent) { if (parent.left === pp) { parent.balanceFactor -= 1; } else { parent.balanceFactor += 1; } if (parent.balanceFactor < -1) { - //let newRoot = rightBalance(parent); + // inlined + //var newRoot = rightBalance(parent); if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } - var newRoot = rotateLeft(parent); + newRoot = rotateLeft(parent); if (parent === this$1._root) { this$1._root = newRoot; } parent = newRoot; } else if (parent.balanceFactor > 1) { - // let newRoot = leftBalance(parent); + // inlined + // var newRoot = leftBalance(parent); if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } - var newRoot$1 = rotateRight(parent); + newRoot = rotateRight(parent); - if (parent === this$1._root) { this$1._root = newRoot$1; } - parent = newRoot$1; + if (parent === this$1._root) { this$1._root = newRoot; } + parent = newRoot; } if (parent.balanceFactor === -1 || parent.balanceFactor === 1) { break; } @@ -660,11 +692,11 @@ Tree.prototype.remove = function remove (key) { /** * Bulk-load items - * @param{Array}keys - * @param{Array}[values] - * @return {Tree} + * @param{Array}keys + * @param{Array}[values] + * @return {AVLTree} */ -Tree.prototype.load = function load (keys, values) { +AVLTree.prototype.load = function load (keys, values) { var this$1 = this; if ( keys === void 0 ) keys = []; if ( values === void 0 ) values = []; @@ -680,25 +712,25 @@ Tree.prototype.load = function load (keys, values) { /** * Returns true if the tree is balanced - * @return {Boolean} + * @return {boolean} */ -Tree.prototype.isBalanced = function isBalanced$1 () { +AVLTree.prototype.isBalanced = function isBalanced$1 () { return isBalanced(this._root); }; /** * String representation of the tree - primitive horizontal print-out - * @param{Function(Node):String} [printNode] - * @return {String} + * @param{Function(Node):string} [printNode] + * @return {string} */ -Tree.prototype.toString = function toString (printNode) { +AVLTree.prototype.toString = function toString (printNode) { return print(this._root, printNode); }; -Object.defineProperties( Tree.prototype, prototypeAccessors ); +Object.defineProperties( AVLTree.prototype, prototypeAccessors ); -return Tree; +return AVLTree; }))); @@ -795,7 +827,7 @@ var signedArea = require('./signed_area'); * @param {SweepEvent} e2 * @return {Number} */ -module.exports = function compareEvents (e1, e2) { +module.exports = function compareEvents(e1, e2) { var p1 = e1.point; var p2 = e2.point; @@ -818,12 +850,12 @@ function specialCases(e1, e2, p1, p2) { if (e1.left !== e2.left) return e1.left ? 1 : -1; - var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; - var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) + // var p2 = e1.otherEvent.point, p3 = e2.otherEvent.point; + // var sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]) // Same coordinates, both events // are left endpoints or right endpoints. // not collinear - if (sa/*signedArea(p1, e1.otherEvent.point, e2.otherEvent.point)*/ !== 0) { + if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) { // the event associate to the bottom segment is processed first return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; } @@ -891,12 +923,15 @@ module.exports = function compareSegments(le1, le2) { }; },{"./compare_events":4,"./equals":10,"./signed_area":16}],6:[function(require,module,exports){ +'use strict'; + var edgeType = require('./edge_type'); +var operationType = require('./operation'); -var INTERSECTION = 0; -var UNION = 1; -var DIFFERENCE = 2; -var XOR = 3; +var INTERSECTION = operationType.INTERSECTION; +var UNION = operationType.UNION; +var DIFFERENCE = operationType.DIFFERENCE; +var XOR = operationType.XOR; /** * @param {SweepEvent} event @@ -935,33 +970,37 @@ module.exports = function computeFields(event, prev, operation) { function inResult(event, operation) { switch (event.type) { - case edgeType.NORMAL: - switch (operation) { - case INTERSECTION: - return !event.otherInOut; - case UNION: - return event.otherInOut; - case DIFFERENCE: - return (event.isSubject && event.otherInOut) || - (!event.isSubject && !event.otherInOut); - case XOR: - return true; - } - break; - case edgeType.SAME_TRANSITION: - return operation === INTERSECTION || operation === UNION; - case edgeType.DIFFERENT_TRANSITION: - return operation === DIFFERENCE; - case edgeType.NON_CONTRIBUTING: - return false; + case edgeType.NORMAL: + switch (operation) { + case INTERSECTION: + return !event.otherInOut; + case UNION: + return event.otherInOut; + case DIFFERENCE: + // return (event.isSubject && !event.otherInOut) || + // (!event.isSubject && event.otherInOut); + return (event.isSubject && event.otherInOut) || + (!event.isSubject && !event.otherInOut); + case XOR: + return true; + } + break; + case edgeType.SAME_TRANSITION: + return operation === INTERSECTION || operation === UNION; + case edgeType.DIFFERENT_TRANSITION: + return operation === DIFFERENCE; + case edgeType.NON_CONTRIBUTING: + return false; } return false; } -},{"./edge_type":9}],7:[function(require,module,exports){ -var equals = require('./equals'); -var compareEvents = require('./compare_events'); +},{"./edge_type":9,"./operation":13}],7:[function(require,module,exports){ +'use strict'; +// var equals = require('./equals'); +var compareEvents = require('./compare_events'); +var operationType = require('./operation'); /** * @param {Array.} sortedEvents @@ -977,7 +1016,6 @@ function orderEvents(sortedEvents) { resultEvents.push(event); } } - // Due to overlapping edges the resultEvents array can be not wholly sorted var sorted = false; while (!sorted) { @@ -994,11 +1032,20 @@ function orderEvents(sortedEvents) { } for (i = 0, len = resultEvents.length; i < len; i++) { + if (i < len - 1) { + if (resultEvents[i].point[0] !== resultEvents[i + 1].point[0] && + resultEvents[i].point[1] !== resultEvents[i + 1].point[1] && + resultEvents[i].point[1] === resultEvents[i].otherEvent.point[1]) { + var currentCloned = resultEvents[i + 1].clone(); + resultEvents.splice(i + 1, 0, currentCloned); + len = resultEvents.length; + } + } resultEvents[i].pos = i; } for (i = 0, len = resultEvents.length; i < len; i++) { - var event = resultEvents[i]; + event = resultEvents[i]; if (!event.left) { tmp = event.pos; event.pos = event.otherEvent.pos; @@ -1016,32 +1063,31 @@ function orderEvents(sortedEvents) { * @param {Object>} processed * @return {Number} */ -function nextPos(pos, resultEvents, processed) { +function nextPos(pos, resultEvents, processed, origIndex) { var newPos = pos + 1; var length = resultEvents.length; + if (newPos > length - 1) return pos - 1; var p = resultEvents[pos].point; var p1 = resultEvents[newPos].point; - // if (newPos < length && - // p1[0] !== p[0] || p1[1] !== p[1] && - // !processed[newPos]) return newPos; - // else return pos - 1; - // while in range and not the current one by value while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { if (!processed[newPos]) { - console.log(pos, newPos, length); + // console.log(pos, newPos, length); return newPos; + } else { + newPos++; } - else newPos++; - p1 = resultEvents[newPos].point + p1 = resultEvents[newPos].point; } newPos = pos - 1; - while (processed[newPos]) newPos--; - console.log('other', pos, newPos, length); + while (processed[newPos] && newPos >= origIndex) { + newPos--; + } + // console.log('other', pos, newPos, length); return newPos; } @@ -1050,9 +1096,10 @@ function nextPos(pos, resultEvents, processed) { * @param {Array.} sortedEvents * @return {Array.<*>} polygons */ -module.exports = function (sortedEvents, operation) { +module.exports = function connectEdges(sortedEvents, operation) { var i, len; var resultEvents = orderEvents(sortedEvents); + //_renderPoints(resultEvents, 'inResult'); // "false"-filled array var processed = {}; @@ -1060,18 +1107,17 @@ module.exports = function (sortedEvents, operation) { var event; for (i = 0, len = resultEvents.length; i < len; i++) { + // console.log('i is ' + i) if (processed[i]) continue; var contour = [[]]; if (!resultEvents[i].isExteriorRing) { if (result.length === 0) { result.push([[contour]]); + } else if (operation === operationType.UNION || operation === operationType.XOR) { + result[result.length - 1].push(contour[0]); } else { - if (operation === 1) { - result.push(contour) - } else { - result[result.length - 1].push(contour); - } + result[result.length - 1].push(contour); } } else { result.push(contour); @@ -1081,11 +1127,12 @@ module.exports = function (sortedEvents, operation) { var pos = i; var initial = resultEvents[i].point; - // initial.push(resultEvents[i].isExteriorRing); contour[0].push(initial); while (pos >= i) { - var event = resultEvents[pos]; + // console.log('pos is ' + pos) + + event = resultEvents[pos]; processed[pos] = true; if (event.left) { @@ -1095,13 +1142,15 @@ module.exports = function (sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } + // new L.Marker(event.point.slice().reverse()).addTo(map); pos = event.pos; processed[pos] = true; // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); - + // new L.circleMarker(resultEvents[pos].point.slice().reverse()).addTo(map); + // console.log(resultEvents[pos].point) contour[0].push(resultEvents[pos].point); - pos = nextPos(pos, resultEvents, processed); + pos = nextPos(pos, resultEvents, processed, i); } pos = pos === -1 ? i : pos; @@ -1111,6 +1160,7 @@ module.exports = function (sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } + //_renderPoints(resultEvents, 'resultInOut'); for (i = 0, len = result.length; i < len; i++) { var polygon = result[i]; @@ -1126,10 +1176,36 @@ module.exports = function (sortedEvents, operation) { } } + // Handle if the result is a polygon (eg not multipoly) + // Commented it again, let's see what do we mean by that + // if (result.length === 1) result = result[0]; return result; }; -},{"./compare_events":4,"./equals":10}],8:[function(require,module,exports){ + +/* eslint-disable no-unused-vars, no-debugger, no-undef, no-use-before-define */ +function _renderPoints(possiblePoints, prop) { + var map = window.map; + var points = window.points; + if (!map) return; + if (points !== undefined) points.clearLayers(); + + points = window.points = L.layerGroup([]).addTo(map); + possiblePoints.forEach(function (e) { + var point = L.circleMarker([e.point[1], e.point[0]], { + radius: Math.floor(5 + Math.random() * 10), + color: e[prop] ? 'green' : 'gray', + opacity: e[prop] ? 0.5 : 0.1, + weight: 1 + }).addTo(points); + }); +} + +/* eslint-enable no-unused-vars, no-debugger, no-undef */ + +},{"./compare_events":4,"./operation":13}],8:[function(require,module,exports){ +'use strict'; + var SweepEvent = require('./sweep_event'); var equals = require('./equals'); var compareEvents = require('./compare_events'); @@ -1145,7 +1221,7 @@ module.exports = function divideSegment(se, p, queue) { var l = new SweepEvent(p, true, se.otherEvent, se.isSubject); if (equals(se.point, se.otherEvent.point)) { - console.warn('what is that?', se); + console.warn('what is that, a collapsed segment?', se); } r.contourId = l.contourId = se.contourId; @@ -1185,7 +1261,14 @@ module.exports = { // var abs = Math.abs; module.exports = function equals(p1, p2) { - return p1[0] === p2[0] && p1[1] === p2[1]; + if (p1[0] === p2[0]) { + if (p1[1] === p2[1]) { + return true; + } else { + return false; + } + } + return false; }; // TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164 @@ -1196,6 +1279,8 @@ module.exports = function equals(p1, p2) { // }; },{}],11:[function(require,module,exports){ +'use strict'; + var Queue = require('tinyqueue'); var SweepEvent = require('./sweep_event'); var compareEvents = require('./compare_events'); @@ -1208,9 +1293,9 @@ var contourId = 0; function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { var i, len, s1, s2, e1, e2; - var d = depth + 1; + // var d = depth + 1; for (i = 0, len = contourOrHole.length - 1; i < len; i++) { - s1 = contourOrHole[i], + s1 = contourOrHole[i]; s2 = contourOrHole[i + 1]; //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); e1 = new SweepEvent(s1, false, undefined, isSubject); @@ -1244,7 +1329,7 @@ function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { var eventQueue = new Queue(null, compareEvents); - var polygonSet, isExteriorRing, i, ii, j, jj, k, kk; + var polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk; for (i = 0, ii = subject.length; i < ii; i++) { polygonSet = subject[i]; @@ -1265,15 +1350,17 @@ module.exports = function fillQueue(subject, clipping, sbbox, cbbox) { } return eventQueue; -} +}; },{"./compare_events":4,"./sweep_event":18,"tinyqueue":3}],12:[function(require,module,exports){ 'use strict'; + var subdivideSegments = require('./subdivide_segments'); var connectEdges = require('./connect_edges'); -var equals = require('./equals'); var fillQueue = require('./fill_queue'); -var operations = require('./operation') +var operations = require('./operation'); + +var EMPTY = []; function trivialOperation(subject, clipping, operation) { @@ -1371,7 +1458,9 @@ module.exports.intersection = function (subject, clipping) { */ module.exports.operations = operations; -},{"./connect_edges":7,"./equals":10,"./fill_queue":11,"./operation":13,"./subdivide_segments":17}],13:[function(require,module,exports){ +},{"./connect_edges":7,"./fill_queue":11,"./operation":13,"./subdivide_segments":17}],13:[function(require,module,exports){ +'use strict'; + module.exports = { INTERSECTION: 0, UNION: 1, @@ -1380,6 +1469,8 @@ module.exports = { }; },{}],14:[function(require,module,exports){ +'use strict'; + var divideSegment = require('./divide_segment'); var intersection = require('./segment_intersection'); var equals = require('./equals'); @@ -1459,8 +1550,8 @@ module.exports = function possibleIntersection(se1, se2, queue) { if ((leftCoincide && rightCoincide) || leftCoincide) { // both line segments are equal or share the left endpoint - se1.type = edgeType.NON_CONTRIBUTING; - se2.type = (se1.inOut === se2.inOut) ? + se2.type = edgeType.NON_CONTRIBUTING; + se1.type = (se2.inOut === se1.inOut) ? edgeType.SAME_TRANSITION : edgeType.DIFFERENT_TRANSITION; @@ -1652,6 +1743,8 @@ module.exports = function signedArea(p0, p1, p2) { }; },{}],17:[function(require,module,exports){ +'use strict'; + var Tree = require('avl'); var computeFields = require('./compute_fields'); var possibleIntersection = require('./possible_intersection'); @@ -1659,13 +1752,13 @@ var compareSegments = require('./compare_segments'); var operations = require('./operation'); -module.exports = function subdivide (eventQueue, subject, clipping, sbbox, cbbox, operation) { +module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) { var sweepLine = new Tree(compareSegments); var sortedEvents = []; var rightbound = Math.min(sbbox[2], cbbox[2]); - var prev, next, begin, end; + var prev, next, begin; var INTERSECTION = operations.INTERSECTION; var DIFFERENCE = operations.DIFFERENCE; @@ -1699,6 +1792,7 @@ module.exports = function subdivide (eventQueue, subject, clipping, sbbox, cbbox computeFields(event, next.key, operation); } } + if (prev) { if (possibleIntersection(prev.key, event, eventQueue) === 2) { var prevprev = prev; @@ -1714,7 +1808,7 @@ module.exports = function subdivide (eventQueue, subject, clipping, sbbox, cbbox event = event.otherEvent; next = prev = sweepLine.find(event); - // _renderSweepLine(sweepLine, event.otherEvent.point, event); + //_renderSweepLine(sweepLine, event.otherEvent.point, event); if (prev && next) { @@ -1727,9 +1821,9 @@ module.exports = function subdivide (eventQueue, subject, clipping, sbbox, cbbox // _renderSweepLine(sweepLine, event.otherEvent.point, event); if (next && prev) { - //if (typeof prev !== 'undefined' && typeof next !== 'undefined') { + // if (typeof prev !== 'undefined' && typeof next !== 'undefined') { possibleIntersection(prev.key, next.key, eventQueue); - //} + // } } } } @@ -1748,8 +1842,8 @@ function _renderSweepLine(sweepLine, pos, event) { window.sws = []; sweepLine.forEach(function (e) { var poly = L.polyline([ - e.point.slice().reverse(), - e.otherEvent.point.slice().reverse() + e.key.point.slice().reverse(), + e.key.otherEvent.point.slice().reverse() ], {color: 'green'}).addTo(map); window.sws.push(poly); }); @@ -1774,7 +1868,7 @@ function _renderSweepLine(sweepLine, pos, event) { },{"./compare_segments":5,"./compute_fields":6,"./operation":13,"./possible_intersection":14,"avl":2}],18:[function(require,module,exports){ 'use strict'; -var signedArea = require('./signed_area'); +//var signedArea = require('./signed_area'); var EdgeType = require('./edge_type'); /** @@ -1865,7 +1959,7 @@ SweepEvent.prototype = { return this.left ? (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0 : // signedArea(this.point, this.otherEvent.point, p) > 0 : - (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0 + (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0; //signedArea(this.otherEvent.point, this.point, p) > 0; }, @@ -1884,10 +1978,24 @@ SweepEvent.prototype = { */ isVertical: function () { return this.point[0] === this.otherEvent.point[0]; + }, + + + clone: function () { + var copy = new SweepEvent( + this.point, this.left, this.otherEvent, this.isSubject, this.type); + + copy.inResult = this.inResult; + copy.prevInResult = this.prevInResult; + copy.isExteriorRing = this.isExteriorRing; + copy.inOut = this.inOut; + copy.otherInOut = this.otherInOut; + + return copy; } }; module.exports = SweepEvent; -},{"./edge_type":9,"./signed_area":16}]},{},[1])(1) +},{"./edge_type":9}]},{},[1])(1) }); \ No newline at end of file From 5e6b8b41d5e749827ab43fffd41cd9a187411856 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Sun, 17 Dec 2017 16:33:15 +0100 Subject: [PATCH 33/42] just threw away code --- demo/js/bundle.js | 19 +++++-------------- dist/martinez.js | 17 ++++------------- src/compute_fields.js | 2 ++ src/connect_edges.js | 15 ++------------- 4 files changed, 13 insertions(+), 40 deletions(-) diff --git a/demo/js/bundle.js b/demo/js/bundle.js index 0acaae2..62a30ff 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -2851,6 +2851,7 @@ module.exports = function computeFields(event, prev, operation) { }; +/* eslint-disable indent */ function inResult(event, operation) { switch (event.type) { case edgeType.NORMAL: @@ -2877,6 +2878,7 @@ function inResult(event, operation) { } return false; } +/* eslint-enable indent */ },{"./edge_type":18,"./operation":22}],16:[function(require,module,exports){ 'use strict'; @@ -2914,21 +2916,10 @@ function orderEvents(sortedEvents) { } } - for (i = 0, len = resultEvents.length; i < len; i++) { - if (i < len - 1) { - if (resultEvents[i].point[0] !== resultEvents[i + 1].point[0] && - resultEvents[i].point[1] !== resultEvents[i + 1].point[1] && - resultEvents[i].point[1] === resultEvents[i].otherEvent.point[1]) { - var currentCloned = resultEvents[i + 1].clone(); - resultEvents.splice(i + 1, 0, currentCloned); - len = resultEvents.length; - } - } - resultEvents[i].pos = i; - } - for (i = 0, len = resultEvents.length; i < len; i++) { event = resultEvents[i]; + event.pos = i; + if (!event.left) { tmp = event.pos; event.pos = event.otherEvent.pos; @@ -3881,4 +3872,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdG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x0aW5nIHRoZSBgLnR5cGUoKWAgdG8gXCJqc29uXCIgd2hlblxuICogYW4gb2JqZWN0IGlzIGdpdmVuLlxuICpcbiAqIEV4YW1wbGVzOlxuICpcbiAqICAgICAgIC8vIG1hbnVhbCBqc29uXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2pzb24nKVxuICogICAgICAgICAuc2VuZCgne1wibmFtZVwiOlwidGpcIn0nKVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGF1dG8ganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIG1hbnVhbCB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKCduYW1lPXRqJylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdmb3JtJylcbiAqICAgICAgICAgLnNlbmQoeyBuYW1lOiAndGonIH0pXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gZGVmYXVsdHMgdG8geC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgIC5zZW5kKCduYW1lPXRvYmknKVxuICogICAgICAgIC5zZW5kKCdzcGVjaWVzPWZlcnJldCcpXG4gKiAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gK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O1xuICAgIH0sXG5cbiAgICBwZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRhdGFbMF07XG4gICAgfSxcblxuICAgIF91cDogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmU7XG5cbiAgICAgICAgd2hpbGUgKHBvcyA+IDApIHtcbiAgICAgICAgICAgIHZhciBwYXJlbnQgPSBNYXRoLmZsb29yKChwb3MgLSAxKSAvIDIpO1xuICAgICAgICAgICAgaWYgKGNvbXBhcmUoZGF0YVtwb3NdLCBkYXRhW3BhcmVudF0pIDwgMCkge1xuICAgICAgICAgICAgICAgIHN3YXAoZGF0YSwgcGFyZW50LCBwb3MpO1xuICAgICAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcblxuICAgICAgICAgICAgfSBlbHNlIGJyZWFrO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhLFxuICAgICAgICAgICAgY29tcGFyZSA9IHRoaXMuY29tcGFyZSxcbiAgICAgICAgICAgIGxlbiA9IHRoaXMubGVuZ3RoO1xuXG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICB2YXIgbGVmdCA9IDIgKiBwb3MgKyAxLFxuICAgICAgICAgICAgICAgIHJpZ2h0ID0gbGVmdCArIDEsXG4gICAgICAgICAgICAgICAgbWluID0gcG9zO1xuXG4gICAgICAgICAgICBpZiAobGVmdCA8IGxlbiAmJiBjb21wYXJlKGRhdGFbbGVmdF0sIGRhdGFbbWluXSkgPCAwKSBtaW4gPSBsZWZ0O1xuICAgICAgICAgICAgaWYgKHJpZ2h0IDwgbGVuICYmIGNvbXBhcmUoZGF0YVtyaWdodF0sIGRhdGFbbWluXSkgPCAwKSBtaW4gPSBya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mVudC5pblJlc3VsdCA9IGluUmVzdWx0KGV2ZW50LCBvcGVyYXRpb24pO1xufTtcblxuXG5mdW5jdGlvbiBpblJlc3VsdChldmVudCwgb3BlcmF0aW9uKSB7XG4gIHN3aXRjaCAoZXZlbnQudHlwZSkge1xuICAgIGNhc2UgZWRnZVR5cGUuTk9STUFMOlxuICAgICAgc3dpdGNoIChvcGVyYXRpb24pIHtcbiAgICAgICAgY2FzZSBJTlRFUlNFQ1RJT046XG4gICAgICAgICAgcmV0dXJuICFldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIFVOSU9OOlxuICAgICAgICAgIHJldHVybiBldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIERJRkZFUkVOQ0U6XG4gICAgICAgICAgLy8gcmV0dXJuIChldmVudC5pc1N1YmplY3QgJiYgIWV2ZW50Lm90aGVySW5PdXQpIHx8XG4gICAgICAgICAgLy8gICAgICAgICAoIWV2ZW50LmlzU3ViamVjdCAmJiBldmVudC5vdGhlckluT3V0KTtcbiAgICAgICAgICByZXR1cm4gKGV2ZW50LmlzU3ViamVjdCAmJiBldmVudC5vdGhlckluT3V0KSB8fFxuICAgICAgICAgICAgICAgICAgKCFldmVudC5pc1N1YmplY3QgJiYgIWV2ZW50Lm90aGVySW5PdXQpO1xuICAgICAgICBjYXNlIFhPUjpcbiAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgZWRnZVR5cGUuU0FNRV9UUkFOU0lUSU9OOlxuICAgICAgcmV0dXJuIG9wZXJhdGlvbiA9PT0gSU5URVJTRUNUSU9OIHx8IG9wZXJhdGlvbiA9PT0gVU5JT047XG4gICAgY2FzZSBlZGdlVHlwZS5ESUZGRVJFTlRfVFJBTlNJVElPTjpcbiAgICAgIHJldHVybiBvcGVyYXRpb24gPT09IERJRkZFUkVOQ0U7XG4gICAgY2FzZSBlZGdlVHlwZS5OT05fQ09OVFJJQlVUSU5HO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AgICYmIGV2ZW50LnBvaW50WzBdID4gc2Jib3hbMl0pKSB7XG4gICAgICBicmVhaztcbiAgICB9XG5cbiAgICBpZiAoZXZlbnQubGVmdCkge1xuICAgICAgbmV4dCAgPSBwcmV2ID0gc3dlZXBMaW5lLmluc2VydChldmVudCk7XG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5wb2ludCwgZXZlbnQpO1xuICAgICAgYmVnaW4gPSBzd2VlcExpbmUubWluTm9kZSgpO1xuXG4gICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChwcmV2KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgZXZlbnQsIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgdmFyIHByZXZwcmV2ID0gcHJldjtcbiAgICAgICAgICBpZiAocHJldnByZXYgIT09IGJlZ2luKSBwcmV2cHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXZwcmV2KTtcbiAgICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICBwcmV2cHJldiA9IG51bGw7XG5cbiAgICAgICAgICBwcmV2cHJldkV2ZW50ID0gcHJldnByZXYgPyBwcmV2cHJldi5rZXkgOiBudWxsO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMocHJldkV2ZW50LCBwcmV2cHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsICAgICBwcmV2RXZlbnQsICAgICBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGV2ZW50ID0gZXZlbnQub3RoZXJFdmVudDtcbiAgICAgIG5leHQgPSBwcmV2ID0gc3dlZXBMaW5lLmZpbmQoZXZlbnQpO1xuXG4gICAgICAvL19yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgIGlmIChwcmV2ICYmIG5leHQpIHtcblxuICAgICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgICAgZWxzZSAgICAgICAgICAgICAgICBwcmV2ID0gbnVsbDtcblxuICAgICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG4gICAgICAgIHN3ZWVwTGluZS5yZW1vdmUoZXZlbnQpO1xuXG4gICAgICAgIC8vIF9yZW5kZXJTd2VlcExpbmUoc3dlZXBMaW5lLCBldmVudC5vdGhlckV2ZW50LnBvaW50LCBldmVudCk7XG5cbiAgICAgICAgaWYgKG5leHQgJiYgcHJldikge1xuICAgICAgICAgIC8vIGlmICh0eXBlb2YgcHJldiAhPT0gJ3VuZGVmaW5lZCcgJiYgdHlwZW9mIG5leHQgIT09ICd1bmRlZmluZWQnKSB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gcmV0dXJuIHRoaXMucG9pbnRbMF0gPT09IHRoaXMub3RoZXJFdmVudC5wb2ludFswXTtcbiAgfSxcblxuXG4gIGNsb25lOiBmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGNvcHkgPSBuZXcgU3dlZXBFdmVudChcbiAgICAgIHRoaXMucG9pbnQsIHRoaXMubGVmdCwgdGhpcy5vdGhlckV2ZW50LCB0aGlzLmlzU3ViamVjdCwgdGhpcy50eXBlKTtcblxuICAgIGNvcHkuaW5SZXN1bHQgICAgICAgPSB0aGlzLmluUmVzdWx0O1xuICAgIGNvcHkucHJldkluUmVzdWx0ICAgPSB0aGlzLnByZXZJblJlc3VsdDtcbiAgICBjb3B5LmlzRXh0ZXJpb3JSaW5nID0gdGhpcy5pc0V4dGVyaW9yUmluZztcbiAgICBjb3B5LmluT3V0ICAgICAgICAgID0gdGhpcy5pbk91dDtcbiAgICBjb3B5Lm90aGVySW5PdXQgICAgID0gdGhpcy5vdGhlckluT3V0O1xuXG4gICAgcmV0dXJuIGNvcHk7XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzID0gU3dlZXBFdmVudDtcbiJdfQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvb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ICAgICAgaWYgKGNvbXBhcmUoZGF0YVtwb3NdLCBkYXRhW3BhcmVudF0pIDwgMCkge1xuICAgICAgICAgICAgICAgIHN3YXAoZGF0YSwgcGFyZW50LCBwb3MpO1xuICAgICAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcblxuICAgICAgICAgICAgfSBlbHNlIGJyZWFrO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhLFxuICAgICAgICAgICAgY29tcGFyZSA9IHRoaXMuY29tcGFyZSxcbiAgICAgICAgICAgIGxlbiA9IHRoaXMubGVuZ3RoO1xuXG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICB2YXIgbGVmdCA9IDIgKiBwb3MgKyAxLFxuICAgICAgICAgICAgICAgIHJpZ2h0ID0gbGVmdCArIDEsXG4gICAgICAgICAgICAgICAgbWluID0gcG9zO1xuXG4gICAgICAgICAgICBpZiAobGVmdCA8IGxlbiAmJiBjb21wYXJlKGRhdGFbbGVmdF0sIGRhdGFbbWluXSkgPCAwKSBtaW4gPSBsZWZ0O1xuICAgICAgICAgICAgaWYgKHJpZ2h0IDwgbGVuICYmIGNvbXBhcmUoZGF0YVtyaWdodF0sIGRhdGFbbWluXSkgPCAwKSBtaW4gPSByaWdodDtcblxuICAgICAgICAgICAgaWYgKG1pbiA9PT0gcG9zKSByZXR1cm47XG5cbiAgICAgICAgICAgIHN3YXAoZGF0YSwgbWluLCBwb3MpO1xuICAgICAgICAgICAgcG9zID0gbWluO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuZnVuY3Rpb24gc3dhcChkYXRhLCBpLCBqKSB7XG4gICAgdmFyIHRtcCA9IGRhdGFbaV07XG4gICAgZGF0YVtpXSA9IGRhdGFbal07XG4gICAgZGF0YVtqXSA9IHRtcDtcbn1cbiIsIid1c2Ugc3RyaWN0JztcblxudmFyIHNpZ25lZEFy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Y2UgZ29lcyBoZXJlXG4gICAgaWYgKChvcGVyYXRpb24gPT09IElOVEVSU0VDVElPTiAmJiBldmVudC5wb2ludFswXSA+IHJpZ2h0Ym91bmQpIHx8XG4gICAgICAgIChvcGVyYXRpb24gPT09IERJRkZFUkVOQ0UgICAmJiBldmVudC5wb2ludFswXSA+IHNiYm94WzJdKSkge1xuICAgICAgYnJlYWs7XG4gICAgfVxuXG4gICAgaWYgKGV2ZW50LmxlZnQpIHtcbiAgICAgIG5leHQgID0gcHJldiA9IHN3ZWVwTGluZS5pbnNlcnQoZXZlbnQpO1xuICAgICAgLy9fcmVuZGVyU3dlZXBMaW5lKHN3ZWVwTGluZSwgZXZlbnQucG9pbnQsIGV2ZW50KTtcbiAgICAgIGJlZ2luID0gc3dlZXBMaW5lLm1pbk5vZGUoKTtcblxuICAgICAgaWYgKHByZXYgIT09IGJlZ2luKSBwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldik7XG4gICAgICBlbHNlICAgICAgICAgICAgICAgIHByZXYgPSBudWxsO1xuXG4gICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG5cbiAgICAgIHZhciBwcmV2RXZlbnQgPSBwcmV2ID8gcHJldi5rZXkgOiBudWxsO1xuICAgICAgdmFyIHByZXZwcmV2RXZlbnQ7XG4gICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICBpZiAobmV4dCkge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW50LCAgICAgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBldmVudCA9IGV2ZW50Lm90aGVyRXZlbnQ7XG4gICAgICBuZXh0ID0gcHJldiA9IHN3ZWVwTGluZS5maW5kKGV2ZW50KTtcblxuICAgICAgLy9fcmVuZGVyU3dlZXBMaW5lKHN3ZWVwTGluZSwgZXZlbnQub3RoZXJFdmVudC5wb2ludCwgZXZlbnQpO1xuXG4gICAgICBpZiAocHJldiAmJiBuZXh0KSB7XG5cbiAgICAgICAgaWYgKHByZXYgIT09IGJlZ2luKSBwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldik7XG4gICAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgICAgbmV4dCA9IHN3ZWVwTGluZS5uZXh0KG5leHQpO1xuICAgICAgICBzd2VlcExpbmUucmVtb3ZlKGV2ZW50KTtcblxuICAgICAgICAvLyBfcmVuZGVyU3dlZXBMaW5lKHN3ZWVwTGluZSwgZXZlbnQub3RoZXJFdmVudC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WxvdyhwKTtcbiAgfSxcblxuXG4gIC8qKlxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNWZXJ0aWNhbDogZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiB0aGlzLnBvaW50WzBdID09PSB0aGlzLm90aGVyRXZlbnQucG9pbnRbMF07XG4gIH0sXG5cblxuICBjbG9uZTogZnVuY3Rpb24gKCkge1xuICAgIHZhciBjb3B5ID0gbmV3IFN3ZWVwRXZlbnQoXG4gICAgICB0aGlzLnBvaW50LCB0aGlzLmxlZnQsIHRoaXMub3RoZXJFdmVudCwgdGhpcy5pc1N1YmplY3QsIHRoaXMudHlwZSk7XG5cbiAgICBjb3B5LmluUmVzdWx0ICAgICAgID0gdGhpcy5pblJlc3VsdDtcbiAgICBjb3B5LnByZXZJblJlc3VsdCAgID0gdGhpcy5wcmV2SW5SZXN1bHQ7XG4gICAgY29weS5pc0V4dGVyaW9yUmluZyA9IHRoaXMuaXNFeHRlcmlvclJpbmc7XG4gICAgY29weS5pbk91dCAgICAgICAgICA9IHRoaXMuaW5PdXQ7XG4gICAgY29weS5vdGhlckluT3V0ICAgICA9IHRoaXMub3RoZXJJbk91dDtcblxuICAgIHJldHVybiBjb3B5O1xuICB9XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IFN3ZWVwRXZlbnQ7XG4iXX0= diff --git a/dist/martinez.js b/dist/martinez.js index 1985427..cea5f63 100644 --- a/dist/martinez.js +++ b/dist/martinez.js @@ -968,6 +968,7 @@ module.exports = function computeFields(event, prev, operation) { }; +/* eslint-disable indent */ function inResult(event, operation) { switch (event.type) { case edgeType.NORMAL: @@ -994,6 +995,7 @@ function inResult(event, operation) { } return false; } +/* eslint-enable indent */ },{"./edge_type":9,"./operation":13}],7:[function(require,module,exports){ 'use strict'; @@ -1031,21 +1033,10 @@ function orderEvents(sortedEvents) { } } - for (i = 0, len = resultEvents.length; i < len; i++) { - if (i < len - 1) { - if (resultEvents[i].point[0] !== resultEvents[i + 1].point[0] && - resultEvents[i].point[1] !== resultEvents[i + 1].point[1] && - resultEvents[i].point[1] === resultEvents[i].otherEvent.point[1]) { - var currentCloned = resultEvents[i + 1].clone(); - resultEvents.splice(i + 1, 0, currentCloned); - len = resultEvents.length; - } - } - resultEvents[i].pos = i; - } - for (i = 0, len = resultEvents.length; i < len; i++) { event = resultEvents[i]; + event.pos = i; + if (!event.left) { tmp = event.pos; event.pos = event.otherEvent.pos; diff --git a/src/compute_fields.js b/src/compute_fields.js index d5d5ce2..844be70 100644 --- a/src/compute_fields.js +++ b/src/compute_fields.js @@ -43,6 +43,7 @@ module.exports = function computeFields(event, prev, operation) { }; +/* eslint-disable indent */ function inResult(event, operation) { switch (event.type) { case edgeType.NORMAL: @@ -69,3 +70,4 @@ function inResult(event, operation) { } return false; } +/* eslint-enable indent */ diff --git a/src/connect_edges.js b/src/connect_edges.js index 5b6d73c..8235771 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -33,21 +33,10 @@ function orderEvents(sortedEvents) { } } - for (i = 0, len = resultEvents.length; i < len; i++) { - if (i < len - 1) { - if (resultEvents[i].point[0] !== resultEvents[i + 1].point[0] && - resultEvents[i].point[1] !== resultEvents[i + 1].point[1] && - resultEvents[i].point[1] === resultEvents[i].otherEvent.point[1]) { - var currentCloned = resultEvents[i + 1].clone(); - resultEvents.splice(i + 1, 0, currentCloned); - len = resultEvents.length; - } - } - resultEvents[i].pos = i; - } - for (i = 0, len = resultEvents.length; i < len; i++) { event = resultEvents[i]; + event.pos = i; + if (!event.left) { tmp = event.pos; event.pos = event.otherEvent.pos; From 323f9cb167827feb2e175267b9d7a67fb516c7e1 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Sun, 17 Dec 2017 16:56:21 +0100 Subject: [PATCH 34/42] that fixed difference in #holecut --- demo/js/bundle.js | 19 +++++++------------ demo/js/index.js | 3 ++- src/connect_edges.js | 14 ++++---------- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/demo/js/bundle.js b/demo/js/bundle.js index 62a30ff..0b2ac6a 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -222,7 +222,7 @@ function run (op) { console.timeEnd('martinez'); //if (op === OPERATIONS.UNION) result = result[0]; - // console.log('result', result); + console.log('result', result); // console.log(JSON.stringify(result)) results.clearLayers(); @@ -251,6 +251,7 @@ function run (op) { } res = writer.write(res); console.timeEnd('jsts'); + console.log(res); }, 500); } } @@ -2981,14 +2982,14 @@ module.exports = function connectEdges(sortedEvents, operation) { var event; for (i = 0, len = resultEvents.length; i < len; i++) { - // console.log('i is ' + i) if (processed[i]) continue; var contour = [[]]; if (!resultEvents[i].isExteriorRing) { if (result.length === 0) { result.push([[contour]]); - } else if (operation === operationType.UNION || operation === operationType.XOR) { + } else if (operation === operationType.UNION || + operation === operationType.XOR) { result[result.length - 1].push(contour[0]); } else { result[result.length - 1].push(contour); @@ -3004,8 +3005,6 @@ module.exports = function connectEdges(sortedEvents, operation) { contour[0].push(initial); while (pos >= i) { - // console.log('pos is ' + pos) - event = resultEvents[pos]; processed[pos] = true; @@ -3016,13 +3015,9 @@ module.exports = function connectEdges(sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } - // new L.Marker(event.point.slice().reverse()).addTo(map); pos = event.pos; processed[pos] = true; - // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); - // new L.circleMarker(resultEvents[pos].point.slice().reverse()).addTo(map); - // console.log(resultEvents[pos].point) contour[0].push(resultEvents[pos].point); pos = nextPos(pos, resultEvents, processed, i); } @@ -3034,7 +3029,6 @@ module.exports = function connectEdges(sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } - //_renderPoints(resultEvents, 'resultInOut'); for (i = 0, len = result.length; i < len; i++) { var polygon = result[i]; @@ -3043,8 +3037,9 @@ module.exports = function connectEdges(sortedEvents, operation) { for (var k = 0, kk = polygonContour.length; k < kk; k++) { var coords = polygonContour[k]; if (typeof coords[0] !== 'number') { - polygon.push(coords[0]); + console.log('p', polygon.slice(), 'c', coords); polygon.splice(j, 1); + polygon.push(coords); } } } @@ -3872,4 +3867,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvbGliL2lzLW9iamVjdC5qcyIsIm5vZGVfbW9kdWxlcy9zdXBlcmFnZW50L2xpYi9yZXF1ZXN0LWJhc2UuanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvcmVxdWVzdC5qcyIsIm5vZGVfbW9kdWxlcy90aW55cXVldWUvaW5kZXguanMiLCJzcmMvY29tcGFyZV9ldmVudHMuanMiLCJzcmMvY29tcGFyZV9zZWdtZW50cy5qcyIsInNyYy9jb21wdXRlX2ZpZWxkcy5qcyIsInNyYy9jb25uZWN0X2VkZ2VzLmpzIiwic3JjL2RpdmlkZV9zZWdtZW50LmpzIiwic3JjL2VkZ2VfdHlwZS5qcyIsInNyYy9lcXVhbHMuanMiLCJzcmMvZmlsbF9xdWV1ZS5qcyIsInNyYy9pbmRleC5qcyIsInNyYy9vcGVyYXRpb24uanMiLCJzcmMvcG9zc2libGVfaW50ZXJzZW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gIHBvcDogZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgdG9wID0gdGhpcy5kYXRhWzBdO1xuICAgICAgICB0aGlzLmRhdGFbMF0gPSB0aGlzLmRhdGFbdGhpcy5sZW5ndGggLSAxXTtcbiAgICAgICAgdGhpcy5sZW5ndGgtLTtcbiAgICAgICAgdGhpcy5kYXRhLnBvcCgpO1xuICAgICAgICB0aGlzLl9kb3duKDApO1xuICAgICAgICByZXR1cm4gdG9wO1xuICAgIH0sXG5cbiAgICBwZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRhdGFbMF07XG4gICAgfSxcblxuICAgIF91cDogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmU7XG5cbiAgICAgICAgd2hpbGUgKHBvcyA+IDApIHtcbiAgICAgICAgICAgIHZhciBwYXJlbnQgPSBNYXRoLmZsb29yKChwb3MgLSAxKSAvIDIpO1xuICAgICAgICAgICAgaWYgKGNvbXBhcmUoZGF0YVtwb3NdLCBkYXRhW3BhcmVudF0pIDwgMCkge1xuICAgICAgICAgICAgICAgIHN3YXAoZGF0YSwgcGFyZW50LCBwb3MpO1xuICAgICAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcblxuICAgICAgICAgICAgfSBlbHNlIGJyZWFrO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhLFxuICAgICAgICAgICAgY29tcGFyZSA9IHRoaXMuY29tcGFyZSxcbiAgICAgICAgICAgIGxlbiA9IHRoaXMubGVuZ3RoO1xuXG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICB2YXIgbGVmdCA9IDIgKiBwb3MgKyAxLFxuICAgICAgICAgICAgICAgIHJpZ2h0ID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c3dlZXBMaW5lLnByZXYocHJldik7XG4gICAgICBlbHNlICAgICAgICAgICAgICAgIHByZXYgPSBudWxsO1xuXG4gICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG5cbiAgICAgIHZhciBwcmV2RXZlbnQgPSBwcmV2ID8gcHJldi5rZXkgOiBudWxsO1xuICAgICAgdmFyIHByZXZwcmV2RXZlbnQ7XG4gICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICBpZiAobmV4dCkge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW50LCAgICA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GVuZ3RoKys7XG4gICAgICAgIHRoaXMuX3VwKHRoaXMubGVuZ3RoIC0gMSk7XG4gICAgfSxcblxuICAgIHBvcDogZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgdG9wID0gdGhpcy5kYXRhWzBdO1xuICAgICAgICB0aGlzLmRhdGFbMF0gPSB0aGlzLmRhdGFbdGhpcy5sZW5ndGggLSAxXTtcbiAgICAgICAgdGhpcy5sZW5ndGgtLTtcbiAgICAgICAgdGhpcy5kYXRhLnBvcCgpO1xuICAgICAgICB0aGlzLl9kb3duKDApO1xuICAgICAgICByZXR1cm4gdG9wO1xuICAgIH0sXG5cbiAgICBwZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRhdGFbMF07XG4gICAgfSxcblxuICAgIF91cDogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmU7XG5cbiAgICAgICAgd2hpbGUgKHBvcyA+IDApIHtcbiAgICAgICAgICAgIHZhciBwYXJlbnQgPSBNYXRoLmZsb29yKChwb3MgLSAxKSAvIDIpO1xuICAgICAgICAgICAgaWYgKGNvbXBhcmUoZGF0YVtwb3NdLCBkYXRhW3BhcmVudF0pIDwgMCkge1xuICAgICAgICAgICAgICAgIHN3YXAoZGF0YSwgcGFyZW50LCBwb3MpO1xuICAgICAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcblxuICAgICAgICAgICAgfSBlbHNlIGJyZWFrO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhLFxuICAgICAgICAgICAgY29tcGFyZSA9IHRoaXMuY29tcGFyZSxcbiAgICAgICAgICAgIGxlbiA9IHRoaXMubGVuZ3RoO1xuXG4gICAgICAgIHdoaWxlICh0cnVlKSB7X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NpYmxlSW50ZXJzZWN0aW9uKGV2ZW50LCBuZXh0LmtleSwgZXZlbnRRdWV1ZSkgPT09IDIpIHtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgbmV4dC5rZXksIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKHByZXYpIHtcbiAgICAgICAgaWYgKHBvc3NpYmxlSW50ZXJzZWN0aW9uKHByZXYua2V5LCBldmVudCwgZXZlbnRRdWV1ZSkgPT09IDIpIHtcbiAgICAgICAgICB2YXIgcHJldnByZXYgPSBwcmV2O1xuICAgICAgICAgIGlmIChwcmV2cHJldiAhPT0gYmVnaW4pIHByZXZwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldnByZXYpO1xuICAgICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgIHByZXZwcmV2ID0gbnVsbDtcblxuICAgICAgICAgIHByZXZwcmV2RXZlbnQgPSBwcmV2cHJldiA/IHByZXZwcmV2LmtleSA6IG51bGw7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhwcmV2RXZlbnQsIHByZXZwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgICAgIHByZXZFdmVudCwgICAgIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZXZlbnQgPSBldmVudC5vdGhlckV2ZW50O1xuICAgICAgbmV4dCA9IHByZXYgPSBzd2VlcExpbmUuZmluZChldmVudCk7XG5cbiAgICAgIC8vX3JlbmRlclN3ZWVwTGluZShzd2VlcExpbmUsIGV2ZW50Lm90aGVyRXZlbnQucG9pbnQsIGV2ZW50KTtcblxuICAgICAgaWYgKHByZXYgJiYgbmV4dCkge1xuXG4gICAgICAgIGlmIChw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LSBwWzBdKSAqIChwMVsxXSAtIHBbMV0pID4gMDtcbiAgICAgIC8vc2lnbmVkQXJlYSh0aGlzLm90aGVyRXZlbnQucG9pbnQsIHRoaXMucG9pbnQsIHApID4gMDtcbiAgfSxcblxuXG4gIC8qKlxuICAgKiBAcGFyYW0gIHtBcnJheS48TnVtYmVyPn0gIHBcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzQWJvdmU6IGZ1bmN0aW9uIChwKSB7XG4gICAgcmV0dXJuICF0aGlzLmlzQmVsb3cocCk7XG4gIH0sXG5cblxuICAvKipcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzVmVydGljYWw6IGZ1bmN0aW9uICgpIHtcbiAgICByZXR1cm4gdGhpcy5wb2ludFswXSA9PT0gdGhpcy5vdGhlckV2ZW50LnBvaW50WzBdO1xuICB9LFxuXG5cbiAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgY29weSA9IG5ldyBTd2VlcEV2ZW50KFxuICAgICAgdGhpcy5wb2ludCwgdGhpcy5sZWZ0LCB0aGlzLm90aGVyRXZlbnQsIHRoaXMuaXNTdWJqZWN0LCB0aGlzLnR5cGUpO1xuXG4gICAgY29weS5pblJlc3VsdCAgICAgICA9IHRoaXMuaW5SZXN1bHQ7XG4gICAgY29weS5wcmV2SW5SZXN1bHQgICA9IHRoaXMucHJldkluUmVzdWx0O1xuICAgIGNvcHkuaXNFeHRlcmlvclJpbmcgPSB0aGlzLmlzRXh0ZXJpb3JSaW5nO1xuICAgIGNvcHkuaW5PdXQgICAgICAgICAgPSB0aGlzLmluT3V0O1xuICAgIGNvcHkub3RoZXJJbk91dCAgICAgPSB0aGlzLm90aGVySW5PdXQ7XG5cbiAgICByZXR1cm4gY29weTtcbiAgfVxufTtcblxubW9kdWxlLmV4cG9ydHMgPSBTd2VlcEV2ZW50O1xuIl19 diff --git a/demo/js/index.js b/demo/js/index.js index e65a44b..06eca86 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -155,7 +155,7 @@ function run (op) { console.timeEnd('martinez'); //if (op === OPERATIONS.UNION) result = result[0]; - // console.log('result', result); + console.log('result', result); // console.log(JSON.stringify(result)) results.clearLayers(); @@ -184,6 +184,7 @@ function run (op) { } res = writer.write(res); console.timeEnd('jsts'); + console.log(res); }, 500); } } diff --git a/src/connect_edges.js b/src/connect_edges.js index 8235771..3904b76 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -98,14 +98,14 @@ module.exports = function connectEdges(sortedEvents, operation) { var event; for (i = 0, len = resultEvents.length; i < len; i++) { - // console.log('i is ' + i) if (processed[i]) continue; var contour = [[]]; if (!resultEvents[i].isExteriorRing) { if (result.length === 0) { result.push([[contour]]); - } else if (operation === operationType.UNION || operation === operationType.XOR) { + } else if (operation === operationType.UNION || + operation === operationType.XOR) { result[result.length - 1].push(contour[0]); } else { result[result.length - 1].push(contour); @@ -121,8 +121,6 @@ module.exports = function connectEdges(sortedEvents, operation) { contour[0].push(initial); while (pos >= i) { - // console.log('pos is ' + pos) - event = resultEvents[pos]; processed[pos] = true; @@ -133,13 +131,9 @@ module.exports = function connectEdges(sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } - // new L.Marker(event.point.slice().reverse()).addTo(map); pos = event.pos; processed[pos] = true; - // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); - // new L.circleMarker(resultEvents[pos].point.slice().reverse()).addTo(map); - // console.log(resultEvents[pos].point) contour[0].push(resultEvents[pos].point); pos = nextPos(pos, resultEvents, processed, i); } @@ -151,7 +145,6 @@ module.exports = function connectEdges(sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } - //_renderPoints(resultEvents, 'resultInOut'); for (i = 0, len = result.length; i < len; i++) { var polygon = result[i]; @@ -160,8 +153,9 @@ module.exports = function connectEdges(sortedEvents, operation) { for (var k = 0, kk = polygonContour.length; k < kk; k++) { var coords = polygonContour[k]; if (typeof coords[0] !== 'number') { - polygon.push(coords[0]); + console.log('p', polygon.slice(), 'c', coords); polygon.splice(j, 1); + polygon.push(coords); } } } From 12c95fb8ed297be2cf33e2a8f27a3ceaa4f09cab Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Mon, 18 Dec 2017 13:29:19 +0100 Subject: [PATCH 35/42] removed console.log --- demo/js/bundle.js | 3 +-- src/connect_edges.js | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/demo/js/bundle.js b/demo/js/bundle.js index 0b2ac6a..d5441fd 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -3037,7 +3037,6 @@ module.exports = function connectEdges(sortedEvents, operation) { for (var k = 0, kk = polygonContour.length; k < kk; k++) { var coords = polygonContour[k]; if (typeof coords[0] !== 'number') { - console.log('p', polygon.slice(), 'c', coords); polygon.splice(j, 1); polygon.push(coords); } @@ -3867,4 +3866,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvbGliL2lzLW9iamVjdC5qcyIsIm5vZGVfbW9kdWxlcy9zdXBlcmFnZW50L2xpYi9yZXF1ZXN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1xuICAgICAgZWxzZSAgICAgICAgICAgICAgICBwcmV2ID0gbnVsbDtcblxuICAgICAgbmV4dCA9IHN3ZWVwTGluZS5uZXh0KG5leHQpO1xuXG4gICAgICB2YXIgcHJldkV2ZW50ID0gcHJldiA/IHByZXYua2V5IDogbnVsbDtcbiAgICAgIHZhciBwcmV2cHJldkV2ZW50O1xuICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgaWYgKG5leHQpIHtcbiAgICAgICAgaWYgKHBvc3NpYmxlSW50ZXJzZWN0aW9uKGV2ZW50LCBuZXh0LmtleSwgZXZlbnRRdWV1ZSkgPT09IDIpIHtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgbmV4dC5rZXksIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKHByZXYpIHtcbiAgICAgICAgaWYgKHBvc3NpYmxlSW50ZXJzZWN0aW9uKHByZXYua2V5LCBldmVudCwgZXZlbnRRdWV1ZSkgPT09IDIpIHtcbiAgICAgICAgICB2YXIgcHJldnByZXYgPSBwcmV2O1xuICAgICAgICAgIGlmIChwcmV2cHJldiAhPT0gYmVnaW4pIHByZXZwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldnByZXYpO1xuICAgICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgIHByZXZwcmV2ID0gbnVsbDtcblxuICAgICAgICAgIHByZXZwcmV2RXZlbnQgPSBwcmV2cHJldiA/IHByZXZwcmV2LmtleSA6IG51bGw7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhwcmV2RXZlbnQsIHByZXZwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgICAgIHByZXZFdmVudCwgICAg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cHJldi5vdGhlckluT3V0O1xuICAgICAgZXZlbnQub3RoZXJJbk91dCA9IHByZXYuaXNWZXJ0aWNhbCgpID8gIXByZXYuaW5PdXQgOiBwcmV2LmluT3V0O1xuICAgIH1cblxuICAgIC8vIGNvbXB1dGUgcHJldkluUmVzdWx0IGZpZWxkXG4gICAgaWYgKHByZXYpIHtcbiAgICAgIGV2ZW50LnByZXZJblJlc3VsdCA9ICghaW5SZXN1bHQocHJldiwgb3BlcmF0aW9uKSB8fCBwcmV2LmlzVmVydGljYWwoKSkgP1xuICAgICAgICAgcHJldi5wcmV2SW5SZXN1bHQgOiBwcmV2O1xuICAgIH1cbiAgfVxuXG4gIC8vIGNoZWNrIGlmIHRoZSBsaW5lIHNlZ21lbnQgYmVsb25ncyB0byB0aGUgQm9vbGVhbiBvcGVyYXRpb25cbiAgZXZlbnQuaW5SZXN1bHQgPSBpblJlc3VsdChldmVudCwgb3BlcmF0aW9uKTtcbn07XG5cblxuLyogZXNsaW50LWRpc2FibGUgaW5kZW50ICovXG5mdW5jdGlvbiBpblJlc3VsdChldmVudCwgb3BlcmF0aW9uKSB7XG4gIHN3aXRjaCAoZXZlbnQudHlwZSkge1xuICAgIGNhc2UgZWRnZVR5cGUuTk9STUFMOlxuICAgICAgc3dpdGNoIChvcGVyYXRpb24pIHtcbiAgICAgICAgY2FzZSBJTlRFUlNFQ1RJT046XG4gICAgICAgICAgcmV0dXJuICFldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIFVOSU9OOlxuICAgICAgICAgIHJldHVybiBldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIERJRkZFUkVOQ0U6XG4gICAgICAgICAgLy8gcmV0dXJuIChldmVudC5pc1N1YmplY3QgJiYgIWV2ZW50Lm90aGVySW5PdXQpIHx8XG4gICAgICAgICAgLy8gICAgICAgICAoIWV2ZW50LmlzU3ViamVjdCAmJiBldmVudC5vdGhlckluT3V0KTtcbiAgICAgICAgICByZXR1cm4gKGV2ZW50L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cmF0aW9uID09PSBvcGVyYXRpb25UeXBlLlhPUikge1xuICAgICAgICByZXN1bHRbcmVzdWx0Lmxlbmd0aCAtIDFdLnB1c2goY29udG91clswXSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXN1bHRbcmVzdWx0Lmxlbmd0aCAtIDFdLnB1c2goY29udG91cik7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIHJlc3VsdC5wdXNoKGNvbnRvdXIpO1xuICAgIH1cblxuICAgIHZhciByaW5nSWQgPSByZXN1bHQubGVuZ3RoIC0gMTtcbiAgICB2YXIgcG9zID0gaTtcblxuICAgIHZhciBpbml0aWFsID0gcmVzdWx0RXZlbnRzW2ldLnBvaW50O1xuICAgIGNvbnRvdXJbMF0ucHVzaChpbml0aWFsKTtcblxuICAgIHdoaWxlIChwb3MgPj0gaSkge1xuICAgICAgZXZlbnQgPSByZXN1bHRFdmVudHNbcG9zXTtcbiAgICAgIHByb2Nlc3NlZFtwb3NdID0gdHJ1ZTtcblxuICAgICAgaWYgKGV2ZW50LmxlZnQpIHtcbiAgICAgICAgZXZlbnQucmVzdWx0SW5PdXQgPSBmYWxzZTtcbiAgICAgICAgZXZlbnQuY29udG91cklkICAgPSByaW5nSWQ7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBldmVudC5vdGhlckV2ZW50LnJlc3VsdEluT3V0ID0gdHJ1ZTtcbiAgICAgICAgZXZlbnQub3RoZXJFdmVudC5jb250b3VySWQgICA9IHJpbmdJZDtcbiAgICAgIH1cblxuICAgICAgcG9zID0gZXZlbnQucG9zO1xuICAgICAgcHJvY2Vzc2VkW3Bvc10gPSB0cnVlO1xuICAgICAgY29udG91clswXS5wdXNoKHJlc3VsdEV2ZW50c1twb3NdLnBvaW50KTtcbiAgICAgIHBvcyA9IG5leHRQb3MocG9zLCByZXN1bHRFdmVudHMsIHByb2Nlc3NlZCwgaSk7XG4gICAgfVxuXG4gICAgcG9zID0gcG9zID09PSAtMSA/IGkgOiB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G5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCAgICAgcHJldkV2ZW50LCAgICAgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBldmVudCA9IGV2ZW50Lm90aGVyRXZlbnQ7XG4gICAgICBuZXh0ID0gcHJldiA9IHN3ZWVwTGluZS5maW5kKGV2ZW50KTtcblxuICAgICAgLy9fcmVuZGVyU3dlZXBMaW5lKHN3ZWVwTGluZSwgZXZlbnQub3RoZXJFdmVudC5wb2ludCwgZXZlbnQpO1xuXG4gICAgICBpZiAocHJldiAmJiBuZXh0KSB7XG5cbiAgICAgICAgaWYgKHByZXYgIT09IGJlZ2luKSBwcmV2ID0gc3dlZXBMaW5lLnByZXYocH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HRoaXMub3RoZXJFdmVudC5wb2ludCwgdGhpcy5wb2ludCwgcCkgPiAwO1xuICB9LFxuXG5cbiAgLyoqXG4gICAqIEBwYXJhbSAge0FycmF5LjxOdW1iZXI+fSAgcFxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNBYm92ZTogZnVuY3Rpb24gKHApIHtcbiAgICByZXR1cm4gIXRoaXMuaXNCZWxvdyhwKTtcbiAgfSxcblxuXG4gIC8qKlxuICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgKi9cbiAgaXNWZXJ0aWNhbDogZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiB0aGlzLnBvaW50WzBdID09PSB0aGlzLm90aGVyRXZlbnQucG9pbnRbMF07XG4gIH0sXG5cblxuICBjbG9uZTogZnVuY3Rpb24gKCkge1xuICAgIHZhciBjb3B5ID0gbmV3IFN3ZWVwRXZlbnQoXG4gICAgICB0aGlzLnBvaW50LCB0aGlzLmxlZnQsIHRoaXMub3RoZXJFdmVudCwgdGhpcy5pc1N1YmplY3QsIHRoaXMudHlwZSk7XG5cbiAgICBjb3B5LmluUmVzdWx0ICAgICAgID0gdGhpcy5pblJlc3VsdDtcbiAgICBjb3B5LnByZXZJblJlc3VsdCAgID0gdGhpcy5wcmV2SW5SZXN1bHQ7XG4gICAgY29weS5pc0V4dGVyaW9yUmluZyA9IHRoaXMuaXNFeHRlcmlvclJpbmc7XG4gICAgY29weS5pbk91dCAgICAgICAgICA9IHRoaXMuaW5PdXQ7XG4gICAgY29weS5vdGhlckluT3V0ICAgICA9IHRoaXMub3RoZXJJbk91dDtcblxuICAgIHJldHVybiBjb3B5O1xuICB9XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IFN3ZWVwRXZlbnQ7XG4iXX0= diff --git a/src/connect_edges.js b/src/connect_edges.js index 3904b76..2b563ca 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -153,7 +153,6 @@ module.exports = function connectEdges(sortedEvents, operation) { for (var k = 0, kk = polygonContour.length; k < kk; k++) { var coords = polygonContour[k]; if (typeof coords[0] !== 'number') { - console.log('p', polygon.slice(), 'c', coords); polygon.splice(j, 1); polygon.push(coords); } From c08251a5475fe8a7927ee8534f95f5d9c06fbbb3 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Wed, 20 Dec 2017 20:55:34 +1100 Subject: [PATCH 36/42] Update tinyqueue for performance improvement --- package.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7c15e28..14a4240 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,8 @@ "eslint-config-mourner": "^2.0.1", "geojson-project": "^1.0.0", "http-server": "^0.9.0", + "leaflet": "^1.2.0", + "leaflet-editable": "^1.1.0", "load-json-file": "^2.0.0", "nodemon": "^1.9.2", "smokestack": "^3.4.1", @@ -75,9 +77,6 @@ }, "dependencies": { "avl": "^1.4.0", - "functional-red-black-tree": "1.0.1", - "leaflet": "^1.2.0", - "leaflet-editable": "^1.1.0", - "tinyqueue": "1.1.0" + "tinyqueue": "^1.2.0" } } From 24c5918804233d9ce1b8cbddfa4de66878f88290 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Wed, 20 Dec 2017 12:07:28 +0100 Subject: [PATCH 37/42] cleanup --- Makefile | 2 +- dist/martinez.js | 196 +-- package-lock.json | 2363 +++++++++++++------------------------ package.json | 1 - src/compare_events.js | 9 - src/connect_edges.js | 24 - src/fill_queue.js | 2 - src/index.js | 31 +- src/priority_queue.js | 130 -- src/set.js | 196 --- src/subdivide_segments.js | 41 - src/sweep_event.js | 1 + 12 files changed, 919 insertions(+), 2077 deletions(-) delete mode 100644 src/priority_queue.js delete mode 100644 src/set.js diff --git a/Makefile b/Makefile index cf41555..67b8b6d 100644 --- a/Makefile +++ b/Makefile @@ -18,4 +18,4 @@ compile: ${COMPILED} %.min.js: %.js @echo " - $(<) -> $(@)"; @curl --silent --show-error --data-urlencode "js_code@$(<)" --data-urlencode "js_externs@src/externs.js" \ - --data "${QS}&output_info=compiled_code" ${URL} -o $(@) \ No newline at end of file + --data "${QS}&output_info=warnings" ${URL} -o $(@) diff --git a/dist/martinez.js b/dist/martinez.js index cea5f63..794dee1 100644 --- a/dist/martinez.js +++ b/dist/martinez.js @@ -739,6 +739,7 @@ return AVLTree; 'use strict'; module.exports = TinyQueue; +module.exports.default = TinyQueue; function TinyQueue(data, compare) { if (!(this instanceof TinyQueue)) return new TinyQueue(data, compare); @@ -747,7 +748,9 @@ function TinyQueue(data, compare) { this.length = this.data.length; this.compare = compare || defaultCompare; - if (data) for (var i = Math.floor(this.length / 2); i >= 0; i--) this._down(i); + if (this.length > 0) { + for (var i = (this.length >> 1) - 1; i >= 0; i--) this._down(i); + } } function defaultCompare(a, b) { @@ -763,11 +766,17 @@ TinyQueue.prototype = { }, pop: function () { + if (this.length === 0) return undefined; + var top = this.data[0]; - this.data[0] = this.data[this.length - 1]; this.length--; + + if (this.length > 0) { + this.data[0] = this.data[this.length]; + this._down(0); + } this.data.pop(); - this._down(0); + return top; }, @@ -776,46 +785,46 @@ TinyQueue.prototype = { }, _up: function (pos) { - var data = this.data, - compare = this.compare; + var data = this.data; + var compare = this.compare; + var item = data[pos]; while (pos > 0) { - var parent = Math.floor((pos - 1) / 2); - if (compare(data[pos], data[parent]) < 0) { - swap(data, parent, pos); - pos = parent; - - } else break; + var parent = (pos - 1) >> 1; + var current = data[parent]; + if (compare(item, current) >= 0) break; + data[pos] = current; + pos = parent; } + + data[pos] = item; }, _down: function (pos) { - var data = this.data, - compare = this.compare, - len = this.length; - - while (true) { - var left = 2 * pos + 1, - right = left + 1, - min = pos; - - if (left < len && compare(data[left], data[min]) < 0) min = left; - if (right < len && compare(data[right], data[min]) < 0) min = right; - - if (min === pos) return; - - swap(data, min, pos); - pos = min; + var data = this.data; + var compare = this.compare; + var halfLength = this.length >> 1; + var item = data[pos]; + + while (pos < halfLength) { + var left = (pos << 1) + 1; + var right = left + 1; + var best = data[left]; + + if (right < this.length && compare(data[right], best) < 0) { + left = right; + best = data[right]; + } + if (compare(best, item) >= 0) break; + + data[pos] = best; + pos = left; } + + data[pos] = item; } }; -function swap(data, i, j) { - var tmp = data[i]; - data[i] = data[j]; - data[j] = tmp; -} - },{}],4:[function(require,module,exports){ 'use strict'; @@ -860,15 +869,6 @@ function specialCases(e1, e2, p1, p2) { return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; } - // uncomment this if you want to play with multipolygons - // if (e1.isSubject === e2.isSubject) { - // if(equals(e1.point, e2.point) && e1.contourId === e2.contourId) { - // return 0; - // } else { - // return e1.contourId > e2.contourId ? 1 : -1; - // } - // } - return (!e1.isSubject && e2.isSubject) ? 1 : -1; } /* eslint-enable no-unused-vars */ @@ -1065,7 +1065,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { // while in range and not the current one by value while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { if (!processed[newPos]) { - // console.log(pos, newPos, length); return newPos; } else { newPos++; @@ -1078,7 +1077,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { while (processed[newPos] && newPos >= origIndex) { newPos--; } - // console.log('other', pos, newPos, length); return newPos; } @@ -1090,7 +1088,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { module.exports = function connectEdges(sortedEvents, operation) { var i, len; var resultEvents = orderEvents(sortedEvents); - //_renderPoints(resultEvents, 'inResult'); // "false"-filled array var processed = {}; @@ -1098,14 +1095,14 @@ module.exports = function connectEdges(sortedEvents, operation) { var event; for (i = 0, len = resultEvents.length; i < len; i++) { - // console.log('i is ' + i) if (processed[i]) continue; var contour = [[]]; if (!resultEvents[i].isExteriorRing) { if (result.length === 0) { result.push([[contour]]); - } else if (operation === operationType.UNION || operation === operationType.XOR) { + } else if (operation === operationType.UNION || + operation === operationType.XOR) { result[result.length - 1].push(contour[0]); } else { result[result.length - 1].push(contour); @@ -1121,8 +1118,6 @@ module.exports = function connectEdges(sortedEvents, operation) { contour[0].push(initial); while (pos >= i) { - // console.log('pos is ' + pos) - event = resultEvents[pos]; processed[pos] = true; @@ -1133,13 +1128,9 @@ module.exports = function connectEdges(sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } - // new L.Marker(event.point.slice().reverse()).addTo(map); pos = event.pos; processed[pos] = true; - // resultEvents[pos].point.push(resultEvents[pos].isExteriorRing); - // new L.circleMarker(resultEvents[pos].point.slice().reverse()).addTo(map); - // console.log(resultEvents[pos].point) contour[0].push(resultEvents[pos].point); pos = nextPos(pos, resultEvents, processed, i); } @@ -1151,7 +1142,6 @@ module.exports = function connectEdges(sortedEvents, operation) { event.otherEvent.resultInOut = true; event.otherEvent.contourId = ringId; } - //_renderPoints(resultEvents, 'resultInOut'); for (i = 0, len = result.length; i < len; i++) { var polygon = result[i]; @@ -1160,8 +1150,8 @@ module.exports = function connectEdges(sortedEvents, operation) { for (var k = 0, kk = polygonContour.length; k < kk; k++) { var coords = polygonContour[k]; if (typeof coords[0] !== 'number') { - polygon.push(coords[0]); polygon.splice(j, 1); + polygon.push(coords); } } } @@ -1173,27 +1163,6 @@ module.exports = function connectEdges(sortedEvents, operation) { return result; }; - -/* eslint-disable no-unused-vars, no-debugger, no-undef, no-use-before-define */ -function _renderPoints(possiblePoints, prop) { - var map = window.map; - var points = window.points; - if (!map) return; - if (points !== undefined) points.clearLayers(); - - points = window.points = L.layerGroup([]).addTo(map); - possiblePoints.forEach(function (e) { - var point = L.circleMarker([e.point[1], e.point[0]], { - radius: Math.floor(5 + Math.random() * 10), - color: e[prop] ? 'green' : 'gray', - opacity: e[prop] ? 0.5 : 0.1, - weight: 1 - }).addTo(points); - }); -} - -/* eslint-enable no-unused-vars, no-debugger, no-undef */ - },{"./compare_events":4,"./operation":13}],8:[function(require,module,exports){ 'use strict'; @@ -1284,11 +1253,9 @@ var contourId = 0; function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { var i, len, s1, s2, e1, e2; - // var d = depth + 1; for (i = 0, len = contourOrHole.length - 1; i < len; i++) { s1 = contourOrHole[i]; s2 = contourOrHole[i + 1]; - //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); e1 = new SweepEvent(s1, false, undefined, isSubject); e2 = new SweepEvent(s2, false, e1, isSubject); e1.otherEvent = e2; @@ -1403,43 +1370,40 @@ function boolean(subject, clipping, operation) { var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; - //console.time('fill'); + //console.time('fill queue'); var eventQueue = fillQueue(subject, clipping, sbbox, cbbox); - //console.timeEnd('fill'); + //console.timeEnd('fill queue'); trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation); if (trivial) { return trivial === EMPTY ? null : trivial; } - //console.time('subdiv'); + //console.time('subdivide edges'); var sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); - //console.timeEnd('subdiv'); - //console.time('connect'); + //console.timeEnd('subdivide edges'); + + //console.time('connect vertices'); var result = connectEdges(sortedEvents, operation); - //console.timeEnd('connect'); + //console.timeEnd('connect vertices'); return result; } - -module.exports = boolean; - - -module.exports.union = function (subject, clipping) { +boolean.union = function (subject, clipping) { return boolean(subject, clipping, operations.UNION); }; -module.exports.diff = function (subject, clipping) { +boolean.diff = function (subject, clipping) { return boolean(subject, clipping, operations.DIFFERENCE); }; -module.exports.xor = function (subject, clipping) { +boolean.xor = function (subject, clipping) { return boolean(subject, clipping, operations.XOR); }; -module.exports.intersection = function (subject, clipping) { +boolean.intersection = function (subject, clipping) { return boolean(subject, clipping, operations.INTERSECTION); }; @@ -1447,7 +1411,11 @@ module.exports.intersection = function (subject, clipping) { /** * @enum {Number} */ -module.exports.operations = operations; +boolean.operations = operations; + + +module.exports = boolean; +module.exports.default = boolean; },{"./connect_edges":7,"./fill_queue":11,"./operation":13,"./subdivide_segments":17}],13:[function(require,module,exports){ 'use strict'; @@ -1766,7 +1734,6 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, if (event.left) { next = prev = sweepLine.insert(event); - //_renderSweepLine(sweepLine, event.point, event); begin = sweepLine.minNode(); if (prev !== begin) prev = sweepLine.prev(prev); @@ -1799,8 +1766,6 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, event = event.otherEvent; next = prev = sweepLine.find(event); - //_renderSweepLine(sweepLine, event.otherEvent.point, event); - if (prev && next) { if (prev !== begin) prev = sweepLine.prev(prev); @@ -1809,12 +1774,8 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, next = sweepLine.next(next); sweepLine.remove(event); - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - if (next && prev) { - // if (typeof prev !== 'undefined' && typeof next !== 'undefined') { possibleIntersection(prev.key, next.key, eventQueue); - // } } } } @@ -1822,40 +1783,6 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, return sortedEvents; }; - -/* eslint-disable no-unused-vars, no-debugger, no-undef */ -function _renderSweepLine(sweepLine, pos, event) { - var map = window.map; - if (!map) return; - if (window.sws) window.sws.forEach(function (p) { - map.removeLayer(p); - }); - window.sws = []; - sweepLine.forEach(function (e) { - var poly = L.polyline([ - e.key.point.slice().reverse(), - e.key.otherEvent.point.slice().reverse() - ], {color: 'green'}).addTo(map); - window.sws.push(poly); - }); - - if (window.vt) map.removeLayer(window.vt); - var v = pos.slice(); - var b = map.getBounds(); - window.vt = L.polyline([ - [b.getNorth(), v[0]], - [b.getSouth(), v[0]] - ], {color: 'green', weight: 1}).addTo(map); - - if (window.ps) map.removeLayer(window.ps); - window.ps = L.polyline([ - event.point.slice().reverse(), - event.otherEvent.point.slice().reverse() - ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); - debugger; -} -/* eslint-enable no-unused-vars, no-debugger, no-undef */ - },{"./compare_segments":5,"./compute_fields":6,"./operation":13,"./possible_intersection":14,"avl":2}],18:[function(require,module,exports){ 'use strict'; @@ -1865,6 +1792,7 @@ var EdgeType = require('./edge_type'); /** * Sweepline event * + * @class {SweepEvent} * @param {Array.} point * @param {Boolean} left * @param {SweepEvent=} otherEvent diff --git a/package-lock.json b/package-lock.json index 5640268..d89c2f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,25 +4,44 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@remy/pstree": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@remy/pstree/-/pstree-1.1.0.tgz", + "integrity": "sha512-3rxECj41p0Qkdgoc50VnZpSDTXS+UZGRzTTO+qb3TiZDhuZMmf4z/wApcIeJ878okVq7D9phadgXQD9Kvbq3tQ==", + "dev": true, + "requires": { + "ps-tree": "1.1.0" + } + }, "@turf/union": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@turf/union/-/union-4.6.0.tgz", - "integrity": "sha1-O4YeNfbOMX6Gszuido5dP2JUF7M=", + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/@turf/union/-/union-4.7.3.tgz", + "integrity": "sha1-AS1Kx0ZdbK1n/klI1AG3+L4P5BI=", "dev": true, "requires": { "jsts": "1.3.0" } }, "@types/geojson": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.3.tgz", - "integrity": "sha512-unWrGQhXRrNTk/MabfBLCM/rWT6zxR1OSK0GIPxsP8NX8mJcsNWkERPp4z0pTyHLiANy+Nwczf8Q2I16Pth1FA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz", + "integrity": "sha512-Xqg/lIZMrUd0VRmSRbCAewtwGZiAk3mEUDvV4op1tGl+LvyPcb/MIOSxTl9z+9+J+R4/vpjiCAT4xeKzH9ji1w==", "dev": true }, + "JSONStream": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", + "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, "abbrev": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", - "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, "acorn": { @@ -75,11 +94,47 @@ "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", "dev": true }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true + "ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "dev": true, + "requires": { + "string-width": "2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } }, "ansi-escapes": { "version": "1.4.0", @@ -109,75 +164,6 @@ "normalize-path": "2.1.1" } }, - "archiver": { - "version": "0.14.4", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-0.14.4.tgz", - "integrity": "sha1-W53bn17hzu8hy487Ag5iQOy0MVw=", - "dev": true, - "requires": { - "async": "0.9.0", - "buffer-crc32": "0.2.13", - "glob": "4.3.5", - "lazystream": "0.1.0", - "lodash": "3.2.0", - "readable-stream": "1.0.34", - "tar-stream": "1.1.5", - "zip-stream": "0.5.2" - }, - "dependencies": { - "glob": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", - "integrity": "sha1-gPuwjKVA8jiszl0R0em8QedRc9M=", - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "2.0.10", - "once": "1.4.0" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "lodash": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", - "integrity": "sha1-S/UKMkP5rrC6xBpV09WZBnWkYvs=", - "dev": true - }, - "minimatch": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", - "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, "argparse": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", @@ -254,9 +240,9 @@ "dev": true }, "asn1.js": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz", - "integrity": "sha1-SLokC0WpKA6UdImQull9IWYX/UA=", + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.2.tgz", + "integrity": "sha512-b/OsSjvWEo8Pi8H0zsDd2P6Uqo2TK2pH8gNLSJtNLM2Db0v2QaAZ0pBQJXVjAn4gBuugeVDr7s63ZogpUIwWDg==", "dev": true, "requires": { "bn.js": "4.11.8", @@ -334,9 +320,9 @@ "babel-register": "6.26.0", "babel-runtime": "6.26.0", "chokidar": "1.7.0", - "commander": "2.11.0", - "convert-source-map": "1.5.0", - "fs-readdir-recursive": "1.0.0", + "commander": "2.12.2", + "convert-source-map": "1.5.1", + "fs-readdir-recursive": "1.1.0", "glob": "7.1.2", "lodash": "4.17.4", "output-file-sync": "1.1.2", @@ -373,13 +359,13 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "convert-source-map": "1.5.0", - "debug": "2.6.8", + "convert-source-map": "1.5.1", + "debug": "2.6.9", "json5": "0.5.1", "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -780,7 +766,7 @@ "dev": true, "requires": { "babel-runtime": "6.26.0", - "core-js": "2.5.0", + "core-js": "2.5.3", "regenerator-runtime": "0.10.5" }, "dependencies": { @@ -832,11 +818,11 @@ "requires": { "babel-core": "6.26.0", "babel-runtime": "6.26.0", - "core-js": "2.5.0", + "core-js": "2.5.3", "home-or-tmp": "2.0.0", "lodash": "4.17.4", "mkdirp": "0.5.1", - "source-map-support": "0.4.16" + "source-map-support": "0.4.18" } }, "babel-runtime": { @@ -845,8 +831,8 @@ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { - "core-js": "2.5.0", - "regenerator-runtime": "0.11.0" + "core-js": "2.5.3", + "regenerator-runtime": "0.11.1" } }, "babel-template": { @@ -873,7 +859,7 @@ "babel-runtime": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "debug": "2.6.8", + "debug": "2.6.9", "globals": "9.18.0", "invariant": "2.2.2", "lodash": "4.17.4" @@ -940,50 +926,9 @@ } }, "binary-extensions": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz", - "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=", - "dev": true - }, - "bl": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", - "integrity": "sha1-wGt5evCF6gC8Unr8jvzxHeIjIFQ=", - "dev": true, - "requires": { - "readable-stream": "1.0.34" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, - "bluebird": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", - "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", "dev": true }, "bn.js": { @@ -1001,6 +946,83 @@ "hoek": "2.16.3" } }, + "boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "dev": true, + "requires": { + "ansi-align": "2.0.0", + "camelcase": "4.1.0", + "chalk": "2.3.0", + "cli-boxes": "1.0.0", + "string-width": "2.1.1", + "term-size": "1.2.0", + "widest-line": "2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, "brace-expansion": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", @@ -1034,9 +1056,9 @@ "integrity": "sha1-+GzWzvT1MAyOY+B6TVEvZfv/RTE=", "dev": true, "requires": { + "JSONStream": "1.3.2", "combine-source-map": "0.7.2", "defined": "1.0.0", - "JSONStream": "1.3.1", "through2": "2.0.3", "umd": "3.0.1" } @@ -1064,6 +1086,7 @@ "integrity": "sha1-tanJAgJD8McORnW+yCI7xifkFc4=", "dev": true, "requires": { + "JSONStream": "1.3.2", "assert": "1.4.1", "browser-pack": "6.0.2", "browser-resolve": "1.11.2", @@ -1073,7 +1096,7 @@ "concat-stream": "1.5.2", "console-browserify": "1.1.0", "constants-browserify": "1.0.0", - "crypto-browserify": "3.11.1", + "crypto-browserify": "3.12.0", "defined": "1.0.0", "deps-sort": "2.0.0", "domain-browser": "1.1.7", @@ -1085,7 +1108,6 @@ "https-browserify": "0.0.1", "inherits": "2.0.3", "insert-module-globals": "7.0.1", - "JSONStream": "1.3.1", "labeled-stream-splicer": "2.0.0", "module-deps": "4.1.1", "os-browserify": "0.1.2", @@ -1096,7 +1118,7 @@ "querystring-es3": "0.2.1", "read-only-stream": "2.0.0", "readable-stream": "2.3.3", - "resolve": "1.4.0", + "resolve": "1.5.0", "shasum": "1.0.2", "shell-quote": "1.6.1", "stream-browserify": "2.0.1", @@ -1122,16 +1144,17 @@ } }, "browserify-aes": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", - "integrity": "sha1-Xncl297x/Vkw1OurSFZ85FHEigo=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz", + "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==", "dev": true, "requires": { "buffer-xor": "1.0.3", "cipher-base": "1.0.4", "create-hash": "1.1.3", - "evp_bytestokey": "1.0.2", - "inherits": "2.0.3" + "evp_bytestokey": "1.0.3", + "inherits": "2.0.3", + "safe-buffer": "5.1.1" } }, "browserify-cipher": { @@ -1140,9 +1163,9 @@ "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", "dev": true, "requires": { - "browserify-aes": "1.0.6", + "browserify-aes": "1.1.1", "browserify-des": "1.0.0", - "evp_bytestokey": "1.0.2" + "evp_bytestokey": "1.0.3" } }, "browserify-des": { @@ -1201,12 +1224,6 @@ "isarray": "1.0.0" } }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", - "dev": true - }, "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", @@ -1241,15 +1258,15 @@ "dev": true }, "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "capture-stack-trace": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", + "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=", "dev": true }, "chalk": { @@ -1273,7 +1290,7 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", - "fsevents": "1.1.2", + "fsevents": "1.1.3", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -1282,28 +1299,6 @@ "readdirp": "2.1.0" } }, - "chrome-launch": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chrome-launch/-/chrome-launch-1.1.4.tgz", - "integrity": "sha1-yJhb0CJjWlzIlwmbr9GYMYOKclI=", - "dev": true, - "requires": { - "chrome-location": "1.2.1", - "quick-tmp": "0.0.0", - "rimraf": "2.6.1", - "shallow-copy": "0.0.1" - } - }, - "chrome-location": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/chrome-location/-/chrome-location-1.2.1.tgz", - "integrity": "sha1-aRFRGk6sVQJ2Jcc7k3ylynq5SZU=", - "dev": true, - "requires": { - "userhome": "1.0.0", - "which": "1.3.0" - } - }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -1326,6 +1321,12 @@ "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", "dev": true }, + "cli-boxes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", + "dev": true + }, "cli-cursor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", @@ -1341,17 +1342,6 @@ "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" - } - }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -1364,6 +1354,21 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "color-support": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", @@ -1406,9 +1411,9 @@ } }, "commander": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz", + "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==", "dev": true }, "component-emitter": { @@ -1417,44 +1422,6 @@ "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", "dev": true }, - "compress-commons": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.2.9.tgz", - "integrity": "sha1-Qi2SdDDAGr0GzUVbbfwEy0z4ADw=", - "dev": true, - "requires": { - "buffer-crc32": "0.2.13", - "crc32-stream": "0.3.4", - "node-int64": "0.3.3", - "readable-stream": "1.0.34" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1495,19 +1462,17 @@ } }, "configstore": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-1.4.0.tgz", - "integrity": "sha1-w1eB0FAdJowlxUuLF/YkDopPsCE=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.1.tgz", + "integrity": "sha512-5oNkD/L++l0O6xGXxb1EWS7SivtjfGQlRyxJsYgE0Z495/L81e2h4/d3r969hoPXuFItzNOKMtsXgYG4c7dYvw==", "dev": true, "requires": { + "dot-prop": "4.2.0", "graceful-fs": "4.1.11", - "mkdirp": "0.5.1", - "object-assign": "4.1.1", - "os-tmpdir": "1.0.2", - "osenv": "0.1.4", - "uuid": "2.0.3", - "write-file-atomic": "1.3.4", - "xdg-basedir": "2.0.0" + "make-dir": "1.1.0", + "unique-string": "1.0.0", + "write-file-atomic": "2.3.0", + "xdg-basedir": "3.0.0" } }, "console-browserify": { @@ -1526,9 +1491,9 @@ "dev": true }, "convert-source-map": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", - "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", "dev": true }, "cookiejar": { @@ -1538,9 +1503,9 @@ "dev": true }, "core-js": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.0.tgz", - "integrity": "sha1-VpwFCRi+ZIazg3VSAorgRmtxcIY=", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", + "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=", "dev": true }, "core-util-is": { @@ -1556,9 +1521,9 @@ "dev": true }, "coveralls": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-2.13.1.tgz", - "integrity": "sha1-1wu5rMGDXsTwY/+drFQjwXsR8Xg=", + "version": "2.13.3", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-2.13.3.tgz", + "integrity": "sha512-iiAmn+l1XqRwNLXhW8Rs5qHZRFMYp9ZIPjEOVRpC/c4so6Y/f4/lFi0FfR5B9cCqgyhkJ5cZmbvcVRfP8MHchw==", "dev": true, "requires": { "js-yaml": "3.6.1", @@ -1587,8 +1552,8 @@ "dev": true, "requires": { "chalk": "1.1.3", - "commander": "2.11.0", - "is-my-json-valid": "2.16.1", + "commander": "2.12.2", + "is-my-json-valid": "2.17.1", "pinkie-promise": "2.0.1" } }, @@ -1633,11 +1598,11 @@ "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.16", + "mime-types": "2.1.17", "oauth-sign": "0.8.2", "qs": "6.3.2", "stringstream": "0.0.5", - "tough-cookie": "2.3.2", + "tough-cookie": "2.3.3", "tunnel-agent": "0.4.3", "uuid": "3.1.0" } @@ -1647,48 +1612,6 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", "dev": true - }, - "uuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", - "dev": true - } - } - }, - "crc32-stream": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.3.4.tgz", - "integrity": "sha1-c7wltF+sHbZjIjGnv86JJ+nwZVI=", - "dev": true, - "requires": { - "buffer-crc32": "0.2.13", - "readable-stream": "1.0.34" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true } } }, @@ -1702,6 +1625,15 @@ "elliptic": "6.4.0" } }, + "create-error-class": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", + "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", + "dev": true, + "requires": { + "capture-stack-trace": "1.0.0" + } + }, "create-hash": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", @@ -1711,7 +1643,7 @@ "cipher-base": "1.0.4", "inherits": "2.0.3", "ripemd160": "2.0.1", - "sha.js": "2.4.8" + "sha.js": "2.4.9" } }, "create-hmac": { @@ -1725,16 +1657,17 @@ "inherits": "2.0.3", "ripemd160": "2.0.1", "safe-buffer": "5.1.1", - "sha.js": "2.4.8" + "sha.js": "2.4.9" } }, "cross-spawn": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", - "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { "lru-cache": "4.1.1", + "shebang-command": "1.2.0", "which": "1.3.0" } }, @@ -1748,9 +1681,9 @@ } }, "crypto-browserify": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.1.tgz", - "integrity": "sha512-Na7ZlwCOqoaW5RwUK1WpXws2kv8mNhWdTlzob0UXulk6G9BDbyiJaGTYBIX61Ozn9l1EPPJpICZb4DaOpT9NlQ==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "dev": true, "requires": { "browserify-cipher": "1.0.0", @@ -1760,15 +1693,16 @@ "create-hmac": "1.1.6", "diffie-hellman": "5.0.2", "inherits": "2.0.3", - "pbkdf2": "3.0.13", + "pbkdf2": "3.0.14", "public-encrypt": "4.0.0", - "randombytes": "2.0.5" + "randombytes": "2.0.5", + "randomfill": "1.0.3" } }, - "ctype": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", - "integrity": "sha1-gsGMJGH3QRTvFsE1IkrQuRRMoS8=", + "crypto-random-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", + "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", "dev": true }, "d": { @@ -1777,7 +1711,7 @@ "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "dev": true, "requires": { - "es5-ext": "0.10.30" + "es5-ext": "0.10.37" } }, "dashdash": { @@ -1804,20 +1738,14 @@ "dev": true }, "debug": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", @@ -1870,7 +1798,7 @@ "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1", - "rimraf": "2.6.1" + "rimraf": "2.6.2" } }, "delayed-stream": { @@ -1885,7 +1813,7 @@ "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", "dev": true, "requires": { - "JSONStream": "1.3.1", + "JSONStream": "1.3.2", "shasum": "1.0.2", "subarg": "1.0.0", "through2": "2.0.3" @@ -1911,13 +1839,21 @@ } }, "detective": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/detective/-/detective-4.5.0.tgz", - "integrity": "sha1-blqMaybmx6JUsca210kNmOyR7dE=", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.0.tgz", + "integrity": "sha512-4mBqSEdMfBpRAo/DQZnTcAXenpiSIJmVKbCMSotS+SFWWcrP/CKM6iBRPdTiEO+wZhlfEsoZlGqpG6ycl5vTqw==", "dev": true, "requires": { - "acorn": "4.0.13", + "acorn": "5.2.1", "defined": "1.0.0" + }, + "dependencies": { + "acorn": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", + "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==", + "dev": true + } } }, "diff": { @@ -1933,32 +1869,34 @@ "dev": true, "requires": { "bn.js": "4.11.8", - "miller-rabin": "4.0.0", + "miller-rabin": "4.0.1", "randombytes": "2.0.5" } }, "doctrine": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", - "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz", + "integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==", "dev": true, "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" + "esutils": "2.0.2" } }, - "dom-walk": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", - "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=", - "dev": true - }, "domain-browser": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", "dev": true }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, + "requires": { + "is-obj": "1.0.1" + } + }, "duplexer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", @@ -1974,17 +1912,11 @@ "readable-stream": "2.3.3" } }, - "duplexify": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.1.tgz", - "integrity": "sha512-j5goxHTwVED1Fpe5hh3q9R93Kip0Bg2KVAt4f8CEYM3UEwYcPSvWbXaUQOzdX/HtiNomipv+gU7ASQPDbV7pGQ==", - "dev": true, - "requires": { - "end-of-stream": "1.4.0", - "inherits": "2.0.3", - "readable-stream": "2.3.3", - "stream-shift": "1.0.0" - } + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true }, "ecc-jsbn": { "version": "0.1.1", @@ -2003,7 +1935,7 @@ "dev": true, "requires": { "he": "0.5.0", - "mime": "1.4.0", + "mime": "1.6.0", "minimist": "1.2.0", "url-join": "1.1.0" }, @@ -2031,15 +1963,6 @@ "minimalistic-crypto-utils": "1.0.1" } }, - "end-of-stream": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", - "integrity": "sha1-epDYM+/abPpurA9JSduw+tOmMgY=", - "dev": true, - "requires": { - "once": "1.4.0" - } - }, "error-ex": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", @@ -2050,9 +1973,9 @@ } }, "es-abstract": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.8.0.tgz", - "integrity": "sha512-Cf9/h5MrXtExM20gSS55YFrGKCyPrRBjIVBtVyy8vmlsDfe0NPKMWj65tPLgzyfPuapWxh5whpXCtW4+AW5mRg==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.10.0.tgz", + "integrity": "sha512-/uh/DhdqIOSkAWifU+8nG78vlQxdLckUdI/sPgy0VhuXi2qJ7T8czBmqIYtLQVpCIFYafChnsRsB5pyb1JdmCQ==", "dev": true, "requires": { "es-to-primitive": "1.1.1", @@ -2074,23 +1997,23 @@ } }, "es5-ext": { - "version": "0.10.30", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.30.tgz", - "integrity": "sha1-cUGhaDZpfbq/qq7uQUlc4p9SyTk=", + "version": "0.10.37", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.37.tgz", + "integrity": "sha1-DudB0Ui4AGm6J9AgOTdWryV978M=", "dev": true, "requires": { - "es6-iterator": "2.0.1", + "es6-iterator": "2.0.3", "es6-symbol": "3.1.1" } }, "es6-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.30", + "es5-ext": "0.10.37", "es6-symbol": "3.1.1" } }, @@ -2101,8 +2024,8 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.30", - "es6-iterator": "2.0.1", + "es5-ext": "0.10.37", + "es6-iterator": "2.0.3", "es6-set": "0.1.5", "es6-symbol": "3.1.1", "event-emitter": "0.3.5" @@ -2121,8 +2044,8 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.30", - "es6-iterator": "2.0.1", + "es5-ext": "0.10.37", + "es6-iterator": "2.0.3", "es6-symbol": "3.1.1", "event-emitter": "0.3.5" } @@ -2134,7 +2057,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.30" + "es5-ext": "0.10.37" } }, "es6-weak-map": { @@ -2144,8 +2067,8 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.30", - "es6-iterator": "2.0.1", + "es5-ext": "0.10.37", + "es6-iterator": "2.0.3", "es6-symbol": "3.1.1" } }, @@ -2176,22 +2099,22 @@ "babel-code-frame": "6.26.0", "chalk": "1.1.3", "concat-stream": "1.5.2", - "debug": "2.6.8", - "doctrine": "2.0.0", + "debug": "2.6.9", + "doctrine": "2.0.2", "escope": "3.6.0", - "espree": "3.5.0", + "espree": "3.5.2", "esquery": "1.0.0", "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "glob": "7.1.2", "globals": "9.18.0", - "ignore": "3.3.5", + "ignore": "3.3.7", "imurmurhash": "0.1.4", "inquirer": "0.12.0", - "is-my-json-valid": "2.16.1", - "is-resolvable": "1.0.0", - "js-yaml": "3.9.1", + "is-my-json-valid": "2.17.1", + "is-resolvable": "1.0.1", + "js-yaml": "3.10.0", "json-stable-stringify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.4", @@ -2231,25 +2154,25 @@ } }, "eslint-config-mourner": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/eslint-config-mourner/-/eslint-config-mourner-2.0.2.tgz", - "integrity": "sha512-togtcP30k+0k5ipHOw9pv0MGUlyKPju6qGnFYtRt10iNxW1rv1PdppDN0dDKdk+sKCrDAIuZ9wdyTU322vQCrg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/eslint-config-mourner/-/eslint-config-mourner-2.0.3.tgz", + "integrity": "sha512-ydFFzE/WkqvmozI3CM0lAtDZoYfmN03ycjlHzdPZW5x+o3Me1pI0lyfpsWoz9kOqykZk8qlvOVC5BN5UMwtXrg==", "dev": true }, "espree": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.0.tgz", - "integrity": "sha1-mDWGJb3QVYYeon4oZ+pyn69GPY0=", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", + "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", "dev": true, "requires": { - "acorn": "5.1.1", + "acorn": "5.2.1", "acorn-jsx": "3.0.1" }, "dependencies": { "acorn": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz", - "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", + "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==", "dev": true } } @@ -2298,7 +2221,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.30" + "es5-ext": "0.10.37" } }, "event-stream": { @@ -2335,15 +2258,30 @@ "dev": true }, "evp_bytestokey": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.2.tgz", - "integrity": "sha512-ni0r0lrm7AOzsh2qC5mi9sj8S0gmj5fLNjfFpxN05FB4tAVZEKotbkjOtLPqTCX/CXT7NsUr6juZb4IFJeNNdA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { "md5.js": "1.3.4", "safe-buffer": "5.1.1" } }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, "exit-hook": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", @@ -2395,12 +2333,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "faye-websocket": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.4.4.tgz", - "integrity": "sha1-wUxbO/FNdBf/v9mQwKdJXNnzN7w=", - "dev": true - }, "figures": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", @@ -2417,7 +2349,7 @@ "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { - "flat-cache": "1.2.2", + "flat-cache": "1.3.0", "object-assign": "4.1.1" } }, @@ -2440,39 +2372,10 @@ "repeat-string": "1.6.1" } }, - "firefox-launch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/firefox-launch/-/firefox-launch-1.1.0.tgz", - "integrity": "sha1-c24XocOtsvDSeBdVpKDqSHBUnJU=", - "dev": true, - "requires": { - "firefox-location": "1.0.2", - "mkdirp": "0.5.1", - "quick-tmp": "0.0.0", - "rimraf": "2.6.1", - "shallow-copy": "0.0.1" - } - }, - "firefox-location": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/firefox-location/-/firefox-location-1.0.2.tgz", - "integrity": "sha1-S+5a+TewR5Qf8glkTK/479MrK0c=", - "dev": true, - "requires": { - "userhome": "1.0.0", - "which": "1.3.0" - } - }, - "first-match": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/first-match/-/first-match-0.0.1.tgz", - "integrity": "sha1-pg7GQnAPD0NyNOu37D84JHblQv0=", - "dev": true - }, "flat-cache": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", - "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "dev": true, "requires": { "circular-json": "0.3.3", @@ -2519,6 +2422,18 @@ "requires": { "cross-spawn": "4.0.2", "signal-exit": "3.0.2" + }, + "dependencies": { + "cross-spawn": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "which": "1.3.0" + } + } } }, "forever-agent": { @@ -2535,7 +2450,7 @@ "requires": { "asynckit": "0.4.0", "combined-stream": "1.0.5", - "mime-types": "2.1.16" + "mime-types": "2.1.17" } }, "formidable": { @@ -2551,9 +2466,9 @@ "dev": true }, "fs-readdir-recursive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz", - "integrity": "sha1-jNF0XItPiinIyuw5JHaSG6GV9WA=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", "dev": true }, "fs.realpath": { @@ -2563,14 +2478,14 @@ "dev": true }, "fsevents": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", - "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", "dev": true, "optional": true, "requires": { - "nan": "2.7.0", - "node-pre-gyp": "0.6.36" + "nan": "2.8.0", + "node-pre-gyp": "0.6.39" }, "dependencies": { "abbrev": { @@ -2728,7 +2643,6 @@ "version": "2.0.5", "bundled": true, "dev": true, - "optional": true, "requires": { "boom": "2.10.1" } @@ -2776,6 +2690,12 @@ "dev": true, "optional": true }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, "ecc-jsbn": { "version": "0.1.1", "bundled": true, @@ -2917,7 +2837,6 @@ "version": "3.1.3", "bundled": true, "dev": true, - "optional": true, "requires": { "boom": "2.10.1", "cryptiles": "2.0.5", @@ -3089,11 +3008,13 @@ "optional": true }, "node-pre-gyp": { - "version": "0.6.36", + "version": "0.6.39", "bundled": true, "dev": true, "optional": true, "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", "mkdirp": "0.5.1", "nopt": "4.0.1", "npmlog": "4.1.0", @@ -3301,7 +3222,6 @@ "version": "1.0.9", "bundled": true, "dev": true, - "optional": true, "requires": { "hoek": "2.16.3" } @@ -3331,14 +3251,6 @@ } } }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, "string-width": { "version": "1.0.2", "bundled": true, @@ -3349,6 +3261,14 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, "stringstream": { "version": "0.0.5", "bundled": true, @@ -3467,11 +3387,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" - }, "generate-function": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", @@ -3493,6 +3408,12 @@ "integrity": "sha1-qpNGWGVYo2XETWaY/80L/FffRAY=", "dev": true }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -3543,22 +3464,13 @@ "is-glob": "2.0.1" } }, - "global": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", - "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", "dev": true, "requires": { - "min-document": "2.19.0", - "process": "0.5.2" - }, - "dependencies": { - "process": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", - "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", - "dev": true - } + "ini": "1.3.5" } }, "globals": { @@ -3582,29 +3494,22 @@ } }, "got": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/got/-/got-3.3.1.tgz", - "integrity": "sha1-5dDtSvVfw+701WAHdp2YGSvLLso=", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", "dev": true, "requires": { - "duplexify": "3.5.1", - "infinity-agent": "2.0.3", + "create-error-class": "3.0.2", + "duplexer3": "0.1.4", + "get-stream": "3.0.0", "is-redirect": "1.0.0", + "is-retry-allowed": "1.1.0", "is-stream": "1.1.0", "lowercase-keys": "1.0.0", - "nested-error-stacks": "1.0.2", - "object-assign": "3.0.0", - "prepend-http": "1.0.4", - "read-all-stream": "3.1.0", - "timed-out": "2.0.0" - }, - "dependencies": { - "object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", - "dev": true - } + "safe-buffer": "5.1.1", + "timed-out": "4.0.1", + "unzip-response": "2.0.1", + "url-parse-lax": "1.0.0" } }, "graceful-fs": { @@ -3613,22 +3518,6 @@ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, - "har-schema": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", - "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", - "dev": true - }, - "har-validator": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", - "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", - "dev": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, "has": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", @@ -3647,6 +3536,12 @@ "ansi-regex": "2.1.1" } }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, "hash-base": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", @@ -3767,9 +3662,9 @@ "dev": true }, "ignore": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.5.tgz", - "integrity": "sha512-JLH93mL8amZQhh/p6mfQgVBH3M6epNq3DfsXsTSuSrInVjwyYlFE1nv2AgfRCC8PoOhM0jwQ5v8s9LgbK7yGDw==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", "dev": true }, "ignore-by-default": { @@ -3778,6 +3673,12 @@ "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -3790,12 +3691,6 @@ "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", "dev": true }, - "infinity-agent": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/infinity-agent/-/infinity-agent-2.0.3.tgz", - "integrity": "sha1-ReDi/3qesDCyfWK3SzdEt6esQhY=", - "dev": true - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -3813,9 +3708,9 @@ "dev": true }, "ini": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, "inline-source-map": { @@ -3854,10 +3749,10 @@ "integrity": "sha1-wDv04BywhtW15azorQr+eInWOMM=", "dev": true, "requires": { + "JSONStream": "1.3.2", "combine-source-map": "0.7.2", "concat-stream": "1.5.2", - "is-buffer": "1.1.5", - "JSONStream": "1.3.1", + "is-buffer": "1.1.6", "lexical-scope": "1.2.0", "process": "0.11.10", "through2": "2.0.3", @@ -3865,9 +3760,9 @@ } }, "interpret": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", - "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", "dev": true }, "invariant": { @@ -3879,12 +3774,6 @@ "loose-envify": "1.3.1" } }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -3897,13 +3786,13 @@ "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { - "binary-extensions": "1.10.0" + "binary-extensions": "1.11.0" } }, "is-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", - "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, "is-callable": { @@ -3918,12 +3807,6 @@ "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", "dev": true }, - "is-dom": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/is-dom/-/is-dom-1.0.9.tgz", - "integrity": "sha1-SDgy1SlyBz3hK5/j9gMghw2oNw0=", - "dev": true - }, "is-dotfile": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", @@ -3984,10 +3867,20 @@ "is-extglob": "1.0.0" } }, + "is-installed-globally": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", + "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", + "dev": true, + "requires": { + "global-dirs": "0.1.1", + "is-path-inside": "1.0.1" + } + }, "is-my-json-valid": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz", - "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz", + "integrity": "sha512-Q2khNw+oBlWuaYvEEHtKSw/pCxD2L5Rc1C+UQme9X6JdRDh7m5D7HkozA0qa3DUkQ6VzCnEm8mVIQPyIRkI5sQ==", "dev": true, "requires": { "generate-function": "2.0.0", @@ -4011,6 +3904,12 @@ "kind-of": "3.2.2" } }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, "is-path-cwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", @@ -4023,13 +3922,13 @@ "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", "dev": true, "requires": { - "is-path-inside": "1.0.0" + "is-path-inside": "1.0.1" } }, "is-path-inside": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", - "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { "path-is-inside": "1.0.2" @@ -4069,13 +3968,16 @@ } }, "is-resolvable": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", - "integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI=", - "dev": true, - "requires": { - "tryit": "1.0.3" - } + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.1.tgz", + "integrity": "sha512-y5CXYbzvB3jTnWAZH1Nl7ykUWb6T3BcTs56HUruwBf8MhF56n1HWqhDWnVFo8GHrUPDgvUUNVhrc2U8W7iqz5g==", + "dev": true + }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "dev": true }, "is-stream": { "version": "1.1.0", @@ -4129,9 +4031,9 @@ "dev": true }, "js-yaml": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.1.tgz", - "integrity": "sha512-CbcG379L1e+mWBnLvHWWeLs8GyV/EMw862uLI3c+GxVyDHWZcjZinwuBd3iW2pgxgIlksW/1vNJa4to+RvDOww==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", "dev": true, "requires": { "argparse": "1.0.9", @@ -4196,16 +4098,6 @@ "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", "dev": true }, - "JSONStream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", - "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", - "dev": true, - "requires": { - "jsonparse": "1.3.1", - "through": "2.3.8" - } - }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -4238,7 +4130,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } }, "labeled-stream-splicer": { @@ -4261,56 +4153,12 @@ } }, "latest-version": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-1.0.1.tgz", - "integrity": "sha1-cs/Ebj6NG+ZR4eu1Tqn26pbzdLs=", - "dev": true, - "requires": { - "package-json": "1.2.0" - } - }, - "lazystream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz", - "integrity": "sha1-GyXWPHcqTCDwpe0KnXf0hLbhaSA=", - "dev": true, - "requires": { - "readable-stream": "1.0.34" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", + "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", "dev": true, "requires": { - "invert-kv": "1.0.0" + "package-json": "4.0.1" } }, "lcov-parse": { @@ -4322,12 +4170,14 @@ "leaflet": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.2.0.tgz", - "integrity": "sha512-Bold8phAE6WcRsuwhofrQ7cOK1REFHaYIkKuj7+TBYK3ONKRpGGIb5oXR5akYotFnrWN0TWKh6Svlhflm3dogg==" + "integrity": "sha512-Bold8phAE6WcRsuwhofrQ7cOK1REFHaYIkKuj7+TBYK3ONKRpGGIb5oXR5akYotFnrWN0TWKh6Svlhflm3dogg==", + "dev": true }, "leaflet-editable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/leaflet-editable/-/leaflet-editable-1.1.0.tgz", - "integrity": "sha1-93dZekCoGic/KHtIn9D+XM1gyNA=" + "integrity": "sha1-93dZekCoGic/KHtIn9D+XM1gyNA=", + "dev": true }, "levn": { "version": "0.3.0", @@ -4360,18 +4210,6 @@ "strip-bom": "3.0.0" } }, - "localtunnel": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-1.8.3.tgz", - "integrity": "sha1-3MWSL9hWUQN9S94k/ZMkjQsk6wU=", - "dev": true, - "requires": { - "debug": "2.6.8", - "openurl": "1.1.1", - "request": "2.81.0", - "yargs": "3.29.0" - } - }, "lodash": { "version": "4.17.4", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", @@ -4510,6 +4348,23 @@ "yallist": "2.1.2" } }, + "make-dir": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.1.0.tgz", + "integrity": "sha512-0Pkui4wLJ7rxvmfUvs87skoEaxmu0hCUApF8nonzpl7q//FWp9zu8W61Scz4sd/kUiqDxvUhtoam2efDyiBzcA==", + "dev": true, + "requires": { + "pify": "3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, "map-stream": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", @@ -4562,13 +4417,13 @@ "normalize-path": "2.1.1", "object.omit": "2.0.1", "parse-glob": "3.0.4", - "regex-cache": "0.4.3" + "regex-cache": "0.4.4" } }, "miller-rabin": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.0.tgz", - "integrity": "sha1-SmL7HUKTPAVYOYL0xxb2+55sbT0=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, "requires": { "bn.js": "4.11.8", @@ -4576,33 +4431,24 @@ } }, "mime": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.0.tgz", - "integrity": "sha512-n9ChLv77+QQEapYz8lV+rIZAW3HhAPW2CXnzb1GN5uMkuczshwvkW7XPsbzU0ZQN3sP47Er2KVkp2p3KyqZKSQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true }, "mime-db": { - "version": "1.29.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.29.0.tgz", - "integrity": "sha1-SNJtI1WJZRcErFkWygYAGRQmaHg=", + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=", "dev": true }, "mime-types": { - "version": "2.1.16", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz", - "integrity": "sha1-K4WKUuXs1RbbiXrCvodIeDBpjiM=", - "dev": true, - "requires": { - "mime-db": "1.29.0" - } - }, - "min-document": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", "dev": true, "requires": { - "dom-walk": "0.1.1" + "mime-db": "1.30.0" } }, "minimalistic-assert": { @@ -4647,17 +4493,17 @@ "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", "dev": true, "requires": { + "JSONStream": "1.3.2", "browser-resolve": "1.11.2", "cached-path-relative": "1.0.1", "concat-stream": "1.5.2", "defined": "1.0.0", - "detective": "4.5.0", + "detective": "4.7.0", "duplexer2": "0.1.4", "inherits": "2.0.3", - "JSONStream": "1.3.1", "parents": "1.0.1", "readable-stream": "2.3.3", - "resolve": "1.4.0", + "resolve": "1.5.0", "stream-combiner2": "1.1.1", "subarg": "1.0.0", "through2": "2.0.3", @@ -4677,9 +4523,9 @@ "dev": true }, "nan": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", - "integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", + "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", "dev": true, "optional": true }, @@ -4689,43 +4535,22 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "nested-error-stacks": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz", - "integrity": "sha1-GfYZWRUZ8JZ2mlupqG5u7sgjw88=", - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "node-int64": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.3.3.tgz", - "integrity": "sha1-LW5rLs5d6FiLQ9iNG8QbJs0fqE0=", - "dev": true - }, - "node-uuid": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.3.3.tgz", - "integrity": "sha1-09tNe1aBDZ5AMjQnZigq8HORcps=", - "dev": true - }, "nodemon": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.11.0.tgz", - "integrity": "sha1-ImxWK9KnsT09dRi0mtSCijYj0Gw=", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.13.3.tgz", + "integrity": "sha512-JTDI4il69J3rQ5aXQdNcDZDfk8JXC2c5Uh9zjTtFGrlP72UDoOEPB7reDMjo27tbLhtxtPAfGwhs28RVMz5rHQ==", "dev": true, "requires": { + "@remy/pstree": "1.1.0", "chokidar": "1.7.0", - "debug": "2.6.8", + "debug": "2.6.9", "es6-promise": "3.3.1", "ignore-by-default": "1.0.1", "lodash.defaults": "3.1.2", "minimatch": "3.0.4", - "ps-tree": "1.1.0", - "touch": "1.0.0", + "touch": "3.1.0", "undefsafe": "0.0.3", - "update-notifier": "0.5.0" + "update-notifier": "2.3.0" } }, "nopt": { @@ -4734,7 +4559,7 @@ "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", "dev": true, "requires": { - "abbrev": "1.1.0" + "abbrev": "1.1.1" } }, "normalize-path": { @@ -4746,6 +4571,15 @@ "remove-trailing-separator": "1.1.0" } }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "2.0.1" + } + }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -6228,12 +6062,6 @@ "integrity": "sha1-XG2ixdflgx6P+jlklQ+NZnSskLg=", "dev": true }, - "openurl": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz", - "integrity": "sha1-OHW0sO96UsFW8NtB1GCduw+Us4c=", - "dev": true - }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", @@ -6278,31 +6106,12 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "requires": { - "lcid": "1.0.0" - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "osenv": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", - "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", - "dev": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, "outpipe": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", @@ -6323,14 +6132,22 @@ "object-assign": "4.1.1" } }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, "package-json": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-1.2.0.tgz", - "integrity": "sha1-yOysCUInzfdqMWh07QXifMk5oOA=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", + "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", "dev": true, "requires": { - "got": "3.3.1", - "registry-url": "3.1.0" + "got": "6.7.1", + "registry-auth-token": "3.3.1", + "registry-url": "3.1.0", + "semver": "5.4.1" } }, "pako": { @@ -6354,11 +6171,11 @@ "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", "dev": true, "requires": { - "asn1.js": "4.9.1", - "browserify-aes": "1.0.6", + "asn1.js": "4.9.2", + "browserify-aes": "1.1.1", "create-hash": "1.1.3", - "evp_bytestokey": "1.0.2", - "pbkdf2": "3.0.13" + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.14" } }, "parse-glob": { @@ -6373,16 +6190,6 @@ "is-glob": "2.0.1" } }, - "parse-headers": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", - "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", - "dev": true, - "requires": { - "for-each": "0.3.2", - "trim": "0.0.1" - } - }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -6410,6 +6217,12 @@ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", @@ -6432,24 +6245,18 @@ } }, "pbkdf2": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.13.tgz", - "integrity": "sha512-+dCHxDH+djNtjgWmvVC/my3SYBAKpKNqKSjLkp+GtWWYe4XPE+e/PSD2aCanlEZZnqPk2uekTKNC/ccbwd2X2Q==", + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", + "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", "dev": true, "requires": { "create-hash": "1.1.3", "create-hmac": "1.1.6", "ripemd160": "2.0.1", "safe-buffer": "5.1.1", - "sha.js": "2.4.8" + "sha.js": "2.4.9" } }, - "performance-now": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", - "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", - "dev": true - }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -6512,9 +6319,9 @@ "dev": true }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", "dev": true }, "process": { @@ -6569,12 +6376,6 @@ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true }, - "q": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", - "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", - "dev": true - }, "qs": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", @@ -6593,24 +6394,6 @@ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, - "quick-tmp": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/quick-tmp/-/quick-tmp-0.0.0.tgz", - "integrity": "sha1-QWXmYyDqBfnLzM874fj9X9sF998=", - "dev": true, - "requires": { - "first-match": "0.0.1", - "osenv": "0.0.3" - }, - "dependencies": { - "osenv": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.0.3.tgz", - "integrity": "sha1-zWrY3bKQkVrZ4idlV2Al1BHynLY=", - "dev": true - } - } - }, "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", @@ -6636,7 +6419,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } } } @@ -6647,7 +6430,7 @@ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } } } @@ -6661,14 +6444,24 @@ "safe-buffer": "5.1.1" } }, + "randomfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.3.tgz", + "integrity": "sha512-YL6GrhrWoic0Eq8rXVbMptH7dAxCs0J+mh5Y0euNekPPYaxEmdVGim6GdoxoRzKW2yJoU8tueifS7mYxvcFDEQ==", + "dev": true, + "requires": { + "randombytes": "2.0.5", + "safe-buffer": "5.1.1" + } + }, "rc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz", - "integrity": "sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU=", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.2.tgz", + "integrity": "sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=", "dev": true, "requires": { "deep-extend": "0.4.2", - "ini": "1.3.4", + "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" }, @@ -6681,16 +6474,6 @@ } } }, - "read-all-stream": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz", - "integrity": "sha1-NcPhd/IHjveJ7kv6+kNzB06u9Po=", - "dev": true, - "requires": { - "pinkie-promise": "2.0.1", - "readable-stream": "2.3.3" - } - }, "read-only-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", @@ -6744,19 +6527,19 @@ "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { - "resolve": "1.4.0" + "resolve": "1.5.0" } }, "regenerate": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.2.tgz", - "integrity": "sha1-0ZQcZ7rUN+G+dkM63Vs4X5WxkmA=", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", + "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==", "dev": true }, "regenerator-runtime": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", - "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, "regenerator-transform": { @@ -6767,17 +6550,16 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regex-cache": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", - "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "dev": true, "requires": { - "is-equal-shallow": "0.1.3", - "is-primitive": "2.0.0" + "is-equal-shallow": "0.1.3" } }, "regexpu-core": { @@ -6786,18 +6568,28 @@ "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", "dev": true, "requires": { - "regenerate": "1.3.2", + "regenerate": "1.3.3", "regjsgen": "0.2.0", "regjsparser": "0.1.5" } }, + "registry-auth-token": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.1.tgz", + "integrity": "sha1-+w0yie4Nmtosu1KvXf5mywcNMAY=", + "dev": true, + "requires": { + "rc": "1.2.2", + "safe-buffer": "5.1.1" + } + }, "registry-url": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", "dev": true, "requires": { - "rc": "1.2.1" + "rc": "1.2.2" } }, "regjsgen": { @@ -6850,50 +6642,6 @@ "is-finite": "1.0.2" } }, - "request": { - "version": "2.81.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", - "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", - "dev": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.16", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.1.0" - }, - "dependencies": { - "qs": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", - "dev": true - }, - "uuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", - "dev": true - } - } - }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", @@ -6911,9 +6659,9 @@ "dev": true }, "resolve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", "dev": true, "requires": { "path-parse": "1.0.5" @@ -6945,9 +6693,9 @@ } }, "rimraf": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", - "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { "glob": "7.1.2" @@ -7006,20 +6754,15 @@ "dev": true }, "sha.js": { - "version": "2.4.8", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz", - "integrity": "sha1-NwaMLEdra69ALRSknGf1l5IfY08=", + "version": "2.4.9", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.9.tgz", + "integrity": "sha512-G8zektVqbiPHrylgew9Zg1VRB1L/DtXNUVAM6q4QLy8NE3qtHlFXTf8VLL4k1Yl6c7NMjtZUTdXV+X44nFaT6A==", "dev": true, "requires": { - "inherits": "2.0.3" + "inherits": "2.0.3", + "safe-buffer": "5.1.1" } }, - "shallow-copy": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", - "integrity": "sha1-QV9CcC1z2BAzApLMXuhurhoRoXA=", - "dev": true - }, "shasum": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", @@ -7027,9 +6770,24 @@ "dev": true, "requires": { "json-stable-stringify": "0.0.1", - "sha.js": "2.4.8" + "sha.js": "2.4.9" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" } }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, "shell-quote": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", @@ -7049,27 +6807,10 @@ "dev": true, "requires": { "glob": "7.1.2", - "interpret": "1.0.3", + "interpret": "1.1.0", "rechoir": "0.6.2" } }, - "shoe": { - "version": "0.0.15", - "resolved": "https://registry.npmjs.org/shoe/-/shoe-0.0.15.tgz", - "integrity": "sha1-uu2PGn8I9TC2bwkUKH/KplsSRDo=", - "dev": true, - "requires": { - "sockjs": "0.3.7", - "sockjs-client": "0.0.0-unreleasable" - }, - "dependencies": { - "sockjs-client": { - "version": "0.0.0-unreleasable", - "bundled": true, - "dev": true - } - } - }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", @@ -7088,140 +6829,6 @@ "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true }, - "slide": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", - "dev": true - }, - "smokestack": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/smokestack/-/smokestack-3.4.1.tgz", - "integrity": "sha1-yw2V+kVbzkIU3SdQp6zlJAOmD/E=", - "dev": true, - "requires": { - "bl": "0.9.5", - "chrome-launch": "1.1.4", - "convert-source-map": "1.5.0", - "debug": "2.6.8", - "firefox-launch": "1.1.0", - "is-dom": "1.0.9", - "localtunnel": "1.8.3", - "minimist": "1.1.3", - "mkdirp": "0.5.1", - "rimraf": "2.3.4", - "shoe": "0.0.15", - "source-map": "0.4.4", - "source-map-support": "0.2.10", - "split": "0.3.3", - "synthetic-dom-events": "0.2.2", - "tap-finished": "0.0.1", - "through2": "0.6.5", - "wd": "0.3.12", - "xhr": "2.4.0" - }, - "dependencies": { - "glob": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", - "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "2.0.10", - "once": "1.4.0" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "minimatch": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", - "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } - }, - "minimist": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", - "integrity": "sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "rimraf": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.3.4.tgz", - "integrity": "sha1-gtm8Gy/PMeIFrHsoE4oCXQjpFZo=", - "dev": true, - "requires": { - "glob": "4.5.3" - } - }, - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, - "requires": { - "amdefine": "1.0.1" - } - }, - "source-map-support": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz", - "integrity": "sha1-6lo5AKHByyUJagrozFwrSxDe09w=", - "dev": true, - "requires": { - "source-map": "0.1.32" - }, - "dependencies": { - "source-map": { - "version": "0.1.32", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz", - "integrity": "sha1-yLbBZ3l7pHQKjqMyUhYv8IWRsmY=", - "dev": true, - "requires": { - "amdefine": "1.0.1" - } - } - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } - } - }, "sntp": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", @@ -7231,16 +6838,6 @@ "hoek": "2.16.3" } }, - "sockjs": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.7.tgz", - "integrity": "sha1-KVDgWG2KnTBElYqDGt5o2xl3Scs=", - "dev": true, - "requires": { - "faye-websocket": "0.4.4", - "node-uuid": "1.3.3" - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -7248,9 +6845,9 @@ "dev": true }, "source-map-support": { - "version": "0.4.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.16.tgz", - "integrity": "sha512-A6vlydY7H/ljr4L2UOhDSajQdZQ6dMD7cLH0pzwcmwLyc9u8PNI4WGtnfDDzX7uzGL6c/T+ORL97Zlh+S4iOrg==", + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "dev": true, "requires": { "source-map": "0.5.7" @@ -7343,12 +6940,6 @@ "xtend": "4.0.1" } }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, "stream-splicer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", @@ -7359,24 +6950,6 @@ "readable-stream": "2.3.3" } }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, - "string-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", - "integrity": "sha1-VpcPscOFWOnnC3KL894mmsRa36w=", - "dev": true, - "requires": { - "strip-ansi": "3.0.1" - } - }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -7395,12 +6968,21 @@ "dev": true, "requires": { "define-properties": "1.1.2", - "es-abstract": "1.8.0", + "es-abstract": "1.10.0", "function-bind": "1.1.1" } }, - "stringstream": { - "version": "0.0.5", + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "stringstream": { + "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", "dev": true @@ -7420,6 +7002,12 @@ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -7451,13 +7039,13 @@ "requires": { "component-emitter": "1.2.1", "cookiejar": "2.1.1", - "debug": "2.6.8", + "debug": "2.6.9", "extend": "3.0.1", "form-data": "1.0.0-rc4", "formidable": "1.1.1", "methods": "1.1.2", - "mime": "1.4.0", - "qs": "6.5.0", + "mime": "1.6.0", + "qs": "6.5.1", "readable-stream": "2.3.3" }, "dependencies": { @@ -7475,13 +7063,13 @@ "requires": { "async": "1.5.2", "combined-stream": "1.0.5", - "mime-types": "2.1.16" + "mime-types": "2.1.17" } }, "qs": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.0.tgz", - "integrity": "sha512-fjVFjW9yhqMhVGwRExCXLhJKrLlkYSaxNWdyc9rmHlrVZbk35YHH312dFd7191uQeXkI3mKLZTIbSvIeFwFemg==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", "dev": true } } @@ -7501,12 +7089,6 @@ "acorn": "4.0.13" } }, - "synthetic-dom-events": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/synthetic-dom-events/-/synthetic-dom-events-0.2.2.tgz", - "integrity": "sha1-fsfRPz87wMmXAbWsvLrMRZw/jAw=", - "dev": true - }, "table": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", @@ -7560,15 +7142,15 @@ "integrity": "sha1-4RTImqqqHAp3fiWnHLExT9BGpV4=", "dev": true, "requires": { - "bluebird": "3.5.0", + "bluebird": "3.5.1", "clean-yaml-object": "0.1.0", "color-support": "1.1.3", - "coveralls": "2.13.1", + "coveralls": "2.13.3", "deeper": "2.1.0", "foreground-child": "1.5.6", "glob": "7.1.2", "isexe": "1.1.2", - "js-yaml": "3.9.1", + "js-yaml": "3.10.0", "nyc": "7.1.0", "only-shallow": "1.2.0", "opener": "1.4.3", @@ -7582,9 +7164,9 @@ }, "dependencies": { "bluebird": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", - "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", "dev": true }, "isexe": { @@ -7607,22 +7189,12 @@ "requires": { "events-to-array": "1.1.2", "inherits": "2.0.3", - "js-yaml": "3.9.1", + "js-yaml": "3.10.0", "readable-stream": "2.3.3" } } } }, - "tap-finished": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tap-finished/-/tap-finished-0.0.1.tgz", - "integrity": "sha1-CLW1Q/3ASDApDGxWEnlVLnHEvWc=", - "dev": true, - "requires": { - "tap-parser": "0.2.1", - "through": "2.3.8" - } - }, "tap-mocha-reporter": { "version": "0.0.27", "resolved": "https://registry.npmjs.org/tap-mocha-reporter/-/tap-mocha-reporter-0.0.27.tgz", @@ -7630,11 +7202,11 @@ "dev": true, "requires": { "color-support": "1.1.3", - "debug": "2.6.8", + "debug": "2.6.9", "diff": "1.4.0", "escape-string-regexp": "1.0.5", "glob": "7.1.2", - "js-yaml": "3.9.1", + "js-yaml": "3.10.0", "readable-stream": "1.1.14", "tap-parser": "1.3.2", "unicode-length": "1.0.3" @@ -7675,7 +7247,7 @@ "requires": { "events-to-array": "1.1.2", "inherits": "2.0.3", - "js-yaml": "3.9.1", + "js-yaml": "3.10.0", "readable-stream": "2.3.3" }, "dependencies": { @@ -7716,32 +7288,6 @@ } } }, - "tap-parser": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.2.1.tgz", - "integrity": "sha1-jh6CPyEU7iHQMuLzHk+2QqKW9Qs=", - "dev": true, - "requires": { - "split": "0.1.2" - }, - "dependencies": { - "split": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/split/-/split-0.1.2.tgz", - "integrity": "sha1-8HEHRMRT1VH8cUPq2YPaYBTjNsw=", - "dev": true, - "requires": { - "through": "1.1.2" - } - }, - "through": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/through/-/through-1.1.2.tgz", - "integrity": "sha1-NEpUJaN3MxTKfg62US+6+vdsC/4=", - "dev": true - } - } - }, "tap-status": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/tap-status/-/tap-status-1.0.1.tgz", @@ -7760,7 +7306,7 @@ "requires": { "events-to-array": "1.1.2", "inherits": "2.0.3", - "js-yaml": "3.9.1", + "js-yaml": "3.10.0", "readable-stream": "2.3.3" } } @@ -7792,47 +7338,27 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true - } - } - }, - "tar-stream": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.1.5.tgz", - "integrity": "sha1-vpIYwTDCACnhB7D5Z/sj3gV50Tw=", - "dev": true, - "requires": { - "bl": "0.9.5", - "end-of-stream": "1.4.0", - "readable-stream": "1.0.34", - "xtend": "4.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "resolve": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", + "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" + "path-parse": "1.0.5" } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true } } }, + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "dev": true, + "requires": { + "execa": "0.7.0" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -7856,9 +7382,9 @@ } }, "timed-out": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-2.0.0.tgz", - "integrity": "sha1-84sK6B03R9YoAB9B2vxlKs5nHAo=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", "dev": true }, "timers-browserify": { @@ -7871,9 +7397,9 @@ } }, "tinyqueue": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-1.1.0.tgz", - "integrity": "sha1-nF929UqEX0kU51T1qo1z72wBH3s=" + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-1.2.3.tgz", + "integrity": "sha512-Qz9RgWuO9l8lT+Y9xvbzhPT2efIUIFd69N7eF7tJ9lnQl0iLj1M7peK7IoUGZL9DJHw9XftqLreccfxcQgYLxA==" }, "tmatch": { "version": "2.0.1", @@ -7894,56 +7420,35 @@ "dev": true }, "touch": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", - "integrity": "sha1-RJy+LbrlqMgDjjDXH6D/RklHxN4=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", "dev": true, "requires": { "nopt": "1.0.10" } }, "tough-cookie": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", "dev": true, "requires": { "punycode": "1.4.1" } }, - "trim": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", - "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=", - "dev": true - }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, - "tryit": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", - "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", - "dev": true - }, "tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", @@ -7967,9 +7472,9 @@ "dev": true }, "typescript": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.4.2.tgz", - "integrity": "sha1-+DlfhdRZJ2BnyYiqQYN6j4KHCEQ=", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.6.2.tgz", + "integrity": "sha1-PFtv1/beCRQmkCfwPAlGdY92c6Q=", "dev": true }, "uglifyjs": { @@ -7990,12 +7495,6 @@ "integrity": "sha1-7Mo6A+VrmvFzhbqsgSrIO5lKli8=", "dev": true }, - "underscore.string": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.0.3.tgz", - "integrity": "sha1-Rhe4waJQz25QZPu7Nj0PqWzxRVI=", - "dev": true - }, "unicode-length": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz", @@ -8015,28 +7514,65 @@ "qs": "2.3.3" } }, + "unique-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", + "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", + "dev": true, + "requires": { + "crypto-random-string": "1.0.0" + } + }, + "unzip-response": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", + "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", + "dev": true + }, "update-notifier": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.5.0.tgz", - "integrity": "sha1-B7XcIGazYnqztPUwEw9+3doHpMw=", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.3.0.tgz", + "integrity": "sha1-TognpruRUUCrCTVZ1wFOPruDdFE=", "dev": true, "requires": { - "chalk": "1.1.3", - "configstore": "1.4.0", + "boxen": "1.3.0", + "chalk": "2.3.0", + "configstore": "3.1.1", + "import-lazy": "2.1.0", + "is-installed-globally": "0.1.0", "is-npm": "1.0.0", - "latest-version": "1.0.1", - "repeating": "1.1.3", + "latest-version": "3.1.0", "semver-diff": "2.1.0", - "string-length": "1.0.1" + "xdg-basedir": "3.0.0" }, "dependencies": { - "repeating": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", - "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=", + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "dev": true, "requires": { - "is-finite": "1.0.2" + "has-flag": "2.0.0" } } } @@ -8065,18 +7601,21 @@ "integrity": "sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg=", "dev": true }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "1.0.4" + } + }, "user-home": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", "dev": true }, - "userhome": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/userhome/-/userhome-1.0.0.tgz", - "integrity": "sha1-tkkf8S0hpecmcd+czIcX4cZojAs=", - "dev": true - }, "util": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", @@ -8101,9 +7640,9 @@ "dev": true }, "uuid": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", - "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", "dev": true }, "v8flags": { @@ -8115,12 +7654,6 @@ "user-home": "1.1.1" } }, - "vargs": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz", - "integrity": "sha1-a2GE2mUgzDIEzhtAfKwm2SYJ6/8=", - "dev": true - }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -8156,7 +7689,7 @@ "dev": true, "requires": { "anymatch": "1.3.2", - "browserify": "14.4.0", + "browserify": "14.5.0", "chokidar": "1.7.0", "defined": "1.0.0", "outpipe": "1.1.1", @@ -8165,21 +7698,22 @@ }, "dependencies": { "browserify": { - "version": "14.4.0", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-14.4.0.tgz", - "integrity": "sha1-CJo0Y69Y0OSNjNQHCz90ZU1avKk=", + "version": "14.5.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-14.5.0.tgz", + "integrity": "sha512-gKfOsNQv/toWz+60nSPfYzuwSEdzvV2WdxrVPUbPD/qui44rAkB3t3muNtmmGYHqrG56FGwX9SUEQmzNLAeS7g==", "dev": true, "requires": { + "JSONStream": "1.3.2", "assert": "1.4.1", "browser-pack": "6.0.2", "browser-resolve": "1.11.2", - "browserify-zlib": "0.1.4", - "buffer": "5.0.7", + "browserify-zlib": "0.2.0", + "buffer": "5.0.8", "cached-path-relative": "1.0.1", "concat-stream": "1.5.2", "console-browserify": "1.1.0", "constants-browserify": "1.0.0", - "crypto-browserify": "3.11.1", + "crypto-browserify": "3.12.0", "defined": "1.0.0", "deps-sort": "2.0.0", "domain-browser": "1.1.7", @@ -8191,10 +7725,9 @@ "https-browserify": "1.0.0", "inherits": "2.0.3", "insert-module-globals": "7.0.1", - "JSONStream": "1.3.1", "labeled-stream-splicer": "2.0.0", "module-deps": "4.1.1", - "os-browserify": "0.1.2", + "os-browserify": "0.3.0", "parents": "1.0.1", "path-browserify": "0.0.0", "process": "0.11.10", @@ -8202,7 +7735,7 @@ "querystring-es3": "0.2.1", "read-only-stream": "2.0.0", "readable-stream": "2.3.3", - "resolve": "1.4.0", + "resolve": "1.5.0", "shasum": "1.0.2", "shell-quote": "1.6.1", "stream-browserify": "2.0.1", @@ -8219,10 +7752,19 @@ "xtend": "4.0.1" } }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "1.0.6" + } + }, "buffer": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.0.7.tgz", - "integrity": "sha512-NeeHXWh5pCbPQCt2/6rLvXqapZfVsqw/YgRgaHpT3H9Uzgs+S0lSg5SQzouIuDvcmlQRqBe8hOO2scKCu3cxrg==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.0.8.tgz", + "integrity": "sha512-xXvjQhVNz50v2nPeoOsNqWCLGfiv4ji/gXZM28jnVwdLJxH4mFyqgqCKfaK9zf1KUbG6zTkjLOy7ou+jSMarGA==", "dev": true, "requires": { "base64-js": "1.2.1", @@ -8234,227 +7776,78 @@ "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "dev": true } } }, - "wd": { - "version": "0.3.12", - "resolved": "https://registry.npmjs.org/wd/-/wd-0.3.12.tgz", - "integrity": "sha1-P7Tx11n4yF3eU5PRczT/4D6bsyk=", + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "widest-line": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz", + "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", "dev": true, "requires": { - "archiver": "0.14.4", - "async": "1.0.0", - "lodash": "3.9.3", - "q": "1.4.1", - "request": "2.55.0", - "underscore.string": "3.0.3", - "vargs": "0.1.0" + "string-width": "2.1.1" }, "dependencies": { - "asn1": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", - "integrity": "sha1-VZvhg3bQik7E2+gId9J4GGObLfc=", - "dev": true - }, - "assert-plus": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", - "integrity": "sha1-7nQAlBMALYTOxyGcasgRgS5yMWA=", - "dev": true - }, - "async": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", - "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", - "dev": true - }, - "aws-sign2": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", - "integrity": "sha1-xXED96F/wDfwLXwuZLYC6iI/fWM=", - "dev": true - }, - "caseless": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.9.0.tgz", - "integrity": "sha1-t7Zc5r8UE4hlOc/VM/CzDv+pz4g=", - "dev": true - }, - "combined-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", - "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", - "dev": true, - "requires": { - "delayed-stream": "0.0.5" - } - }, - "delayed-stream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", - "integrity": "sha1-1LH0OpPoKW3+AmlPRoC8N6MTxz8=", - "dev": true - }, - "form-data": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", - "integrity": "sha1-Jvi8JtpkQOKZy9z7aQNcT3em5GY=", - "dev": true, - "requires": { - "async": "0.9.2", - "combined-stream": "0.0.7", - "mime-types": "2.0.14" - }, - "dependencies": { - "async": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", - "dev": true - } - } - }, - "har-validator": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-1.8.0.tgz", - "integrity": "sha1-2DhCsOtMQ1lgrrEIoGejqpTA7rI=", - "dev": true, - "requires": { - "bluebird": "2.11.0", - "chalk": "1.1.3", - "commander": "2.11.0", - "is-my-json-valid": "2.16.1" - } - }, - "hawk": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-2.3.1.tgz", - "integrity": "sha1-HnMc45RH+h0PbXB/e87r7A/R7B8=", - "dev": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "http-signature": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", - "integrity": "sha1-T72sEyVZqoMjEh5UB3nAoBKyfmY=", - "dev": true, - "requires": { - "asn1": "0.1.11", - "assert-plus": "0.1.5", - "ctype": "0.5.3" - } - }, - "lodash": { - "version": "3.9.3", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz", - "integrity": "sha1-AVnoaDL+/8bWHYUrEqlTuZSWvTI=", + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, - "mime-db": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz", - "integrity": "sha1-PQxjGA9FjrENMlqqN9fFiuMS6dc=", + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "mime-types": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", - "integrity": "sha1-MQ4VnbI+B3+Lsit0jav6SVcUCqY=", + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "mime-db": "1.12.0" + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" } }, - "node-uuid": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", - "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=", - "dev": true - }, - "oauth-sign": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.6.0.tgz", - "integrity": "sha1-fb6uRPbKRU4fFoRR1jB0ZzWBPOM=", - "dev": true - }, - "qs": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-2.4.2.tgz", - "integrity": "sha1-9854jld33wtQENp/fE5zujJHD1o=", - "dev": true - }, - "request": { - "version": "2.55.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.55.0.tgz", - "integrity": "sha1-11wc32eddrsQD5v/4f5VG1wk6T0=", + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "aws-sign2": "0.5.0", - "bl": "0.9.5", - "caseless": "0.9.0", - "combined-stream": "0.0.7", - "forever-agent": "0.6.1", - "form-data": "0.2.0", - "har-validator": "1.8.0", - "hawk": "2.3.1", - "http-signature": "0.10.1", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.0.14", - "node-uuid": "1.4.8", - "oauth-sign": "0.6.0", - "qs": "2.4.2", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.4.3" + "ansi-regex": "3.0.0" } - }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", - "dev": true } } }, - "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", - "dev": true, - "requires": { - "isexe": "2.0.0" - } - }, - "window-size": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", - "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", - "dev": true - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -8471,36 +7864,21 @@ } }, "write-file-atomic": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", - "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", "dev": true, "requires": { "graceful-fs": "4.1.11", "imurmurhash": "0.1.4", - "slide": "1.1.6" + "signal-exit": "3.0.2" } }, "xdg-basedir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz", - "integrity": "sha1-7byQPMOF/ARSPZZqM1UEtVBNG9I=", - "dev": true, - "requires": { - "os-homedir": "1.0.2" - } - }, - "xhr": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.4.0.tgz", - "integrity": "sha1-4W5mpF+GmGHu76tBbV7/ci3ECZM=", - "dev": true, - "requires": { - "global": "4.3.2", - "is-function": "1.0.1", - "parse-headers": "2.0.1", - "xtend": "4.0.1" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", + "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", + "dev": true }, "xtend": { "version": "4.0.1", @@ -8508,74 +7886,11 @@ "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", "dev": true }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true - }, - "yargs": { - "version": "3.29.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz", - "integrity": "sha1-GquWYOrnnYuPZ1vK7qtu40ws9pw=", - "dev": true, - "requires": { - "camelcase": "1.2.1", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "os-locale": "1.4.0", - "window-size": "0.1.4", - "y18n": "3.2.1" - } - }, - "zip-stream": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.5.2.tgz", - "integrity": "sha1-Mty8UG0Nq00hNyYlvX66rDwv/1Y=", - "dev": true, - "requires": { - "compress-commons": "0.2.9", - "lodash": "3.2.0", - "readable-stream": "1.0.34" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "lodash": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", - "integrity": "sha1-S/UKMkP5rrC6xBpV09WZBnWkYvs=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } } } } diff --git a/package.json b/package.json index 14a4240..4fc2543 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,6 @@ "leaflet-editable": "^1.1.0", "load-json-file": "^2.0.0", "nodemon": "^1.9.2", - "smokestack": "^3.4.1", "superagent": "^2.1.0", "tap": "^6.2.0", "tap-status": "^1.0.1", diff --git a/src/compare_events.js b/src/compare_events.js index 778a901..daf4413 100644 --- a/src/compare_events.js +++ b/src/compare_events.js @@ -41,15 +41,6 @@ function specialCases(e1, e2, p1, p2) { return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; } - // uncomment this if you want to play with multipolygons - // if (e1.isSubject === e2.isSubject) { - // if(equals(e1.point, e2.point) && e1.contourId === e2.contourId) { - // return 0; - // } else { - // return e1.contourId > e2.contourId ? 1 : -1; - // } - // } - return (!e1.isSubject && e2.isSubject) ? 1 : -1; } /* eslint-enable no-unused-vars */ diff --git a/src/connect_edges.js b/src/connect_edges.js index 2b563ca..d28d88f 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -65,7 +65,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { // while in range and not the current one by value while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { if (!processed[newPos]) { - // console.log(pos, newPos, length); return newPos; } else { newPos++; @@ -78,7 +77,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { while (processed[newPos] && newPos >= origIndex) { newPos--; } - // console.log('other', pos, newPos, length); return newPos; } @@ -90,7 +88,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { module.exports = function connectEdges(sortedEvents, operation) { var i, len; var resultEvents = orderEvents(sortedEvents); - //_renderPoints(resultEvents, 'inResult'); // "false"-filled array var processed = {}; @@ -165,24 +162,3 @@ module.exports = function connectEdges(sortedEvents, operation) { // if (result.length === 1) result = result[0]; return result; }; - - -/* eslint-disable no-unused-vars, no-debugger, no-undef, no-use-before-define */ -function _renderPoints(possiblePoints, prop) { - var map = window.map; - var points = window.points; - if (!map) return; - if (points !== undefined) points.clearLayers(); - - points = window.points = L.layerGroup([]).addTo(map); - possiblePoints.forEach(function (e) { - var point = L.circleMarker([e.point[1], e.point[0]], { - radius: Math.floor(5 + Math.random() * 10), - color: e[prop] ? 'green' : 'gray', - opacity: e[prop] ? 0.5 : 0.1, - weight: 1 - }).addTo(points); - }); -} - -/* eslint-enable no-unused-vars, no-debugger, no-undef */ diff --git a/src/fill_queue.js b/src/fill_queue.js index 1e67046..b82f9f5 100644 --- a/src/fill_queue.js +++ b/src/fill_queue.js @@ -12,11 +12,9 @@ var contourId = 0; function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { var i, len, s1, s2, e1, e2; - // var d = depth + 1; for (i = 0, len = contourOrHole.length - 1; i < len; i++) { s1 = contourOrHole[i]; s2 = contourOrHole[i + 1]; - //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); e1 = new SweepEvent(s1, false, undefined, isSubject); e2 = new SweepEvent(s2, false, e1, isSubject); e1.otherEvent = e2; diff --git a/src/index.js b/src/index.js index a495991..77149eb 100644 --- a/src/index.js +++ b/src/index.js @@ -57,43 +57,40 @@ function boolean(subject, clipping, operation) { var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; - //console.time('fill'); + //console.time('fill queue'); var eventQueue = fillQueue(subject, clipping, sbbox, cbbox); - //console.timeEnd('fill'); + //console.timeEnd('fill queue'); trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation); if (trivial) { return trivial === EMPTY ? null : trivial; } - //console.time('subdiv'); + //console.time('subdivide edges'); var sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); - //console.timeEnd('subdiv'); - //console.time('connect'); + //console.timeEnd('subdivide edges'); + + //console.time('connect vertices'); var result = connectEdges(sortedEvents, operation); - //console.timeEnd('connect'); + //console.timeEnd('connect vertices'); return result; } - -module.exports = boolean; - - -module.exports.union = function (subject, clipping) { +boolean.union = function (subject, clipping) { return boolean(subject, clipping, operations.UNION); }; -module.exports.diff = function (subject, clipping) { +boolean.diff = function (subject, clipping) { return boolean(subject, clipping, operations.DIFFERENCE); }; -module.exports.xor = function (subject, clipping) { +boolean.xor = function (subject, clipping) { return boolean(subject, clipping, operations.XOR); }; -module.exports.intersection = function (subject, clipping) { +boolean.intersection = function (subject, clipping) { return boolean(subject, clipping, operations.INTERSECTION); }; @@ -101,4 +98,8 @@ module.exports.intersection = function (subject, clipping) { /** * @enum {Number} */ -module.exports.operations = operations; +boolean.operations = operations; + + +module.exports = boolean; +module.exports.default = boolean; diff --git a/src/priority_queue.js b/src/priority_queue.js deleted file mode 100644 index f955fdf..0000000 --- a/src/priority_queue.js +++ /dev/null @@ -1,130 +0,0 @@ -'use strict'; - -/** - * @param {Number} a - * @param {Number} b - * @return {Number} - */ -function DEFAULT_COMPARATOR(a, b) { - return a < b ? -1 : a > b ? 1 : 0; -} - -/** - * @param {Array.<*>=} data - * @param {Function=} comparator - */ -function Queue(data, comparator) { - this._comparator = comparator || DEFAULT_COMPARATOR; - this.data = []; - this.length = 0; - if (data) { - for (var i = 0, len = data.length; i < len; i++) { - this.push(data[i]); - } - } -} -Queue.DEFAULT_COMPARATOR = DEFAULT_COMPARATOR; - - -Queue.prototype = { - - /** - * First element - * @return {*} - */ - peek: function () { - return this.data[0]; - }, - - - /** - * @return {*} - */ - pop: function () { - var data = this.data; - var first = data[0]; - var last = data.pop(); - var size = --this.length; - - if (size === 0) { - return first; - } - - data[0] = last; - var current = 0; - var compare = this._comparator; - - while (current < size) { - var largest = current; - var left = (2 * current) + 1; - var right = (2 * current) + 2; - - if (left < size && compare(data[left], data[largest]) > 0) { - largest = left; - } - - if (right < size && compare(data[right], data[largest]) > 0) { - largest = right; - } - - if (largest === current) break; - - this._swap(largest, current); - current = largest; - } - - return first; - }, - - - /** - * @param {*} element - * @return {Number} new size - */ - push: function (element) { - var size = this.length = this.data.push(element); - var current = size - 1; - var compare = this._comparator; - var data = this.data; - - while (current > 0) { - var parent = Math.floor((current - 1) / 2); - if (compare(data[current], data[parent]) > 0) break; - this._swap(parent, current); - current = parent; - } - - return size; - }, - - - /** - * @return {Number} - */ - size: function () { - return this.length; - }, - - - /** - * @param {Function} fn - * @param {*} context - */ - forEach: function (fn, context) { - this.data.forEach(fn, context); - }, - - - /** - * @param {Number} a - * @param {Number} b - */ - _swap: function (a, b) { - var temp = this.data[a]; - this.data[a] = this.data[b]; - this.data[b] = temp; - } -}; - - -module.exports = Queue; diff --git a/src/set.js b/src/set.js deleted file mode 100644 index 6210e95..0000000 --- a/src/set.js +++ /dev/null @@ -1,196 +0,0 @@ -'use strict'; - -/** - * @param {Number} a - * @param {Number} b - * @return {Number} - */ -function DEFAULT_COMPARATOR(a, b) { - return a.data < b.data ? -1 : a.data > b.data ? 1 : 0; -} - - -/** - * Doubly linked sorted list. - * If you want to use it with raw numbers - wrap them into objects, or - * they're going to be replaced on insert and it's gonna break - * - * @example - * var list = new Set([{data: 50}, {data: 120}, {data: 10}]); - * list.head; // {data:10, next: {data: 50, ...}, prev: {data: 120, ...}} - * list.tail; // {data:120, next: {data: 10, ...}, prev: {data: 50, ...}} - * - * @param {Array.<*>=} data - * @param {Function=} comparator - */ -function Set(data, comparator) { - - /** - * @type {*} - */ - this.head = null; - - /** - * @type {*} - */ - this.tail = null; - - /** - * @type {Number} - */ - this.length = 0; - - /** - * @type {Function} - */ - this._comparator = comparator || DEFAULT_COMPARATOR; - - if (data) { - for (var i = 0, len = data.length; i < len; i++) { - this.insert(data[i]); - } - } -} - - -Set.prototype = { - /** - * @param {*} a - * @param {*} b - * @return {*} Inserted node - */ - insertBefore: function (a, b) { - if (b === this.head) { - a.prev = this.tail; - this.head = a; - this.tail.next = this.head; - } else { - a.prev = b.prev; - b.prev.next = a; - } - a.next = b; - b.prev = a; - return a; - }, - - - /** - * @param {*} a - * @param {*} b - * @return {*} inserted node - */ - insertAfter: function (a, b) { - if (b === this.tail) { - a.next = this.head; - this.tail = a; - this.head.prev = this.tail; - } else { - a.next = b.next; - b.next.prev = a; - } - a.prev = b; - b.next = a; - return a; - }, - - - /** - * @param {*} node - * @return {*} - */ - insert: function (node) { - var current, next; - - this.length++; - - if (this.head === null) { - this.head = node; - this.head.next = this.head.prev = this.tail = this.head; - return node; - } - - if (this._comparator(this.head, node) > 0) { - this.insertBefore(node, this.head); - } else { - current = this.head; - while (current !== this.tail) { - next = current.next; - if (this._comparator(next, node) > 0) break; - current = current.next; - } - this.insertAfter(node, current); - } - - if (this._comparator(node, this.head) < 0) this.head = node; - if (this._comparator(node, this.tail) > 0) this.tail = node; - - return node; - }, - - - /** - * @param {*} node - * @return {*} - */ - remove: function (node) { - var current = this.head; - while (current !== node) { - current = current.next; - if (current === this.head) return undefined; - } - - if (current === this.head) { - this.head = this.tail.next = current.next; - this.head.prev = this.tail; - } else { - current.prev.next = current.next; - } - - this.length--; - - if (current === this.tail) { - this.tail = this.head.prev = current.prev; - this.tail.next = this.head; - return this.head; - } else { - current.next.prev = current.prev; - return current.prev; - } - }, - - - /** - * @param {*} node - * @return {*|Null} - */ - find: function (node) { - var current; - if (!this.head) { // empty list - return null; - } else { - current = this.head; - while (current.next !== this.head) { - if (current === node) return current; - current = current.next; - } - return null; - } - }, - - - /** - * @return {Array.<*>} - */ - toArray: function () { - var arr = []; - var current = this.head; - while (current !== this.tail) { - arr.push(current); - current = current.next; - } - return arr; - } - -}; - -module.exports = Set; diff --git a/src/subdivide_segments.js b/src/subdivide_segments.js index a0929a9..e1480c7 100644 --- a/src/subdivide_segments.js +++ b/src/subdivide_segments.js @@ -30,7 +30,6 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, if (event.left) { next = prev = sweepLine.insert(event); - //_renderSweepLine(sweepLine, event.point, event); begin = sweepLine.minNode(); if (prev !== begin) prev = sweepLine.prev(prev); @@ -63,8 +62,6 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, event = event.otherEvent; next = prev = sweepLine.find(event); - //_renderSweepLine(sweepLine, event.otherEvent.point, event); - if (prev && next) { if (prev !== begin) prev = sweepLine.prev(prev); @@ -73,49 +70,11 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, next = sweepLine.next(next); sweepLine.remove(event); - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - if (next && prev) { - // if (typeof prev !== 'undefined' && typeof next !== 'undefined') { possibleIntersection(prev.key, next.key, eventQueue); - // } } } } } return sortedEvents; }; - - -/* eslint-disable no-unused-vars, no-debugger, no-undef */ -function _renderSweepLine(sweepLine, pos, event) { - var map = window.map; - if (!map) return; - if (window.sws) window.sws.forEach(function (p) { - map.removeLayer(p); - }); - window.sws = []; - sweepLine.forEach(function (e) { - var poly = L.polyline([ - e.key.point.slice().reverse(), - e.key.otherEvent.point.slice().reverse() - ], {color: 'green'}).addTo(map); - window.sws.push(poly); - }); - - if (window.vt) map.removeLayer(window.vt); - var v = pos.slice(); - var b = map.getBounds(); - window.vt = L.polyline([ - [b.getNorth(), v[0]], - [b.getSouth(), v[0]] - ], {color: 'green', weight: 1}).addTo(map); - - if (window.ps) map.removeLayer(window.ps); - window.ps = L.polyline([ - event.point.slice().reverse(), - event.otherEvent.point.slice().reverse() - ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); - debugger; -} -/* eslint-enable no-unused-vars, no-debugger, no-undef */ diff --git a/src/sweep_event.js b/src/sweep_event.js index 9468aba..e7d0f2e 100644 --- a/src/sweep_event.js +++ b/src/sweep_event.js @@ -6,6 +6,7 @@ var EdgeType = require('./edge_type'); /** * Sweepline event * + * @class {SweepEvent} * @param {Array.} point * @param {Boolean} left * @param {SweepEvent=} otherEvent From 998f29172f4975f67f8b352649126471e48ffba2 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Wed, 20 Dec 2017 12:07:59 +0100 Subject: [PATCH 38/42] debug files --- dist/martinez.min.js | 0 src/debug_utils.js | 50 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 dist/martinez.min.js create mode 100644 src/debug_utils.js diff --git a/dist/martinez.min.js b/dist/martinez.min.js new file mode 100644 index 0000000..e69de29 diff --git a/src/debug_utils.js b/src/debug_utils.js new file mode 100644 index 0000000..9e68ef3 --- /dev/null +++ b/src/debug_utils.js @@ -0,0 +1,50 @@ +/* eslint-disable no-unused-vars, no-debugger, no-undef, no-use-before-define */ +module.exports.renderPoints = function renderPoints(possiblePoints, prop) { + var map = window.map; + var points = window.points; + if (!map) return; + if (points !== undefined) points.clearLayers(); + + points = window.points = L.layerGroup([]).addTo(map); + possiblePoints.forEach(function (e) { + var point = L.circleMarker([e.point[1], e.point[0]], { + radius: Math.floor(5 + Math.random() * 10), + color: e[prop] ? 'green' : 'gray', + opacity: e[prop] ? 0.5 : 0.1, + weight: 1 + }).addTo(points); + }); +} + +module.exports.renderSweepLine = function renderSweepLine(sweepLine, pos, event) { + var map = window.map; + if (!map) return; + if (window.sws) window.sws.forEach(function (p) { + map.removeLayer(p); + }); + window.sws = []; + sweepLine.forEach(function (e) { + var poly = L.polyline([ + e.key.point.slice().reverse(), + e.key.otherEvent.point.slice().reverse() + ], {color: 'green'}).addTo(map); + window.sws.push(poly); + }); + + if (window.vt) map.removeLayer(window.vt); + var v = pos.slice(); + var b = map.getBounds(); + window.vt = L.polyline([ + [b.getNorth(), v[0]], + [b.getSouth(), v[0]] + ], {color: 'green', weight: 1}).addTo(map); + + if (window.ps) map.removeLayer(window.ps); + window.ps = L.polyline([ + event.point.slice().reverse(), + event.otherEvent.point.slice().reverse() + ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); + debugger; +} + +/* eslint-enable no-unused-vars, no-debugger, no-undef, no-use-before-define */ From 11236ea8436af56f4db143b9933ff61d34facc7c Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Wed, 20 Dec 2017 22:24:47 +1100 Subject: [PATCH 39/42] Fix for #holecut difference nesting --- src/connect_edges.js | 31 +++++++++---------- .../{featureTypes.js => featureTypes.test.js} | 0 2 files changed, 14 insertions(+), 17 deletions(-) rename test/{featureTypes.js => featureTypes.test.js} (100%) diff --git a/src/connect_edges.js b/src/connect_edges.js index 2b563ca..6cbbe7c 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -104,11 +104,8 @@ module.exports = function connectEdges(sortedEvents, operation) { if (!resultEvents[i].isExteriorRing) { if (result.length === 0) { result.push([[contour]]); - } else if (operation === operationType.UNION || - operation === operationType.XOR) { - result[result.length - 1].push(contour[0]); } else { - result[result.length - 1].push(contour); + result[result.length - 1].push(contour[0]); } } else { result.push(contour); @@ -146,19 +143,19 @@ module.exports = function connectEdges(sortedEvents, operation) { event.otherEvent.contourId = ringId; } - for (i = 0, len = result.length; i < len; i++) { - var polygon = result[i]; - for (var j = 0, jj = polygon.length; j < jj; j++) { - var polygonContour = polygon[j]; - for (var k = 0, kk = polygonContour.length; k < kk; k++) { - var coords = polygonContour[k]; - if (typeof coords[0] !== 'number') { - polygon.splice(j, 1); - polygon.push(coords); - } - } - } - } + // for (i = 0, len = result.length; i < len; i++) { + // var polygon = result[i]; + // for (var j = 0, jj = polygon.length; j < jj; j++) { + // var polygonContour = polygon[j]; + // for (var k = 0, kk = polygonContour.length; k < kk; k++) { + // var coords = polygonContour[k]; + // if (typeof coords[0] !== 'number') { + // polygon.splice(j, 1); + // polygon.push(coords); + // } + // } + // } + // } // Handle if the result is a polygon (eg not multipoly) // Commented it again, let's see what do we mean by that diff --git a/test/featureTypes.js b/test/featureTypes.test.js similarity index 100% rename from test/featureTypes.js rename to test/featureTypes.test.js From c7ec961937acff8f5ac0e0ce90f8ebb57903aa12 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Wed, 20 Dec 2017 22:57:20 +1100 Subject: [PATCH 40/42] Fluke fix? --- src/connect_edges.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/connect_edges.js b/src/connect_edges.js index 8a0afe3..8c9953a 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -104,6 +104,8 @@ module.exports = function connectEdges(sortedEvents, operation) { } else { result[result.length - 1].push(contour[0]); } + } else if (operation === operationType.DIFFERENCE && !resultEvents[i].isSubject && result.length > 1) { + result[result.length - 1].push(contour[0]); } else { result.push(contour); } From e2de512138051bc04eaa776385f6b4e77f443b47 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Wed, 20 Dec 2017 16:27:07 +0100 Subject: [PATCH 41/42] added test for #47 --- demo/js/bundle.js | 218 ++++++++++++++-------------------------- test/edge_cases.test.js | 11 ++ 2 files changed, 87 insertions(+), 142 deletions(-) diff --git a/demo/js/bundle.js b/demo/js/bundle.js index d5441fd..debbb96 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -2623,6 +2623,7 @@ module.exports = request; 'use strict'; module.exports = TinyQueue; +module.exports.default = TinyQueue; function TinyQueue(data, compare) { if (!(this instanceof TinyQueue)) return new TinyQueue(data, compare); @@ -2631,7 +2632,9 @@ function TinyQueue(data, compare) { this.length = this.data.length; this.compare = compare || defaultCompare; - if (data) for (var i = Math.floor(this.length / 2); i >= 0; i--) this._down(i); + if (this.length > 0) { + for (var i = (this.length >> 1) - 1; i >= 0; i--) this._down(i); + } } function defaultCompare(a, b) { @@ -2647,11 +2650,17 @@ TinyQueue.prototype = { }, pop: function () { + if (this.length === 0) return undefined; + var top = this.data[0]; - this.data[0] = this.data[this.length - 1]; this.length--; + + if (this.length > 0) { + this.data[0] = this.data[this.length]; + this._down(0); + } this.data.pop(); - this._down(0); + return top; }, @@ -2660,46 +2669,46 @@ TinyQueue.prototype = { }, _up: function (pos) { - var data = this.data, - compare = this.compare; + var data = this.data; + var compare = this.compare; + var item = data[pos]; while (pos > 0) { - var parent = Math.floor((pos - 1) / 2); - if (compare(data[pos], data[parent]) < 0) { - swap(data, parent, pos); - pos = parent; - - } else break; + var parent = (pos - 1) >> 1; + var current = data[parent]; + if (compare(item, current) >= 0) break; + data[pos] = current; + pos = parent; } + + data[pos] = item; }, _down: function (pos) { - var data = this.data, - compare = this.compare, - len = this.length; - - while (true) { - var left = 2 * pos + 1, - right = left + 1, - min = pos; - - if (left < len && compare(data[left], data[min]) < 0) min = left; - if (right < len && compare(data[right], data[min]) < 0) min = right; - - if (min === pos) return; - - swap(data, min, pos); - pos = min; + var data = this.data; + var compare = this.compare; + var halfLength = this.length >> 1; + var item = data[pos]; + + while (pos < halfLength) { + var left = (pos << 1) + 1; + var right = left + 1; + var best = data[left]; + + if (right < this.length && compare(data[right], best) < 0) { + left = right; + best = data[right]; + } + if (compare(best, item) >= 0) break; + + data[pos] = best; + pos = left; } + + data[pos] = item; } }; -function swap(data, i, j) { - var tmp = data[i]; - data[i] = data[j]; - data[j] = tmp; -} - },{}],13:[function(require,module,exports){ 'use strict'; @@ -2744,15 +2753,6 @@ function specialCases(e1, e2, p1, p2) { return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1; } - // uncomment this if you want to play with multipolygons - // if (e1.isSubject === e2.isSubject) { - // if(equals(e1.point, e2.point) && e1.contourId === e2.contourId) { - // return 0; - // } else { - // return e1.contourId > e2.contourId ? 1 : -1; - // } - // } - return (!e1.isSubject && e2.isSubject) ? 1 : -1; } /* eslint-enable no-unused-vars */ @@ -2949,7 +2949,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { // while in range and not the current one by value while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { if (!processed[newPos]) { - // console.log(pos, newPos, length); return newPos; } else { newPos++; @@ -2962,7 +2961,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { while (processed[newPos] && newPos >= origIndex) { newPos--; } - // console.log('other', pos, newPos, length); return newPos; } @@ -2974,7 +2972,6 @@ function nextPos(pos, resultEvents, processed, origIndex) { module.exports = function connectEdges(sortedEvents, operation) { var i, len; var resultEvents = orderEvents(sortedEvents); - //_renderPoints(resultEvents, 'inResult'); // "false"-filled array var processed = {}; @@ -2988,12 +2985,11 @@ module.exports = function connectEdges(sortedEvents, operation) { if (!resultEvents[i].isExteriorRing) { if (result.length === 0) { result.push([[contour]]); - } else if (operation === operationType.UNION || - operation === operationType.XOR) { - result[result.length - 1].push(contour[0]); } else { - result[result.length - 1].push(contour); + result[result.length - 1].push(contour[0]); } + } else if (operation === operationType.DIFFERENCE && !resultEvents[i].isSubject && result.length > 1) { + result[result.length - 1].push(contour[0]); } else { result.push(contour); } @@ -3030,19 +3026,19 @@ module.exports = function connectEdges(sortedEvents, operation) { event.otherEvent.contourId = ringId; } - for (i = 0, len = result.length; i < len; i++) { - var polygon = result[i]; - for (var j = 0, jj = polygon.length; j < jj; j++) { - var polygonContour = polygon[j]; - for (var k = 0, kk = polygonContour.length; k < kk; k++) { - var coords = polygonContour[k]; - if (typeof coords[0] !== 'number') { - polygon.splice(j, 1); - polygon.push(coords); - } - } - } - } + // for (i = 0, len = result.length; i < len; i++) { + // var polygon = result[i]; + // for (var j = 0, jj = polygon.length; j < jj; j++) { + // var polygonContour = polygon[j]; + // for (var k = 0, kk = polygonContour.length; k < kk; k++) { + // var coords = polygonContour[k]; + // if (typeof coords[0] !== 'number') { + // polygon.splice(j, 1); + // polygon.push(coords); + // } + // } + // } + // } // Handle if the result is a polygon (eg not multipoly) // Commented it again, let's see what do we mean by that @@ -3050,27 +3046,6 @@ module.exports = function connectEdges(sortedEvents, operation) { return result; }; - -/* eslint-disable no-unused-vars, no-debugger, no-undef, no-use-before-define */ -function _renderPoints(possiblePoints, prop) { - var map = window.map; - var points = window.points; - if (!map) return; - if (points !== undefined) points.clearLayers(); - - points = window.points = L.layerGroup([]).addTo(map); - possiblePoints.forEach(function (e) { - var point = L.circleMarker([e.point[1], e.point[0]], { - radius: Math.floor(5 + Math.random() * 10), - color: e[prop] ? 'green' : 'gray', - opacity: e[prop] ? 0.5 : 0.1, - weight: 1 - }).addTo(points); - }); -} - -/* eslint-enable no-unused-vars, no-debugger, no-undef */ - },{"./compare_events":13,"./operation":22}],17:[function(require,module,exports){ 'use strict'; @@ -3161,11 +3136,9 @@ var contourId = 0; function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) { var i, len, s1, s2, e1, e2; - // var d = depth + 1; for (i = 0, len = contourOrHole.length - 1; i < len; i++) { s1 = contourOrHole[i]; s2 = contourOrHole[i + 1]; - //processSegment(contourOrHole[i], contourOrHole[i + 1], isSubject, depth + 1, Q, bbox, isExteriorRing); e1 = new SweepEvent(s1, false, undefined, isSubject); e2 = new SweepEvent(s2, false, e1, isSubject); e1.otherEvent = e2; @@ -3280,43 +3253,40 @@ function boolean(subject, clipping, operation) { var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; - //console.time('fill'); + //console.time('fill queue'); var eventQueue = fillQueue(subject, clipping, sbbox, cbbox); - //console.timeEnd('fill'); + //console.timeEnd('fill queue'); trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation); if (trivial) { return trivial === EMPTY ? null : trivial; } - //console.time('subdiv'); + //console.time('subdivide edges'); var sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); - //console.timeEnd('subdiv'); - //console.time('connect'); + //console.timeEnd('subdivide edges'); + + //console.time('connect vertices'); var result = connectEdges(sortedEvents, operation); - //console.timeEnd('connect'); + //console.timeEnd('connect vertices'); return result; } - -module.exports = boolean; - - -module.exports.union = function (subject, clipping) { +boolean.union = function (subject, clipping) { return boolean(subject, clipping, operations.UNION); }; -module.exports.diff = function (subject, clipping) { +boolean.diff = function (subject, clipping) { return boolean(subject, clipping, operations.DIFFERENCE); }; -module.exports.xor = function (subject, clipping) { +boolean.xor = function (subject, clipping) { return boolean(subject, clipping, operations.XOR); }; -module.exports.intersection = function (subject, clipping) { +boolean.intersection = function (subject, clipping) { return boolean(subject, clipping, operations.INTERSECTION); }; @@ -3324,7 +3294,11 @@ module.exports.intersection = function (subject, clipping) { /** * @enum {Number} */ -module.exports.operations = operations; +boolean.operations = operations; + + +module.exports = boolean; +module.exports.default = boolean; },{"./connect_edges":16,"./fill_queue":20,"./operation":22,"./subdivide_segments":26}],22:[function(require,module,exports){ 'use strict'; @@ -3643,7 +3617,6 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, if (event.left) { next = prev = sweepLine.insert(event); - //_renderSweepLine(sweepLine, event.point, event); begin = sweepLine.minNode(); if (prev !== begin) prev = sweepLine.prev(prev); @@ -3676,8 +3649,6 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, event = event.otherEvent; next = prev = sweepLine.find(event); - //_renderSweepLine(sweepLine, event.otherEvent.point, event); - if (prev && next) { if (prev !== begin) prev = sweepLine.prev(prev); @@ -3686,12 +3657,8 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, next = sweepLine.next(next); sweepLine.remove(event); - // _renderSweepLine(sweepLine, event.otherEvent.point, event); - if (next && prev) { - // if (typeof prev !== 'undefined' && typeof next !== 'undefined') { possibleIntersection(prev.key, next.key, eventQueue); - // } } } } @@ -3699,40 +3666,6 @@ module.exports = function subdivide(eventQueue, subject, clipping, sbbox, cbbox, return sortedEvents; }; - -/* eslint-disable no-unused-vars, no-debugger, no-undef */ -function _renderSweepLine(sweepLine, pos, event) { - var map = window.map; - if (!map) return; - if (window.sws) window.sws.forEach(function (p) { - map.removeLayer(p); - }); - window.sws = []; - sweepLine.forEach(function (e) { - var poly = L.polyline([ - e.key.point.slice().reverse(), - e.key.otherEvent.point.slice().reverse() - ], {color: 'green'}).addTo(map); - window.sws.push(poly); - }); - - if (window.vt) map.removeLayer(window.vt); - var v = pos.slice(); - var b = map.getBounds(); - window.vt = L.polyline([ - [b.getNorth(), v[0]], - [b.getSouth(), v[0]] - ], {color: 'green', weight: 1}).addTo(map); - - if (window.ps) map.removeLayer(window.ps); - window.ps = L.polyline([ - event.point.slice().reverse(), - event.otherEvent.point.slice().reverse() - ], {color: 'black', weight: 9, opacity: 0.4}).addTo(map); - debugger; -} -/* eslint-enable no-unused-vars, no-debugger, no-undef */ - },{"./compare_segments":14,"./compute_fields":15,"./operation":22,"./possible_intersection":23,"avl":6}],27:[function(require,module,exports){ 'use strict'; @@ -3742,6 +3675,7 @@ var EdgeType = require('./edge_type'); /** * Sweepline event * + * @class {SweepEvent} * @param {Array.} point * @param {Boolean} left * @param {SweepEvent=} otherEvent @@ -3866,4 +3800,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMi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i9cbmZ1bmN0aW9uIHByaW50IChyb290LCBwcmludE5vZGUpIHtcbiAgaWYgKCBwcmludE5vZGUgPT09IHZvaWQgMCApIHByaW50Tm9kZSA9IGZ1bmN0aW9uIChuKSB7IHJldHVybiBuLmtleTsgfTtcblxuICB2YXIgb3V0ID0gW107XG4gIHJvdyhyb290LCAnJywgdHJ1ZSwgZnVuY3Rpb24gKHYpIHsgcmV0dXJuIG91dC5wdXNoKHYpOyB9LCBwcmludE5vZGUpO1xuICByZXR1cm4gb3V0LmpvaW4oJycpO1xufVxuXG4vKipcbiAqIFByaW50cyBsZXZlbCBvZiB0aGUgdHJlZVxuICogQHBhcmFtICB7Tm9kZX0gICAgICAgICAgICAgICAgICAgICAgICByb290XG4gKiBAcGFyYW0gIHtTdHJpbmd9ICAgICAgICAgICAgICAgICAgICAgIHByZWZpeFxuICogQHBhcmFtICB7Qm9vbGVhbn0gICAgICAgICAgICAgICAgICAgICBpc1RhaWxcbiAqIEBwYXJhbSAge0Z1bmN0aW9uKGluOnN0cmluZyk6dm9pZH0gICAgb3V0XG4gKiBAcGFyYW0gIHtGdW5jdGlvbihub2RlOk5vZGUpOlN0cmluZ30gIHByaW50Tm9kZVxuICovXG5mdW5jdGlvbiByb3cgKHJvb3QsIHByZWZpeCwgaXNUYWlsLCBvdXQsIHByaW50Tm9kZSkge1xuICBpZiAocm9vdCkge1xuICAgIG91dCgoXCJcIiArIHByZWZpeCArIChpc1RhaWwgPyAn4pSU4pSA4pSAICcgOiAn4pSc4pSA4pSAICcpICsgKHByaW50Tm9kZShyb290KSkgKyBcIlxcblwiKSk7XG4gICAgdmFyIGluZGVudCA9IHByZWZpeCArIChpc1RhaWwgPyAnICAgICcgOiAn4pSCICAgJyk7XG4gICAgaWYgKHJvb3QubGVmdCkgIHsgcm93KHJvb3QubGVmdCwgIGluZGVudCwgZmFsc2UsIG91dCwgcHJpbnROb2RlKTsgfVxuICAgIGlmIChyb290LnJpZ2h0KSB7IHJvdyhyb290LnJpZ2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VxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGRlZmF1bHRzIHRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAuc2VuZCgnbmFtZT10b2JpJylcbiAqICAgICAgICAuc2VuZCgnc3BlY2llcz1mZXJyZXQnKVxuICogICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogQHBhcmFtIHtTdHJpbmd8T2JqZWN0fSBkYXRhXG4gKiBAcmV0dXJuIHtSZXF1ZXN0fSBmb3IgY2hhaW5pbmdcbiAqIEBhcGkgcHVibGljXG4gKi9cblxuZXhwb3J0cy5zZW5kID0gZnVuY3Rpb24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GlzLmRhdGEsXG4gICAgICAgICAgICBjb21wYXJlID0gdGhpcy5jb21wYXJlO1xuXG4gICAgICAgIHdoaWxlIChwb3MgPiAwKSB7XG4gICAgICAgICAgICB2YXIgcGFyZW50ID0gTWF0aC5mbG9vcigocG9zIC0gMSkgLyAyKTtcbiAgICAgICAgICAgIGlmIChjb21wYXJlKGRhdGFbcG9zXSwgZGF0YVtwYXJlbnRdKSA8IDApIHtcbiAgICAgICAgICAgICAgICBzd2FwKGRhdGEsIHBhcmVudCwgcG9zKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBwYXJlbnQ7XG5cbiAgICAgICAgICAgIH0gZWxzZSBicmVhaztcbiAgICAgICAgfVxuICAgIH0sXG5cbiAgICBfZG93bjogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmUsXG4gICAgICAgICAgICBsZW4gPSB0aGlzLmxlbmd0aDtcblxuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgdmFyIGxlZnQgPSAyICogcG9zICsgMSxcbiAgICAgICAgICAgICAgICByaWdodCA9IGxlZnQgKyAxLFxuICAgICAgICAgICAgICAgIG1pbiA9IHBvcztcblxuICAgICAgICAgICAgaWYgKGxlZnQgPCBsZW4gJiYgY29tcGFyZShkYXRhW2xlZnRdLCBkYXRhW21pbl0pIDwgMCkgbWluID0gbGVmdDtcbiAgICAgICAgICAgIGlmIChyaWdodCA8IGxlbiAmJiBjb21wYXJlKGRhdGFbcmlnaHRdLCBkYXRhW21pbl0pIDwgMCkgbWluID0gcmlnaHQ7XG5cbiAgICAgICAgICAgIGlmIChtaW4gPT09IHBvcykgcmV0dXJuO1xuXG4gICAgICAgICAgICBzd2FwKGRhdGEsIG1pbiwgcG9zKTtcbiAgICAgICAgICAgIHBvcyA9IG1pbjtcbiAgICAgICAgfVxuICAgIH1cbn07XG5cbmZ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lbnQudHlwZSkge1xuICAgIGNhc2UgZWRnZVR5cGUuTk9STUFMOlxuICAgICAgc3dpdGNoIChvcGVyYXRpb24pIHtcbiAgICAgICAgY2FzZSBJTlRFUlNFQ1RJT046XG4gICAgICAgICAgcmV0dXJuICFldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIFVOSU9OOlxuICAgICAgICAgIHJldHVybiBldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIERJRkZFUkVOQ0U6XG4gICAgICAgICAgLy8gcmV0dXJuIChldmVudC5pc1N1YmplY3QgJiYgIWV2ZW50Lm90aGVySW5PdXQpIHx8XG4gICAgICAgICAgLy8gICAgICAgICAoIWV2ZW50LmlzU3ViamVjdCAmJiBldmVudC5vdGhlckluT3V0KTtcbiAgICAgICAgICByZXR1cm4gKGV2ZW50LmlzU3ViamVjdCAmJiBldmVudC5vdGhlckluT3V0KSB8fFxuICAgICAgICAgICAgICAgICAgKCFldmVudC5pc1N1YmplY3QgJiYgIWV2ZW50Lm90aGVySW5PdXQpO1xuICAgICAgICBjYXNlIFhPUjpcbiAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgZWRnZVR5cGUuU0FNRV9UUkFOU0lUSU9OOlxuICAgICAgcmV0dXJuIG9wZXJhdGlvbiA9PT0gSU5URVJTRUNUSU9OIHx8IG9wZXJhdGlvbiA9PT0gVU5JT047XG4gICAgY2FzZSBlZGdlVHlwZS5ESUZGRVJFTlRfVFJBTlNJVElPTjpcbiAgICAgIHJldHVybiBvcGVyYXRpb24gPT09IERJRkZFUkVOQ0U7XG4gICAgY2FzZSBlZGdlVHlwZS5OT05fQ09OVFJJQlVUSU5HOlxuICAgICAgcmV0dXJuIGZhbHNlO1xuICB9XG4gIHJldHVybiBmYWxzZTtcbn1cbi8qIGVzbGludC1lbmFibGUgaW5kZW50ICovXG4iLCIndXNlIHN0cmljdCc7XG5cbi8vIHZhciBlcX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nlc3NlZCA9IHt9O1xuICB2YXIgcmVzdWx0ID0gW107XG4gIHZhciBldmVudDtcblxuICBmb3IgKGkgPSAwLCBsZW4gPSByZXN1bHRFdmVudHMubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcbiAgICBpZiAocHJvY2Vzc2VkW2ldKSBjb250aW51ZTtcbiAgICB2YXIgY29udG91ciA9IFtbXV07XG5cbiAgICBpZiAoIXJlc3VsdEV2ZW50c1tpXS5pc0V4dGVyaW9yUmluZykge1xuICAgICAgaWYgKHJlc3VsdC5sZW5ndGggPT09IDApIHtcbiAgICAgICAgcmVzdWx0LnB1c2goW1tjb250b3VyXV0pO1xuICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09IG9wZXJhdGlvblR5cGUuVU5JT04gfHxcbiAgICAgICAgICAgICAgICAgb3BlcmF0aW9uID09PSBvcGVyYXRpb25UeXBlLlhPUikge1xuICAgICAgICByZXN1bHRbcmVzdWx0Lmxlbmd0aCAtIDFdLnB1c2goY29udG91clswXSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXN1bHRbcmVzdWx0Lmxlbmd0aCAtIDFdLnB1c2goY29udG91cik7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIHJlc3VsdC5wdXNoKGNvbnRvdXIpO1xuICAgIH1cblxuICAgIHZhciByaW5nSWQgPSByZXN1bHQubGVuZ3RoIC0gMTtcbiAgICB2YXIgcG9zID0gaTtcblxuICAgIHZhciBpbml0aWFsID0gcmVzdWx0RXZlbnRzW2ldLnBvaW50O1xuICAgIGNvbnRvdXJbMF0ucHVzaChpbml0aWFsKTtcblxuICAgIHdoaWxlIChwb3MgPj0gaSkge1xuICAgICAgZXZlbnQgPSByZXN1bHRFdmVudHNbcG9zXTtcbiAgICAgIHByb2Nlc3NlZFtwb3NdID0gdHJ1ZTtcblxuICAgICAgaWYgKGV2ZW50LmxlZnQpIHtcbiAgICAgICAgZXZlbnQucmVzdWx0SW5PdXQgPSBmYW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gICAgIGJlZ2luID0gc3dlZXBMaW5lLm1pbk5vZGUoKTtcblxuICAgICAgaWYgKHByZXYgIT09IGJlZ2luKSBwcmV2ID0gc3dlZXBMaW5lLnByZXYocHJldik7XG4gICAgICBlbHNlICAgICAgICAgICAgICAgIHByZXYgPSBudWxsO1xuXG4gICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG5cbiAgICAgIHZhciBwcmV2RXZlbnQgPSBwcmV2ID8gcHJldi5rZXkgOiBudWxsO1xuICAgICAgdmFyIHByZXZwcmV2RXZlbnQ7XG4gICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICBpZiAobmV4dCkge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24oZXZlbnQsIG5leHQua2V5LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKGV2ZW50LCBuZXh0LmtleSwgb3BlcmF0aW9uKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAocHJldikge1xuICAgICAgICBpZiAocG9zc2libGVJbnRlcnNlY3Rpb24ocHJldi5rZXksIGV2ZW50LCBldmVudFF1ZXVlKSA9PT0gMikge1xuICAgICAgICAgIHZhciBwcmV2cHJldiA9IHByZXY7XG4gICAgICAgICAgaWYgKHByZXZwcmV2ICE9PSBiZWdpbikgcHJldnByZXYgPSBzd2VlcExpbmUucHJldihwcmV2cHJldik7XG4gICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgcHJldnByZXYgPSBudWxsO1xuXG4gICAgICAgICAgcHJldnByZXZFdmVudCA9IHByZXZwcmV2ID8gcHJldnByZXYua2V5IDogbnVsbDtcbiAgICAgICAgICBjb21wdXRlRmllbGRzKHByZXZFdmVudCwgcHJldnBy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dbb2JqZWN0IEJsb2JdJzpcbiAgICBjYXNlICdbb2JqZWN0IEZvcm1EYXRhXSc6XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICBkZWZhdWx0OlxuICAgICAgcmV0dXJuIGZhbHNlO1xuICB9XG59XG5cbi8qKlxuICogU2VuZCBgZGF0YWAgYXMgdGhlIHJlcXVlc3QgYm9keSwgZGVmYXVsdGluZyB0aGUgYC50eXBlKClgIHRvIFwianNvblwiIHdoZW5cbiAqIGFuIG9iamVjdCBpcyBnaXZlbi5cbiAqXG4gKiBFeGFtcGxlczpcbiAqXG4gKiAgICAgICAvLyBtYW51YWwganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8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9LFxuXG4gICAgcG9wOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLmxlbmd0aCA9PT0gMCkgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICB2YXIgdG9wID0gdGhpcy5kYXRhWzBdO1xuICAgICAgICB0aGlzLmxlbmd0aC0tO1xuXG4gICAgICAgIGlmICh0aGlzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIHRoaXMuZGF0YVswXSA9IHRoaXMuZGF0YVt0aGlzLmxlbmd0aF07XG4gICAgICAgICAgICB0aGlzLl9kb3duKDApO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuZGF0YS5wb3AoKTtcblxuICAgICAgICByZXR1cm4gdG9wO1xuICAgIH0sXG5cbiAgICBwZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRhdGFbMF07XG4gICAgfSxcblxuICAgIF91cDogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YTtcbiAgICAgICAgdmFyIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmU7XG4gICAgICAgIHZhciBpdGVtID0gZGF0YVtwb3NdO1xuXG4gICAgICAgIHdoaWxlIChwb3MgPiAwKSB7XG4gICAgICAgICAgICB2YXIgcGFyZW50ID0gKHBvcyAtIDEpID4+IDE7XG4gICAgICAgICAgICB2YXIgY3VycmVudCA9IGRhdGFbcGFyZW50XTtcbiAgICAgICAgICAgIGlmIChjb21wYXJlKGl0ZW0sIGN1cnJlbnQpID49IDApIGJyZWFrO1xuICAgICAgICAgICAgZGF0YVtwb3NdID0gY3VycmVudDtcbiAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcbiAgICAgICAgfVxuXG4gICAgICAgIGRhdGFbcG9zXSA9IGl0ZW07XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhO1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21lbnQgYmVsb25ncyB0byB0aGUgQm9vbGVhbiBvcGVyYXRpb25cbiAgZXZlbnQuaW5SZXN1bHQgPSBpblJlc3VsdChldmVudCwgb3BlcmF0aW9uKTtcbn07XG5cblxuLyogZXNsaW50LWRpc2FibGUgaW5kZW50ICovXG5mdW5jdGlvbiBpblJlc3VsdChldmVudCwgb3BlcmF0aW9uKSB7XG4gIHN3aXRjaCAoZXZlbnQudHlwZSkge1xuICAgIGNhc2UgZWRnZVR5cGUuTk9STUFMOlxuICAgICAgc3dpdGNoIChvcGVyYXRpb24pIHtcbiAgICAgICAgY2FzZSBJTlRFUlNFQ1RJT046XG4gICAgICAgICAgcmV0dXJuICFldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIFVOSU9OOlxuICAgICAgICAgIHJldHVybiBldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIERJRkZFUkVOQ0U6XG4gICAgICAgICAgLy8gcmV0dXJuIChldmVudC5pc1N1YmplY3QgJiYgIWV2ZW50Lm90aGVySW5PdXQpIHx8XG4gICAgICAgICAgLy8gICAgICAgICAoIWV2ZW50LmlzU3ViamVjdCAmJiBldmVudC5vdGhlckluT3V0KTtcbiAgICAgICAgICByZXR1cm4gKGV2ZW50LmlzU3ViamVjdCAmJiBldmVudC5vdGhlckluT3V0KSB8fFxuICAgICAgICAgICAgICAgICAgKCFldmVudC5pc1N1YmplY3QgJiYgIWV2ZW50Lm90aGVySW5PdXQpO1xuICAgICAgICBjYXNlIFhPUjpcbiAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgZWRnZVR5cGUuU0FNRV9UUkFOU0lUSU9OOlxuICAgICAgcmV0dXJuIG9wZXJhdGlvbiA9PT0gSU5URVJTRUNUSU9OIHx8IG9wZXJhdGlvbiA9PT0gVU5JT047XG4gICAgY2FzZSBlZGdlVHlwZS5ESUZGRVJFTlRfVFJBTlNJVElPTjpcbiAgICA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iBldmVudC5wb2ludFswXSA+IHNiYm94WzJdKSkge1xuICAgICAgYnJlYWs7XG4gICAgfVxuXG4gICAgaWYgKGV2ZW50LmxlZnQpIHtcbiAgICAgIG5leHQgID0gcHJldiA9IHN3ZWVwTGluZS5pbnNlcnQoZXZlbnQpO1xuICAgICAgYmVnaW4gPSBzd2VlcExpbmUubWluTm9kZSgpO1xuXG4gICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChwcmV2KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgZXZlbnQsIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgdmFyIHByZXZwcmV2ID0gcHJldjtcbiAgICAgICAgICBpZiAocHJldnByZXYgIT09IGJlZ2luKSBwcmV2cHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXZwcmV2KTtcbiAgICAgICAgICBlbHNlICAg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lZXBFdmVudDtcbiJdfQ== diff --git a/test/edge_cases.test.js b/test/edge_cases.test.js index ec63178..0bcf695 100644 --- a/test/edge_cases.test.js +++ b/test/edge_cases.test.js @@ -207,5 +207,16 @@ tap.test('Edge cases', function(main) { t.end(); }); + main.test('disjoint union nesting', (t) => { // issue #47 + const p1 = [[[12.91,6.09],[12.91,6.91],[12.09,6.91],[12.09,6.09],[12.91,6.09]] + ]; + const p2 = [ + [[12.75,6.25],[12.75,6.75],[11.75,6.75],[11.75,8.25],[12.75,8.25],[12.75,8.75],[11.75,8.75],[11.75,9.75],[11.25,9.75],[11.25,8.75],[10.25,8.75],[10.25,8.25],[11.25,8.25],[11.25,6.75],[10.25,6.75],[10.25,6.25],[12.75,6.25]], + [[4.75,2.25],[4.75,2.75],[4.25,2.75],[4.25,2.25],[4.75,2.25]] + ]; + t.deepEqual(martinez.union(p1, p2), [[[[[[4.25,2.25],[4.75,2.25],[4.75,2.75],[4.25,2.75],[4.25,2.25]]]]],[[[10.25,6.25],[12.09,6.25],[12.09,6.09],[12.91,6.09],[12.91,6.91],[12.09,6.91],[12.09,6.75],[11.75,6.75],[11.75,8.25],[12.75,8.25],[12.75,8.75],[11.75,8.75],[11.75,9.75],[11.25,9.75],[11.25,8.75],[10.25,8.75],[10.25,8.25],[11.25,8.25],[11.25,6.75],[10.25,6.75],[10.25,6.25]]]]); + t.end(); + }); + main.end(); }); From 9a9e1c109cd0f6d06e6a467775f54baa72991f58 Mon Sep 17 00:00:00 2001 From: Alexander Milevski Date: Mon, 1 Jan 2018 20:58:46 +0100 Subject: [PATCH 42/42] filtered out collapsed edges --- demo/js/bundle.js | 107 +++++++++++++------------ demo/js/index.js | 11 ++- dist/martinez.js | 127 +++++++++++++++--------------- src/fill_queue.js | 4 + test/edge_cases.test.js | 25 ++++++ test/fixtures/collapsed.geojson | 35 ++++++++ test/fixtures/overlap_two.geojson | 76 ++++++++++++++++++ 7 files changed, 269 insertions(+), 116 deletions(-) create mode 100644 test/fixtures/collapsed.geojson create mode 100644 test/fixtures/overlap_two.geojson diff --git a/demo/js/bundle.js b/demo/js/bundle.js index debbb96..adca98e 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -122,9 +122,18 @@ switch (mode) { case 'overlap_y': file = 'overlap_y.geojson'; break; + case 'overlap_two': + file = 'overlap_two.geojson'; + break; case 'disjoint_boxes': file = 'disjoint_boxes.geojson'; break; + case 'polygons_edge_overlap': + file = 'polygons_edge_overlap.geojson'; + break; + case 'collapsed': + file = 'collapsed.geojson'; + break; default: file = 'hole_hole.geojson'; break; @@ -152,7 +161,7 @@ var map = window.map = L.map('image-map', { center: [0, 0], zoom: 2, crs: mode === 'geo' ? L.CRS.EPSG4326 : L.extend({}, L.CRS.Simple, { - transformation: new L.Transformation(0.5, 0, -0.5, 0) + transformation: new L.Transformation(1/8, 0, -1/8, 0) }), editable: true }); @@ -951,7 +960,7 @@ AVLTree.prototype.remove = function remove (key) { while (min.left || min.right) { while (min.left) { min = min.left; } - node.key= min.key; + node.key = min.key; node.data = min.data; if (min.right) { node = min; @@ -959,20 +968,22 @@ AVLTree.prototype.remove = function remove (key) { } } - node.key= min.key; + node.key = min.key; node.data = min.data; node = min; } var parent = node.parent; - var pp = node; + var pp = node; var newRoot; while (parent) { if (parent.left === pp) { parent.balanceFactor -= 1; } - else { parent.balanceFactor += 1; } + else { parent.balanceFactor += 1; } - if (parent.balanceFactor < -1) { + + if (parent.balanceFactor === -2) { + if (!parent.right) { parent.balanceFactor += 1; break; } // inlined //var newRoot = rightBalance(parent); if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } @@ -980,7 +991,8 @@ AVLTree.prototype.remove = function remove (key) { if (parent === this$1._root) { this$1._root = newRoot; } parent = newRoot; - } else if (parent.balanceFactor > 1) { + } else if (parent.balanceFactor === 2) { + if (!parent.right) { parent.balanceFactor += 1; break; } // inlined // var newRoot = leftBalance(parent); if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } @@ -2623,7 +2635,6 @@ module.exports = request; 'use strict'; module.exports = TinyQueue; -module.exports.default = TinyQueue; function TinyQueue(data, compare) { if (!(this instanceof TinyQueue)) return new TinyQueue(data, compare); @@ -2632,9 +2643,7 @@ function TinyQueue(data, compare) { this.length = this.data.length; this.compare = compare || defaultCompare; - if (this.length > 0) { - for (var i = (this.length >> 1) - 1; i >= 0; i--) this._down(i); - } + if (data) for (var i = Math.floor(this.length / 2); i >= 0; i--) this._down(i); } function defaultCompare(a, b) { @@ -2650,17 +2659,11 @@ TinyQueue.prototype = { }, pop: function () { - if (this.length === 0) return undefined; - var top = this.data[0]; + this.data[0] = this.data[this.length - 1]; this.length--; - - if (this.length > 0) { - this.data[0] = this.data[this.length]; - this._down(0); - } this.data.pop(); - + this._down(0); return top; }, @@ -2669,46 +2672,46 @@ TinyQueue.prototype = { }, _up: function (pos) { - var data = this.data; - var compare = this.compare; - var item = data[pos]; + var data = this.data, + compare = this.compare; while (pos > 0) { - var parent = (pos - 1) >> 1; - var current = data[parent]; - if (compare(item, current) >= 0) break; - data[pos] = current; - pos = parent; - } + var parent = Math.floor((pos - 1) / 2); + if (compare(data[pos], data[parent]) < 0) { + swap(data, parent, pos); + pos = parent; - data[pos] = item; + } else break; + } }, _down: function (pos) { - var data = this.data; - var compare = this.compare; - var halfLength = this.length >> 1; - var item = data[pos]; - - while (pos < halfLength) { - var left = (pos << 1) + 1; - var right = left + 1; - var best = data[left]; - - if (right < this.length && compare(data[right], best) < 0) { - left = right; - best = data[right]; - } - if (compare(best, item) >= 0) break; - - data[pos] = best; - pos = left; - } + var data = this.data, + compare = this.compare, + len = this.length; + + while (true) { + var left = 2 * pos + 1, + right = left + 1, + min = pos; + + if (left < len && compare(data[left], data[min]) < 0) min = left; + if (right < len && compare(data[right], data[min]) < 0) min = right; + + if (min === pos) return; - data[pos] = item; + swap(data, min, pos); + pos = min; + } } }; +function swap(data, i, j) { + var tmp = data[i]; + data[i] = data[j]; + data[j] = tmp; +} + },{}],13:[function(require,module,exports){ 'use strict'; @@ -3143,6 +3146,10 @@ function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing e2 = new SweepEvent(s2, false, e1, isSubject); e1.otherEvent = e2; + if (s1[0] === s2[0] && s1[1] === s2[1]) { + continue; // skip collapsed edges, or it breaks + } + e1.contourId = e2.contourId = depth; if (!isExteriorRing) { e1.isExteriorRing = false; @@ -3800,4 +3807,4 @@ SweepEvent.prototype = { module.exports = SweepEvent; },{"./edge_type":18}]},{},[3]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGVtby9qcy9pbmRleC5qcyIsImRlbW8vanMvcG9seWdvbmNvbnRyb2wuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hdmwvZGlzdC9hdmwuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvY2xpZW50LmpzIiwibm9kZV9tb2R1bGVzL3N1cGVyYWdlbnQvbGliL2lzLW9iamVjdC5qcyIsIm5vZGVfbW9kdWxlcy9zdXBlcmFnZW50L2xpYi9yZXF1ZXN0LWJhc2UuanMiLCJub2RlX21vZHVsZXMvc3VwZXJhZ2VudC9saWIvcmVxdWVzdC5qcyIsIm5vZGVfbW9kdWxlcy90aW55cXVldWUvaW5kZXguanMiLCJzcmMvY29tcGFyZV9ldmVudHMuanMiLCJzcmMvY29tcGFyZV9zZWdtZW50cy5qcyIsInNyYy9jb21wdXRlX2ZpZWxkcy5qcyIsInNyYy9jb25uZWN0X2VkZ2VzLmpzIiwic3JjL2RpdmlkZV9zZWdtZW50LmpzIiwic3JjL2VkZ2VfdHlwZ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b2RlfSAgICAgICAgICAgICAgICAgICAgICAgcm9vdFxuICogQHBhcmFtICB7RnVuY3Rpb24obm9kZTpOb2RlKTpTdHJpbmd9IFtwcmludE5vZGVdXG4gKiBAcmV0dXJuIHtTdHJpbmd9XG4gKi9cbmZ1bmN0aW9uIHByaW50IChyb290LCBwcmludE5vZGUpIHtcbiAgaWYgKCBwcmludE5vZGUgPT09IHZvaWQgMCApIHByaW50Tm9kZSA9IGZ1bmN0aW9uIChuKSB7IHJldHVybiBuLmtleTsgfTtcblxuICB2YXIgb3V0ID0gW107XG4gIHJvdyhyb290LCAnJywgdHJ1ZSwgZnVuY3Rpb24gKHYpIHsgcmV0dXJuIG91dC5wdXNoKHYpOyB9LCBwcmludE5vZGUpO1xuICByZXR1cm4gb3V0LmpvaW4oJycpO1xufVxuXG4vKipcbiAqIFByaW50cyBsZXZlbCBvZiB0aGUgdHJlZVxuICogQHBhcmFtICB7Tm9kZX0gICAgICAgICAgICAgICAgICAgICAgICByb290XG4gKiBAcGFyYW0gIHtTdHJpbmd9ICAgICAgICAgICAgICAgICAgICAgIHByZWZpeFxuICogQHBhcmFtICB7Qm9vbGVhbn0gICAgICAgICAgICAgICAgICAgICBpc1RhaWxcbiAqIEBwYXJhbSAge0Z1bmN0aW9uKGluOnN0cmluZyk6dm9pZH0gICAgb3V0XG4gKiBAcGFyYW0gIHtGdW5jdGlvbihub2RlOk5vZGUpOlN0cmluZ30gIHByaW50Tm9kZVxuICovXG5mdW5jdGlvbiByb3cgKHJvb3QsIHByZWZpeCwgaXNUYWlsLCBvdXQsIHByaW50Tm9kZSkge1xuICBpZiAocm9vdCkge1xuICAgIG91dCgoXCJcIiArIHByZWZpeCArIChpc1RhaWwgPyAn4pSU4pSA4pSAICcgOiAn4pSc4pSA4pSAICcpICsgKHByaW50Tm9kZShyb290KSkgKyBcIlxcblwiKSk7XG4gICAgdmFyIGluZGVudCA9IHByZWZpeCArIChpc1RhaWwgPyAnICAgICcgOiAn4pSCICAgJyk7XG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GUgYC50eXBlKClgIHRvIFwianNvblwiIHdoZW5cbiAqIGFuIG9iamVjdCBpcyBnaXZlbi5cbiAqXG4gKiBFeGFtcGxlczpcbiAqXG4gKiAgICAgICAvLyBtYW51YWwganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGRlZmF1bHRzIHRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAuc2VuZCgnbmFtZT10b2JpJylcbiAqICAgICAgICAuc2VuZCgnc3BlY2llcz1mZXJyZXQnKVxuICogICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogQHBhcmFtIHtT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tcbiAgICAgICAgICAgIHRoaXMuZGF0YVswXSA9IHRoaXMuZGF0YVt0aGlzLmxlbmd0aF07XG4gICAgICAgICAgICB0aGlzLl9kb3duKDApO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuZGF0YS5wb3AoKTtcblxuICAgICAgICByZXR1cm4gdG9wO1xuICAgIH0sXG5cbiAgICBwZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRhdGFbMF07XG4gICAgfSxcblxuICAgIF91cDogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YTtcbiAgICAgICAgdmFyIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmU7XG4gICAgICAgIHZhciBpdGVtID0gZGF0YVtwb3NdO1xuXG4gICAgICAgIHdoaWxlIChwb3MgPiAwKSB7XG4gICAgICAgICAgICB2YXIgcGFyZW50ID0gKHBvcyAtIDEpID4+IDE7XG4gICAgICAgICAgICB2YXIgY3VycmVudCA9IGRhdGFbcGFyZW50XTtcbiAgICAgICAgICAgIGlmIChjb21wYXJlKGl0ZW0sIGN1cnJlbnQpID49IDApIGJyZWFrO1xuICAgICAgICAgICAgZGF0YVtwb3NdID0gY3VycmVudDtcbiAgICAgICAgICAgIHBvcyA9IHBhcmVudDtcbiAgICAgICAgfVxuXG4gICAgICAgIGRhdGFbcG9zXSA9IGl0ZW07XG4gICAgfSxcblxuICAgIF9kb3duOiBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhO1xuICAgICAgICB2YXIgY29tcGFyZSA9IHRoaXMuY29tcGFyZTtcbiAgICAgICAgdmFyIGhhbGZMZW5ndGggPSB0aGlzLmxlbmd0aCA+PiAxO1xuICAgICAgICB2YXIgaXRlbSA9IGRhdGFbcG9zXTtcblxuICAgICAgICB3aGlsZSAocG9zIDwgaGFsZkxlbmd0aCkge1xuICAgICAgICAgICAgdmFyIGxlZnQgPS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AoZXZlbnQudHlwZSkge1xuICAgIGNhc2UgZWRnZVR5cGUuTk9STUFMOlxuICAgICAgc3dpdGNoIChvcGVyYXRpb24pIHtcbiAgICAgICAgY2FzZSBJTlRFUlNFQ1RJT046XG4gICAgICAgICAgcmV0dXJuICFldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIFVOSU9OOlxuICAgICAgICAgIHJldHVybiBldmVudC5vdGhlckluT3V0O1xuICAgICAgICBjYXNlIERJRkZFUkVOQ0U6XG4gICAgICAgICAgLy8gcmV0dXJuIChldmVudC5pc1N1YmplY3QgJiYgIWV2ZW50Lm90aGVySW5PdXQpIHx8XG4gICAgICAgICAgLy8gICAgICAgICAoIWV2ZW50LmlzU3ViamVjdCAmJiBldmVudC5vdGhlckluT3V0KTtcbiAgICAgICAgICByZXR1cm4gKGV2ZW50LmlzU3ViamVjdCAmJiBldmVudC5vdGhlckluT3V0KSB8fFxuICAgICAgICAgICAgICAgICAgKCFldmVudC5pc1N1YmplY3QgJiYgIWV2ZW50Lm90aGVySW5PdXQpO1xuICAgICAgICBjYXNlIFhPUjpcbiAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgZWRnZVR5cGUuU0FNRV9UUkFOU0lUSU9OOlxuICAgICAgcmV0dXJuIG9wZXJhdGlvbiA9PT0gSU5URVJTRUNUSU9OIHx8IG9wZXJhdGlvbiA9PT0gVU5JT047XG4gICAgY2FzZSBlZGdlVHlwZS5ESUZGRVJFTlRfVFJBTlNJVElPTjpcbiAgICAgIHJldHVybiBvcGVyYXRpb24gPT09IERJRkZFUkVOQ0U7XG4gICAgY2FzZSBlZGdlVHlwZS5OT05fQ09OVFJJQlVUSU5HOlxuICAgICAgcmV0dXJuIGZhbHNlO1xuICB9XG4gIHJldHVybiBmYWxzZTtcbn1cbi8qIGVzbGludC1lbmFibGUgaW5kZW50ICovXG4iLCIndXNlIHN0cmljdCc7XG5cbi8vIHZh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JldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgIGVsc2UgICAgICAgICAgICAgICAgcHJldiA9IG51bGw7XG5cbiAgICAgIG5leHQgPSBzd2VlcExpbmUubmV4dChuZXh0KTtcblxuICAgICAgdmFyIHByZXZFdmVudCA9IHByZXYgPyBwcmV2LmtleSA6IG51bGw7XG4gICAgICB2YXIgcHJldnByZXZFdmVudDtcbiAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIHByZXZFdmVudCwgb3BlcmF0aW9uKTtcbiAgICAgIGlmIChuZXh0KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihldmVudCwgbmV4dC5rZXksIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgcHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMoZXZlbnQsIG5leHQua2V5LCBvcGVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChwcmV2KSB7XG4gICAgICAgIGlmIChwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgZXZlbnQsIGV2ZW50UXVldWUpID09PSAyKSB7XG4gICAgICAgICAgdmFyIHByZXZwcmV2ID0gcHJldjtcbiAgICAgICAgICBpZiAocHJldnByZXYgIT09IGJlZ2luKSBwcmV2cHJldiA9IHN3ZWVwTGluZS5wcmV2KHByZXZwcmV2KTtcbiAgICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICBwcmV2cHJldiA9IG51bGw7XG5cbiAgICAgICAgICBwcmV2cHJldkV2ZW50ID0gcHJldnByZXYgPyBwcmV2cHJldi5rZXkgOiBudWxsO1xuICAgICAgICAgIGNvbXB1dGVGaWVsZHMocHJldkV2ZW50LCBwcmV2cHJldkV2ZW50LCBvcGVyYXRpb24pO1xuICAgICAgICAgIGNvbXB1dGVGa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mFtICB7QXJyYXkuPE51bWJlcj59ICBwXG4gICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAqL1xuICBpc0Fib3ZlOiBmdW5jdGlvbiAocCkge1xuICAgIHJldHVybiAhdGhpcy5pc0JlbG93KHApO1xuICB9LFxuXG5cbiAgLyoqXG4gICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAqL1xuICBpc1ZlcnRpY2FsOiBmdW5jdGlvbiAoKSB7XG4gICAgcmV0dXJuIHRoaXMucG9pbnRbMF0gPT09IHRoaXMub3RoZXJFdmVudC5wb2ludFswXTtcbiAgfSxcblxuXG4gIGNsb25lOiBmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGNvcHkgPSBuZXcgU3dlZXBFdmVudChcbiAgICAgIHRoaXMucG9pbnQsIHRoaXMubGVmdCwgdGhpcy5vdGhlckV2ZW50LCB0aGlzLmlzU3ViamVjdCwgdGhpcy50eXBlKTtcblxuICAgIGNvcHkuaW5SZXN1bHQgICAgICAgPSB0aGlzLmluUmVzdWx0O1xuICAgIGNvcHkucHJldkluUmVzdWx0ICAgPSB0aGlzLnByZXZJblJlc3VsdDtcbiAgICBjb3B5LmlzRXh0ZXJpb3JSaW5nID0gdGhpcy5pc0V4dGVyaW9yUmluZztcbiAgICBjb3B5LmluT3V0ICAgICAgICAgID0gdGhpcy5pbk91dDtcbiAgICBjb3B5Lm90aGVySW5PdXQgICAgID0gdGhpcy5vdGhlckluT3V0O1xuXG4gICAgcmV0dXJuIGNvcHk7XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzID0gU3dlZXBFdmVudDtcbiJdfQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL2pzL2Jvb2xlYW5vcGNvbnRyb2wuanMiLCJkZW1vL2pzL2Nvb3JkaW5hdGVzLmpzIiwiZGV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uIHtTdHJpbmd9XG4gKi9cbmZ1bmN0aW9uIHByaW50IChyb290LCBwcmludE5vZGUpIHtcbiAgaWYgKCBwcmludE5vZGUgPT09IHZvaWQgMCApIHByaW50Tm9kZSA9IGZ1bmN0aW9uIChuKSB7IHJldHVybiBuLmtleTsgfTtcblxuICB2YXIgb3V0ID0gW107XG4gIHJvdyhyb290LCAnJywgdHJ1ZSwgZnVuY3Rpb24gKHYpIHsgcmV0dXJuIG91dC5wdXNoKHYpOyB9LCBwcmludE5vZGUpO1xuICByZXR1cm4gb3V0LmpvaW4oJycpO1xufVxuXG4vKipcbiAqIFByaW50cyBsZXZlbCBvZiB0aGUgdHJlZVxuICogQHBhcmFtICB7Tm9kZX0gICAgICAgICAgICAgICAgICAgICAgICByb290XG4gKiBAcGFyYW0gIHtTdHJpbmd9ICAgICAgICAgICAgICAgICAgICAgIHByZWZpeFxuICogQHBhcmFtICB7Qm9vbGVhbn0gICAgICAgICAgICAgICAgICAgICBpc1RhaWxcbiAqIEBwYXJhbSAge0Z1bmN0aW9uKGluOnN0cmluZyk6dm9pZH0gICAgb3V0XG4gKiBAcGFyYW0gIHtGdW5jdGlvbihub2RlOk5vZGUpOlN0cmluZ30gIHByaW50Tm9kZVxuICovXG5mdW5jdGlvbiByb3cgKHJvb3QsIHByZWZpeCwgaXNUYWlsLCBvdXQsIHByaW50Tm9kZSkge1xuICBpZiAocm9vdCkge1xuICAgIG91dCgoXCJcIiArIHByZWZpeCArIChpc1RhaWwgPyAn4pSU4pSA4pSAICcgOiAn4pSc4pSA4pSAICcpICsgKHByaW50Tm9kZShyb290KSkgKyBcIlxcblwiKSk7XG4gICAgdmFyIGluZGVudCA9IHByZWZpeCArIChpc1RhaWwgPyAnICAgICcgOiAn4pSCICAgJyk7XG4gICAgaWYgKHJvb3QubGVmdCkgIHsgcm93KHJvb3QubGVmdCwgIGluZGVudCwgZmFsc2UsIG91dCwgcHJpbnROb2RlKTsgfVxuICAgIGlmIChyb290LnJpZ2h0KSB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uZCBgZGF0YWAgYXMgdGhlIHJlcXVlc3QgYm9keSwgZGVmYXVsdGluZyB0aGUgYC50eXBlKClgIHRvIFwianNvblwiIHdoZW5cbiAqIGFuIG9iamVjdCBpcyBnaXZlbi5cbiAqXG4gKiBFeGFtcGxlczpcbiAqXG4gKiAgICAgICAvLyBtYW51YWwganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGRlZmF1bHRzIHRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAuc2VuZCgnbmFtZT10b2JpJylcbiAqICAgICAgICAuc2VuZCgnc3BlY2llcz1mZXJyZ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ZG93bigwKTtcbiAgICAgICAgcmV0dXJuIHRvcDtcbiAgICB9LFxuXG4gICAgcGVlazogZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kYXRhWzBdO1xuICAgIH0sXG5cbiAgICBfdXA6IGZ1bmN0aW9uIChwb3MpIHtcbiAgICAgICAgdmFyIGRhdGEgPSB0aGlzLmRhdGEsXG4gICAgICAgICAgICBjb21wYXJlID0gdGhpcy5jb21wYXJlO1xuXG4gICAgICAgIHdoaWxlIChwb3MgPiAwKSB7XG4gICAgICAgICAgICB2YXIgcGFyZW50ID0gTWF0aC5mbG9vcigocG9zIC0gMSkgLyAyKTtcbiAgICAgICAgICAgIGlmIChjb21wYXJlKGRhdGFbcG9zXSwgZGF0YVtwYXJlbnRdKSA8IDApIHtcbiAgICAgICAgICAgICAgICBzd2FwKGRhdGEsIHBhcmVudCwgcG9zKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBwYXJlbnQ7XG5cbiAgICAgICAgICAgIH0gZWxzZSBicmVhaztcbiAgICAgICAgfVxuICAgIH0sXG5cbiAgICBfZG93bjogZnVuY3Rpb24gKHBvcykge1xuICAgICAgICB2YXIgZGF0YSA9IHRoaXMuZGF0YSxcbiAgICAgICAgICAgIGNvbXBhcmUgPSB0aGlzLmNvbXBhcmUsXG4gICAgICAgICAgICBsZW4gPSB0aGlzLmxlbmd0aDtcblxuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgdmFyIGxlZnQgPSAyICogcG9zICsgMSxcbiAgICAgICAgICAgICAgICByaWdodCA9IGxlZnQgKyAxLFxuICAgICAgICAgICAgICAgIG1pbiA9IHBvcztcblxuICAgICAgICAgICAgaWYgKGxlZnQgPCBsZW4gJiYgY29tcGFyZShkYXRhW2xlZnRdLCBkYXRhW21pbl0pIDwgMCkgbWluID0gbGVmdDtcbiAgICAgICAgICAgIGlmIChyaWdodCA8IGxlbiAmJiBjb21wYXJlKGRhdGFbcmlnaHRdLCBkY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xkcyhwcmV2RXZlbnQsIHByZXZwcmV2RXZlbnQsIG9wZXJhdGlvbik7XG4gICAgICAgICAgY29tcHV0ZUZpZWxkcyhldmVudCwgICAgIHByZXZFdmVudCwgICAgIG9wZXJhdGlvbik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZXZlbnQgPSBldmVudC5vdGhlckV2ZW50O1xuICAgICAgbmV4dCA9IHByZXYgPSBzd2VlcExpbmUuZmluZChldmVudCk7XG5cbiAgICAgIGlmIChwcmV2ICYmIG5leHQpIHtcblxuICAgICAgICBpZiAocHJldiAhPT0gYmVnaW4pIHByZXYgPSBzd2VlcExpbmUucHJldihwcmV2KTtcbiAgICAgICAgZWxzZSAgICAgICAgICAgICAgICBwcmV2ID0gbnVsbDtcblxuICAgICAgICBuZXh0ID0gc3dlZXBMaW5lLm5leHQobmV4dCk7XG4gICAgICAgIHN3ZWVwTGluZS5yZW1vdmUoZXZlbnQpO1xuXG4gICAgICAgIGlmIChuZXh0ICYmIHByZXYpIHtcbiAgICAgICAgICBwb3NzaWJsZUludGVyc2VjdGlvbihwcmV2LmtleSwgbmV4dC5rZXksIGV2ZW50UXVldWUpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiBzb3J0ZWRFdmVudHM7XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vL3ZhciBzaWduZWRBcmVhID0gcmVxdWlyZSgnLi9zaWduZWRfYXJlYScpO1xudmFyIEVkZ2VUeXBlICAgPSByZXF1aXJlKCcuL2VkZ2VfdHlwZScpO1xuXG4vKipcbiAqIFN3ZWVwbGluZSBldmVudFxuICpcbiAqIEBjbGFzcyB7U3dlZXBFdmVudH1cbiAqIEBwYXJhbSB7QXJyYXkuPE51bWJlcj59ICBwb2ludFxuICogQHBhcmFtIHtCb29sZWFufSAgICAgICAgIGxlZnRcbiAqIEBwYXJhbSB7U3dlZXBFdmVudD19ICAgICBvdGhlckV2Z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AgfSxcblxuXG4gIC8qKlxuICAgKiBAcGFyYW0gIHtBcnJheS48TnVtYmVyPn0gIHBcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzQWJvdmU6IGZ1bmN0aW9uIChwKSB7XG4gICAgcmV0dXJuICF0aGlzLmlzQmVsb3cocCk7XG4gIH0sXG5cblxuICAvKipcbiAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICovXG4gIGlzVmVydGljYWw6IGZ1bmN0aW9uICgpIHtcbiAgICByZXR1cm4gdGhpcy5wb2ludFswXSA9PT0gdGhpcy5vdGhlckV2ZW50LnBvaW50WzBdO1xuICB9LFxuXG5cbiAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgY29weSA9IG5ldyBTd2VlcEV2ZW50KFxuICAgICAgdGhpcy5wb2ludCwgdGhpcy5sZWZ0LCB0aGlzLm90aGVyRXZlbnQsIHRoaXMuaXNTdWJqZWN0LCB0aGlzLnR5cGUpO1xuXG4gICAgY29weS5pblJlc3VsdCAgICAgICA9IHRoaXMuaW5SZXN1bHQ7XG4gICAgY29weS5wcmV2SW5SZXN1bHQgICA9IHRoaXMucHJldkluUmVzdWx0O1xuICAgIGNvcHkuaXNFeHRlcmlvclJpbmcgPSB0aGlzLmlzRXh0ZXJpb3JSaW5nO1xuICAgIGNvcHkuaW5PdXQgICAgICAgICAgPSB0aGlzLmluT3V0O1xuICAgIGNvcHkub3RoZXJJbk91dCAgICAgPSB0aGlzLm90aGVySW5PdXQ7XG5cbiAgICByZXR1cm4gY29weTtcbiAgfVxufTtcblxubW9kdWxlLmV4cG9ydHMgPSBTd2VlcEV2ZW50O1xuIl19 diff --git a/demo/js/index.js b/demo/js/index.js index 06eca86..87b0a63 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -55,9 +55,18 @@ switch (mode) { case 'overlap_y': file = 'overlap_y.geojson'; break; + case 'overlap_two': + file = 'overlap_two.geojson'; + break; case 'disjoint_boxes': file = 'disjoint_boxes.geojson'; break; + case 'polygons_edge_overlap': + file = 'polygons_edge_overlap.geojson'; + break; + case 'collapsed': + file = 'collapsed.geojson'; + break; default: file = 'hole_hole.geojson'; break; @@ -85,7 +94,7 @@ var map = window.map = L.map('image-map', { center: [0, 0], zoom: 2, crs: mode === 'geo' ? L.CRS.EPSG4326 : L.extend({}, L.CRS.Simple, { - transformation: new L.Transformation(0.5, 0, -0.5, 0) + transformation: new L.Transformation(1/8, 0, -1/8, 0) }), editable: true }); diff --git a/dist/martinez.js b/dist/martinez.js index 794dee1..3e86638 100644 --- a/dist/martinez.js +++ b/dist/martinez.js @@ -633,7 +633,7 @@ AVLTree.prototype.remove = function remove (key) { while (min.left || min.right) { while (min.left) { min = min.left; } - node.key= min.key; + node.key = min.key; node.data = min.data; if (min.right) { node = min; @@ -641,20 +641,22 @@ AVLTree.prototype.remove = function remove (key) { } } - node.key= min.key; + node.key = min.key; node.data = min.data; node = min; } var parent = node.parent; - var pp = node; + var pp = node; var newRoot; while (parent) { if (parent.left === pp) { parent.balanceFactor -= 1; } - else { parent.balanceFactor += 1; } + else { parent.balanceFactor += 1; } - if (parent.balanceFactor < -1) { + + if (parent.balanceFactor === -2) { + if (!parent.right) { parent.balanceFactor += 1; break; } // inlined //var newRoot = rightBalance(parent); if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } @@ -662,7 +664,8 @@ AVLTree.prototype.remove = function remove (key) { if (parent === this$1._root) { this$1._root = newRoot; } parent = newRoot; - } else if (parent.balanceFactor > 1) { + } else if (parent.balanceFactor === 2) { + if (!parent.right) { parent.balanceFactor += 1; break; } // inlined // var newRoot = leftBalance(parent); if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } @@ -739,7 +742,6 @@ return AVLTree; 'use strict'; module.exports = TinyQueue; -module.exports.default = TinyQueue; function TinyQueue(data, compare) { if (!(this instanceof TinyQueue)) return new TinyQueue(data, compare); @@ -748,9 +750,7 @@ function TinyQueue(data, compare) { this.length = this.data.length; this.compare = compare || defaultCompare; - if (this.length > 0) { - for (var i = (this.length >> 1) - 1; i >= 0; i--) this._down(i); - } + if (data) for (var i = Math.floor(this.length / 2); i >= 0; i--) this._down(i); } function defaultCompare(a, b) { @@ -766,17 +766,11 @@ TinyQueue.prototype = { }, pop: function () { - if (this.length === 0) return undefined; - var top = this.data[0]; + this.data[0] = this.data[this.length - 1]; this.length--; - - if (this.length > 0) { - this.data[0] = this.data[this.length]; - this._down(0); - } this.data.pop(); - + this._down(0); return top; }, @@ -785,46 +779,46 @@ TinyQueue.prototype = { }, _up: function (pos) { - var data = this.data; - var compare = this.compare; - var item = data[pos]; + var data = this.data, + compare = this.compare; while (pos > 0) { - var parent = (pos - 1) >> 1; - var current = data[parent]; - if (compare(item, current) >= 0) break; - data[pos] = current; - pos = parent; - } + var parent = Math.floor((pos - 1) / 2); + if (compare(data[pos], data[parent]) < 0) { + swap(data, parent, pos); + pos = parent; - data[pos] = item; + } else break; + } }, _down: function (pos) { - var data = this.data; - var compare = this.compare; - var halfLength = this.length >> 1; - var item = data[pos]; - - while (pos < halfLength) { - var left = (pos << 1) + 1; - var right = left + 1; - var best = data[left]; - - if (right < this.length && compare(data[right], best) < 0) { - left = right; - best = data[right]; - } - if (compare(best, item) >= 0) break; - - data[pos] = best; - pos = left; - } + var data = this.data, + compare = this.compare, + len = this.length; + + while (true) { + var left = 2 * pos + 1, + right = left + 1, + min = pos; + + if (left < len && compare(data[left], data[min]) < 0) min = left; + if (right < len && compare(data[right], data[min]) < 0) min = right; - data[pos] = item; + if (min === pos) return; + + swap(data, min, pos); + pos = min; + } } }; +function swap(data, i, j) { + var tmp = data[i]; + data[i] = data[j]; + data[j] = tmp; +} + },{}],4:[function(require,module,exports){ 'use strict'; @@ -1101,12 +1095,11 @@ module.exports = function connectEdges(sortedEvents, operation) { if (!resultEvents[i].isExteriorRing) { if (result.length === 0) { result.push([[contour]]); - } else if (operation === operationType.UNION || - operation === operationType.XOR) { - result[result.length - 1].push(contour[0]); } else { - result[result.length - 1].push(contour); + result[result.length - 1].push(contour[0]); } + } else if (operation === operationType.DIFFERENCE && !resultEvents[i].isSubject && result.length > 1) { + result[result.length - 1].push(contour[0]); } else { result.push(contour); } @@ -1143,19 +1136,19 @@ module.exports = function connectEdges(sortedEvents, operation) { event.otherEvent.contourId = ringId; } - for (i = 0, len = result.length; i < len; i++) { - var polygon = result[i]; - for (var j = 0, jj = polygon.length; j < jj; j++) { - var polygonContour = polygon[j]; - for (var k = 0, kk = polygonContour.length; k < kk; k++) { - var coords = polygonContour[k]; - if (typeof coords[0] !== 'number') { - polygon.splice(j, 1); - polygon.push(coords); - } - } - } - } + // for (i = 0, len = result.length; i < len; i++) { + // var polygon = result[i]; + // for (var j = 0, jj = polygon.length; j < jj; j++) { + // var polygonContour = polygon[j]; + // for (var k = 0, kk = polygonContour.length; k < kk; k++) { + // var coords = polygonContour[k]; + // if (typeof coords[0] !== 'number') { + // polygon.splice(j, 1); + // polygon.push(coords); + // } + // } + // } + // } // Handle if the result is a polygon (eg not multipoly) // Commented it again, let's see what do we mean by that @@ -1260,6 +1253,10 @@ function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing e2 = new SweepEvent(s2, false, e1, isSubject); e1.otherEvent = e2; + if (s1[0] === s2[0] && s1[1] === s2[1]) { + continue; // skip collapsed edges, or it breaks + } + e1.contourId = e2.contourId = depth; if (!isExteriorRing) { e1.isExteriorRing = false; diff --git a/src/fill_queue.js b/src/fill_queue.js index b82f9f5..e1cb9ca 100644 --- a/src/fill_queue.js +++ b/src/fill_queue.js @@ -19,6 +19,10 @@ function processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing e2 = new SweepEvent(s2, false, e1, isSubject); e1.otherEvent = e2; + if (s1[0] === s2[0] && s1[1] === s2[1]) { + continue; // skip collapsed edges, or it breaks + } + e1.contourId = e2.contourId = depth; if (!isExteriorRing) { e1.isExteriorRing = false; diff --git a/test/edge_cases.test.js b/test/edge_cases.test.js index 0bcf695..cfc783b 100644 --- a/test/edge_cases.test.js +++ b/test/edge_cases.test.js @@ -218,5 +218,30 @@ tap.test('Edge cases', function(main) { t.end(); }); + main.test('collapsed edges removed', (t) => { + const p1 = [[ + [355,139], + [420,202], + [384,237], + [353,205], + [330,230], + [330,230], + [291,197] + ]]; + const p2 =[[ + [355,139], + [420,202], + [384,237], + [353,205], + + [330,230], + [330,230], + [291,197] + ]]; + + t.deepEqual(martinez.intersection(p1, p2), [[[[291,197],[330,230],[353,205],[384,237],[420,202],[355,139]]]]); + t.end(); + }); + main.end(); }); diff --git a/test/fixtures/collapsed.geojson b/test/fixtures/collapsed.geojson new file mode 100644 index 0000000..0cada48 --- /dev/null +++ b/test/fixtures/collapsed.geojson @@ -0,0 +1,35 @@ +{ + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [[355.9999999950329,139.33333333333331], + [420.9999999950329,202.33333333333331], + [384.3333333283663,237.66666667163372], + [353.9999999950329,205.33333333333331], + [330.6666666616996,230.33333332339922], + [330.6666666616996,230.33333332339922], + [291.3333333283663,197.33333333333331]] + ] + } + },{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [[355.9999999950329,139.33333333333331], + [420.9999999950329,202.33333333333331], + [384.3333333283663,237.66666667163372], + [353.9999999950329,205.33333333333331], + + [330.6666666616996,230.33333332339922], + [330.6666666616996,230.33333332339922], + [291.3333333283663,197.33333333333331]] + ] + } + }] +} diff --git a/test/fixtures/overlap_two.geojson b/test/fixtures/overlap_two.geojson new file mode 100644 index 0000000..4468f2f --- /dev/null +++ b/test/fixtures/overlap_two.geojson @@ -0,0 +1,76 @@ +{ + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -492.1913921306456, + -246.09569606532278 + ], + [ + -492.1913921306456, + 246.09569606532278 + ], + [ + 328.12759475376373, + 164.06379737688187 + ], + [ + 328.12759475376373, + 82.03189868844093 + ], + [ + 0, + 98.43827842612912 + ], + [ + 0, + -98.43827842612912 + ], + [ + 328.12759475376373, + -82.03189868844093 + ], + [ + 328.12759475376373, + -164.06379737688187 + ], + [ + -492.1913921306456, + -246.09569606532278 + ] + ] +] + } + },{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 118.12593411135472, + 92.53198172056138 + ], + [ + 328.12759475376373, + 82.03189868844093 + ], + [ + 328.12759475376373, + 92.53198172056136 + ], + [ + 118.12593411135472, + 92.53198172056138 + ] + ] +] + } + }] +}