Shu_Ju_Wei_Hu_Ping_Tai/public/js/shp.min.js

16 lines
243 KiB
JavaScript
Raw Normal View History

2023-05-30 10:14:48 +08:00
(function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,t.shp=e()}})(function(){var n=Math.floor,r=Math.log,o=Math.abs,l=Math.pow,d=String.fromCharCode,p=Math.min,u;return function(){function s(l,e,n){function t(o,i){if(!e[o]){if(!l[o]){var d="function"==typeof require&&require;if(!i&&d)return d(o,!0);if(r)return r(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var a=e[o]={exports:{}};l[o][0].call(a.exports,function(e){var a=l[o][1][e];return t(a||e)},a,a.exports,s,l,e,n)}return e[o].exports}for(var r="function"==typeof require&&require,a=0;a<n.length;a++)t(n[a]);return t}return s}()({1:[function(e,t){'use strict';const a=e("lie"),n=e("./combine"),r=e("buffer").Buffer;t.exports=function(e,t){return new a(function(a,o){const s=n(e,t),i=new XMLHttpRequest;i.open("GET",s,!0),"prj"!==t&&"cpg"!==t&&(i.responseType="arraybuffer"),i.addEventListener("load",function(){return 399<i.status?"prj"===t||"cpg"===t?a(!1):o(new Error(i.status)):"prj"!==t&&"cpg"!==t?a(r.from(i.response)):a(i.response)},!1),i.send()})}},{"./combine":3,buffer:8,lie:12}],2:[function(e,t){(function(a){(function(){'use strict';const n=e("./binaryajax-browser"),r=e("./combine"),o=e("buffer").Buffer;t.exports=async function(e,t){if(!a.fetch)return n(e,t);const s=r(e,t),i="prj"===t||"cpg"===t;try{const e=await fetch(s);if(399<e.status)throw new Error(e.statusText);if(i)return e.text();const t=await e.arrayBuffer();return o.from(t)}catch(a){if(console.log("ERROR",a,t),i||"dbf"===t)return!1;throw a}}}).call(this)}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./binaryajax-browser":1,"./combine":3,buffer:8}],3:[function(e,t){(function(e){(function(){const a=e.URL;t.exports=(e,t)=>{if(!t)return e;const n=new a(e);return n.pathname=`${n.pathname}.${t}`,n.href}}).call(this)}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],4:[function(e,t){'use strict';function n(e){let t=0,a=1;const n=e.length;for(let r,o;a<n;)r=o||e[0],o=e[a],t+=(o[0]-r[0])*(o[1]+r[1]),a++;return 0<t}function r(e,t){return n(t)||!e.length?e.push([t]):e[e.length-1].push(t),e}function o(e){return e?function(t,a){const n=[t.readDoubleLE(a),t.readDoubleLE(a+8)];return e.inverse(n)}:function(e,t){return[e.readDoubleLE(t),e.readDoubleLE(t+8)]}}function s(e,t){return this instanceof s?void(this.buffer=e,this.headers=this.parseHeader(),this.headers.length<this.buffer.byteLength&&(this.buffer=this.buffer.slice(0,this.headers.length)),this.shpFuncs(t),this.rows=this.getRows()):new s(e,t)}s.prototype.parsePoint=function(e){return{type:"Point",coordinates:this.parseCoord(e,0)}},s.prototype.parseZPoint=function(e){const t=this.parsePoint(e);return t.coordinates.push(e.readDoubleLE(16)),t},s.prototype.parsePointArray=function(e,t,a){const n=[];for(let r=0;r<a;)n.push(this.parseCoord(e,t)),t+=16,r++;return n},s.prototype.parseZPointArray=function(e,t,a,n){for(let r=0;r<a;)n[r].push(e.readDoubleLE(t)),r++,t+=8;return n},s.prototype.parseArrayGroup=function(e,t,a,n,r){const o=[];let s=0,i=0,l,d;for(;s<n;)(s++,a+=4,l=i,i=s===n?r:e.readInt32LE(a),d=i-l,!!d)&&(o.push(this.parsePointArray(e,t,d)),t+=d<<4);return o},s.prototype.parseZArrayGroup=function(e,t,a,n){for(let r=0;r<a;)n[r]=this.parseZPointArray(e,t,n[r].length,n[r]),t+=n[r].length<<3,r++;return n},s.prototype.parseMultiPoint=function(e){const t={},a=e.readInt32LE(32,!0);if(!a)return null;const n=this.parseCoord(e,0),r=this.parseCoord(e,16);t.bbox=[n[0],n[1],r[0],r[1]];return 1===a?(t.type="Point",t.coordinates=this.parseCoord(e,36)):(t.type="MultiPoint",t.coordinates=this.parsePointArray(e,36,a)),t},s.prototype.parseZMultiPoint=function(e){const t=this.parseMultiPoint(e);if(!t)return null;let a;if("Point"===t.type)return t.coordinates.push(e.readDoubleLE(72)),t;a=t.coordinates.leng
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/'use strict';function t(e){if(2147483647<e)throw new RangeError("The value \""+e+"\" is invalid for option \"size\"");var t=new Uint8Array(e);return t.__proto__=n.prototype,t}function n(e,t,a){if("number"==typeof e){if("string"==typeof t)throw new TypeError("The \"string\" argument must be of type string. Received type number");return i(e)}return r(e,t,a)}function r(e,t,a){if("string"==typeof e)return u(e,t);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return m(e,t,a);if("number"==typeof e)throw new TypeError("The \"value\" argument must not be of type number. Received type number");var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return n.from(r,t,a);var o=f(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return n.from(e[Symbol.toPrimitive]("string"),t,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError("\"size\" argument must be of type number");else if(0>e)throw new RangeError("The value \""+e+"\" is invalid for option \"size\"")}function s(e,a,n){return o(e),0>=e?t(e):void 0===a?t(e):"string"==typeof n?t(e).fill(a,n):t(e).fill(a)}function i(e){return o(e),t(0>e?0:0|h(e))}function u(e,a){if(("string"!=typeof a||""===a)&&(a="utf8"),!n.isEncoding(a))throw new TypeError("Unknown encoding: "+a);var r=0|_(e,a),o=t(r),s=o.write(e,a);return s!==r&&(o=o.slice(0,s)),o}function c(e){for(var a=0>e.length?0:0|h(e.length),n=t(a),r=0;r<a;r+=1)n[r]=255&e[r];return n}function m(e,t,a){if(0>t||e.byteLength<t)throw new RangeError("\"offset\" is outside of buffer bounds");if(e.byteLength<t+(a||0))throw new RangeError("\"length\" is outside of buffer bounds");var r;return r=void 0===t&&void 0===a?new Uint8Array(e):void 0===a?new Uint8Array(e,t):new Uint8Array(e,t,a),r.__proto__=n.prototype,r}function f(e){if(n.isBuffer(e)){var a=0|h(e.length),r=t(a);return 0===r.length?r:(e.copy(r,0,0,a),r)}return void 0===e.length?"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0:"number"!=typeof e.length||K(e.length)?t(0):c(e)}function h(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|e}function _(e,t){if(n.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type "+typeof e);var a=e.length,r=2<arguments.length&&!0===arguments[2];if(!r&&0===a)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*a;case"hex":return a>>>1;case"base64":return Z(e).length;default:if(o)return r?-1:M(e).length;t=(""+t).toLowerCase(),o=!0;}}function g(e,t,a){var n=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===a||a>this.length)&&(a=this.length),0>=a)return"";if(a>>>=0,t>>>=0,a<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return z(this,t,a);case"utf8":case"utf-8":return I(this,t,a);case"ascii":return B(this,t,a);case"latin1":case"binary":return L(this,t,a);case"base64":return A(this,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,a);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0;}}function y(e,t,a){var n=e[t];e[t]=e[a],e[a]=n}function x(e,t,a,r,o){if(0===e.length)return-1;if("string"==typeof a?(r=a,a=0):2147483647<a?a=2147483647:-2147483648>a&&(a=-2147483648),a=+a,K(a)&&(a=o?0:e.length-1),0>a&&(a=e.length+a),a>=e.length){if(o)return-1;a=e.length-1}else if(0>a)if(o)a=0;else return-1;if("string"==typeof t&&(t=n.from(t,r)),n.isBuffer(t))return 0===t.length?-1:b(e,t,a,r,o);if("number"==typeof t)ret
JSZip v3.6.0 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/master/LICENSE
*/!function(t){"object"==typeof s&&"undefined"!=typeof r?r.exports=t():"function"==typeof u&&u.amd?u([],t):("undefined"==typeof window?"undefined"==typeof i?"undefined"==typeof self?this:self:i:window).JSZip=t()}(function(){return function l(s,d,o){function n(p,r){if(!d[p]){if(!s[p]){var e="function"==typeof a&&a;if(!r&&e)return e(p,!0);if(i)return i(p,!0);var t=new Error("Cannot find module '"+p+"'");throw t.code="MODULE_NOT_FOUND",t}var u=d[p]={exports:{}};s[p][0].call(u.exports,function(a){var e=s[p][1][a];return n(e||a)},u,u.exports,l,s,d,o)}return d[p].exports}for(var i="function"==typeof a&&a,t=0;t<o.length;t++)n(o[t]);return n}({1:[function(a,s,t){(function(i){!function(a){"object"==typeof t&&void 0!==s?s.exports=a():("undefined"==typeof window?void 0===i?"undefined"==typeof self?this:self:i:window).JSZip=a()}(function(){return function l(s,d,o){function n(p,t){if(!d[p]){if(!s[p]){var e="function"==typeof a&&a;if(!t&&e)return e(p,!0);if(i)return i(p,!0);var r=new Error("Cannot find module '"+p+"'");throw r.code="MODULE_NOT_FOUND",r}var u=d[p]={exports:{}};s[p][0].call(u.exports,function(t){return n(s[p][1][t]||t)},u,u.exports,l,s,d,o)}return d[p].exports}for(var i="function"==typeof a&&a,t=0;t<o.length;t++)n(o[t]);return n}({1:[function(a,s,t){(function(i){!function(a){"object"==typeof t&&void 0!==s?s.exports=a():("undefined"==typeof window?void 0===i?"undefined"==typeof self?this:self:i:window).JSZip=a()}(function(){return function l(s,d,o){function n(p,t){if(!d[p]){if(!s[p]){var e="function"==typeof a&&a;if(!t&&e)return e(p,!0);if(i)return i(p,!0);var r=new Error("Cannot find module '"+p+"'");throw r.code="MODULE_NOT_FOUND",r}var u=d[p]={exports:{}};s[p][0].call(u.exports,function(t){return n(s[p][1][t]||t)},u,u.exports,l,s,d,o)}return d[p].exports}for(var i="function"==typeof a&&a,t=0;t<o.length;t++)n(o[t]);return n}({1:[function(a,s,t){(function(i){!function(a){"object"==typeof t&&void 0!==s?s.exports=a():("undefined"==typeof window?void 0===i?"undefined"==typeof self?this:self:i:window).JSZip=a()}(function(){return function l(s,d,o){function n(p,t){if(!d[p]){if(!s[p]){var e="function"==typeof a&&a;if(!t&&e)return e(p,!0);if(i)return i(p,!0);var r=new Error("Cannot find module '"+p+"'");throw r.code="MODULE_NOT_FOUND",r}var u=d[p]={exports:{}};s[p][0].call(u.exports,function(t){return n(s[p][1][t]||t)},u,u.exports,l,s,d,o)}return d[p].exports}for(var i="function"==typeof a&&a,t=0;t<o.length;t++)n(o[t]);return n}({1:[function(a,s,t){(function(i){!function(a){"object"==typeof t&&void 0!==s?s.exports=a():("undefined"==typeof window?void 0===i?"undefined"==typeof self?this:self:i:window).JSZip=a()}(function(){return function l(s,d,o){function n(p,t){if(!d[p]){if(!s[p]){var e="function"==typeof a&&a;if(!t&&e)return e(p,!0);if(i)return i(p,!0);var r=new Error("Cannot find module '"+p+"'");throw r.code="MODULE_NOT_FOUND",r}var u=d[p]={exports:{}};s[p][0].call(u.exports,function(t){return n(s[p][1][t]||t)},u,u.exports,l,s,d,o)}return d[p].exports}for(var i="function"==typeof a&&a,t=0;t<o.length;t++)n(o[t]);return n}({1:[function(a,s,t){(function(i){!function(a){"object"==typeof t&&void 0!==s?s.exports=a():("undefined"==typeof window?void 0===i?"undefined"==typeof self?this:self:i:window).JSZip=a()}(function(){return function l(s,d,o){function n(p,t){if(!d[p]){if(!s[p]){var e="function"==typeof a&&a;if(!t&&e)return e(p,!0);if(i)return i(p,!0);var r=new Error("Cannot find module '"+p+"'");throw r.code="MODULE_NOT_FOUND",r}var u=d[p]={exports:{}};s[p][0].call(u.exports,function(t){return n(s[p][1][t]||t)},u,u.exports,l,s,d,o)}return d[p].exports}for(var i="function"==typeof a&&a,t=0;t<o.length;t++)n(o[t]);return n}({1:[function(a,e,t){"use strict";var p=a("./utils"),d=a("./support");t.encode=function(c){for(var e=[],u=0,m=c.length,f=m,_="string"!==p.getTypeOf(c),d,g,y,x,b,w,k;u<c.length;)f=m-u,y=_?(d=c[u++],g=u<m?c[u++]:0,u<m?c[u++]:0):(d=c.charCodeAt(u++),g=u<m?c.charCodeAt(u++):0,u<m?c.charCodeAt(u++):0),x=d>>2,b=(3&d)<<4|g>>4,w=1<f?(15&g)<<2|y>>6:64,k=2<f?63&y:64,e.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst