10 lines
7.6 KiB
JavaScript
10 lines
7.6 KiB
JavaScript
|
|
/*!
|
||
|
|
* DevExtreme (dx.vectormaputils.js)
|
||
|
|
* Version: 19.2.5
|
||
|
|
* Build date: Mon Dec 16 2019
|
||
|
|
*
|
||
|
|
* Copyright (c) 2012 - 2019 Developer Express Inc. ALL RIGHTS RESERVED
|
||
|
|
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
|
||
|
|
*/
|
||
|
|
"use strict";!function(n,e){if("function"==typeof define&&define.amd)define(function(n,t,r){e(t)});else if("object"==typeof module&&module.exports)e(t);else{var t=n.DevExpress=n.DevExpress||{};t=t.viz=t.viz||{},t=t.vectormaputils={},e(t)}}(this,function(n){function e(){}function t(n){return n}function r(n){return"function"==typeof n}function o(n){var e,t=F(n),r=0;return e={pos:function(){return r},skip:function(n){return r+=n,e},ui8arr:function(n){var t=0,r=[];for(r.length=n;t<n;++t)r[t]=e.ui8();return r},ui8:function(){var n=O(t,r);return r+=1,n},ui16LE:function(){var n=T(t,r);return r+=2,n},ui32LE:function(){var n=H(t,r);return r+=4,n},ui32BE:function(){var n=J(t,r);return r+=4,n},f64LE:function(){var n=V(t,r);return r+=8,n}}}function i(n,e,t){var r,i=n[0]?l(o(n[0]),t):{},s=n[1]?_(o(n[1]),t):{},c=u(i.shapes||[],s.records||[],e);return c.length?(r={type:"FeatureCollection",features:c},r.bbox=i.bBox):r=null,r}function u(n,e,t){var r,o,i=[],u=i.length=u=Math.max(n.length,e.length);for(r=0;r<u;++r)o=n[r]||{},i[r]={type:"Feature",geometry:{type:o.geoJSON_type||null,coordinates:o.coordinates?t(o.coordinates):[]},properties:e[r]||null};return i}function s(n){function e(n){return Math.round(n*r)/r}function t(n){return n.map(n[0].length?t:e)}var r=Number("1E"+n);return t}function c(n){return n=n||{},["shp","dbf"].map(function(e){return function(t){n.substr?(e="."+e,Y(n+(n.substr(-e.length).toLowerCase()===e?"":e),function(n,e){t(n,e)})):t(null,n[e]||null)}})}function a(n,o,u){var a;return f(c(n),function(n,c){u=r(o)&&o||r(u)&&u||e,o=!r(o)&&o||{};var f=[];n.forEach(function(n){n&&f.push(n)}),a=i(c,o.precision>=0?s(o.precision):t,f),u(a,f.length?f:null)}),a}function f(n,e){function t(){--i,0!==i||u||e(r,o)}var r=[],o=[],i=1,u=!0;n.forEach(function(n,e){++i,n(function(n,i){r[e]=n,o[e]=i,t()})}),u=!1,t()}function l(n,e){var t,r,o,i,u=[];try{t=new Date,o=x(n)}catch(n){return void e.push("shp: header parsing error: "+n.message+" / "+n.description)}9994!==o.fileCode&&e.push("shp: file code: "+o.fileCode+" / expected: 9994"),1e3!==o.version&&e.push("shp: file version: "+o.version+" / expected: 1000");try{for(;n.pos()<o.fileLength&&(i=N(n,o.type,e));)u.push(i);n.pos()!==o.fileLength&&e.push("shp: file length: "+o.fileLength+" / actual: "+n.pos()),r=new Date}catch(n){e.push("shp: records parsing error: "+n.message+" / "+n.description)}return{bBox:o.bBox_XY,type:o.shapeType,shapes:u,errors:e,time:r-t}}function p(n,e){e.coordinates=k(n,1)[0]}function h(n,e){var t,r=w(n),o=M(n),i=M(n),u=B(n,o),s=k(n,i),c=[];for(c.length=o,t=0;t<o;++t)c[t]=s.slice(u[t],u[t+1]||i);e.bBox=r,e.coordinates=c}function d(n,e){e.bBox=w(n),e.coordinates=k(n,M(n))}function g(n,e){e.coordinates=k(n,1)[0],e.coordinates.push(E(n,1)[0])}function v(n,e){var t=w(n),r=M(n),o=k(n,r),i=D(n),u=E(n,r);e.bBox=t,e.mBox=i,e.coordinates=C(o,u,r)}function y(n,e){var t,r,o,i=w(n),u=M(n),s=M(n),c=B(n,u),a=k(n,s),f=D(n),l=E(n,s),p=[];for(p.length=u,t=0;t<u;++t)r=c[t],o=c[t+1]||s,p[t]=C(a.slice(r,o),l.slice(r,o),o-r);e.bBox=i,e.mBox=f,e.coordinates=p}function m(n,e){e.coordinates=k(n,1)[0],e.push(E(n,1)[0],E(n,1)[0])}function b(n,e){var t=w(n),r=M(n),o=k(n,r),i=D(n),u=E(n,r),s=D(n),c=E(n,r);e.bBox=t,e.zBox=i,e.mBox=s,e.coordinates=Z(o,u,c,r)}function L(n,e){var t,r,o,i=w(n),u=M(n),s=M(n),c=B(n,u),a=k(n,s),f=D(n),l=E(n,s),p=D(n),h=E(n,s),d=[];for(d.length=u,t=0;t<u;++t)r=c[t],o=c[t+1]||s,d[t]=Z(a.slice(r,o),l.slice(r,o),h.slice(r,o),o-r);e.bBox=i,e.zBox=f,e.mBox=p,e.coordinates=d}function P(n,e){var t,r,o,i=w(n),u=M(n),s=M(n),c=B(n,u),a=B(n,u),f=k(n,s),l=D(n),p=E(n,s),h=D(n),d=[];for(d.length=u,t=0;t<u;++t)r=c[t],o=c[t+1]||s,d[t]=Z(f.slice(r,o),p.slice(r,o),mValues.slice(r,o),o-r);e.bBox=i,e.zBox=l,e.mBox=h,e.types=a,e.coordinates=d}function x(n){var e={};return e.fileCode=n.ui32BE(),n.skip(20),e.fileLength=n.ui32BE()<<1,e.version=n.ui32LE(),e.type_number=n.ui32LE(),e.type=j[e.type_number],e.bBox_XY=w(n),e.bBox_ZM=k(n,2),e}function M(n){return n.ui32LE()}function B(n,e){var t,r=[];for(r.length=e,t=0;t<e;++t)r[t]=M(n);return r}function E(n,e){var t,r=[];for(r.length=e,t=0;t<e;++t)r[t]=n.
|