@mapcatch/util 2.0.6 → 2.0.7

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.
Files changed (123) hide show
  1. package/dist/catchUtil.min.cjs.js +2928 -0
  2. package/dist/catchUtil.min.esm.js +44499 -42811
  3. package/dist/catchUtil.min.js +248 -248
  4. package/package.json +11 -2
  5. package/src/constants/annotation_color.js +0 -7
  6. package/src/constants/annotation_draw_style.js +0 -228
  7. package/src/constants/annotation_label_style.js +0 -76
  8. package/src/constants/annotation_style.js +0 -118
  9. package/src/constants/bmap_types.js +0 -44
  10. package/src/constants/cameras.js +0 -5
  11. package/src/constants/crs.js +0 -42099
  12. package/src/constants/crs_types.js +0 -22
  13. package/src/constants/default_layers.js +0 -149
  14. package/src/constants/dsm_colors.js +0 -10
  15. package/src/constants/error_codes.js +0 -44
  16. package/src/constants/height_colors.js +0 -1
  17. package/src/constants/index.js +0 -20
  18. package/src/constants/layer_folders.js +0 -6
  19. package/src/constants/layer_groups.js +0 -34
  20. package/src/constants/layer_groups_multispectral.js +0 -34
  21. package/src/constants/layer_icons.js +0 -19
  22. package/src/constants/map_style.js +0 -11
  23. package/src/constants/measurement_fields.js +0 -208
  24. package/src/constants/task_params.js +0 -33
  25. package/src/constants/tools.js +0 -20
  26. package/src/event/event.js +0 -191
  27. package/src/event/event_bus.js +0 -5
  28. package/src/event/index.js +0 -2
  29. package/src/gl-operations/constants.js +0 -9
  30. package/src/gl-operations/default_options.js +0 -98
  31. package/src/gl-operations/index.js +0 -533
  32. package/src/gl-operations/reglCommands/contours.js +0 -27
  33. package/src/gl-operations/reglCommands/default.js +0 -46
  34. package/src/gl-operations/reglCommands/hillshading.js +0 -340
  35. package/src/gl-operations/reglCommands/index.js +0 -6
  36. package/src/gl-operations/reglCommands/multiLayers.js +0 -303
  37. package/src/gl-operations/reglCommands/transitions.js +0 -111
  38. package/src/gl-operations/reglCommands/util.js +0 -71
  39. package/src/gl-operations/renderer.js +0 -210
  40. package/src/gl-operations/shaders/fragment/convertDem.js +0 -26
  41. package/src/gl-operations/shaders/fragment/convolutionSmooth.js +0 -55
  42. package/src/gl-operations/shaders/fragment/diffCalc.js +0 -34
  43. package/src/gl-operations/shaders/fragment/drawResult.js +0 -47
  44. package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +0 -79
  45. package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +0 -60
  46. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +0 -31
  47. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +0 -61
  48. package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +0 -27
  49. package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +0 -26
  50. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +0 -54
  51. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +0 -81
  52. package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +0 -55
  53. package/src/gl-operations/shaders/fragment/interpolateColor.js +0 -66
  54. package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +0 -50
  55. package/src/gl-operations/shaders/fragment/interpolateValue.js +0 -137
  56. package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +0 -36
  57. package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +0 -46
  58. package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +0 -54
  59. package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +0 -62
  60. package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +0 -70
  61. package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +0 -78
  62. package/src/gl-operations/shaders/fragment/single.js +0 -93
  63. package/src/gl-operations/shaders/transform.js +0 -22
  64. package/src/gl-operations/shaders/util/computeColor.glsl +0 -85
  65. package/src/gl-operations/shaders/util/getTexelValue.glsl +0 -10
  66. package/src/gl-operations/shaders/util/isCloseEnough.glsl +0 -9
  67. package/src/gl-operations/shaders/util/rgbaToFloat.glsl +0 -18
  68. package/src/gl-operations/shaders/vertex/double.js +0 -17
  69. package/src/gl-operations/shaders/vertex/multi3.js +0 -20
  70. package/src/gl-operations/shaders/vertex/multi4.js +0 -23
  71. package/src/gl-operations/shaders/vertex/multi5.js +0 -26
  72. package/src/gl-operations/shaders/vertex/multi6.js +0 -29
  73. package/src/gl-operations/shaders/vertex/single.js +0 -13
  74. package/src/gl-operations/shaders/vertex/singleNotTransformed.js +0 -12
  75. package/src/gl-operations/texture_manager.js +0 -141
  76. package/src/gl-operations/util.js +0 -336
  77. package/src/index.js +0 -20
  78. package/src/measure/index.js +0 -209
  79. package/src/measure/tile_cache.js +0 -88
  80. package/src/mvs/index.js +0 -26
  81. package/src/mvs/protos/index.js +0 -12
  82. package/src/mvs/protos/proto_10.js +0 -155
  83. package/src/observation_pretict.js +0 -168
  84. package/src/photo-parser/exif/gps_tags.js +0 -33
  85. package/src/photo-parser/exif/ifd1_tags.js +0 -22
  86. package/src/photo-parser/exif/index.js +0 -143
  87. package/src/photo-parser/exif/parse_image.js +0 -290
  88. package/src/photo-parser/exif/string_values.js +0 -137
  89. package/src/photo-parser/exif/tags.js +0 -75
  90. package/src/photo-parser/exif/tiff_tags.js +0 -35
  91. package/src/photo-parser/exif/util.js +0 -103
  92. package/src/photo-parser/image-size/detector.js +0 -24
  93. package/src/photo-parser/image-size/fromFile.js +0 -55
  94. package/src/photo-parser/image-size/index.js +0 -2
  95. package/src/photo-parser/image-size/lookup.js +0 -37
  96. package/src/photo-parser/image-size/types/bmp.js +0 -10
  97. package/src/photo-parser/image-size/types/cur.js +0 -16
  98. package/src/photo-parser/image-size/types/dds.js +0 -10
  99. package/src/photo-parser/image-size/types/gif.js +0 -11
  100. package/src/photo-parser/image-size/types/heif.js +0 -35
  101. package/src/photo-parser/image-size/types/icns.js +0 -112
  102. package/src/photo-parser/image-size/types/ico.js +0 -74
  103. package/src/photo-parser/image-size/types/index.js +0 -43
  104. package/src/photo-parser/image-size/types/j2c.js +0 -11
  105. package/src/photo-parser/image-size/types/jp2.js +0 -22
  106. package/src/photo-parser/image-size/types/jpg.js +0 -157
  107. package/src/photo-parser/image-size/types/ktx.js +0 -18
  108. package/src/photo-parser/image-size/types/png.js +0 -36
  109. package/src/photo-parser/image-size/types/pnm.js +0 -74
  110. package/src/photo-parser/image-size/types/psd.js +0 -10
  111. package/src/photo-parser/image-size/types/svg.js +0 -100
  112. package/src/photo-parser/image-size/types/tga.js +0 -14
  113. package/src/photo-parser/image-size/types/tiff.js +0 -92
  114. package/src/photo-parser/image-size/types/utils.js +0 -83
  115. package/src/photo-parser/image-size/types/webp.js +0 -67
  116. package/src/photo-parser/index.js +0 -185
  117. package/src/report/annotations_report.js +0 -446
  118. package/src/report/index.js +0 -2
  119. package/src/report/map_util.js +0 -81
  120. package/src/report/pdf_creator.js +0 -247
  121. package/src/report/report.js +0 -581
  122. package/src/transform.js +0 -207
  123. package/src/util.js +0 -671
