landxml/bundles/landxml.browser.js

3 lines
2.4 MiB
JavaScript
Raw Normal View History

2020-12-10 16:54:02 +01:00
/*! For license information please see landxml.browser.js.LICENSE.txt */
2021-06-30 15:15:22 +02:00
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.landxml=e():t.landxml=e()}(self,(function(){return(()=>{var t={8899:(t,e,r)=>{"use strict";var n=r(5266),i=6378137;function o(t){var e=0;if(t&&t.length>0){e+=Math.abs(s(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(s(t[r]))}return e}function s(t){var e,r,n,o,s,h,u=0,c=t.length;if(c>2){for(h=0;h<c;h++)h===c-2?(n=c-2,o=c-1,s=0):h===c-1?(n=c-1,o=0,s=1):(n=h,o=h+1,s=h+2),e=t[n],r=t[o],u+=(a(t[s][0])-a(e[0]))*Math.sin(a(r[1]));u=u*i*i/2}return u}function a(t){return t*Math.PI/180}e.Z=function(t){return n.geomReduce(t,(function(t,e){return t+function(t){var e,r=0;switch(t.type){case"Polygon":return o(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)r+=o(t.coordinates[e]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)}),0)}},3470:(t,e)=>{"use strict";function r(t){var e={type:"Feature"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}})),e.properties=n(t.properties),e.geometry=i(t.geometry),e}function n(t){var e={};return t?(Object.keys(t).forEach((function(r){var i=t[r];"object"==typeof i?null===i?e[r]=null:Array.isArray(i)?e[r]=i.map((function(t){return t})):e[r]=n(i):e[r]=i})),e):e}function i(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return i(t)})),e):(e.coordinates=o(t.coordinates),e)}function o(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return o(t)}))}e.Z=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return r(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}})),e.features=t.features.map((function(t){return r(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return i(t);default:throw new Error("unknown GeoJSON type")}}},1257:(t,e)=>{"use strict";function r(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function n(t,e,n){return void 0===n&&(n={}),r({type:"Point",coordinates:t},e,n)}function i(t,e,n){void 0===n&&(n={});for(var i=0,o=t;i<o.length;i++){var s=o[i];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}return r({type:"Polygon",coordinates:t},e,n)}function o(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return r({type:"LineString",coordinates:t},e,n)}function s(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function a(t,e,n){return void 0===n&&(n={}),r({type:"MultiLineString",coordinates:t},e,n)}function h(t,e,n){return void 0===n&&(n={}),r({type:"MultiPoint",coordinates:t},e,n)}function u(t,e,n){return void 0===n&&(n={}),r({type:"MultiPolygon",coordinates:t},e,n)}function c(t,r){void 0===r&&(r="kilometers");var n=e.factors[r];if(!n)throw new Error(r+" units is invalid");return t*n}function l(t,r){void 0===r&&(r="kilometers");var n=e.factors[r];if(!n)throw new Error(r+" units is invalid");return t/n}function f(t){return t%(2*Math.PI)*180/Math.PI}function p(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)&&!/^\s*$/.test(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9sYW5keG1sL3dlYnBhY2svdW5pdmVyc2FsTW9kdWxlRGVmaW5pdGlvbiIsIndlYnBhY2s6Ly9sYW5keG1sLy4vbm9kZV9tb2R1bGVzL0B0dXJmL2FyZWEvaW5kZXguanMiLCJ3ZWJwYWNrOi8vbGFuZHhtbC8uL25vZGVfbW9kdWxlcy9AdHVyZi9jbG9uZS9pbmRleC5qcyIsIndlYnBhY2s6Ly9sYW5keG1sLy4vbm9kZV9tb2R1bGVzL0B0dXJmL2hlbHBlcnMvaW5kZXguanMiLCJ3ZWJwYWNrOi8vbGFuZHhtbC8uL25vZGVfbW9kdWxlcy9AdHVyZi9tZXRhL2luZGV4LmpzIiwid2VicGFjazovL2xhbmR4bWwvLi9ub2RlX21vZHVsZXMvQHR1cmYvdW5pb24vaW5kZXguanMiLCJ3ZWJwYWNrOi8vbGFuZHhtbC8uL25vZGVfbW9kdWxlcy9AdHVyZi91bmlvbi9ub2RlX21vZHVsZXMvQHR1cmYvaW52YXJpYW50L2luZGV4LmpzIiwid2VicGFjazovL2xhbmR4bWwvLi9ub2RlX21vZHVsZXMvYmFiZWwtcG9seWZpbGwvbGliL2luZGV4LmpzIiwid2VicGFjazovL2xhbmR4bWwvLi9ub2RlX21vZHVsZXMvYmFiZWwtcG9seWZpbGwvbm9kZV9tb2R1bGVzL3JlZ2VuZXJhdG9yLXJ1bnRpbWUvcnVudGltZS5qcyIsIndlYnBhY2s6Ly9sYW5keG1sLy4vbm9kZV9tb2R1bGVzL2Jhc2U2NC1qcy9pbmRle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