@mapcatch/util 1.0.15 → 2.0.1

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 (81) hide show
  1. package/dist/catchUtil.min.esm.js +67927 -14001
  2. package/dist/catchUtil.min.js +2695 -55
  3. package/package.json +22 -3
  4. package/src/constants/annotation_color.js +7 -0
  5. package/src/constants/annotation_draw_style.js +228 -0
  6. package/src/constants/annotation_label_style.js +76 -0
  7. package/src/constants/annotation_style.js +118 -0
  8. package/src/constants/cameras.js +1 -1
  9. package/src/constants/crs.js +31473 -31473
  10. package/src/constants/error_codes.js +44 -0
  11. package/src/constants/height_colors.js +1 -0
  12. package/src/constants/index.js +9 -2
  13. package/src/constants/map_style.js +11 -0
  14. package/src/constants/measurement_fields.js +3 -3
  15. package/src/{event.js → event/event.js} +1 -14
  16. package/src/event/event_bus.js +5 -0
  17. package/src/event/index.js +2 -0
  18. package/src/gl-operations/constants.js +9 -11
  19. package/src/gl-operations/default_options.js +5 -5
  20. package/src/gl-operations/index.js +166 -239
  21. package/src/gl-operations/reglCommands/contours.js +20 -20
  22. package/src/gl-operations/reglCommands/default.js +34 -34
  23. package/src/gl-operations/reglCommands/hillshading.js +116 -116
  24. package/src/gl-operations/reglCommands/index.js +6 -6
  25. package/src/gl-operations/reglCommands/multiLayers.js +55 -55
  26. package/src/gl-operations/reglCommands/transitions.js +24 -24
  27. package/src/gl-operations/reglCommands/util.js +54 -54
  28. package/src/gl-operations/renderer.js +69 -69
  29. package/src/gl-operations/shaders/transform.js +2 -2
  30. package/src/gl-operations/shaders/util/rgbaToFloat.glsl +11 -11
  31. package/src/gl-operations/texture_manager.js +58 -58
  32. package/src/gl-operations/util.js +154 -154
  33. package/src/index.js +14 -2
  34. package/src/measure/index.js +198 -0
  35. package/src/measure/tile_cache.js +88 -0
  36. package/src/mvs/index.js +26 -0
  37. package/src/mvs/protos/index.js +12 -0
  38. package/src/mvs/protos/proto_10.js +155 -0
  39. package/src/observation_pretict.js +168 -0
  40. package/src/photo-parser/exif/gps_tags.js +33 -0
  41. package/src/photo-parser/exif/ifd1_tags.js +22 -0
  42. package/src/photo-parser/exif/index.js +130 -0
  43. package/src/photo-parser/exif/parse_image.js +290 -0
  44. package/src/photo-parser/exif/string_values.js +137 -0
  45. package/src/photo-parser/exif/tags.js +75 -0
  46. package/src/photo-parser/exif/tiff_tags.js +35 -0
  47. package/src/photo-parser/exif/util.js +103 -0
  48. package/src/photo-parser/image-size/detector.js +24 -0
  49. package/src/photo-parser/image-size/fromFile.js +55 -0
  50. package/src/photo-parser/image-size/index.js +2 -0
  51. package/src/photo-parser/image-size/lookup.js +37 -0
  52. package/src/photo-parser/image-size/types/bmp.js +10 -0
  53. package/src/photo-parser/image-size/types/cur.js +16 -0
  54. package/src/photo-parser/image-size/types/dds.js +10 -0
  55. package/src/photo-parser/image-size/types/gif.js +11 -0
  56. package/src/photo-parser/image-size/types/heif.js +35 -0
  57. package/src/photo-parser/image-size/types/icns.js +112 -0
  58. package/src/photo-parser/image-size/types/ico.js +74 -0
  59. package/src/photo-parser/image-size/types/index.js +43 -0
  60. package/src/photo-parser/image-size/types/j2c.js +11 -0
  61. package/src/photo-parser/image-size/types/jp2.js +22 -0
  62. package/src/photo-parser/image-size/types/jpg.js +157 -0
  63. package/src/photo-parser/image-size/types/ktx.js +18 -0
  64. package/src/photo-parser/image-size/types/png.js +36 -0
  65. package/src/photo-parser/image-size/types/pnm.js +74 -0
  66. package/src/photo-parser/image-size/types/psd.js +10 -0
  67. package/src/photo-parser/image-size/types/svg.js +100 -0
  68. package/src/photo-parser/image-size/types/tga.js +14 -0
  69. package/src/photo-parser/image-size/types/tiff.js +92 -0
  70. package/src/photo-parser/image-size/types/utils.js +83 -0
  71. package/src/photo-parser/image-size/types/webp.js +67 -0
  72. package/src/photo-parser/index.js +181 -0
  73. package/src/report/annotations_report.js +446 -0
  74. package/src/report/index.js +2 -0
  75. package/src/report/map_util.js +81 -0
  76. package/src/report/pdf_creator.js +247 -0
  77. package/src/report/report.js +583 -0
  78. package/src/transform.js +204 -0
  79. package/src/util.js +371 -75
  80. package/CHANGELOG.md +0 -60
  81. /package/src/constants/{colors.js → dsm_colors.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapcatch/util",
3
- "version": "1.0.15",
3
+ "version": "2.0.1",
4
4
  "main": "./dist/catchUtil.min.esm.js",
5
5
  "repository": "",
6
6
  "author": "wanyanyan",
@@ -9,20 +9,39 @@
9
9
  "build": "vite build",
10
10
  "start": "vite --host --port 5174",
11
11
  "lint": "eslint src/ --fix",
12
- "format": "prettier-eslint --write src/*.js"
12
+ "format": "prettier-eslint --write src/*.js",
13
+ "prepare": "husky",
14
+ "lint-staged": "lint-staged"
15
+ },
16
+ "lint-staged": {
17
+ "src/**/*.js": "yarn lint"
13
18
  },