package/src/transform.js DELETED
@@ -1,207 +0,0 @@
1
- // 坐标转换类
2
- import satellite_geo_calc from 'satellite-geo-calc'
3
- import proj4 from 'proj4'
4
- import { crsList, crsTypes } from './constants'
5
-
6
- /**
7
- * 根据坐标系参数获取其WKT字符串
8
- * @param {*} crs
9
- * @returns
10
- */
11
- export function getWKTString (crs) {
12
- let {type, epsg_code} = crs
13
- for(let i = 0;i < crsList.length;i++) {
14
- if (!crsTypes[crsList[i].type]) {
15
- continue
16
- }
17
- let typeCode = crsTypes[crsList[i].type].code
18
- if (typeCode !== type) {
19
- continue
20
- }
21
- let {authCode, wkt, children} = crsList[i]
22
- if (authCode == epsg_code) {
23
- return wkt
24
- }
25
- if (children?.length) {
26
- for(let j = 0;j < children.length;j++) {
27
- if (children[j].children) {
28
- for(let n = 0;n < children[j].children.length;n++) {
29
- if (children[j].children[n].authCode == epsg_code) {
30
- return children[j].children[n].wkt
31
- }
32
- }
33
- } else {
34
- if (children[j].authCode == epsg_code) {
35
- return children[j].wkt
36
- }
37
- }
38
- }
39
- }
40
- }
41
- return null
42
- }
43
-
44
- /**
45
- * 将经纬度转为指定级别的像素坐标,瓦片大小按照512计算
46
- * @param {*} lngLat
47
- * @param {*} zoom
48
- * @returns
49
- */
50
- export function project (lngLat, zoom = 12) { // 经纬度转墨卡托像素坐标
51
- let [lng, lat] = lngLat
52
- let x = (180 + lng) / 360
53
- let y = (180 - (180 / Math.PI) * Math.log(Math.tan(Math.PI / 4 + (lat * Math.PI) / 360))) / 360
54
- return {
55
- x: x * Math.pow(2, zoom) * 512,
56
- y: y * Math.pow(2, zoom) * 512
57
- }
58
- }
59
-
60
- /**
61
- * 经纬度转为指定级别的瓦片坐标
62
- * @param {*} zoom
63
- * @param {*} lngLat
64
- * @returns
65
- */
66
- export function getTileCoord (zoom, lngLat) {
67
- let [lng, lat] = lngLat
68
- let x = (180 + lng) / 360
69
- let y = (180 - (180 / Math.PI) * Math.log(Math.tan(Math.PI / 4 + (lat * Math.PI) / 360))) / 360
70
- return {
71
- x: Math.floor(x * Math.pow(2, zoom)),
72
- y: Math.floor(y * Math.pow(2, zoom)),
73
- z: zoom
74
- }
75
- }
76
-
77
- /**
78
- * 经纬度转为指定级别的瓦片上的像素坐标
79
- * @param {*} zoom
80
- * @param {*} lngLat
81
- * @returns 返回的坐标是在瓦片坐标系的坐标
82
- */
83
- export function getTilePixelCoord (zoom, lngLat) {
84
- let [lng, lat] = lngLat
85
- let x = (180 + lng) / 360
86
- let y = (180 - (180 / Math.PI) * Math.log(Math.tan(Math.PI / 4 + (lat * Math.PI) / 360))) / 360
87
- return {
88
- x: Math.round(x * Math.pow(2, zoom) * 512) % 512,
89
- y: Math.round(y * Math.pow(2, zoom) * 512) % 512
90
- }
91
- }
92
-
93
- // 根据传入的经度,计算所属UTM投影带
94
- export function getUTMProjection (lng) {
95
- let initCode = 32600
96
- let n = Math.ceil((lng + 180) / 6)
97
- return {
98
- type: 3,
99
- type_name: 'Projected',
100
- label: `WGS 84 / UTM zone ${n}N`,
101
- epsg_code: initCode + n
102
- }
103
- }
104
-
105
- /**
106
- * 通用的坐标转换函数,将一个坐标由源坐标系转到目标坐标系
107
- * @param {Array} coordinate 带转换的坐标
108
- * @param {*} sourceCrs 原坐标系
109
- * @param {*} targetCrs 目标坐标系
110
- * @returns Array | null
111
- */
112
- export function transformCoordinate (coordinate, sourceCrs, targetCrs) {
113
- if (!coordinate) {
114
- return null
115
- }
116
- coordinate = [...coordinate]
117
- if (!coordinate[2]) {
118
- coordinate[2] = 0
119
- }
120
- if (!sourceCrs || !targetCrs) {
121
- return coordinate
122
- }
123
- if (targetCrs.type === 1 || sourceCrs.type === 1) { // any => Local 或者 Local => any,无法转换
124
- return coordinate
125
- } else if (sourceCrs.type === 0 && targetCrs.type === 0) { // LocalEnu => LocalEnu
126
- let p = satellite_geo_calc.coordinateTransfer.lla_to_enu({ lon:sourceCrs.origin_point[0], lat:sourceCrs.origin_point[1], alt: sourceCrs.origin_point[2]}, {lon: targetCrs.origin_point[0], lat: targetCrs.origin_point[1], alt: targetCrs.origin_point[2]})
127
- return [p.x + coordinate[0], p.y + coordinate[1], p.z + coordinate[2]]
128
- } else if (sourceCrs.type === 0) { // LocalEnu => geo
129
- let lla = satellite_geo_calc.coordinateTransfer.enu_to_lla({x: coordinate[0], y: coordinate[1], z: coordinate[2]}, { lon: sourceCrs.origin_point[0], lat: sourceCrs.origin_point[1], alt: sourceCrs.origin_point[2] })
130
- let coord = [lla.lon, lla.lat, lla.alt]
131
- let {wkt, epsg_code} = targetCrs
132
- if (epsg_code === 4326 || epsg_code === 4490) {
133
- return coord
134
- }
135
- if (!wkt && epsg_code) {
136
- wkt = getWKTString(targetCrs)
137
- }
138
- if (!wkt) {
139
- return null
140
- }
141
- return proj4('EPSG:4326', wkt, coord)
142
- } else if (targetCrs.type === 0) { // geo => LocalEnu
143
- let {wkt, epsg_code} = sourceCrs
144
- let lla = coordinate
145
- if (epsg_code !== 4326) {
146
- if (!wkt && epsg_code) {
147
- wkt = getWKTString(sourceCrs)
148
- }
149
- if (!wkt) {
150
- return null
151
- }
152
- lla = proj4(wkt, 'EPSG:4326', coordinate)
153
- }
154
- let p = satellite_geo_calc.coordinateTransfer.lla_to_enu({ lon:lla[0], lat:lla[1], alt: lla[2]}, {lon: targetCrs.origin_point[0], lat: targetCrs.origin_point[1], alt: targetCrs.origin_point[2]})
155
- return [p.x, p.y, p.z]
156
- } else { // geo => geo
157
- let sourceWkt = sourceCrs.wkt
158
- let targetWkt = targetCrs.wkt
159
- if (!sourceWkt && sourceCrs.epsg_code) {
160
- sourceWkt = getWKTString(sourceCrs)
161
- }
162
- if (!targetWkt && targetCrs.epsg_code) {
163
- targetWkt = getWKTString(targetCrs)
164
- }
165
- if (!sourceWkt || !targetWkt) {
166
- return null
167
- }
168
- return proj4(sourceWkt, targetWkt, coordinate)
169
- }
170
- }
171
-
172
- /**
173
- * 将指定坐标系下的某个坐标转到WGS84经纬度
174
- * @param {*} lngLat
175
- * @param {*} sourceCrs
176
- * @returns
177
- */
178
- export function transformCoordinateToLngLat (lngLat, sourceCrs) {
179
- return transformCoordinate(lngLat, sourceCrs, {
180
- type: 2,
181
- type_name: 'Geographic',
182
- epsg_code: 4326
183
- })
184
- }
185
-
186
- /**
187
- * 将经纬度转为其他坐标系
188
- */
189
- export function transformLnglat (lngLat, coordinate_system) {
190
- return transformCoordinate(lngLat, {
191
- type: 2,
192
- type_name: 'Geographic',
193
- epsg_code: 4326
194
- }, coordinate_system)
195
- }
196
-
197
- /**
198
- * 将经纬度转为笛卡尔地心坐标系
199
- * @param {*} coord
200
- * @returns
201
- */
202
- export function geographicToCartesian (coord) {
203
- let p1 = '+proj=longlat +datum=WGS84'
204
- let p2 = '+proj=geocent +datum=WGS84'
205
- return proj4(p1, p2, coord)
206
- }
207
-