mirage2d 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MirageHttp.es.js +5268 -0
- package/dist/MirageHttp.es.js.map +1 -0
- package/dist/MirageHttp.umd.js +2 -0
- package/dist/MirageHttp.umd.js.map +1 -0
- package/dist/assets/js/basedecoder-fa2b8e8d.js +107 -0
- package/dist/assets/js/decoder-f19e05cf.js +6 -0
- package/dist/assets/js/deflate-adb9a67b.js +8 -0
- package/dist/{js/dist/_html2canvas@1.4.1@html2canvas.e8006fee.js → assets/js/html2canvas.esm-3dd231c5.js} +0 -0
- package/dist/assets/js/index-3263db85.js +1 -0
- package/dist/assets/js/index-a9db46a5.js +212968 -0
- package/dist/{js/lib/_canvg@3.0.10@canvg.bd557ac8.js → assets/js/index.es-38f73a27.js} +2179 -351
- package/dist/assets/js/jpeg-3bf23728.js +835 -0
- package/dist/{js/_lerc@3.0.0@lerc/_lerc@3.0.0@lerc.dc2ff398.js → assets/js/lerc-4c39f39b.js} +26 -1
- package/dist/assets/js/lzw-d0cad8af.js +123 -0
- package/dist/assets/js/packbits-d75b4cce.js +25 -0
- package/dist/{js/_pako@2.0.4@pako/_pako@2.0.4@pako.52d6b320.js → assets/js/pako.esm-49deb4d7.js} +0 -0
- package/dist/{js/dist/_dompurify@2.4.0@dompurify.e7ba523e.js → assets/js/purify.es-1915dfae.js} +0 -0
- package/dist/assets/js/raw-9656f9cc.js +7 -0
- package/dist/assets/js/webimage-edb7156c.js +27 -0
- package/package.json +1 -1
- package/dist/js/_@babel_runtime@7.18.9@@babel/_@babel_runtime@7.18.9@@babel.e0126ca2.js +0 -51
- package/dist/js/_@petamoriken_float16@3.6.6@@petamoriken/_@petamoriken_float16@3.6.6@@petamoriken.c5188241.js +0 -217
- package/dist/js/_@turf_along@6.5.0@@turf/_@turf_along@6.5.0@@turf.18dbc1a3.js +0 -31
- package/dist/js/_@turf_angle@6.5.0@@turf/_@turf_angle@6.5.0@@turf.554ac9bf.js +0 -1
- package/dist/js/_@turf_area@6.5.0@@turf/_@turf_area@6.5.0@@turf.6cbf0cc1.js +0 -74
- package/dist/js/_@turf_bbox-clip@6.5.0@@turf/_@turf_bbox-clip@6.5.0@@turf.e491cb90.js +0 -1
- package/dist/js/_@turf_bbox-polygon@6.5.0@@turf/_@turf_bbox-polygon@6.5.0@@turf.523f1c20.js +0 -19
- package/dist/js/_@turf_bbox@6.5.0@@turf/_@turf_bbox@6.5.0@@turf.4c59feee.js +0 -48
- package/dist/js/_@turf_bearing@6.5.0@@turf/_@turf_bearing@6.5.0@@turf.f2555a09.js +0 -25
- package/dist/js/_@turf_bezier-spline@6.5.0@@turf/_@turf_bezier-spline@6.5.0@@turf.fa7991dd.js +0 -137
- package/dist/js/_@turf_boolean-clockwise@6.5.0@@turf/_@turf_boolean-clockwise@6.5.0@@turf.4031f280.js +0 -1
- package/dist/js/_@turf_boolean-contains@6.5.0@@turf/_@turf_boolean-contains@6.5.0@@turf.836d55d8.js +0 -191
- package/dist/js/_@turf_boolean-crosses@6.5.0@@turf/_@turf_boolean-crosses@6.5.0@@turf.c5f65a28.js +0 -125
- package/dist/js/_@turf_boolean-disjoint@6.5.0@@turf/_@turf_boolean-disjoint@6.5.0@@turf.bbd60872.js +0 -122
- package/dist/js/_@turf_boolean-equal@6.5.0@@turf/_@turf_boolean-equal@6.5.0@@turf.341ffa01.js +0 -1
- package/dist/js/_@turf_boolean-intersects@6.5.0@@turf/_@turf_boolean-intersects@6.5.0@@turf.05fc28b3.js +0 -15
- package/dist/js/_@turf_boolean-overlap@6.5.0@@turf/_@turf_boolean-overlap@6.5.0@@turf.a519db25.js +0 -53
- package/dist/js/_@turf_boolean-parallel@6.5.0@@turf/_@turf_boolean-parallel@6.5.0@@turf.dbf2bc2d.js +0 -1
- package/dist/js/_@turf_boolean-point-in-polygon@6.5.0@@turf/_@turf_boolean-point-in-polygon@6.5.0@@turf.62a2d48a.js +0 -65
- package/dist/js/_@turf_boolean-point-on-line@6.5.0@@turf/_@turf_boolean-point-on-line@6.5.0@@turf.3cf3aaa1.js +0 -69
- package/dist/js/_@turf_boolean-within@6.5.0@@turf/_@turf_boolean-within@6.5.0@@turf.d70d6bfc.js +0 -172
- package/dist/js/_@turf_buffer@6.5.0@@turf/_@turf_buffer@6.5.0@@turf.88330dfe.js +0 -99
- package/dist/js/_@turf_center-mean@6.5.0@@turf/_@turf_center-mean@6.5.0@@turf.b3d7c917.js +0 -1
- package/dist/js/_@turf_center-median@6.5.0@@turf/_@turf_center-median@6.5.0@@turf.44c4669e.js +0 -1
- package/dist/js/_@turf_center-of-mass@6.5.0@@turf/_@turf_center-of-mass@6.5.0@@turf.63ce279e.js +0 -1
- package/dist/js/_@turf_center@6.5.0@@turf/_@turf_center@6.5.0@@turf.a45495b5.js +0 -12
- package/dist/js/_@turf_centroid@6.5.0@@turf/_@turf_centroid@6.5.0@@turf.0a5be869.js +0 -17
- package/dist/js/_@turf_circle@6.5.0@@turf/_@turf_circle@6.5.0@@turf.0166b8c2.js +0 -16
- package/dist/js/_@turf_clean-coords@6.5.0@@turf/_@turf_clean-coords@6.5.0@@turf.8c76bd63.js +0 -111
- package/dist/js/_@turf_clone@6.5.0@@turf/_@turf_clone@6.5.0@@turf.cd05b1f8.js +0 -100
- package/dist/js/_@turf_clusters-dbscan@6.5.0@@turf/_@turf_clusters-dbscan@6.5.0@@turf.6bbee7e9.js +0 -1
- package/dist/js/_@turf_clusters-kmeans@6.5.0@@turf/_@turf_clusters-kmeans@6.5.0@@turf.505415df.js +0 -1
- package/dist/js/_@turf_clusters@6.5.0@@turf/_@turf_clusters@6.5.0@@turf.84cb9680.js +0 -1
- package/dist/js/_@turf_collect@6.5.0@@turf/_@turf_collect@6.5.0@@turf.93e41b5f.js +0 -1
- package/dist/js/_@turf_combine@6.5.0@@turf/_@turf_combine@6.5.0@@turf.33ee6336.js +0 -1
- package/dist/js/_@turf_concave@6.5.0@@turf/_@turf_concave@6.5.0@@turf.6fb6a8be.js +0 -179
- package/dist/js/_@turf_convex@6.5.0@@turf/_@turf_convex@6.5.0@@turf.24600ac2.js +0 -1
- package/dist/js/_@turf_destination@6.5.0@@turf/_@turf_destination@6.5.0@@turf.2621651e.js +0 -18
- package/dist/js/_@turf_difference@6.5.0@@turf/_@turf_difference@6.5.0@@turf.70df5e79.js +0 -18
- package/dist/js/_@turf_dissolve@6.5.0@@turf/_@turf_dissolve@6.5.0@@turf.edb28fc1.js +0 -1
- package/dist/js/_@turf_distance-weight@6.5.0@@turf/_@turf_distance-weight@6.5.0@@turf.e168af7f.js +0 -1
- package/dist/js/_@turf_distance@6.5.0@@turf/_@turf_distance@6.5.0@@turf.0c7b8aea.js +0 -22
- package/dist/js/_@turf_ellipse@6.5.0@@turf/_@turf_ellipse@6.5.0@@turf.37986056.js +0 -1
- package/dist/js/_@turf_envelope@6.5.0@@turf/_@turf_envelope@6.5.0@@turf.599c5772.js +0 -1
- package/dist/js/_@turf_explode@6.5.0@@turf/_@turf_explode@6.5.0@@turf.5c768db5.js +0 -24
- package/dist/js/_@turf_flatten@6.5.0@@turf/_@turf_flatten@6.5.0@@turf.57e9114c.js +0 -1
- package/dist/js/_@turf_flip@6.5.0@@turf/_@turf_flip@6.5.0@@turf.1f02101f.js +0 -1
- package/dist/js/_@turf_great-circle@6.5.0@@turf/_@turf_great-circle@6.5.0@@turf.2ca021a8.js +0 -1
- package/dist/js/_@turf_helpers@6.5.0@@turf/_@turf_helpers@6.5.0@@turf.f1480aa1.js +0 -364
- package/dist/js/_@turf_hex-grid@6.5.0@@turf/_@turf_hex-grid@6.5.0@@turf.a6a45778.js +0 -99
- package/dist/js/_@turf_interpolate@6.5.0@@turf/_@turf_interpolate@6.5.0@@turf.4d39bd8c.js +0 -1
- package/dist/js/_@turf_intersect@6.5.0@@turf/_@turf_intersect@6.5.0@@turf.34082cdf.js +0 -17
- package/dist/js/_@turf_invariant@6.5.0@@turf/_@turf_invariant@6.5.0@@turf.0ef69f8c.js +0 -71
- package/dist/js/_@turf_isobands@6.5.0@@turf/_@turf_isobands@6.5.0@@turf.def019df.js +0 -3109
- package/dist/js/_@turf_isolines@6.5.0@@turf/_@turf_isolines@6.5.0@@turf.da623b25.js +0 -1
- package/dist/js/_@turf_kinks@6.5.0@@turf/_@turf_kinks@6.5.0@@turf.ee61685b.js +0 -87
- package/dist/js/_@turf_length@6.5.0@@turf/_@turf_length@6.5.0@@turf.f73f6c98.js +0 -12
- package/dist/js/_@turf_line-arc@6.5.0@@turf/_@turf_line-arc@6.5.0@@turf.3dc57055.js +0 -37
- package/dist/js/_@turf_line-chunk@6.5.0@@turf/_@turf_line-chunk@6.5.0@@turf.1867af48.js +0 -43
- package/dist/js/_@turf_line-intersect@6.5.0@@turf/_@turf_line-intersect@6.5.0@@turf.c4d81948.js +0 -73
- package/dist/js/_@turf_line-offset@6.5.0@@turf/_@turf_line-offset@6.5.0@@turf.e6846793.js +0 -116
- package/dist/js/_@turf_line-overlap@6.5.0@@turf/_@turf_line-overlap@6.5.0@@turf.addba9a5.js +0 -76
- package/dist/js/_@turf_line-segment@6.5.0@@turf/_@turf_line-segment@6.5.0@@turf.18ce3010.js +0 -55
- package/dist/js/_@turf_line-slice-along@6.5.0@@turf/_@turf_line-slice-along@6.5.0@@turf.2b802464.js +0 -57
- package/dist/js/_@turf_line-slice@6.5.0@@turf/_@turf_line-slice@6.5.0@@turf.6423a053.js +0 -23
- package/dist/js/_@turf_line-split@6.5.0@@turf/_@turf_line-split@6.5.0@@turf.2022f104.js +0 -125
- package/dist/js/_@turf_line-to-polygon@6.5.0@@turf/_@turf_line-to-polygon@6.5.0@@turf.83f5e69f.js +0 -1
- package/dist/js/_@turf_mask@6.5.0@@turf/_@turf_mask@6.5.0@@turf.96cd5a94.js +0 -1
- package/dist/js/_@turf_meta@6.5.0@@turf/_@turf_meta@6.5.0@@turf.1b9d5da5.js +0 -611
- package/dist/js/_@turf_midpoint@6.5.0@@turf/_@turf_midpoint@6.5.0@@turf.67c14f94.js +0 -1
- package/dist/js/_@turf_moran-index@6.5.0@@turf/_@turf_moran-index@6.5.0@@turf.2ad5365a.js +0 -1
- package/dist/js/_@turf_nearest-point-on-line@6.5.0@@turf/_@turf_nearest-point-on-line@6.5.0@@turf.095c8c0d.js +0 -57
- package/dist/js/_@turf_nearest-point-to-line@6.5.0@@turf/_@turf_nearest-point-to-line@6.5.0@@turf.68484097.js +0 -1
- package/dist/js/_@turf_nearest-point@6.5.0@@turf/_@turf_nearest-point@6.5.0@@turf.e0d2f509.js +0 -24
- package/dist/js/_@turf_planepoint@6.5.0@@turf/_@turf_planepoint@6.5.0@@turf.56fc70b3.js +0 -1
- package/dist/js/_@turf_point-grid@6.5.0@@turf/_@turf_point-grid@6.5.0@@turf.2d278644.js +0 -42
- package/dist/js/_@turf_point-on-feature@6.5.0@@turf/_@turf_point-on-feature@6.5.0@@turf.0c740874.js +0 -1
- package/dist/js/_@turf_point-to-line-distance@6.5.0@@turf/_@turf_point-to-line-distance@6.5.0@@turf.33105d82.js +0 -1
- package/dist/js/_@turf_points-within-polygon@6.5.0@@turf/_@turf_points-within-polygon@6.5.0@@turf.659cd335.js +0 -35
- package/dist/js/_@turf_polygon-smooth@6.5.0@@turf/_@turf_polygon-smooth@6.5.0@@turf.43a7c33e.js +0 -1
- package/dist/js/_@turf_polygon-tangents@6.5.0@@turf/_@turf_polygon-tangents@6.5.0@@turf.a2c3a7b6.js +0 -1
- package/dist/js/_@turf_polygon-to-line@6.5.0@@turf/_@turf_polygon-to-line@6.5.0@@turf.3177cfb1.js +0 -48
- package/dist/js/_@turf_polygonize@6.5.0@@turf/_@turf_polygonize@6.5.0@@turf.f7cc4910.js +0 -1
- package/dist/js/_@turf_projection@6.5.0@@turf/_@turf_projection@6.5.0@@turf.ffdd3321.js +0 -1
- package/dist/js/_@turf_random@6.5.0@@turf/_@turf_random@6.5.0@@turf.f65251e4.js +0 -130
- package/dist/js/_@turf_rectangle-grid@6.5.0@@turf/_@turf_rectangle-grid@6.5.0@@turf.7e8b1a1f.js +0 -49
- package/dist/js/_@turf_rewind@6.5.0@@turf/_@turf_rewind@6.5.0@@turf.5d137ee9.js +0 -1
- package/dist/js/_@turf_rhumb-bearing@6.5.0@@turf/_@turf_rhumb-bearing@6.5.0@@turf.fb8f6ade.js +0 -30
- package/dist/js/_@turf_rhumb-destination@6.5.0@@turf/_@turf_rhumb-destination@6.5.0@@turf.dc0e4753.js +0 -36
- package/dist/js/_@turf_rhumb-distance@6.5.0@@turf/_@turf_rhumb-distance@6.5.0@@turf.94e475b8.js +0 -30
- package/dist/js/_@turf_sample@6.5.0@@turf/_@turf_sample@6.5.0@@turf.7181d7a7.js +0 -1
- package/dist/js/_@turf_sector@6.5.0@@turf/_@turf_sector@6.5.0@@turf.04ffddfe.js +0 -39
- package/dist/js/_@turf_shortest-path@6.5.0@@turf/_@turf_shortest-path@6.5.0@@turf.0c1b62a8.js +0 -367
- package/dist/js/_@turf_simplify@6.5.0@@turf/_@turf_simplify@6.5.0@@turf.46703d2e.js +0 -1
- package/dist/js/_@turf_square-grid@6.5.0@@turf/_@turf_square-grid@6.5.0@@turf.38bd2eaa.js +0 -8
- package/dist/js/_@turf_square@6.5.0@@turf/_@turf_square@6.5.0@@turf.2705289a.js +0 -27
- package/dist/js/_@turf_standard-deviational-ellipse@6.5.0@@turf/_@turf_standard-deviational-ellipse@6.5.0@@turf.7094e432.js +0 -1
- package/dist/js/_@turf_tag@6.5.0@@turf/_@turf_tag@6.5.0@@turf.cb60b0c1.js +0 -1
- package/dist/js/_@turf_tesselate@6.5.0@@turf/_@turf_tesselate@6.5.0@@turf.330e4aae.js +0 -1
- package/dist/js/_@turf_tin@6.5.0@@turf/_@turf_tin@6.5.0@@turf.077204c4.js +0 -173
- package/dist/js/_@turf_transform-rotate@6.5.0@@turf/_@turf_transform-rotate@6.5.0@@turf.6d350d36.js +0 -1
- package/dist/js/_@turf_transform-scale@6.5.0@@turf/_@turf_transform-scale@6.5.0@@turf.d6f65671.js +0 -90
- package/dist/js/_@turf_transform-translate@6.5.0@@turf/_@turf_transform-translate@6.5.0@@turf.9296b81a.js +0 -1
- package/dist/js/_@turf_triangle-grid@6.5.0@@turf/_@turf_triangle-grid@6.5.0@@turf.939f94ab.js +0 -107
- package/dist/js/_@turf_truncate@6.5.0@@turf/_@turf_truncate@6.5.0@@turf.ed70ebcb.js +0 -33
- package/dist/js/_@turf_turf@6.4.0@@turf/_@turf_turf@6.4.0@@turf.34fde8ec.js +0 -1
- package/dist/js/_@turf_union@6.5.0@@turf/_@turf_union@6.5.0@@turf.386ee2eb.js +0 -1
- package/dist/js/_@turf_unkink-polygon@6.5.0@@turf/_@turf_unkink-polygon@6.5.0@@turf.cb446e47.js +0 -1
- package/dist/js/_@turf_voronoi@6.5.0@@turf/_@turf_voronoi@6.5.0@@turf.c30d929e.js +0 -30
- package/dist/js/_call-bind@1.0.2@call-bind/_call-bind@1.0.2@call-bind.3811d387.js +0 -53
- package/dist/js/_concaveman@1.2.1@concaveman/_concaveman@1.2.1@concaveman.e747f731.js +0 -1
- package/dist/js/_core-js@3.25.0@core-js/_core-js@3.25.0@core-js.003355ed.js +0 -5029
- package/dist/js/_crypto-js@4.1.1@crypto-js/_crypto-js@4.1.1@crypto-js.e2f7f158.js +0 -1823
- package/dist/js/_d3-array@1.2.4@d3-array/_d3-array@1.2.4@d3-array.d606df6b.js +0 -58
- package/dist/js/_d3-geo@1.7.1@d3-geo/_d3-geo@1.7.1@d3-geo.7d357be1.js +0 -1094
- package/dist/js/_d3-voronoi@1.1.2@d3-voronoi/_d3-voronoi@1.1.2@d3-voronoi.072f12a6.js +0 -816
- package/dist/js/_deep-equal@1.1.1@deep-equal/_deep-equal@1.1.1@deep-equal.98576c17.js +0 -108
- package/dist/js/_define-properties@1.1.4@define-properties/_define-properties@1.1.4@define-properties.647c3367.js +0 -40
- package/dist/js/_density-clustering@1.3.0@density-clustering/_density-clustering@1.3.0@density-clustering.a07fc6ae.js +0 -1
- package/dist/js/_earcut@2.2.4@earcut/_earcut@2.2.4@earcut.972ebfd3.js +0 -1
- package/dist/js/_echarts-gl@1.1.2@echarts-gl/_echarts-gl@1.1.2@echarts-gl.1e3964b9.js +0 -36533
- package/dist/js/_echarts@4.9.0@echarts/_echarts@4.9.0@echarts.7d74ba77.js +0 -44219
- package/dist/js/_fflate@0.4.8@fflate/_fflate@0.4.8@fflate.d8111196.js +0 -571
- package/dist/js/_function-bind@1.1.1@function-bind/_function-bind@1.1.1@function-bind.de3cf11d.js +0 -46
- package/dist/js/_functions-have-names@1.2.3@functions-have-names/_functions-have-names@1.2.3@functions-have-names.7def2408.js +0 -27
- package/dist/js/_geojson-equality@0.1.6@geojson-equality/_geojson-equality@0.1.6@geojson-equality.09ffa121.js +0 -133
- package/dist/js/_geojson-path-finder@1.5.3@geojson-path-finder/_geojson-path-finder@1.5.3@geojson-path-finder.7a10eb99.js +0 -348
- package/dist/js/_geojson-rbush@3.2.0@geojson-rbush/_geojson-rbush@3.2.0@geojson-rbush.2adaeedb.js +0 -93
- package/dist/js/_geotiff@2.0.4@geotiff/_geotiff@2.0.4@geotiff.5b08f79e.js +0 -3663
- package/dist/js/_get-intrinsic@1.1.2@get-intrinsic/_get-intrinsic@1.1.2@get-intrinsic.a633bd68.js +0 -291
- package/dist/js/_has-property-descriptors@1.0.0@has-property-descriptors/_has-property-descriptors@1.0.0@has-property-descriptors.6bd2d302.js +0 -26
- package/dist/js/_has-symbols@1.0.3@has-symbols/_has-symbols@1.0.3@has-symbols.70406077.js +0 -63
- package/dist/js/_has-tostringtag@1.0.0@has-tostringtag/_has-tostringtag@1.0.0@has-tostringtag.2d502422.js +0 -6
- package/dist/js/_has@1.0.3@has/_has@1.0.3@has.ddd2eb68.js +0 -4
- package/dist/js/_ieee754@1.2.1@ieee754/_ieee754@1.2.1@ieee754.56426503.js +0 -80
- package/dist/js/_is-arguments@1.1.1@is-arguments/_is-arguments@1.1.1@is-arguments.7d77e24a.js +0 -23
- package/dist/js/_is-date-object@1.0.5@is-date-object/_is-date-object@1.0.5@is-date-object.08cc2543.js +0 -20
- package/dist/js/_is-regex@1.1.4@is-regex/_is-regex@1.1.4@is-regex.6417e007.js +0 -47
- package/dist/js/_jspdf@2.5.1@jspdf/_jspdf@2.5.1@jspdf.e927dbd8.js +0 -8494
- package/dist/js/_kml-geojson@1.2.0@kml-geojson/_kml-geojson@1.2.0@kml-geojson.f1ae86e4.js +0 -7858
- package/dist/js/_lru-cache@6.0.0@lru-cache/_lru-cache@6.0.0@lru-cache.dd72cc1b.js +0 -263
- package/dist/js/_mgrs@1.0.0@mgrs/_mgrs@1.0.0@mgrs.12d1da3e.js +0 -432
- package/dist/js/_object-assign@4.1.1@object-assign/_object-assign@4.1.1@object-assign.e4009c1c.js +0 -69
- package/dist/js/_object-is@1.1.5@object-is/_object-is@1.1.5@object-is.e47f5d65.js +0 -45
- package/dist/js/_object-keys@1.1.1@object-keys/_object-keys@1.1.1@object-keys.4b1d0a99.js +0 -151
- package/dist/js/_ol-echarts@2.0.6@ol-echarts/_ol-echarts@2.0.6@ol-echarts.658aaf82.js +0 -841
- package/dist/js/_ol-ext@3.2.30@ol-ext/_ol-ext@3.2.30@ol-ext.b94220dd.js +0 -4614
- package/dist/js/_ol-mapbox-style@8.2.1@ol-mapbox-style/_ol-mapbox-style@8.2.1@ol-mapbox-style.795310f3.js +0 -1
- package/dist/js/_ol@6.15.1@ol/_ol@6.15.1@ol.8fd0cbb5.js +0 -31823
- package/dist/js/_pbf@3.2.1@pbf/_pbf@3.2.1@pbf.330acf55.js +0 -647
- package/dist/js/_performance-now@2.1.0@performance-now/_performance-now@2.1.0@performance-now.a51379c2.js +0 -34
- package/dist/js/_point-in-polygon@1.1.0@point-in-polygon/_point-in-polygon@1.1.0@point-in-polygon.2cc4306e.js +0 -1
- package/dist/js/_polygon-clipping@0.15.3@polygon-clipping/_polygon-clipping@0.15.3@polygon-clipping.c0e9ec57.js +0 -1363
- package/dist/js/_proj4@2.8.0@proj4/_proj4@2.8.0@proj4.1600352c.js +0 -4885
- package/dist/js/_quickselect@1.1.1@quickselect/_quickselect@1.1.1@quickselect.8afce154.js +0 -1
- package/dist/js/_quickselect@2.0.0@quickselect/_quickselect@2.0.0@quickselect.9f5c1e48.js +0 -51
- package/dist/js/_raf@3.4.1@raf/_raf@3.4.1@raf.ac0d6c66.js +0 -60
- package/dist/js/_rbush@2.0.2@rbush/_rbush@2.0.2@rbush.7149e620.js +0 -1
- package/dist/js/_rbush@3.0.1@rbush/_rbush@3.0.1@rbush.57d33d95.js +0 -402
- package/dist/js/_regexp.prototype.flags@1.4.3@regexp.prototype.flags/_regexp.prototype.flags@1.4.3@regexp.prototype.flags.8b6921c6.js +0 -102
- package/dist/js/_rgbcolor@1.0.1@rgbcolor/_rgbcolor@1.0.1@rgbcolor.dd87e013.js +0 -272
- package/dist/js/_robust-predicates@2.0.4@robust-predicates/_robust-predicates@2.0.4@robust-predicates.564bf2f8.js +0 -1
- package/dist/js/_skmeans@0.9.7@skmeans/_skmeans@0.9.7@skmeans.933c6a76.js +0 -1
- package/dist/js/_splaytree@3.1.1@splaytree/_splaytree@3.1.1@splaytree.6cb55ed3.js +0 -671
- package/dist/js/_stackblur-canvas@2.5.0@stackblur-canvas/_stackblur-canvas@2.5.0@stackblur-canvas.dd883d14.js +0 -214
- package/dist/js/_svg-pathdata@6.0.3@svg-pathdata/_svg-pathdata@6.0.3@svg-pathdata.7e858a5f.js +0 -441
- package/dist/js/_tinyqueue@2.0.3@tinyqueue/_tinyqueue@2.0.3@tinyqueue.78918532.js +0 -73
- package/dist/js/_topojson-client@3.1.0@topojson-client/_topojson-client@3.1.0@topojson-client.aef4e2d5.js +0 -238
- package/dist/js/_topojson-server@3.0.1@topojson-server/_topojson-server@3.0.1@topojson-server.b521a412.js +0 -662
- package/dist/js/_turf-jsts@1.2.3@turf-jsts/_turf-jsts@1.2.3@turf-jsts.6ef42696.js +0 -18934
- package/dist/js/_web-worker@1.2.0@web-worker/_web-worker@1.2.0@web-worker.43288df7.js +0 -2
- package/dist/js/_wkt-parser@1.3.2@wkt-parser/_wkt-parser@1.3.2@wkt-parser.0e1cf374.js +0 -461
- package/dist/js/_xml-utils@1.2.0@xml-utils/_xml-utils@1.2.0@xml-utils.2a8ae655.js +0 -126
- package/dist/js/_yallist@4.0.0@yallist/_yallist@4.0.0@yallist.8350aafe.js +0 -363
- package/dist/js/_zrender@4.3.2@zrender/_zrender@4.3.2@zrender.1feea14d.js +0 -12455
- package/dist/mirage2d.es.js +0 -15894
|
@@ -1,1363 +0,0 @@
|
|
|
1
|
-
import { T as Tree } from "../_splaytree@3.1.1@splaytree/_splaytree@3.1.1@splaytree.6cb55ed3.js";
|
|
2
|
-
function _classCallCheck(instance, Constructor) {
|
|
3
|
-
if (!(instance instanceof Constructor)) {
|
|
4
|
-
throw new TypeError("Cannot call a class as a function");
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
function _defineProperties(target, props) {
|
|
8
|
-
for (var i = 0; i < props.length; i++) {
|
|
9
|
-
var descriptor = props[i];
|
|
10
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
11
|
-
descriptor.configurable = true;
|
|
12
|
-
if ("value" in descriptor)
|
|
13
|
-
descriptor.writable = true;
|
|
14
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
18
|
-
if (protoProps)
|
|
19
|
-
_defineProperties(Constructor.prototype, protoProps);
|
|
20
|
-
if (staticProps)
|
|
21
|
-
_defineProperties(Constructor, staticProps);
|
|
22
|
-
return Constructor;
|
|
23
|
-
}
|
|
24
|
-
var isInBbox = function isInBbox2(bbox, point) {
|
|
25
|
-
return bbox.ll.x <= point.x && point.x <= bbox.ur.x && bbox.ll.y <= point.y && point.y <= bbox.ur.y;
|
|
26
|
-
};
|
|
27
|
-
var getBboxOverlap = function getBboxOverlap2(b1, b2) {
|
|
28
|
-
if (b2.ur.x < b1.ll.x || b1.ur.x < b2.ll.x || b2.ur.y < b1.ll.y || b1.ur.y < b2.ll.y)
|
|
29
|
-
return null;
|
|
30
|
-
var lowerX = b1.ll.x < b2.ll.x ? b2.ll.x : b1.ll.x;
|
|
31
|
-
var upperX = b1.ur.x < b2.ur.x ? b1.ur.x : b2.ur.x;
|
|
32
|
-
var lowerY = b1.ll.y < b2.ll.y ? b2.ll.y : b1.ll.y;
|
|
33
|
-
var upperY = b1.ur.y < b2.ur.y ? b1.ur.y : b2.ur.y;
|
|
34
|
-
return {
|
|
35
|
-
ll: {
|
|
36
|
-
x: lowerX,
|
|
37
|
-
y: lowerY
|
|
38
|
-
},
|
|
39
|
-
ur: {
|
|
40
|
-
x: upperX,
|
|
41
|
-
y: upperY
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
var epsilon = Number.EPSILON;
|
|
46
|
-
if (epsilon === void 0)
|
|
47
|
-
epsilon = Math.pow(2, -52);
|
|
48
|
-
var EPSILON_SQ = epsilon * epsilon;
|
|
49
|
-
var cmp = function cmp2(a, b) {
|
|
50
|
-
if (-epsilon < a && a < epsilon) {
|
|
51
|
-
if (-epsilon < b && b < epsilon) {
|
|
52
|
-
return 0;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
var ab = a - b;
|
|
56
|
-
if (ab * ab < EPSILON_SQ * a * b) {
|
|
57
|
-
return 0;
|
|
58
|
-
}
|
|
59
|
-
return a < b ? -1 : 1;
|
|
60
|
-
};
|
|
61
|
-
var PtRounder = /* @__PURE__ */ function() {
|
|
62
|
-
function PtRounder2() {
|
|
63
|
-
_classCallCheck(this, PtRounder2);
|
|
64
|
-
this.reset();
|
|
65
|
-
}
|
|
66
|
-
_createClass(PtRounder2, [{
|
|
67
|
-
key: "reset",
|
|
68
|
-
value: function reset() {
|
|
69
|
-
this.xRounder = new CoordRounder();
|
|
70
|
-
this.yRounder = new CoordRounder();
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "round",
|
|
74
|
-
value: function round(x, y) {
|
|
75
|
-
return {
|
|
76
|
-
x: this.xRounder.round(x),
|
|
77
|
-
y: this.yRounder.round(y)
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
}]);
|
|
81
|
-
return PtRounder2;
|
|
82
|
-
}();
|
|
83
|
-
var CoordRounder = /* @__PURE__ */ function() {
|
|
84
|
-
function CoordRounder2() {
|
|
85
|
-
_classCallCheck(this, CoordRounder2);
|
|
86
|
-
this.tree = new Tree();
|
|
87
|
-
this.round(0);
|
|
88
|
-
}
|
|
89
|
-
_createClass(CoordRounder2, [{
|
|
90
|
-
key: "round",
|
|
91
|
-
value: function round(coord) {
|
|
92
|
-
var node = this.tree.add(coord);
|
|
93
|
-
var prevNode = this.tree.prev(node);
|
|
94
|
-
if (prevNode !== null && cmp(node.key, prevNode.key) === 0) {
|
|
95
|
-
this.tree.remove(coord);
|
|
96
|
-
return prevNode.key;
|
|
97
|
-
}
|
|
98
|
-
var nextNode = this.tree.next(node);
|
|
99
|
-
if (nextNode !== null && cmp(node.key, nextNode.key) === 0) {
|
|
100
|
-
this.tree.remove(coord);
|
|
101
|
-
return nextNode.key;
|
|
102
|
-
}
|
|
103
|
-
return coord;
|
|
104
|
-
}
|
|
105
|
-
}]);
|
|
106
|
-
return CoordRounder2;
|
|
107
|
-
}();
|
|
108
|
-
var rounder = new PtRounder();
|
|
109
|
-
var crossProduct = function crossProduct2(a, b) {
|
|
110
|
-
return a.x * b.y - a.y * b.x;
|
|
111
|
-
};
|
|
112
|
-
var dotProduct = function dotProduct2(a, b) {
|
|
113
|
-
return a.x * b.x + a.y * b.y;
|
|
114
|
-
};
|
|
115
|
-
var compareVectorAngles = function compareVectorAngles2(basePt, endPt1, endPt2) {
|
|
116
|
-
var v1 = {
|
|
117
|
-
x: endPt1.x - basePt.x,
|
|
118
|
-
y: endPt1.y - basePt.y
|
|
119
|
-
};
|
|
120
|
-
var v2 = {
|
|
121
|
-
x: endPt2.x - basePt.x,
|
|
122
|
-
y: endPt2.y - basePt.y
|
|
123
|
-
};
|
|
124
|
-
var kross = crossProduct(v1, v2);
|
|
125
|
-
return cmp(kross, 0);
|
|
126
|
-
};
|
|
127
|
-
var length = function length2(v) {
|
|
128
|
-
return Math.sqrt(dotProduct(v, v));
|
|
129
|
-
};
|
|
130
|
-
var sineOfAngle = function sineOfAngle2(pShared, pBase, pAngle) {
|
|
131
|
-
var vBase = {
|
|
132
|
-
x: pBase.x - pShared.x,
|
|
133
|
-
y: pBase.y - pShared.y
|
|
134
|
-
};
|
|
135
|
-
var vAngle = {
|
|
136
|
-
x: pAngle.x - pShared.x,
|
|
137
|
-
y: pAngle.y - pShared.y
|
|
138
|
-
};
|
|
139
|
-
return crossProduct(vAngle, vBase) / length(vAngle) / length(vBase);
|
|
140
|
-
};
|
|
141
|
-
var cosineOfAngle = function cosineOfAngle2(pShared, pBase, pAngle) {
|
|
142
|
-
var vBase = {
|
|
143
|
-
x: pBase.x - pShared.x,
|
|
144
|
-
y: pBase.y - pShared.y
|
|
145
|
-
};
|
|
146
|
-
var vAngle = {
|
|
147
|
-
x: pAngle.x - pShared.x,
|
|
148
|
-
y: pAngle.y - pShared.y
|
|
149
|
-
};
|
|
150
|
-
return dotProduct(vAngle, vBase) / length(vAngle) / length(vBase);
|
|
151
|
-
};
|
|
152
|
-
var horizontalIntersection = function horizontalIntersection2(pt, v, y) {
|
|
153
|
-
if (v.y === 0)
|
|
154
|
-
return null;
|
|
155
|
-
return {
|
|
156
|
-
x: pt.x + v.x / v.y * (y - pt.y),
|
|
157
|
-
y
|
|
158
|
-
};
|
|
159
|
-
};
|
|
160
|
-
var verticalIntersection = function verticalIntersection2(pt, v, x) {
|
|
161
|
-
if (v.x === 0)
|
|
162
|
-
return null;
|
|
163
|
-
return {
|
|
164
|
-
x,
|
|
165
|
-
y: pt.y + v.y / v.x * (x - pt.x)
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
var intersection = function intersection2(pt1, v1, pt2, v2) {
|
|
169
|
-
if (v1.x === 0)
|
|
170
|
-
return verticalIntersection(pt2, v2, pt1.x);
|
|
171
|
-
if (v2.x === 0)
|
|
172
|
-
return verticalIntersection(pt1, v1, pt2.x);
|
|
173
|
-
if (v1.y === 0)
|
|
174
|
-
return horizontalIntersection(pt2, v2, pt1.y);
|
|
175
|
-
if (v2.y === 0)
|
|
176
|
-
return horizontalIntersection(pt1, v1, pt2.y);
|
|
177
|
-
var kross = crossProduct(v1, v2);
|
|
178
|
-
if (kross == 0)
|
|
179
|
-
return null;
|
|
180
|
-
var ve = {
|
|
181
|
-
x: pt2.x - pt1.x,
|
|
182
|
-
y: pt2.y - pt1.y
|
|
183
|
-
};
|
|
184
|
-
var d1 = crossProduct(ve, v1) / kross;
|
|
185
|
-
var d2 = crossProduct(ve, v2) / kross;
|
|
186
|
-
var x1 = pt1.x + d2 * v1.x, x2 = pt2.x + d1 * v2.x;
|
|
187
|
-
var y1 = pt1.y + d2 * v1.y, y2 = pt2.y + d1 * v2.y;
|
|
188
|
-
var x = (x1 + x2) / 2;
|
|
189
|
-
var y = (y1 + y2) / 2;
|
|
190
|
-
return {
|
|
191
|
-
x,
|
|
192
|
-
y
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
var SweepEvent = /* @__PURE__ */ function() {
|
|
196
|
-
_createClass(SweepEvent2, null, [{
|
|
197
|
-
key: "compare",
|
|
198
|
-
value: function compare(a, b) {
|
|
199
|
-
var ptCmp = SweepEvent2.comparePoints(a.point, b.point);
|
|
200
|
-
if (ptCmp !== 0)
|
|
201
|
-
return ptCmp;
|
|
202
|
-
if (a.point !== b.point)
|
|
203
|
-
a.link(b);
|
|
204
|
-
if (a.isLeft !== b.isLeft)
|
|
205
|
-
return a.isLeft ? 1 : -1;
|
|
206
|
-
return Segment.compare(a.segment, b.segment);
|
|
207
|
-
}
|
|
208
|
-
}, {
|
|
209
|
-
key: "comparePoints",
|
|
210
|
-
value: function comparePoints(aPt, bPt) {
|
|
211
|
-
if (aPt.x < bPt.x)
|
|
212
|
-
return -1;
|
|
213
|
-
if (aPt.x > bPt.x)
|
|
214
|
-
return 1;
|
|
215
|
-
if (aPt.y < bPt.y)
|
|
216
|
-
return -1;
|
|
217
|
-
if (aPt.y > bPt.y)
|
|
218
|
-
return 1;
|
|
219
|
-
return 0;
|
|
220
|
-
}
|
|
221
|
-
}]);
|
|
222
|
-
function SweepEvent2(point, isLeft) {
|
|
223
|
-
_classCallCheck(this, SweepEvent2);
|
|
224
|
-
if (point.events === void 0)
|
|
225
|
-
point.events = [this];
|
|
226
|
-
else
|
|
227
|
-
point.events.push(this);
|
|
228
|
-
this.point = point;
|
|
229
|
-
this.isLeft = isLeft;
|
|
230
|
-
}
|
|
231
|
-
_createClass(SweepEvent2, [{
|
|
232
|
-
key: "link",
|
|
233
|
-
value: function link(other) {
|
|
234
|
-
if (other.point === this.point) {
|
|
235
|
-
throw new Error("Tried to link already linked events");
|
|
236
|
-
}
|
|
237
|
-
var otherEvents = other.point.events;
|
|
238
|
-
for (var i = 0, iMax = otherEvents.length; i < iMax; i++) {
|
|
239
|
-
var evt = otherEvents[i];
|
|
240
|
-
this.point.events.push(evt);
|
|
241
|
-
evt.point = this.point;
|
|
242
|
-
}
|
|
243
|
-
this.checkForConsuming();
|
|
244
|
-
}
|
|
245
|
-
}, {
|
|
246
|
-
key: "checkForConsuming",
|
|
247
|
-
value: function checkForConsuming() {
|
|
248
|
-
var numEvents = this.point.events.length;
|
|
249
|
-
for (var i = 0; i < numEvents; i++) {
|
|
250
|
-
var evt1 = this.point.events[i];
|
|
251
|
-
if (evt1.segment.consumedBy !== void 0)
|
|
252
|
-
continue;
|
|
253
|
-
for (var j = i + 1; j < numEvents; j++) {
|
|
254
|
-
var evt2 = this.point.events[j];
|
|
255
|
-
if (evt2.consumedBy !== void 0)
|
|
256
|
-
continue;
|
|
257
|
-
if (evt1.otherSE.point.events !== evt2.otherSE.point.events)
|
|
258
|
-
continue;
|
|
259
|
-
evt1.segment.consume(evt2.segment);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}, {
|
|
264
|
-
key: "getAvailableLinkedEvents",
|
|
265
|
-
value: function getAvailableLinkedEvents() {
|
|
266
|
-
var events = [];
|
|
267
|
-
for (var i = 0, iMax = this.point.events.length; i < iMax; i++) {
|
|
268
|
-
var evt = this.point.events[i];
|
|
269
|
-
if (evt !== this && !evt.segment.ringOut && evt.segment.isInResult()) {
|
|
270
|
-
events.push(evt);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
return events;
|
|
274
|
-
}
|
|
275
|
-
}, {
|
|
276
|
-
key: "getLeftmostComparator",
|
|
277
|
-
value: function getLeftmostComparator(baseEvent) {
|
|
278
|
-
var _this = this;
|
|
279
|
-
var cache = /* @__PURE__ */ new Map();
|
|
280
|
-
var fillCache = function fillCache2(linkedEvent) {
|
|
281
|
-
var nextEvent = linkedEvent.otherSE;
|
|
282
|
-
cache.set(linkedEvent, {
|
|
283
|
-
sine: sineOfAngle(_this.point, baseEvent.point, nextEvent.point),
|
|
284
|
-
cosine: cosineOfAngle(_this.point, baseEvent.point, nextEvent.point)
|
|
285
|
-
});
|
|
286
|
-
};
|
|
287
|
-
return function(a, b) {
|
|
288
|
-
if (!cache.has(a))
|
|
289
|
-
fillCache(a);
|
|
290
|
-
if (!cache.has(b))
|
|
291
|
-
fillCache(b);
|
|
292
|
-
var _cache$get = cache.get(a), asine = _cache$get.sine, acosine = _cache$get.cosine;
|
|
293
|
-
var _cache$get2 = cache.get(b), bsine = _cache$get2.sine, bcosine = _cache$get2.cosine;
|
|
294
|
-
if (asine >= 0 && bsine >= 0) {
|
|
295
|
-
if (acosine < bcosine)
|
|
296
|
-
return 1;
|
|
297
|
-
if (acosine > bcosine)
|
|
298
|
-
return -1;
|
|
299
|
-
return 0;
|
|
300
|
-
}
|
|
301
|
-
if (asine < 0 && bsine < 0) {
|
|
302
|
-
if (acosine < bcosine)
|
|
303
|
-
return -1;
|
|
304
|
-
if (acosine > bcosine)
|
|
305
|
-
return 1;
|
|
306
|
-
return 0;
|
|
307
|
-
}
|
|
308
|
-
if (bsine < asine)
|
|
309
|
-
return -1;
|
|
310
|
-
if (bsine > asine)
|
|
311
|
-
return 1;
|
|
312
|
-
return 0;
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
}]);
|
|
316
|
-
return SweepEvent2;
|
|
317
|
-
}();
|
|
318
|
-
var segmentId = 0;
|
|
319
|
-
var Segment = /* @__PURE__ */ function() {
|
|
320
|
-
_createClass(Segment2, null, [{
|
|
321
|
-
key: "compare",
|
|
322
|
-
value: function compare(a, b) {
|
|
323
|
-
var alx = a.leftSE.point.x;
|
|
324
|
-
var blx = b.leftSE.point.x;
|
|
325
|
-
var arx = a.rightSE.point.x;
|
|
326
|
-
var brx = b.rightSE.point.x;
|
|
327
|
-
if (brx < alx)
|
|
328
|
-
return 1;
|
|
329
|
-
if (arx < blx)
|
|
330
|
-
return -1;
|
|
331
|
-
var aly = a.leftSE.point.y;
|
|
332
|
-
var bly = b.leftSE.point.y;
|
|
333
|
-
var ary = a.rightSE.point.y;
|
|
334
|
-
var bry = b.rightSE.point.y;
|
|
335
|
-
if (alx < blx) {
|
|
336
|
-
if (bly < aly && bly < ary)
|
|
337
|
-
return 1;
|
|
338
|
-
if (bly > aly && bly > ary)
|
|
339
|
-
return -1;
|
|
340
|
-
var aCmpBLeft = a.comparePoint(b.leftSE.point);
|
|
341
|
-
if (aCmpBLeft < 0)
|
|
342
|
-
return 1;
|
|
343
|
-
if (aCmpBLeft > 0)
|
|
344
|
-
return -1;
|
|
345
|
-
var bCmpARight = b.comparePoint(a.rightSE.point);
|
|
346
|
-
if (bCmpARight !== 0)
|
|
347
|
-
return bCmpARight;
|
|
348
|
-
return -1;
|
|
349
|
-
}
|
|
350
|
-
if (alx > blx) {
|
|
351
|
-
if (aly < bly && aly < bry)
|
|
352
|
-
return -1;
|
|
353
|
-
if (aly > bly && aly > bry)
|
|
354
|
-
return 1;
|
|
355
|
-
var bCmpALeft = b.comparePoint(a.leftSE.point);
|
|
356
|
-
if (bCmpALeft !== 0)
|
|
357
|
-
return bCmpALeft;
|
|
358
|
-
var aCmpBRight = a.comparePoint(b.rightSE.point);
|
|
359
|
-
if (aCmpBRight < 0)
|
|
360
|
-
return 1;
|
|
361
|
-
if (aCmpBRight > 0)
|
|
362
|
-
return -1;
|
|
363
|
-
return 1;
|
|
364
|
-
}
|
|
365
|
-
if (aly < bly)
|
|
366
|
-
return -1;
|
|
367
|
-
if (aly > bly)
|
|
368
|
-
return 1;
|
|
369
|
-
if (arx < brx) {
|
|
370
|
-
var _bCmpARight = b.comparePoint(a.rightSE.point);
|
|
371
|
-
if (_bCmpARight !== 0)
|
|
372
|
-
return _bCmpARight;
|
|
373
|
-
}
|
|
374
|
-
if (arx > brx) {
|
|
375
|
-
var _aCmpBRight = a.comparePoint(b.rightSE.point);
|
|
376
|
-
if (_aCmpBRight < 0)
|
|
377
|
-
return 1;
|
|
378
|
-
if (_aCmpBRight > 0)
|
|
379
|
-
return -1;
|
|
380
|
-
}
|
|
381
|
-
if (arx !== brx) {
|
|
382
|
-
var ay = ary - aly;
|
|
383
|
-
var ax = arx - alx;
|
|
384
|
-
var by = bry - bly;
|
|
385
|
-
var bx = brx - blx;
|
|
386
|
-
if (ay > ax && by < bx)
|
|
387
|
-
return 1;
|
|
388
|
-
if (ay < ax && by > bx)
|
|
389
|
-
return -1;
|
|
390
|
-
}
|
|
391
|
-
if (arx > brx)
|
|
392
|
-
return 1;
|
|
393
|
-
if (arx < brx)
|
|
394
|
-
return -1;
|
|
395
|
-
if (ary < bry)
|
|
396
|
-
return -1;
|
|
397
|
-
if (ary > bry)
|
|
398
|
-
return 1;
|
|
399
|
-
if (a.id < b.id)
|
|
400
|
-
return -1;
|
|
401
|
-
if (a.id > b.id)
|
|
402
|
-
return 1;
|
|
403
|
-
return 0;
|
|
404
|
-
}
|
|
405
|
-
}]);
|
|
406
|
-
function Segment2(leftSE, rightSE, rings, windings) {
|
|
407
|
-
_classCallCheck(this, Segment2);
|
|
408
|
-
this.id = ++segmentId;
|
|
409
|
-
this.leftSE = leftSE;
|
|
410
|
-
leftSE.segment = this;
|
|
411
|
-
leftSE.otherSE = rightSE;
|
|
412
|
-
this.rightSE = rightSE;
|
|
413
|
-
rightSE.segment = this;
|
|
414
|
-
rightSE.otherSE = leftSE;
|
|
415
|
-
this.rings = rings;
|
|
416
|
-
this.windings = windings;
|
|
417
|
-
}
|
|
418
|
-
_createClass(Segment2, [{
|
|
419
|
-
key: "replaceRightSE",
|
|
420
|
-
value: function replaceRightSE(newRightSE) {
|
|
421
|
-
this.rightSE = newRightSE;
|
|
422
|
-
this.rightSE.segment = this;
|
|
423
|
-
this.rightSE.otherSE = this.leftSE;
|
|
424
|
-
this.leftSE.otherSE = this.rightSE;
|
|
425
|
-
}
|
|
426
|
-
}, {
|
|
427
|
-
key: "bbox",
|
|
428
|
-
value: function bbox() {
|
|
429
|
-
var y1 = this.leftSE.point.y;
|
|
430
|
-
var y2 = this.rightSE.point.y;
|
|
431
|
-
return {
|
|
432
|
-
ll: {
|
|
433
|
-
x: this.leftSE.point.x,
|
|
434
|
-
y: y1 < y2 ? y1 : y2
|
|
435
|
-
},
|
|
436
|
-
ur: {
|
|
437
|
-
x: this.rightSE.point.x,
|
|
438
|
-
y: y1 > y2 ? y1 : y2
|
|
439
|
-
}
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
}, {
|
|
443
|
-
key: "vector",
|
|
444
|
-
value: function vector() {
|
|
445
|
-
return {
|
|
446
|
-
x: this.rightSE.point.x - this.leftSE.point.x,
|
|
447
|
-
y: this.rightSE.point.y - this.leftSE.point.y
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
}, {
|
|
451
|
-
key: "isAnEndpoint",
|
|
452
|
-
value: function isAnEndpoint(pt) {
|
|
453
|
-
return pt.x === this.leftSE.point.x && pt.y === this.leftSE.point.y || pt.x === this.rightSE.point.x && pt.y === this.rightSE.point.y;
|
|
454
|
-
}
|
|
455
|
-
}, {
|
|
456
|
-
key: "comparePoint",
|
|
457
|
-
value: function comparePoint(point) {
|
|
458
|
-
if (this.isAnEndpoint(point))
|
|
459
|
-
return 0;
|
|
460
|
-
var lPt = this.leftSE.point;
|
|
461
|
-
var rPt = this.rightSE.point;
|
|
462
|
-
var v = this.vector();
|
|
463
|
-
if (lPt.x === rPt.x) {
|
|
464
|
-
if (point.x === lPt.x)
|
|
465
|
-
return 0;
|
|
466
|
-
return point.x < lPt.x ? 1 : -1;
|
|
467
|
-
}
|
|
468
|
-
var yDist = (point.y - lPt.y) / v.y;
|
|
469
|
-
var xFromYDist = lPt.x + yDist * v.x;
|
|
470
|
-
if (point.x === xFromYDist)
|
|
471
|
-
return 0;
|
|
472
|
-
var xDist = (point.x - lPt.x) / v.x;
|
|
473
|
-
var yFromXDist = lPt.y + xDist * v.y;
|
|
474
|
-
if (point.y === yFromXDist)
|
|
475
|
-
return 0;
|
|
476
|
-
return point.y < yFromXDist ? -1 : 1;
|
|
477
|
-
}
|
|
478
|
-
}, {
|
|
479
|
-
key: "getIntersection",
|
|
480
|
-
value: function getIntersection(other) {
|
|
481
|
-
var tBbox = this.bbox();
|
|
482
|
-
var oBbox = other.bbox();
|
|
483
|
-
var bboxOverlap = getBboxOverlap(tBbox, oBbox);
|
|
484
|
-
if (bboxOverlap === null)
|
|
485
|
-
return null;
|
|
486
|
-
var tlp = this.leftSE.point;
|
|
487
|
-
var trp = this.rightSE.point;
|
|
488
|
-
var olp = other.leftSE.point;
|
|
489
|
-
var orp = other.rightSE.point;
|
|
490
|
-
var touchesOtherLSE = isInBbox(tBbox, olp) && this.comparePoint(olp) === 0;
|
|
491
|
-
var touchesThisLSE = isInBbox(oBbox, tlp) && other.comparePoint(tlp) === 0;
|
|
492
|
-
var touchesOtherRSE = isInBbox(tBbox, orp) && this.comparePoint(orp) === 0;
|
|
493
|
-
var touchesThisRSE = isInBbox(oBbox, trp) && other.comparePoint(trp) === 0;
|
|
494
|
-
if (touchesThisLSE && touchesOtherLSE) {
|
|
495
|
-
if (touchesThisRSE && !touchesOtherRSE)
|
|
496
|
-
return trp;
|
|
497
|
-
if (!touchesThisRSE && touchesOtherRSE)
|
|
498
|
-
return orp;
|
|
499
|
-
return null;
|
|
500
|
-
}
|
|
501
|
-
if (touchesThisLSE) {
|
|
502
|
-
if (touchesOtherRSE) {
|
|
503
|
-
if (tlp.x === orp.x && tlp.y === orp.y)
|
|
504
|
-
return null;
|
|
505
|
-
}
|
|
506
|
-
return tlp;
|
|
507
|
-
}
|
|
508
|
-
if (touchesOtherLSE) {
|
|
509
|
-
if (touchesThisRSE) {
|
|
510
|
-
if (trp.x === olp.x && trp.y === olp.y)
|
|
511
|
-
return null;
|
|
512
|
-
}
|
|
513
|
-
return olp;
|
|
514
|
-
}
|
|
515
|
-
if (touchesThisRSE && touchesOtherRSE)
|
|
516
|
-
return null;
|
|
517
|
-
if (touchesThisRSE)
|
|
518
|
-
return trp;
|
|
519
|
-
if (touchesOtherRSE)
|
|
520
|
-
return orp;
|
|
521
|
-
var pt = intersection(tlp, this.vector(), olp, other.vector());
|
|
522
|
-
if (pt === null)
|
|
523
|
-
return null;
|
|
524
|
-
if (!isInBbox(bboxOverlap, pt))
|
|
525
|
-
return null;
|
|
526
|
-
return rounder.round(pt.x, pt.y);
|
|
527
|
-
}
|
|
528
|
-
}, {
|
|
529
|
-
key: "split",
|
|
530
|
-
value: function split(point) {
|
|
531
|
-
var newEvents = [];
|
|
532
|
-
var alreadyLinked = point.events !== void 0;
|
|
533
|
-
var newLeftSE = new SweepEvent(point, true);
|
|
534
|
-
var newRightSE = new SweepEvent(point, false);
|
|
535
|
-
var oldRightSE = this.rightSE;
|
|
536
|
-
this.replaceRightSE(newRightSE);
|
|
537
|
-
newEvents.push(newRightSE);
|
|
538
|
-
newEvents.push(newLeftSE);
|
|
539
|
-
var newSeg = new Segment2(newLeftSE, oldRightSE, this.rings.slice(), this.windings.slice());
|
|
540
|
-
if (SweepEvent.comparePoints(newSeg.leftSE.point, newSeg.rightSE.point) > 0) {
|
|
541
|
-
newSeg.swapEvents();
|
|
542
|
-
}
|
|
543
|
-
if (SweepEvent.comparePoints(this.leftSE.point, this.rightSE.point) > 0) {
|
|
544
|
-
this.swapEvents();
|
|
545
|
-
}
|
|
546
|
-
if (alreadyLinked) {
|
|
547
|
-
newLeftSE.checkForConsuming();
|
|
548
|
-
newRightSE.checkForConsuming();
|
|
549
|
-
}
|
|
550
|
-
return newEvents;
|
|
551
|
-
}
|
|
552
|
-
}, {
|
|
553
|
-
key: "swapEvents",
|
|
554
|
-
value: function swapEvents() {
|
|
555
|
-
var tmpEvt = this.rightSE;
|
|
556
|
-
this.rightSE = this.leftSE;
|
|
557
|
-
this.leftSE = tmpEvt;
|
|
558
|
-
this.leftSE.isLeft = true;
|
|
559
|
-
this.rightSE.isLeft = false;
|
|
560
|
-
for (var i = 0, iMax = this.windings.length; i < iMax; i++) {
|
|
561
|
-
this.windings[i] *= -1;
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
}, {
|
|
565
|
-
key: "consume",
|
|
566
|
-
value: function consume(other) {
|
|
567
|
-
var consumer = this;
|
|
568
|
-
var consumee = other;
|
|
569
|
-
while (consumer.consumedBy) {
|
|
570
|
-
consumer = consumer.consumedBy;
|
|
571
|
-
}
|
|
572
|
-
while (consumee.consumedBy) {
|
|
573
|
-
consumee = consumee.consumedBy;
|
|
574
|
-
}
|
|
575
|
-
var cmp3 = Segment2.compare(consumer, consumee);
|
|
576
|
-
if (cmp3 === 0)
|
|
577
|
-
return;
|
|
578
|
-
if (cmp3 > 0) {
|
|
579
|
-
var tmp = consumer;
|
|
580
|
-
consumer = consumee;
|
|
581
|
-
consumee = tmp;
|
|
582
|
-
}
|
|
583
|
-
if (consumer.prev === consumee) {
|
|
584
|
-
var _tmp = consumer;
|
|
585
|
-
consumer = consumee;
|
|
586
|
-
consumee = _tmp;
|
|
587
|
-
}
|
|
588
|
-
for (var i = 0, iMax = consumee.rings.length; i < iMax; i++) {
|
|
589
|
-
var ring = consumee.rings[i];
|
|
590
|
-
var winding = consumee.windings[i];
|
|
591
|
-
var index2 = consumer.rings.indexOf(ring);
|
|
592
|
-
if (index2 === -1) {
|
|
593
|
-
consumer.rings.push(ring);
|
|
594
|
-
consumer.windings.push(winding);
|
|
595
|
-
} else
|
|
596
|
-
consumer.windings[index2] += winding;
|
|
597
|
-
}
|
|
598
|
-
consumee.rings = null;
|
|
599
|
-
consumee.windings = null;
|
|
600
|
-
consumee.consumedBy = consumer;
|
|
601
|
-
consumee.leftSE.consumedBy = consumer.leftSE;
|
|
602
|
-
consumee.rightSE.consumedBy = consumer.rightSE;
|
|
603
|
-
}
|
|
604
|
-
}, {
|
|
605
|
-
key: "prevInResult",
|
|
606
|
-
value: function prevInResult() {
|
|
607
|
-
if (this._prevInResult !== void 0)
|
|
608
|
-
return this._prevInResult;
|
|
609
|
-
if (!this.prev)
|
|
610
|
-
this._prevInResult = null;
|
|
611
|
-
else if (this.prev.isInResult())
|
|
612
|
-
this._prevInResult = this.prev;
|
|
613
|
-
else
|
|
614
|
-
this._prevInResult = this.prev.prevInResult();
|
|
615
|
-
return this._prevInResult;
|
|
616
|
-
}
|
|
617
|
-
}, {
|
|
618
|
-
key: "beforeState",
|
|
619
|
-
value: function beforeState() {
|
|
620
|
-
if (this._beforeState !== void 0)
|
|
621
|
-
return this._beforeState;
|
|
622
|
-
if (!this.prev)
|
|
623
|
-
this._beforeState = {
|
|
624
|
-
rings: [],
|
|
625
|
-
windings: [],
|
|
626
|
-
multiPolys: []
|
|
627
|
-
};
|
|
628
|
-
else {
|
|
629
|
-
var seg = this.prev.consumedBy || this.prev;
|
|
630
|
-
this._beforeState = seg.afterState();
|
|
631
|
-
}
|
|
632
|
-
return this._beforeState;
|
|
633
|
-
}
|
|
634
|
-
}, {
|
|
635
|
-
key: "afterState",
|
|
636
|
-
value: function afterState() {
|
|
637
|
-
if (this._afterState !== void 0)
|
|
638
|
-
return this._afterState;
|
|
639
|
-
var beforeState = this.beforeState();
|
|
640
|
-
this._afterState = {
|
|
641
|
-
rings: beforeState.rings.slice(0),
|
|
642
|
-
windings: beforeState.windings.slice(0),
|
|
643
|
-
multiPolys: []
|
|
644
|
-
};
|
|
645
|
-
var ringsAfter = this._afterState.rings;
|
|
646
|
-
var windingsAfter = this._afterState.windings;
|
|
647
|
-
var mpsAfter = this._afterState.multiPolys;
|
|
648
|
-
for (var i = 0, iMax = this.rings.length; i < iMax; i++) {
|
|
649
|
-
var ring = this.rings[i];
|
|
650
|
-
var winding = this.windings[i];
|
|
651
|
-
var index2 = ringsAfter.indexOf(ring);
|
|
652
|
-
if (index2 === -1) {
|
|
653
|
-
ringsAfter.push(ring);
|
|
654
|
-
windingsAfter.push(winding);
|
|
655
|
-
} else
|
|
656
|
-
windingsAfter[index2] += winding;
|
|
657
|
-
}
|
|
658
|
-
var polysAfter = [];
|
|
659
|
-
var polysExclude = [];
|
|
660
|
-
for (var _i = 0, _iMax = ringsAfter.length; _i < _iMax; _i++) {
|
|
661
|
-
if (windingsAfter[_i] === 0)
|
|
662
|
-
continue;
|
|
663
|
-
var _ring = ringsAfter[_i];
|
|
664
|
-
var poly = _ring.poly;
|
|
665
|
-
if (polysExclude.indexOf(poly) !== -1)
|
|
666
|
-
continue;
|
|
667
|
-
if (_ring.isExterior)
|
|
668
|
-
polysAfter.push(poly);
|
|
669
|
-
else {
|
|
670
|
-
if (polysExclude.indexOf(poly) === -1)
|
|
671
|
-
polysExclude.push(poly);
|
|
672
|
-
var _index = polysAfter.indexOf(_ring.poly);
|
|
673
|
-
if (_index !== -1)
|
|
674
|
-
polysAfter.splice(_index, 1);
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
for (var _i2 = 0, _iMax2 = polysAfter.length; _i2 < _iMax2; _i2++) {
|
|
678
|
-
var mp = polysAfter[_i2].multiPoly;
|
|
679
|
-
if (mpsAfter.indexOf(mp) === -1)
|
|
680
|
-
mpsAfter.push(mp);
|
|
681
|
-
}
|
|
682
|
-
return this._afterState;
|
|
683
|
-
}
|
|
684
|
-
}, {
|
|
685
|
-
key: "isInResult",
|
|
686
|
-
value: function isInResult() {
|
|
687
|
-
if (this.consumedBy)
|
|
688
|
-
return false;
|
|
689
|
-
if (this._isInResult !== void 0)
|
|
690
|
-
return this._isInResult;
|
|
691
|
-
var mpsBefore = this.beforeState().multiPolys;
|
|
692
|
-
var mpsAfter = this.afterState().multiPolys;
|
|
693
|
-
switch (operation.type) {
|
|
694
|
-
case "union": {
|
|
695
|
-
var noBefores = mpsBefore.length === 0;
|
|
696
|
-
var noAfters = mpsAfter.length === 0;
|
|
697
|
-
this._isInResult = noBefores !== noAfters;
|
|
698
|
-
break;
|
|
699
|
-
}
|
|
700
|
-
case "intersection": {
|
|
701
|
-
var least;
|
|
702
|
-
var most;
|
|
703
|
-
if (mpsBefore.length < mpsAfter.length) {
|
|
704
|
-
least = mpsBefore.length;
|
|
705
|
-
most = mpsAfter.length;
|
|
706
|
-
} else {
|
|
707
|
-
least = mpsAfter.length;
|
|
708
|
-
most = mpsBefore.length;
|
|
709
|
-
}
|
|
710
|
-
this._isInResult = most === operation.numMultiPolys && least < most;
|
|
711
|
-
break;
|
|
712
|
-
}
|
|
713
|
-
case "xor": {
|
|
714
|
-
var diff = Math.abs(mpsBefore.length - mpsAfter.length);
|
|
715
|
-
this._isInResult = diff % 2 === 1;
|
|
716
|
-
break;
|
|
717
|
-
}
|
|
718
|
-
case "difference": {
|
|
719
|
-
var isJustSubject = function isJustSubject2(mps) {
|
|
720
|
-
return mps.length === 1 && mps[0].isSubject;
|
|
721
|
-
};
|
|
722
|
-
this._isInResult = isJustSubject(mpsBefore) !== isJustSubject(mpsAfter);
|
|
723
|
-
break;
|
|
724
|
-
}
|
|
725
|
-
default:
|
|
726
|
-
throw new Error("Unrecognized operation type found ".concat(operation.type));
|
|
727
|
-
}
|
|
728
|
-
return this._isInResult;
|
|
729
|
-
}
|
|
730
|
-
}], [{
|
|
731
|
-
key: "fromRing",
|
|
732
|
-
value: function fromRing(pt1, pt2, ring) {
|
|
733
|
-
var leftPt, rightPt, winding;
|
|
734
|
-
var cmpPts = SweepEvent.comparePoints(pt1, pt2);
|
|
735
|
-
if (cmpPts < 0) {
|
|
736
|
-
leftPt = pt1;
|
|
737
|
-
rightPt = pt2;
|
|
738
|
-
winding = 1;
|
|
739
|
-
} else if (cmpPts > 0) {
|
|
740
|
-
leftPt = pt2;
|
|
741
|
-
rightPt = pt1;
|
|
742
|
-
winding = -1;
|
|
743
|
-
} else
|
|
744
|
-
throw new Error("Tried to create degenerate segment at [".concat(pt1.x, ", ").concat(pt1.y, "]"));
|
|
745
|
-
var leftSE = new SweepEvent(leftPt, true);
|
|
746
|
-
var rightSE = new SweepEvent(rightPt, false);
|
|
747
|
-
return new Segment2(leftSE, rightSE, [ring], [winding]);
|
|
748
|
-
}
|
|
749
|
-
}]);
|
|
750
|
-
return Segment2;
|
|
751
|
-
}();
|
|
752
|
-
var RingIn = /* @__PURE__ */ function() {
|
|
753
|
-
function RingIn2(geomRing, poly, isExterior) {
|
|
754
|
-
_classCallCheck(this, RingIn2);
|
|
755
|
-
if (!Array.isArray(geomRing) || geomRing.length === 0) {
|
|
756
|
-
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
757
|
-
}
|
|
758
|
-
this.poly = poly;
|
|
759
|
-
this.isExterior = isExterior;
|
|
760
|
-
this.segments = [];
|
|
761
|
-
if (typeof geomRing[0][0] !== "number" || typeof geomRing[0][1] !== "number") {
|
|
762
|
-
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
763
|
-
}
|
|
764
|
-
var firstPoint = rounder.round(geomRing[0][0], geomRing[0][1]);
|
|
765
|
-
this.bbox = {
|
|
766
|
-
ll: {
|
|
767
|
-
x: firstPoint.x,
|
|
768
|
-
y: firstPoint.y
|
|
769
|
-
},
|
|
770
|
-
ur: {
|
|
771
|
-
x: firstPoint.x,
|
|
772
|
-
y: firstPoint.y
|
|
773
|
-
}
|
|
774
|
-
};
|
|
775
|
-
var prevPoint = firstPoint;
|
|
776
|
-
for (var i = 1, iMax = geomRing.length; i < iMax; i++) {
|
|
777
|
-
if (typeof geomRing[i][0] !== "number" || typeof geomRing[i][1] !== "number") {
|
|
778
|
-
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
779
|
-
}
|
|
780
|
-
var point = rounder.round(geomRing[i][0], geomRing[i][1]);
|
|
781
|
-
if (point.x === prevPoint.x && point.y === prevPoint.y)
|
|
782
|
-
continue;
|
|
783
|
-
this.segments.push(Segment.fromRing(prevPoint, point, this));
|
|
784
|
-
if (point.x < this.bbox.ll.x)
|
|
785
|
-
this.bbox.ll.x = point.x;
|
|
786
|
-
if (point.y < this.bbox.ll.y)
|
|
787
|
-
this.bbox.ll.y = point.y;
|
|
788
|
-
if (point.x > this.bbox.ur.x)
|
|
789
|
-
this.bbox.ur.x = point.x;
|
|
790
|
-
if (point.y > this.bbox.ur.y)
|
|
791
|
-
this.bbox.ur.y = point.y;
|
|
792
|
-
prevPoint = point;
|
|
793
|
-
}
|
|
794
|
-
if (firstPoint.x !== prevPoint.x || firstPoint.y !== prevPoint.y) {
|
|
795
|
-
this.segments.push(Segment.fromRing(prevPoint, firstPoint, this));
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
_createClass(RingIn2, [{
|
|
799
|
-
key: "getSweepEvents",
|
|
800
|
-
value: function getSweepEvents() {
|
|
801
|
-
var sweepEvents = [];
|
|
802
|
-
for (var i = 0, iMax = this.segments.length; i < iMax; i++) {
|
|
803
|
-
var segment = this.segments[i];
|
|
804
|
-
sweepEvents.push(segment.leftSE);
|
|
805
|
-
sweepEvents.push(segment.rightSE);
|
|
806
|
-
}
|
|
807
|
-
return sweepEvents;
|
|
808
|
-
}
|
|
809
|
-
}]);
|
|
810
|
-
return RingIn2;
|
|
811
|
-
}();
|
|
812
|
-
var PolyIn = /* @__PURE__ */ function() {
|
|
813
|
-
function PolyIn2(geomPoly, multiPoly) {
|
|
814
|
-
_classCallCheck(this, PolyIn2);
|
|
815
|
-
if (!Array.isArray(geomPoly)) {
|
|
816
|
-
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
817
|
-
}
|
|
818
|
-
this.exteriorRing = new RingIn(geomPoly[0], this, true);
|
|
819
|
-
this.bbox = {
|
|
820
|
-
ll: {
|
|
821
|
-
x: this.exteriorRing.bbox.ll.x,
|
|
822
|
-
y: this.exteriorRing.bbox.ll.y
|
|
823
|
-
},
|
|
824
|
-
ur: {
|
|
825
|
-
x: this.exteriorRing.bbox.ur.x,
|
|
826
|
-
y: this.exteriorRing.bbox.ur.y
|
|
827
|
-
}
|
|
828
|
-
};
|
|
829
|
-
this.interiorRings = [];
|
|
830
|
-
for (var i = 1, iMax = geomPoly.length; i < iMax; i++) {
|
|
831
|
-
var ring = new RingIn(geomPoly[i], this, false);
|
|
832
|
-
if (ring.bbox.ll.x < this.bbox.ll.x)
|
|
833
|
-
this.bbox.ll.x = ring.bbox.ll.x;
|
|
834
|
-
if (ring.bbox.ll.y < this.bbox.ll.y)
|
|
835
|
-
this.bbox.ll.y = ring.bbox.ll.y;
|
|
836
|
-
if (ring.bbox.ur.x > this.bbox.ur.x)
|
|
837
|
-
this.bbox.ur.x = ring.bbox.ur.x;
|
|
838
|
-
if (ring.bbox.ur.y > this.bbox.ur.y)
|
|
839
|
-
this.bbox.ur.y = ring.bbox.ur.y;
|
|
840
|
-
this.interiorRings.push(ring);
|
|
841
|
-
}
|
|
842
|
-
this.multiPoly = multiPoly;
|
|
843
|
-
}
|
|
844
|
-
_createClass(PolyIn2, [{
|
|
845
|
-
key: "getSweepEvents",
|
|
846
|
-
value: function getSweepEvents() {
|
|
847
|
-
var sweepEvents = this.exteriorRing.getSweepEvents();
|
|
848
|
-
for (var i = 0, iMax = this.interiorRings.length; i < iMax; i++) {
|
|
849
|
-
var ringSweepEvents = this.interiorRings[i].getSweepEvents();
|
|
850
|
-
for (var j = 0, jMax = ringSweepEvents.length; j < jMax; j++) {
|
|
851
|
-
sweepEvents.push(ringSweepEvents[j]);
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
return sweepEvents;
|
|
855
|
-
}
|
|
856
|
-
}]);
|
|
857
|
-
return PolyIn2;
|
|
858
|
-
}();
|
|
859
|
-
var MultiPolyIn = /* @__PURE__ */ function() {
|
|
860
|
-
function MultiPolyIn2(geom, isSubject) {
|
|
861
|
-
_classCallCheck(this, MultiPolyIn2);
|
|
862
|
-
if (!Array.isArray(geom)) {
|
|
863
|
-
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
864
|
-
}
|
|
865
|
-
try {
|
|
866
|
-
if (typeof geom[0][0][0] === "number")
|
|
867
|
-
geom = [geom];
|
|
868
|
-
} catch (ex) {
|
|
869
|
-
}
|
|
870
|
-
this.polys = [];
|
|
871
|
-
this.bbox = {
|
|
872
|
-
ll: {
|
|
873
|
-
x: Number.POSITIVE_INFINITY,
|
|
874
|
-
y: Number.POSITIVE_INFINITY
|
|
875
|
-
},
|
|
876
|
-
ur: {
|
|
877
|
-
x: Number.NEGATIVE_INFINITY,
|
|
878
|
-
y: Number.NEGATIVE_INFINITY
|
|
879
|
-
}
|
|
880
|
-
};
|
|
881
|
-
for (var i = 0, iMax = geom.length; i < iMax; i++) {
|
|
882
|
-
var poly = new PolyIn(geom[i], this);
|
|
883
|
-
if (poly.bbox.ll.x < this.bbox.ll.x)
|
|
884
|
-
this.bbox.ll.x = poly.bbox.ll.x;
|
|
885
|
-
if (poly.bbox.ll.y < this.bbox.ll.y)
|
|
886
|
-
this.bbox.ll.y = poly.bbox.ll.y;
|
|
887
|
-
if (poly.bbox.ur.x > this.bbox.ur.x)
|
|
888
|
-
this.bbox.ur.x = poly.bbox.ur.x;
|
|
889
|
-
if (poly.bbox.ur.y > this.bbox.ur.y)
|
|
890
|
-
this.bbox.ur.y = poly.bbox.ur.y;
|
|
891
|
-
this.polys.push(poly);
|
|
892
|
-
}
|
|
893
|
-
this.isSubject = isSubject;
|
|
894
|
-
}
|
|
895
|
-
_createClass(MultiPolyIn2, [{
|
|
896
|
-
key: "getSweepEvents",
|
|
897
|
-
value: function getSweepEvents() {
|
|
898
|
-
var sweepEvents = [];
|
|
899
|
-
for (var i = 0, iMax = this.polys.length; i < iMax; i++) {
|
|
900
|
-
var polySweepEvents = this.polys[i].getSweepEvents();
|
|
901
|
-
for (var j = 0, jMax = polySweepEvents.length; j < jMax; j++) {
|
|
902
|
-
sweepEvents.push(polySweepEvents[j]);
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
return sweepEvents;
|
|
906
|
-
}
|
|
907
|
-
}]);
|
|
908
|
-
return MultiPolyIn2;
|
|
909
|
-
}();
|
|
910
|
-
var RingOut = /* @__PURE__ */ function() {
|
|
911
|
-
_createClass(RingOut2, null, [{
|
|
912
|
-
key: "factory",
|
|
913
|
-
value: function factory(allSegments) {
|
|
914
|
-
var ringsOut = [];
|
|
915
|
-
for (var i = 0, iMax = allSegments.length; i < iMax; i++) {
|
|
916
|
-
var segment = allSegments[i];
|
|
917
|
-
if (!segment.isInResult() || segment.ringOut)
|
|
918
|
-
continue;
|
|
919
|
-
var prevEvent = null;
|
|
920
|
-
var event = segment.leftSE;
|
|
921
|
-
var nextEvent = segment.rightSE;
|
|
922
|
-
var events = [event];
|
|
923
|
-
var startingPoint = event.point;
|
|
924
|
-
var intersectionLEs = [];
|
|
925
|
-
while (true) {
|
|
926
|
-
prevEvent = event;
|
|
927
|
-
event = nextEvent;
|
|
928
|
-
events.push(event);
|
|
929
|
-
if (event.point === startingPoint)
|
|
930
|
-
break;
|
|
931
|
-
while (true) {
|
|
932
|
-
var availableLEs = event.getAvailableLinkedEvents();
|
|
933
|
-
if (availableLEs.length === 0) {
|
|
934
|
-
var firstPt = events[0].point;
|
|
935
|
-
var lastPt = events[events.length - 1].point;
|
|
936
|
-
throw new Error("Unable to complete output ring starting at [".concat(firstPt.x, ",") + " ".concat(firstPt.y, "]. Last matching segment found ends at") + " [".concat(lastPt.x, ", ").concat(lastPt.y, "]."));
|
|
937
|
-
}
|
|
938
|
-
if (availableLEs.length === 1) {
|
|
939
|
-
nextEvent = availableLEs[0].otherSE;
|
|
940
|
-
break;
|
|
941
|
-
}
|
|
942
|
-
var indexLE = null;
|
|
943
|
-
for (var j = 0, jMax = intersectionLEs.length; j < jMax; j++) {
|
|
944
|
-
if (intersectionLEs[j].point === event.point) {
|
|
945
|
-
indexLE = j;
|
|
946
|
-
break;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
if (indexLE !== null) {
|
|
950
|
-
var intersectionLE = intersectionLEs.splice(indexLE)[0];
|
|
951
|
-
var ringEvents = events.splice(intersectionLE.index);
|
|
952
|
-
ringEvents.unshift(ringEvents[0].otherSE);
|
|
953
|
-
ringsOut.push(new RingOut2(ringEvents.reverse()));
|
|
954
|
-
continue;
|
|
955
|
-
}
|
|
956
|
-
intersectionLEs.push({
|
|
957
|
-
index: events.length,
|
|
958
|
-
point: event.point
|
|
959
|
-
});
|
|
960
|
-
var comparator = event.getLeftmostComparator(prevEvent);
|
|
961
|
-
nextEvent = availableLEs.sort(comparator)[0].otherSE;
|
|
962
|
-
break;
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
ringsOut.push(new RingOut2(events));
|
|
966
|
-
}
|
|
967
|
-
return ringsOut;
|
|
968
|
-
}
|
|
969
|
-
}]);
|
|
970
|
-
function RingOut2(events) {
|
|
971
|
-
_classCallCheck(this, RingOut2);
|
|
972
|
-
this.events = events;
|
|
973
|
-
for (var i = 0, iMax = events.length; i < iMax; i++) {
|
|
974
|
-
events[i].segment.ringOut = this;
|
|
975
|
-
}
|
|
976
|
-
this.poly = null;
|
|
977
|
-
}
|
|
978
|
-
_createClass(RingOut2, [{
|
|
979
|
-
key: "getGeom",
|
|
980
|
-
value: function getGeom() {
|
|
981
|
-
var prevPt = this.events[0].point;
|
|
982
|
-
var points = [prevPt];
|
|
983
|
-
for (var i = 1, iMax = this.events.length - 1; i < iMax; i++) {
|
|
984
|
-
var _pt = this.events[i].point;
|
|
985
|
-
var _nextPt = this.events[i + 1].point;
|
|
986
|
-
if (compareVectorAngles(_pt, prevPt, _nextPt) === 0)
|
|
987
|
-
continue;
|
|
988
|
-
points.push(_pt);
|
|
989
|
-
prevPt = _pt;
|
|
990
|
-
}
|
|
991
|
-
if (points.length === 1)
|
|
992
|
-
return null;
|
|
993
|
-
var pt = points[0];
|
|
994
|
-
var nextPt = points[1];
|
|
995
|
-
if (compareVectorAngles(pt, prevPt, nextPt) === 0)
|
|
996
|
-
points.shift();
|
|
997
|
-
points.push(points[0]);
|
|
998
|
-
var step = this.isExteriorRing() ? 1 : -1;
|
|
999
|
-
var iStart = this.isExteriorRing() ? 0 : points.length - 1;
|
|
1000
|
-
var iEnd = this.isExteriorRing() ? points.length : -1;
|
|
1001
|
-
var orderedPoints = [];
|
|
1002
|
-
for (var _i = iStart; _i != iEnd; _i += step) {
|
|
1003
|
-
orderedPoints.push([points[_i].x, points[_i].y]);
|
|
1004
|
-
}
|
|
1005
|
-
return orderedPoints;
|
|
1006
|
-
}
|
|
1007
|
-
}, {
|
|
1008
|
-
key: "isExteriorRing",
|
|
1009
|
-
value: function isExteriorRing() {
|
|
1010
|
-
if (this._isExteriorRing === void 0) {
|
|
1011
|
-
var enclosing = this.enclosingRing();
|
|
1012
|
-
this._isExteriorRing = enclosing ? !enclosing.isExteriorRing() : true;
|
|
1013
|
-
}
|
|
1014
|
-
return this._isExteriorRing;
|
|
1015
|
-
}
|
|
1016
|
-
}, {
|
|
1017
|
-
key: "enclosingRing",
|
|
1018
|
-
value: function enclosingRing() {
|
|
1019
|
-
if (this._enclosingRing === void 0) {
|
|
1020
|
-
this._enclosingRing = this._calcEnclosingRing();
|
|
1021
|
-
}
|
|
1022
|
-
return this._enclosingRing;
|
|
1023
|
-
}
|
|
1024
|
-
}, {
|
|
1025
|
-
key: "_calcEnclosingRing",
|
|
1026
|
-
value: function _calcEnclosingRing() {
|
|
1027
|
-
var leftMostEvt = this.events[0];
|
|
1028
|
-
for (var i = 1, iMax = this.events.length; i < iMax; i++) {
|
|
1029
|
-
var evt = this.events[i];
|
|
1030
|
-
if (SweepEvent.compare(leftMostEvt, evt) > 0)
|
|
1031
|
-
leftMostEvt = evt;
|
|
1032
|
-
}
|
|
1033
|
-
var prevSeg = leftMostEvt.segment.prevInResult();
|
|
1034
|
-
var prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
|
|
1035
|
-
while (true) {
|
|
1036
|
-
if (!prevSeg)
|
|
1037
|
-
return null;
|
|
1038
|
-
if (!prevPrevSeg)
|
|
1039
|
-
return prevSeg.ringOut;
|
|
1040
|
-
if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
|
|
1041
|
-
if (prevPrevSeg.ringOut.enclosingRing() !== prevSeg.ringOut) {
|
|
1042
|
-
return prevSeg.ringOut;
|
|
1043
|
-
} else
|
|
1044
|
-
return prevSeg.ringOut.enclosingRing();
|
|
1045
|
-
}
|
|
1046
|
-
prevSeg = prevPrevSeg.prevInResult();
|
|
1047
|
-
prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
}]);
|
|
1051
|
-
return RingOut2;
|
|
1052
|
-
}();
|
|
1053
|
-
var PolyOut = /* @__PURE__ */ function() {
|
|
1054
|
-
function PolyOut2(exteriorRing) {
|
|
1055
|
-
_classCallCheck(this, PolyOut2);
|
|
1056
|
-
this.exteriorRing = exteriorRing;
|
|
1057
|
-
exteriorRing.poly = this;
|
|
1058
|
-
this.interiorRings = [];
|
|
1059
|
-
}
|
|
1060
|
-
_createClass(PolyOut2, [{
|
|
1061
|
-
key: "addInterior",
|
|
1062
|
-
value: function addInterior(ring) {
|
|
1063
|
-
this.interiorRings.push(ring);
|
|
1064
|
-
ring.poly = this;
|
|
1065
|
-
}
|
|
1066
|
-
}, {
|
|
1067
|
-
key: "getGeom",
|
|
1068
|
-
value: function getGeom() {
|
|
1069
|
-
var geom = [this.exteriorRing.getGeom()];
|
|
1070
|
-
if (geom[0] === null)
|
|
1071
|
-
return null;
|
|
1072
|
-
for (var i = 0, iMax = this.interiorRings.length; i < iMax; i++) {
|
|
1073
|
-
var ringGeom = this.interiorRings[i].getGeom();
|
|
1074
|
-
if (ringGeom === null)
|
|
1075
|
-
continue;
|
|
1076
|
-
geom.push(ringGeom);
|
|
1077
|
-
}
|
|
1078
|
-
return geom;
|
|
1079
|
-
}
|
|
1080
|
-
}]);
|
|
1081
|
-
return PolyOut2;
|
|
1082
|
-
}();
|
|
1083
|
-
var MultiPolyOut = /* @__PURE__ */ function() {
|
|
1084
|
-
function MultiPolyOut2(rings) {
|
|
1085
|
-
_classCallCheck(this, MultiPolyOut2);
|
|
1086
|
-
this.rings = rings;
|
|
1087
|
-
this.polys = this._composePolys(rings);
|
|
1088
|
-
}
|
|
1089
|
-
_createClass(MultiPolyOut2, [{
|
|
1090
|
-
key: "getGeom",
|
|
1091
|
-
value: function getGeom() {
|
|
1092
|
-
var geom = [];
|
|
1093
|
-
for (var i = 0, iMax = this.polys.length; i < iMax; i++) {
|
|
1094
|
-
var polyGeom = this.polys[i].getGeom();
|
|
1095
|
-
if (polyGeom === null)
|
|
1096
|
-
continue;
|
|
1097
|
-
geom.push(polyGeom);
|
|
1098
|
-
}
|
|
1099
|
-
return geom;
|
|
1100
|
-
}
|
|
1101
|
-
}, {
|
|
1102
|
-
key: "_composePolys",
|
|
1103
|
-
value: function _composePolys(rings) {
|
|
1104
|
-
var polys = [];
|
|
1105
|
-
for (var i = 0, iMax = rings.length; i < iMax; i++) {
|
|
1106
|
-
var ring = rings[i];
|
|
1107
|
-
if (ring.poly)
|
|
1108
|
-
continue;
|
|
1109
|
-
if (ring.isExteriorRing())
|
|
1110
|
-
polys.push(new PolyOut(ring));
|
|
1111
|
-
else {
|
|
1112
|
-
var enclosingRing = ring.enclosingRing();
|
|
1113
|
-
if (!enclosingRing.poly)
|
|
1114
|
-
polys.push(new PolyOut(enclosingRing));
|
|
1115
|
-
enclosingRing.poly.addInterior(ring);
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
return polys;
|
|
1119
|
-
}
|
|
1120
|
-
}]);
|
|
1121
|
-
return MultiPolyOut2;
|
|
1122
|
-
}();
|
|
1123
|
-
var SweepLine = /* @__PURE__ */ function() {
|
|
1124
|
-
function SweepLine2(queue) {
|
|
1125
|
-
var comparator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Segment.compare;
|
|
1126
|
-
_classCallCheck(this, SweepLine2);
|
|
1127
|
-
this.queue = queue;
|
|
1128
|
-
this.tree = new Tree(comparator);
|
|
1129
|
-
this.segments = [];
|
|
1130
|
-
}
|
|
1131
|
-
_createClass(SweepLine2, [{
|
|
1132
|
-
key: "process",
|
|
1133
|
-
value: function process2(event) {
|
|
1134
|
-
var segment = event.segment;
|
|
1135
|
-
var newEvents = [];
|
|
1136
|
-
if (event.consumedBy) {
|
|
1137
|
-
if (event.isLeft)
|
|
1138
|
-
this.queue.remove(event.otherSE);
|
|
1139
|
-
else
|
|
1140
|
-
this.tree.remove(segment);
|
|
1141
|
-
return newEvents;
|
|
1142
|
-
}
|
|
1143
|
-
var node = event.isLeft ? this.tree.insert(segment) : this.tree.find(segment);
|
|
1144
|
-
if (!node)
|
|
1145
|
-
throw new Error("Unable to find segment #".concat(segment.id, " ") + "[".concat(segment.leftSE.point.x, ", ").concat(segment.leftSE.point.y, "] -> ") + "[".concat(segment.rightSE.point.x, ", ").concat(segment.rightSE.point.y, "] ") + "in SweepLine tree. Please submit a bug report.");
|
|
1146
|
-
var prevNode = node;
|
|
1147
|
-
var nextNode = node;
|
|
1148
|
-
var prevSeg = void 0;
|
|
1149
|
-
var nextSeg = void 0;
|
|
1150
|
-
while (prevSeg === void 0) {
|
|
1151
|
-
prevNode = this.tree.prev(prevNode);
|
|
1152
|
-
if (prevNode === null)
|
|
1153
|
-
prevSeg = null;
|
|
1154
|
-
else if (prevNode.key.consumedBy === void 0)
|
|
1155
|
-
prevSeg = prevNode.key;
|
|
1156
|
-
}
|
|
1157
|
-
while (nextSeg === void 0) {
|
|
1158
|
-
nextNode = this.tree.next(nextNode);
|
|
1159
|
-
if (nextNode === null)
|
|
1160
|
-
nextSeg = null;
|
|
1161
|
-
else if (nextNode.key.consumedBy === void 0)
|
|
1162
|
-
nextSeg = nextNode.key;
|
|
1163
|
-
}
|
|
1164
|
-
if (event.isLeft) {
|
|
1165
|
-
var prevMySplitter = null;
|
|
1166
|
-
if (prevSeg) {
|
|
1167
|
-
var prevInter = prevSeg.getIntersection(segment);
|
|
1168
|
-
if (prevInter !== null) {
|
|
1169
|
-
if (!segment.isAnEndpoint(prevInter))
|
|
1170
|
-
prevMySplitter = prevInter;
|
|
1171
|
-
if (!prevSeg.isAnEndpoint(prevInter)) {
|
|
1172
|
-
var newEventsFromSplit = this._splitSafely(prevSeg, prevInter);
|
|
1173
|
-
for (var i = 0, iMax = newEventsFromSplit.length; i < iMax; i++) {
|
|
1174
|
-
newEvents.push(newEventsFromSplit[i]);
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
var nextMySplitter = null;
|
|
1180
|
-
if (nextSeg) {
|
|
1181
|
-
var nextInter = nextSeg.getIntersection(segment);
|
|
1182
|
-
if (nextInter !== null) {
|
|
1183
|
-
if (!segment.isAnEndpoint(nextInter))
|
|
1184
|
-
nextMySplitter = nextInter;
|
|
1185
|
-
if (!nextSeg.isAnEndpoint(nextInter)) {
|
|
1186
|
-
var _newEventsFromSplit = this._splitSafely(nextSeg, nextInter);
|
|
1187
|
-
for (var _i = 0, _iMax = _newEventsFromSplit.length; _i < _iMax; _i++) {
|
|
1188
|
-
newEvents.push(_newEventsFromSplit[_i]);
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
if (prevMySplitter !== null || nextMySplitter !== null) {
|
|
1194
|
-
var mySplitter = null;
|
|
1195
|
-
if (prevMySplitter === null)
|
|
1196
|
-
mySplitter = nextMySplitter;
|
|
1197
|
-
else if (nextMySplitter === null)
|
|
1198
|
-
mySplitter = prevMySplitter;
|
|
1199
|
-
else {
|
|
1200
|
-
var cmpSplitters = SweepEvent.comparePoints(prevMySplitter, nextMySplitter);
|
|
1201
|
-
mySplitter = cmpSplitters <= 0 ? prevMySplitter : nextMySplitter;
|
|
1202
|
-
}
|
|
1203
|
-
this.queue.remove(segment.rightSE);
|
|
1204
|
-
newEvents.push(segment.rightSE);
|
|
1205
|
-
var _newEventsFromSplit2 = segment.split(mySplitter);
|
|
1206
|
-
for (var _i2 = 0, _iMax2 = _newEventsFromSplit2.length; _i2 < _iMax2; _i2++) {
|
|
1207
|
-
newEvents.push(_newEventsFromSplit2[_i2]);
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
if (newEvents.length > 0) {
|
|
1211
|
-
this.tree.remove(segment);
|
|
1212
|
-
newEvents.push(event);
|
|
1213
|
-
} else {
|
|
1214
|
-
this.segments.push(segment);
|
|
1215
|
-
segment.prev = prevSeg;
|
|
1216
|
-
}
|
|
1217
|
-
} else {
|
|
1218
|
-
if (prevSeg && nextSeg) {
|
|
1219
|
-
var inter = prevSeg.getIntersection(nextSeg);
|
|
1220
|
-
if (inter !== null) {
|
|
1221
|
-
if (!prevSeg.isAnEndpoint(inter)) {
|
|
1222
|
-
var _newEventsFromSplit3 = this._splitSafely(prevSeg, inter);
|
|
1223
|
-
for (var _i3 = 0, _iMax3 = _newEventsFromSplit3.length; _i3 < _iMax3; _i3++) {
|
|
1224
|
-
newEvents.push(_newEventsFromSplit3[_i3]);
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
if (!nextSeg.isAnEndpoint(inter)) {
|
|
1228
|
-
var _newEventsFromSplit4 = this._splitSafely(nextSeg, inter);
|
|
1229
|
-
for (var _i4 = 0, _iMax4 = _newEventsFromSplit4.length; _i4 < _iMax4; _i4++) {
|
|
1230
|
-
newEvents.push(_newEventsFromSplit4[_i4]);
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
this.tree.remove(segment);
|
|
1236
|
-
}
|
|
1237
|
-
return newEvents;
|
|
1238
|
-
}
|
|
1239
|
-
}, {
|
|
1240
|
-
key: "_splitSafely",
|
|
1241
|
-
value: function _splitSafely(seg, pt) {
|
|
1242
|
-
this.tree.remove(seg);
|
|
1243
|
-
var rightSE = seg.rightSE;
|
|
1244
|
-
this.queue.remove(rightSE);
|
|
1245
|
-
var newEvents = seg.split(pt);
|
|
1246
|
-
newEvents.push(rightSE);
|
|
1247
|
-
if (seg.consumedBy === void 0)
|
|
1248
|
-
this.tree.insert(seg);
|
|
1249
|
-
return newEvents;
|
|
1250
|
-
}
|
|
1251
|
-
}]);
|
|
1252
|
-
return SweepLine2;
|
|
1253
|
-
}();
|
|
1254
|
-
var POLYGON_CLIPPING_MAX_QUEUE_SIZE = typeof process !== "undefined" && {}.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6;
|
|
1255
|
-
var POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS = typeof process !== "undefined" && {}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
|
|
1256
|
-
var Operation = /* @__PURE__ */ function() {
|
|
1257
|
-
function Operation2() {
|
|
1258
|
-
_classCallCheck(this, Operation2);
|
|
1259
|
-
}
|
|
1260
|
-
_createClass(Operation2, [{
|
|
1261
|
-
key: "run",
|
|
1262
|
-
value: function run(type, geom, moreGeoms) {
|
|
1263
|
-
operation.type = type;
|
|
1264
|
-
rounder.reset();
|
|
1265
|
-
var multipolys = [new MultiPolyIn(geom, true)];
|
|
1266
|
-
for (var i = 0, iMax = moreGeoms.length; i < iMax; i++) {
|
|
1267
|
-
multipolys.push(new MultiPolyIn(moreGeoms[i], false));
|
|
1268
|
-
}
|
|
1269
|
-
operation.numMultiPolys = multipolys.length;
|
|
1270
|
-
if (operation.type === "difference") {
|
|
1271
|
-
var subject = multipolys[0];
|
|
1272
|
-
var _i = 1;
|
|
1273
|
-
while (_i < multipolys.length) {
|
|
1274
|
-
if (getBboxOverlap(multipolys[_i].bbox, subject.bbox) !== null)
|
|
1275
|
-
_i++;
|
|
1276
|
-
else
|
|
1277
|
-
multipolys.splice(_i, 1);
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
if (operation.type === "intersection") {
|
|
1281
|
-
for (var _i2 = 0, _iMax = multipolys.length; _i2 < _iMax; _i2++) {
|
|
1282
|
-
var mpA = multipolys[_i2];
|
|
1283
|
-
for (var j = _i2 + 1, jMax = multipolys.length; j < jMax; j++) {
|
|
1284
|
-
if (getBboxOverlap(mpA.bbox, multipolys[j].bbox) === null)
|
|
1285
|
-
return [];
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
var queue = new Tree(SweepEvent.compare);
|
|
1290
|
-
for (var _i3 = 0, _iMax2 = multipolys.length; _i3 < _iMax2; _i3++) {
|
|
1291
|
-
var sweepEvents = multipolys[_i3].getSweepEvents();
|
|
1292
|
-
for (var _j = 0, _jMax = sweepEvents.length; _j < _jMax; _j++) {
|
|
1293
|
-
queue.insert(sweepEvents[_j]);
|
|
1294
|
-
if (queue.size > POLYGON_CLIPPING_MAX_QUEUE_SIZE) {
|
|
1295
|
-
throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
var sweepLine = new SweepLine(queue);
|
|
1300
|
-
var prevQueueSize = queue.size;
|
|
1301
|
-
var node = queue.pop();
|
|
1302
|
-
while (node) {
|
|
1303
|
-
var evt = node.key;
|
|
1304
|
-
if (queue.size === prevQueueSize) {
|
|
1305
|
-
var seg = evt.segment;
|
|
1306
|
-
throw new Error("Unable to pop() ".concat(evt.isLeft ? "left" : "right", " SweepEvent ") + "[".concat(evt.point.x, ", ").concat(evt.point.y, "] from segment #").concat(seg.id, " ") + "[".concat(seg.leftSE.point.x, ", ").concat(seg.leftSE.point.y, "] -> ") + "[".concat(seg.rightSE.point.x, ", ").concat(seg.rightSE.point.y, "] from queue. ") + "Please file a bug report.");
|
|
1307
|
-
}
|
|
1308
|
-
if (queue.size > POLYGON_CLIPPING_MAX_QUEUE_SIZE) {
|
|
1309
|
-
throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");
|
|
1310
|
-
}
|
|
1311
|
-
if (sweepLine.segments.length > POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS) {
|
|
1312
|
-
throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");
|
|
1313
|
-
}
|
|
1314
|
-
var newEvents = sweepLine.process(evt);
|
|
1315
|
-
for (var _i4 = 0, _iMax3 = newEvents.length; _i4 < _iMax3; _i4++) {
|
|
1316
|
-
var _evt = newEvents[_i4];
|
|
1317
|
-
if (_evt.consumedBy === void 0)
|
|
1318
|
-
queue.insert(_evt);
|
|
1319
|
-
}
|
|
1320
|
-
prevQueueSize = queue.size;
|
|
1321
|
-
node = queue.pop();
|
|
1322
|
-
}
|
|
1323
|
-
rounder.reset();
|
|
1324
|
-
var ringsOut = RingOut.factory(sweepLine.segments);
|
|
1325
|
-
var result = new MultiPolyOut(ringsOut);
|
|
1326
|
-
return result.getGeom();
|
|
1327
|
-
}
|
|
1328
|
-
}]);
|
|
1329
|
-
return Operation2;
|
|
1330
|
-
}();
|
|
1331
|
-
var operation = new Operation();
|
|
1332
|
-
var union = function union2(geom) {
|
|
1333
|
-
for (var _len = arguments.length, moreGeoms = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1334
|
-
moreGeoms[_key - 1] = arguments[_key];
|
|
1335
|
-
}
|
|
1336
|
-
return operation.run("union", geom, moreGeoms);
|
|
1337
|
-
};
|
|
1338
|
-
var intersection$1 = function intersection3(geom) {
|
|
1339
|
-
for (var _len2 = arguments.length, moreGeoms = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
1340
|
-
moreGeoms[_key2 - 1] = arguments[_key2];
|
|
1341
|
-
}
|
|
1342
|
-
return operation.run("intersection", geom, moreGeoms);
|
|
1343
|
-
};
|
|
1344
|
-
var xor = function xor2(geom) {
|
|
1345
|
-
for (var _len3 = arguments.length, moreGeoms = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
1346
|
-
moreGeoms[_key3 - 1] = arguments[_key3];
|
|
1347
|
-
}
|
|
1348
|
-
return operation.run("xor", geom, moreGeoms);
|
|
1349
|
-
};
|
|
1350
|
-
var difference = function difference2(subjectGeom) {
|
|
1351
|
-
for (var _len4 = arguments.length, clippingGeoms = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
1352
|
-
clippingGeoms[_key4 - 1] = arguments[_key4];
|
|
1353
|
-
}
|
|
1354
|
-
return operation.run("difference", subjectGeom, clippingGeoms);
|
|
1355
|
-
};
|
|
1356
|
-
var index = {
|
|
1357
|
-
union,
|
|
1358
|
-
intersection: intersection$1,
|
|
1359
|
-
xor,
|
|
1360
|
-
difference
|
|
1361
|
-
};
|
|
1362
|
-
var polygonClipping = index;
|
|
1363
|
-
export { polygonClipping as p };
|