14
19
  "dependencies": {
15
- "@turf/turf": "^6.5.0",
20
+ "@turf/turf": "^7.1.0",
21
+ "@xmldom/xmldom": "^0.9.2",
22
+ "cdt2d": "^1.0.0",
23
+ "eslint": "8.22.0",
16
24
  "gl-matrix": "^3.4.3",
17
25
  "glsl-float-to-rgba": "^1.0.0",
18
26
  "glsl-rgba-to-float": "^1.0.0",
19
27
  "lodash": "^4.17.21",
28
+ "mapbox-gl": "^3.6.0",
29
+ "mathjs": "12.3.0",
20
30
  "moment": "^2.29.4",
31
+ "pbf": "3.2.1",
32
+ "proj4": "^2.12.1",
33
+ "protocol-buffers-schema": "^3.6.0",
21
34
  "regl": "^2.1.0",
35
+ "satellite-geo-calc": "^0.0.7",
36
+ "svg-path-commander": "^2.0.10",
22
37
  "upng-js": "^2.1.0",
23
38
  "uuid": "^9.0.0"
24
39
  },
25
40
  "devDependencies": {
41
+ "@babel/core": "^7.25.2",
42
+ "@babel/eslint-parser": "^7.25.1",
43
+ "husky": "^9.1.6",
44
+ "lint-staged": "^15.2.10",
26
45
  "vite": "^3.0.9",
27
46
  "vite-plugin-glslify": "^2.0.2"
28
47
  }
@@ -0,0 +1,7 @@
1
+ export default {
2
+ point: '#F02DB8',
3
+ line: '#F0B32D',
4
+ polygon: '#2DF0D7',
5
+ vertex: '#2d8cf0',
6
+ midPoint: '#2d8cf0'
7
+ }
@@ -0,0 +1,228 @@
1
+ import annotationColor from './annotation_color'
2
+
3
+ export default [
4
+ {
5
+ 'id': 'gl-draw-polygon-fill-inactive',
6
+ 'type': 'fill',
7
+ 'filter': ['all',
8
+ ['==', 'active', 'false'],
9
+ ['==', '$type', 'Polygon'],
10
+ ['!=', 'mode', 'static']
11
+ ],
12
+ 'paint': {
13
+ 'fill-color': '#3bb2d0',
14
+ 'fill-outline-color': '#3bb2d0',
15
+ 'fill-opacity': 0.1
16
+ }
17
+ },
18
+ {
19
+ 'id': 'gl-draw-polygon-fill-active',
20
+ 'type': 'fill',
21
+ 'filter': ['all', ['==', 'active', 'true'], ['==', '$type', 'Polygon']],
22
+ 'paint': {
23
+ 'fill-color': ['string', ['get', 'user_color'], '#2d8cf0'],
24
+ 'fill-outline-color': ['string', ['get', 'user_color'], '#2d8cf0'],
25
+ 'fill-opacity': 0.1
26
+ }
27
+ },
28
+ {
29
+ 'id': 'gl-draw-polygon-stroke-inactive',
30
+ 'type': 'line',
31
+ 'filter': ['all',
32
+ ['==', 'active', 'false'],
33
+ ['==', '$type', 'Polygon'],
34
+ ['!=', 'mode', 'static']
35
+ ],
36
+ 'layout': {
37
+ 'line-cap': 'round',
38
+ 'line-join': 'round'
39
+ },
40
+ 'paint': {
41
+ 'line-color': '#3bb2d0',
42
+ 'line-width': 2
43
+ }
44
+ },
45
+ {
46
+ 'id': 'gl-draw-polygon-stroke-active_stroke',
47
+ 'type': 'line',
48
+ 'filter': ['all', ['==', 'active', 'true'], ['==', '$type', 'Polygon']],
49
+ 'layout': {
50
+ 'line-cap': 'round',
51
+ 'line-join': 'round'
52
+ },
53
+ 'paint': {
54
+ 'line-color': '#ffffff',
55
+ 'line-width': 4
56
+ }
57
+ },
58
+ {
59
+ 'id': 'gl-draw-polygon-stroke-active',
60
+ 'type': 'line',
61
+ 'filter': ['all', ['==', 'active', 'true'], ['==', '$type', 'Polygon']],
62
+ 'layout': {
63
+ 'line-cap': 'round',
64
+ 'line-join': 'round'
65
+ },
66
+ 'paint': {
67
+ 'line-color': ['string', ['get', 'user_color'], '#2d8cf0'],
68
+ 'line-width': 2
69
+ }
70
+ },
71
+ {
72
+ 'id': 'gl-draw-line-inactive',
73
+ 'type': 'line',
74
+ 'filter': ['all',
75
+ ['==', 'active', 'false'],
76
+ ['==', '$type', 'LineString'],
77
+ ['!=', 'mode', 'static']
78
+ ],
79
+ 'layout': {
80
+ 'line-cap': 'round',
81
+ 'line-join': 'round'
82
+ },
83
+ 'paint': {
84
+ 'line-color': '#3bb2d0',
85
+ 'line-width': 2
86
+ }
87
+ },
88
+ {
89
+ 'id': 'gl-draw-line-active_stroke',
90
+ 'type': 'line',
91
+ 'filter': ['all',
92
+ ['==', '$type', 'LineString'],
93
+ ['==', 'active', 'true']
94
+ ],
95
+ 'layout': {
96
+ 'line-cap': 'round',
97
+ 'line-join': 'round'
98
+ },
99
+ 'paint': {
100
+ 'line-color': '#ffffff',
101
+ 'line-width': 4
102
+ }
103
+ },
104
+ {
105
+ 'id': 'gl-draw-line-active',
106
+ 'type': 'line',
107
+ 'filter': ['all',
108
+ ['==', '$type', 'LineString'],
109
+ ['==', 'active', 'true']
110
+ ],
111
+ 'layout': {
112
+ 'line-cap': 'round',
113
+ 'line-join': 'round'
114
+ },
115
+ 'paint': {
116
+ 'line-color': ['string', ['get', 'user_color'], '#2d8cf0'],
117
+ 'line-width': 2
118
+ }
119
+ },
120
+ {
121
+ 'id': 'gl-draw-polygon-and-line-vertex-stroke-inactive',
122
+ 'type': 'circle',
123
+ 'filter': ['all',
124
+ ['==', 'meta', 'vertex'],
125
+ ['==', '$type', 'Point'],
126
+ ['!=', 'mode', 'static']
127
+ ],
128
+ 'paint': {
129
+ 'circle-radius': 7,
130
+ 'circle-color': '#fff'
131
+ }
132
+ },
133
+ {
134
+ 'id': 'gl-draw-polygon-and-line-vertex-inactive',
135
+ 'type': 'circle',
136
+ 'filter': ['all',
137
+ ['==', 'meta', 'vertex'],
138
+ ['==', '$type', 'Point'],
139
+ ['!=', 'mode', 'static']
140
+ ],
141
+ 'paint': {
142
+ 'circle-radius': 5,
143
+ 'circle-color': annotationColor.vertex
144
+ }
145
+ },
146
+ {
147
+ 'id': 'gl-draw-point-inactive',
148
+ 'type': 'circle',
149
+ 'filter': ['all',
150
+ ['==', 'active', 'false'],
151
+ ['==', '$type', 'Point'],
152
+ ['==', 'meta', 'feature'],
153
+ ['!=', 'mode', 'static']
154
+ ],
155
+ 'paint': {
156
+ 'circle-radius': 5,
157
+ 'circle-color': '#ffffff'
158
+ }
159
+ },
160
+ {
161
+ 'id': 'gl-draw-point-active',
162
+ 'type': 'circle',
163
+ 'filter': ['all',
164
+ ['==', '$type', 'Point'],
165
+ ['!=', 'meta', 'midpoint'],
166
+ ['==', 'active', 'true']],
167
+ 'paint': {
168
+ 'circle-radius': 5,
169
+ 'circle-color': '#2d8cf0'
170
+ }
171
+ },
172
+ {
173
+ 'id': 'gl-draw-polygon-midpoint',
174
+ 'type': 'symbol',
175
+ 'filter': ['all',
176
+ ['==', '$type', 'Point'],
177
+ ['==', 'meta', 'midpoint']],
178
+ 'layout': {
179
+ 'icon-image': 'add',
180
+ 'icon-size': 0.6
181
+ }
182
+ },
183
+ {
184
+ 'id': 'gl-draw-polygon-fill-static',
185
+ 'type': 'fill',
186
+ 'filter': ['all', ['==', 'mode', 'static'], ['==', '$type', 'Polygon']],
187
+ 'paint': {
188
+ 'fill-color': '#3bb2d0',
189
+ 'fill-outline-color': '#3bb2d0',
190
+ 'fill-opacity': 0.1
191
+ }
192
+ },
193
+ {
194
+ 'id': 'gl-draw-polygon-stroke-static',
195
+ 'type': 'line',
196
+ 'filter': ['all', ['==', 'mode', 'static'], ['==', '$type', 'Polygon']],
197
+ 'layout': {
198
+ 'line-cap': 'round',
199
+ 'line-join': 'round'
200
+ },
201
+ 'paint': {
202
+ 'line-color': '#3bb2d0',
203
+ 'line-width': 2
204
+ }
205
+ },
206
+ {
207
+ 'id': 'gl-draw-line-static',
208
+ 'type': 'line',
209
+ 'filter': ['all', ['==', 'mode', 'static'], ['==', '$type', 'LineString']],
210
+ 'layout': {
211
+ 'line-cap': 'round',
212
+ 'line-join': 'round'
213
+ },
214
+ 'paint': {
215
+ 'line-color': '#3bb2d0',
216
+ 'line-width': 2
217
+ }
218
+ },
219
+ {
220
+ 'id': 'gl-draw-point-static',
221
+ 'type': 'circle',
222
+ 'filter': ['all', ['==', 'mode', 'static'], ['==', '$type', 'Point']],
223
+ 'paint': {
224
+ 'circle-radius': 7,
225
+ 'circle-color': '#3bb2d0'
226
+ }
227
+ }
228
+ ]
@@ -0,0 +1,76 @@
1
+ export default [
2
+ {
3
+ 'id': 'annotation_name_label',
4
+ 'type': 'symbol',
5
+ source: 'annotations_label',
6
+ metadata: {
7
+ layerType: 'label'
8
+ },
9
+ paint: {
10
+ 'text-color': '#000000',
11
+ 'text-halo-color': '#ffffff',
12
+ 'text-halo-width': 1.5,
13
+ 'text-opacity': [
14
+ 'case',
15
+ ['boolean', ['feature-state', 'hovered'], false], 1,
16
+ 0
17
+ ]
18
+ },
19
+ layout: {
20
+ 'text-field': ['get', 'name'],
21
+ 'text-size': 12,
22
+ 'text-anchor': 'bottom',
23
+ 'text-rotate': ['get', 'angle'],
24
+ 'text-allow-overlap': true,
25
+ 'text-line-height': 2,
26
+ 'text-offset': [
27
+ 'case',
28
+ ['boolean', ['==', ['get', 'type'], 'point'], false], [0, -1.8],
29
+ [0, 0]
30
+ ]
31
+ }
32
+ },
33
+ {
34
+ 'id': 'annotation_line_label',
35
+ 'type': 'symbol',
36
+ source: 'annotations_label',
37
+ metadata: {
38
+ layerType: 'label'
39
+ },
40
+ filter: ['==', 'type', 'line'],
41
+ paint: {
42
+ 'text-color': '#000000',
43
+ 'text-halo-color': '#ffffff',
44
+ 'text-halo-width': 1.5
45
+ },
46
+ layout: {
47
+ 'text-field': ['concat', ['number-format', ['get', 'distance2d'], { 'min-fraction-digits': 2, 'max-fraction-digits': 2 }], ' m'],
48
+ 'text-size': 12,
49
+ 'text-anchor': 'top',
50
+ 'text-rotate': ['get', 'angle'],
51
+ 'text-allow-overlap': true,
52
+ 'text-line-height': 1.5
53
+ }
54
+ },
55
+ {
56
+ 'id': 'annotation_polygon_label',
57
+ 'type': 'symbol',
58
+ source: 'annotations_label',
59
+ metadata: {
60
+ layerType: 'label'
61
+ },
62
+ filter: ['==', 'type', 'polygon'],
63
+ paint: {
64
+ 'text-color': '#000000',
65
+ 'text-halo-color': '#ffffff',
66
+ 'text-halo-width': 1.5
67
+ },
68
+ layout: {
69
+ 'text-field': ['concat', ['number-format', ['get', 'area2d'], { 'min-fraction-digits': 2, 'max-fraction-digits': 2 }], ' ㎡'],
70
+ 'text-size': 12,
71
+ 'text-anchor': 'top',
72
+ 'text-allow-overlap': true,
73
+ 'text-line-height': 1.5
74
+ }
75
+ }
76
+ ]
@@ -0,0 +1,118 @@
1
+ export default [
2
+ {
3
+ 'id': 'annotation_polygon',
4
+ 'type': 'fill',
5
+ source: 'annotations',
6
+ metadata: {
7
+ layerType: 'annotation'
8
+ },
9
+ filter: ['all', ['==', '$type', 'Polygon'], ['==', 'visible', true]],
10
+ paint: {
11
+ 'fill-color': ['get', 'color'],
12
+ 'fill-opacity': [
13
+ 'case',
14
+ ['boolean', ['feature-state', 'selected'], false], 0,
15
+ 0.2
16
+ ]
17
+ }
18
+ },
19
+ // {
20
+ // 'id': 'annotation_circle',
21
+ // 'type': 'circle',
22
+ // source: 'annotations',
23
+ // metadata: {
24
+ // layerType: 'annotation'
25
+ // },
26
+ // filter: ['all', ['==', '$type', 'Point'], ['==', 'visible', true]],
27
+ // paint: {
28
+ // 'circle-color': ['get', 'color'],
29
+ // 'circle-radius': 5,
30
+ // 'circle-opacity': [
31
+ // 'case',
32
+ // ['boolean', ['feature-state', 'selected'], false], 0,
33
+ // 1
34
+ // ],
35
+ // 'circle-stroke-color': '#ffffff',
36
+ // 'circle-stroke-opacity': [
37
+ // 'case',
38
+ // ['boolean', ['feature-state', 'selected'], false], 0,
39
+ // 1
40
+ // ],
41
+ // 'circle-stroke-width': 1
42
+ // }
43
+ // },
44
+ {
45
+ 'id': 'annotation_marker',
46
+ 'type': 'symbol',
47
+ source: 'annotations',
48
+ metadata: {
49
+ layerType: 'annotation'
50
+ },
51
+ filter: ['all', ['==', '$type', 'Point'], ['==', 'visible', true]],
52
+ 'layout': {
53
+ 'icon-image': 'locate',
54
+ 'icon-size': 1,
55
+ 'icon-allow-overlap': true,
56
+ 'icon-offset': [0, -15]
57
+ },
58
+ 'paint': {
59
+ 'icon-color': ['get', 'color'],
60
+ 'icon-halo-width': [
61
+ 'case',
62
+ ['boolean', ['feature-state', 'hovered'], false], 4,
63
+ ['boolean', ['feature-state', 'selected'], false], 4,
64
+ 0
65
+ ],
66
+ 'icon-halo-color': '#ffffff',
67
+ 'icon-halo-blur': 0
68
+ }
69
+ },
70
+ {
71
+ 'id': 'annotation_line_stroke',
72
+ 'type': 'line',
73
+ source: 'annotations',
74
+ metadata: {
75
+ layerType: 'annotation'
76
+ },
77
+ filter: ['all', ['any', ['==', '$type', 'Polygon'], ['==', '$type', 'LineString']], ['==', 'visible', true]],
78
+ 'layout': {
79
+ 'line-cap': 'round',
80
+ 'line-join': 'round'
81
+ },
82
+ paint: {
83
+ 'line-color': '#ffffff',
84
+ 'line-opacity': [
85
+ 'case',
86
+ ['boolean', ['feature-state', 'selected'], false], 0,
87
+ 1
88
+ ],
89
+ 'line-width': [
90
+ 'case',
91
+ ['boolean', ['feature-state', 'hovered'], false], 4,
92
+ 0
93
+ ]
94
+ }
95
+ },
96
+ {
97
+ 'id': 'annotation_line',
98
+ 'type': 'line',
99
+ source: 'annotations',
100
+ metadata: {
101
+ layerType: 'annotation'
102
+ },
103
+ filter: ['all', ['any', ['==', '$type', 'Polygon'], ['==', '$type', 'LineString']], ['==', 'visible', true]],
104
+ 'layout': {
105
+ 'line-cap': 'round',
106
+ 'line-join': 'round'
107
+ },
108
+ paint: {
109
+ 'line-color': ['get', 'color'],
110
+ 'line-opacity': [
111
+ 'case',
112
+ ['boolean', ['feature-state', 'selected'], false], 0,
113
+ 1
114
+ ],
115
+ 'line-width': 2
116
+ }
117
+ }
118
+ ]
@@ -1,5 +1,5 @@
1
1
  export default {
2
- normal: ['FC6310R', 'FC6310'],
2
+ normal: ['FC6310R', 'FC6310', 'M3E'],
3
3
  infrared: ['M3T'],
4
4
  multispectral: ['FC6360']
5
5
  }