@mapcatch/util 2.0.3 → 2.0.5-a

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 (74) hide show
  1. package/.eslintrc.js +54 -0
  2. package/.husky/pre-commit +1 -0
  3. package/.prettierrc +4 -0
  4. package/.vscode/settings.json +2 -0
  5. package/CHANGELOG.md +5 -1
  6. package/README.md +44 -0
  7. package/debug/app.js +26 -0
  8. package/debug/index.html +55 -0
  9. package/debug/libs/vue.global.js +16159 -0
  10. package/debug/my_icon.png +0 -0
  11. package/docs/Catolog.md +24 -0
  12. package/docs/Constant.md +92 -0
  13. package/docs/Event.md +90 -0
  14. package/docs/Util.md +345 -0
  15. package/package.json +2 -2
  16. package/src/constants/crs.js +42098 -42098
  17. package/src/constants/default_layers.js +102 -11
  18. package/src/constants/index.js +1 -0
  19. package/src/constants/layer_groups_multispectral.js +34 -0
  20. package/src/constants/layer_icons.js +1 -0
  21. package/src/gl-operations/constants.js +9 -9
  22. package/src/gl-operations/default_options.js +97 -97
  23. package/src/gl-operations/index.js +532 -520
  24. package/src/gl-operations/reglCommands/contours.js +27 -27
  25. package/src/gl-operations/reglCommands/default.js +45 -43
  26. package/src/gl-operations/reglCommands/hillshading.js +340 -332
  27. package/src/gl-operations/reglCommands/index.js +6 -6
  28. package/src/gl-operations/reglCommands/multiLayers.js +303 -301
  29. package/src/gl-operations/reglCommands/transitions.js +111 -109
  30. package/src/gl-operations/reglCommands/util.js +71 -71
  31. package/src/gl-operations/renderer.js +209 -192
  32. package/src/gl-operations/shaders/fragment/convertDem.js +25 -25
  33. package/src/gl-operations/shaders/fragment/convolutionSmooth.js +54 -54
  34. package/src/gl-operations/shaders/fragment/diffCalc.js +33 -33
  35. package/src/gl-operations/shaders/fragment/drawResult.js +46 -41
  36. package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +78 -78
  37. package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +59 -54
  38. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +30 -30
  39. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +60 -55
  40. package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +26 -26
  41. package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +25 -25
  42. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +53 -53
  43. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +80 -80
  44. package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +54 -49
  45. package/src/gl-operations/shaders/fragment/interpolateColor.js +65 -62
  46. package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +49 -46
  47. package/src/gl-operations/shaders/fragment/interpolateValue.js +136 -123
  48. package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +35 -35
  49. package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +45 -45
  50. package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +53 -53
  51. package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +61 -61
  52. package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +69 -69
  53. package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +77 -77
  54. package/src/gl-operations/shaders/fragment/single.js +93 -88
  55. package/src/gl-operations/shaders/transform.js +21 -21
  56. package/src/gl-operations/shaders/util/computeColor.glsl +85 -84
  57. package/src/gl-operations/shaders/util/getTexelValue.glsl +10 -10
  58. package/src/gl-operations/shaders/util/isCloseEnough.glsl +9 -9
  59. package/src/gl-operations/shaders/util/rgbaToFloat.glsl +17 -17
  60. package/src/gl-operations/shaders/vertex/double.js +16 -16
  61. package/src/gl-operations/shaders/vertex/multi3.js +19 -19
  62. package/src/gl-operations/shaders/vertex/multi4.js +22 -22
  63. package/src/gl-operations/shaders/vertex/multi5.js +25 -25
  64. package/src/gl-operations/shaders/vertex/multi6.js +28 -28
  65. package/src/gl-operations/shaders/vertex/single.js +13 -13
  66. package/src/gl-operations/shaders/vertex/singleNotTransformed.js +11 -11
  67. package/src/gl-operations/texture_manager.js +141 -141
  68. package/src/gl-operations/util.js +336 -336
  69. package/src/measure/index.js +14 -8
  70. package/src/transform.js +3 -0
  71. package/src/util.js +14 -6
  72. package/vite.config.js +58 -0
  73. package/dist/catchUtil.min.esm.js +0 -112833
  74. package/dist/catchUtil.min.js +0 -2922
@@ -5,7 +5,12 @@ export default [
5
5
  group: 'output',
6
6
  visible: true,
7
7
  opacity: 1,
8
- class: 'image2d'
8
+ class: 'image2d',
9
+ metadata: {
10
+ folder: 'dom_tiles',
11
+ show_annotations: true,
12
+ show_annotation_labels: true
13
+ }
9
14
  },
10
15
  {
11
16
  type: 'tmp',
@@ -13,7 +18,14 @@ export default [
13
18
  group: 'output',
14
19
  visible: true,
15
20
  opacity: 1,
16
- class: 'tmp'
21
+ class: 'tmp',
22
+ metadata: {
23
+ folder: 'tem',
24
+ borderStyle: 'transparent',
25
+ colorType: 'turbo',
26
+ show_annotations: true,
27
+ show_annotation_labels: true
28
+ }
17
29
  },
18
30
  {
19
31
  type: 'dsm',
@@ -21,7 +33,14 @@ export default [
21
33
  group: 'output',
22
34
  visible: false,
23
35
  opacity: 0.5,
24
- class: 'image2d'
36
+ class: 'image2d',
37
+ metadata: {
38
+ folder: 'dsm_tiles',
39
+ borderStyle: 'transparent',
40
+ colorType: 'turbo',
41
+ show_annotations: true,
42
+ show_annotation_labels: true
43
+ }
25
44
  },
26
45
  {
27
46
  type: 'mesh3d',
@@ -39,14 +58,6 @@ export default [
39
58
  opacity: 1,
40
59
  class: 'pnts'
41
60
  },
42
- {
43
- type: 'ndvi',
44
- name: '植被指数(NDVI)',
45
- group: 'output',
46
- visible: true,
47
- opacity: 1,
48
- class: 'ndvi'
49
- },
50
61
  {
51
62
  type: 'photos',
52
63
  name: '照片',
@@ -54,5 +65,85 @@ export default [
54
65
  visible: false,
55
66
  opacity: 1,
56
67
  class: 'photos'
68
+ },
69
+ {
70
+ type: 'ndvi',
71
+ name: 'NDVI',
72
+ group: 'index',
73
+ visible: true,
74
+ opacity: 1,
75
+ class: 'ndvi',
76
+ metadata: {
77
+ folder: 'ndvi',
78
+ borderStyle: 'transparent',
79
+ colorType: 'red-green',
80
+ bands: ['NIR', 'Red'],
81
+ show_annotations: true,
82
+ show_annotation_labels: true
83
+ }
84
+ },
85
+ {
86
+ type: 'gndvi',
87
+ name: 'GNDVI',
88
+ group: 'index',
89
+ visible: true,
90
+ opacity: 1,
91
+ class: 'gndvi',
92
+ metadata: {
93
+ folder: 'gndvi',
94
+ borderStyle: 'transparent',
95
+ colorType: 'glow',
96
+ bands: ['NIR', 'Green'],
97
+ show_annotations: true,
98
+ show_annotation_labels: true
99
+ }
100
+ },
101
+ {
102
+ type: 'lci',
103
+ name: 'LCI',
104
+ group: 'index',
105
+ visible: true,
106
+ opacity: 1,
107
+ class: 'lci',
108
+ metadata: {
109
+ folder: 'lci',
110
+ borderStyle: 'transparent',
111
+ colorType: 'turbo',
112
+ bands: ['NIR', 'RedEdge', 'Red'],
113
+ show_annotations: true,
114
+ show_annotation_labels: true
115
+ }
116
+ },
117
+ {
118
+ type: 'ndre',
119
+ name: 'NDRE',
120
+ group: 'index',
121
+ visible: true,
122
+ opacity: 1,
123
+ class: 'ndre',
124
+ metadata: {
125
+ folder: 'ndre',
126
+ borderStyle: 'transparent',
127
+ colorType: 'gray',
128
+ bands: ['NIR', 'RedEdge'],
129
+ show_annotations: true,
130
+ show_annotation_labels: true
131
+ }
132
+ },
133
+ {
134
+ type: 'osavi',
135
+ name: 'OSAVI',
136
+ group: 'index',
137
+ visible: true,
138
+ opacity: 1,
139
+ class: 'osavi',
140
+ metadata: {
141
+ folder: 'osavi',
142
+ borderStyle: 'transparent',
143
+ colorType: 'red-green',
144
+ bands: ['NIR', 'Red'],
145
+ show_annotations: true,
146
+ show_annotation_labels: true
147
+ }
57
148
  }
58
149
  ]
@@ -1,5 +1,6 @@
1
1
  export {default as cameras} from './cameras'
2
2
  export {default as layerGroups} from './layer_groups'
3
+ export {default as layerGroupsMultispectral} from './layer_groups_multispectral'
3
4
  export {default as bmapTypes} from './bmap_types'
4
5
  export {default as dsmColors} from './dsm_colors'
5
6
  export {default as defaultLayers} from './default_layers'
@@ -0,0 +1,34 @@
1
+ export default [
2
+ {
3
+ id: 'output',
4
+ type: 'output',
5
+ name: '基础成果',
6
+ collapsed: false,
7
+ visible: true,
8
+ opacity: 1
9
+ },
10
+ {
11
+ id: 'index',
12
+ type: 'index',
13
+ name: '植被指数',
14
+ collapsed: false,
15
+ visible: true,
16
+ opacity: 1
17
+ },
18
+ {
19
+ id: 'dataset',
20
+ type: 'dataset',
21
+ name: '数据集',
22
+ collapsed: false,
23
+ visible: true,
24
+ opacity: 1
25
+ },
26
+ {
27
+ id: 'overlay',
28
+ type: 'overlay',
29
+ name: '覆盖物',
30
+ collapsed: false,
31
+ visible: true,
32
+ opacity: 1
33
+ }
34
+ ]
@@ -9,6 +9,7 @@ export default {
9
9
  dom: 'icon-tuxiang',
10
10
  dsm: 'icon-moxing',
11
11
  ndvi: 'icon-zhishu',
12
+ index: 'icon-zhishu',
12
13
  mesh3d: 'icon-mesh',
13
14
  point_cloud: 'icon-dianyun',
14
15
  photos: 'icon-24gf-photoAlbum',
@@ -1,9 +1,9 @@
1
- export const CLEAR_COLOR = [0, 0, 0, 0]
2
- export const MAX_TEXTURE_DIMENSION = 1024
3
- export const EARTH_SUN_DISTANCE = 149600000000
4
- export const EARTH_CIRCUMFERENCE = 40075016.686
5
- export const SUN_RADIUS = 695508000
6
- export const DEG2RAD = 0.017453292519943295
7
- export const SLOPEFACTOR = 0.0333334
8
- export const RGB_REGEX = /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/
9
- export const HEX_REGEX = /(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/ig
1
+ export const CLEAR_COLOR = [0, 0, 0, 0]
2
+ export const MAX_TEXTURE_DIMENSION = 1024
3
+ export const EARTH_SUN_DISTANCE = 149600000000
4
+ export const EARTH_CIRCUMFERENCE = 40075016.686
5
+ export const SUN_RADIUS = 695508000
6
+ export const DEG2RAD = 0.017453292519943295
7
+ export const SLOPEFACTOR = 0.0333334
8
+ export const RGB_REGEX = /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/
9
+ export const HEX_REGEX = /(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/ig
@@ -1,98 +1,98 @@
1
- const defaultOptions = {
2
- tileFormat: 'float32',
3
- tileSize: 256,
4
- colorScale: [],
5
- sentinelValues: [],
6
- transitions: false,
7
- transitionTimeMs: 800,
8
- debug: false,
9
- extraPixelLayers: 0,
10
- colorscaleMaxLength: 16,
11
- sentinelMaxLength: 16,
12
-
13
- // default TileLayer options
14
- minZoom: 0,
15
- maxZoom: 18,
16
- subdomains: 'abc',
17
- errorTileUrl: '',
18
- zoomOffset: 0,
19
- tms: false,
20
- zoomReverse: false,
21
- detectRetina: false,
22
- crossOrigin: false,
23
-
24
- // multi-analyze default options
25
- glOperation: 'none',
26
- multiLayers: 0,
27
- operationUrlA: '',
28
- operationUrlB: '',
29
- operationUrlC: '',
30
- operationUrlD: '',
31
- operationUrlE: '',
32
- operationUrlF: '',
33
- filterLowA: 0,
34
- filterHighA: 100000,
35
- filterLowB: 0,
36
- filterHighB: 100000,
37
- filterLowC: 0,
38
- filterHighC: 100000,
39
- filterLowD: 0,
40
- filterHighD: 100000,
41
- filterLowE: 0,
42
- filterHighE: 100000,
43
- filterLowF: 0,
44
- filterHighF: 100000,
45
- multiplierA: 1,
46
- multiplierB: 1,
47
- multiplierC: 1,
48
- multiplierD: 1,
49
- multiplierE: 1,
50
- multiplierF: 1,
51
-
52
- // Hillshading default options
53
- hillshadeType: 'none', // none, simple or pregen
54
- hsSimpleZoomdelta: 0,
55
- hsSimpleSlopescale: 3.0,
56
- hsSimpleAzimuth: 315,
57
- hsSimpleAltitude: 70,
58
- hsAdvValueScale: 1.0,
59
- hsAdvPixelScale: 'auto',
60
- hsAdvSoftIterations: 10,
61
- hsAdvAmbientIterations: 10,
62
- hsAdvSunRadiusMultiplier: 100,
63
- hsAdvFinalSoftMultiplier: 1.0,
64
- hsAdvFinalAmbientMultiplier: 0.25,
65
- hsAdvBaselayerUrl: '',
66
- hsAdvSmoothInput: false,
67
- hsAdvSmoothInputKernel: 3,
68
- hsPregenUrl: '',
69
- _hillshadeOptions: { hillshadeType: 'none' },
70
-
71
- // Contours default options
72
- contourType: 'none', // none, lines or illuminated
73
- contourSmoothLines: false,
74
- contourSmoothInput: false,
75
- contourSmoothInputKernel: 7,
76
- contourScaleFactor: 1,
77
- contourInterval: 25,
78
- contourIndexInterval: 100,
79
- contourLineColor: '#000000',
80
- contourIlluminatedHighlightColor: 'rgba(177,174,164,.5)',
81
- contourIlluminatedShadowColor: '#5b5143',
82
- contourIlluminatedShadowSize: 2, // px
83
- contourLineWeight: 0.5, // px
84
- contourLineIndexWeight: 2.0, // px
85
- contourIndexLabels: false,
86
- contourLabelFont: '12px Arial',
87
- contourLabelDistance: 250,
88
- contourHypso: false,
89
- contourHypsoDomain: [0, 1000, 2000],
90
- contourHypsoColors: ['#486341', '#e5d9c9', '#dddddd'],
91
- contourBathy: false,
92
- contourBathyDomain: [-2000, 0],
93
- contourBathyColors: ['#315d9b', '#d5f2ff'],
94
- contourBathyShadowColor: '#4e5c66',
95
- contourBathyHighlightColor: 'rgba(224, 242, 255, .5)'
96
- }
97
-
1
+ const defaultOptions = {
2
+ tileFormat: 'float32',
3
+ tileSize: 256,
4
+ colorScale: [],
5
+ sentinelValues: [],
6
+ transitions: false,
7
+ transitionTimeMs: 800,
8
+ debug: false,
9
+ extraPixelLayers: 0,
10
+ colorscaleMaxLength: 16,
11
+ sentinelMaxLength: 16,
12
+
13
+ // default TileLayer options
14
+ minZoom: 0,
15
+ maxZoom: 18,
16
+ subdomains: 'abc',
17
+ errorTileUrl: '',
18
+ zoomOffset: 0,
19
+ tms: false,
20
+ zoomReverse: false,
21
+ detectRetina: false,
22
+ crossOrigin: false,
23
+
24
+ // multi-analyze default options
25
+ glOperation: 'none',
26
+ multiLayers: 0,
27
+ operationUrlA: '',
28
+ operationUrlB: '',
29
+ operationUrlC: '',
30
+ operationUrlD: '',
31
+ operationUrlE: '',
32
+ operationUrlF: '',
33
+ filterLowA: 0,
34
+ filterHighA: 100000,
35
+ filterLowB: 0,
36
+ filterHighB: 100000,
37
+ filterLowC: 0,
38
+ filterHighC: 100000,
39
+ filterLowD: 0,
40
+ filterHighD: 100000,
41
+ filterLowE: 0,
42
+ filterHighE: 100000,
43
+ filterLowF: 0,
44
+ filterHighF: 100000,
45
+ multiplierA: 1,
46
+ multiplierB: 1,
47
+ multiplierC: 1,
48
+ multiplierD: 1,
49
+ multiplierE: 1,
50
+ multiplierF: 1,
51
+
52
+ // Hillshading default options
53
+ hillshadeType: 'none', // none, simple or pregen
54
+ hsSimpleZoomdelta: 0,
55
+ hsSimpleSlopescale: 3.0,
56
+ hsSimpleAzimuth: 315,
57
+ hsSimpleAltitude: 70,
58
+ hsAdvValueScale: 1.0,
59
+ hsAdvPixelScale: 'auto',
60
+ hsAdvSoftIterations: 10,
61
+ hsAdvAmbientIterations: 10,
62
+ hsAdvSunRadiusMultiplier: 100,
63
+ hsAdvFinalSoftMultiplier: 1.0,
64
+ hsAdvFinalAmbientMultiplier: 0.25,
65
+ hsAdvBaselayerUrl: '',
66
+ hsAdvSmoothInput: false,
67
+ hsAdvSmoothInputKernel: 3,
68
+ hsPregenUrl: '',
69
+ _hillshadeOptions: { hillshadeType: 'none' },
70
+
71
+ // Contours default options
72
+ contourType: 'none', // none, lines or illuminated
73
+ contourSmoothLines: false,
74
+ contourSmoothInput: false,
75
+ contourSmoothInputKernel: 7,
76
+ contourScaleFactor: 1,
77
+ contourInterval: 25,
78
+ contourIndexInterval: 100,
79
+ contourLineColor: '#000000',
80
+ contourIlluminatedHighlightColor: 'rgba(177,174,164,.5)',
81
+ contourIlluminatedShadowColor: '#5b5143',
82
+ contourIlluminatedShadowSize: 2, // px
83
+ contourLineWeight: 0.5, // px
84
+ contourLineIndexWeight: 2.0, // px
85
+ contourIndexLabels: false,
86
+ contourLabelFont: '12px Arial',
87
+ contourLabelDistance: 250,
88
+ contourHypso: false,
89
+ contourHypsoDomain: [0, 1000, 2000],
90
+ contourHypsoColors: ['#486341', '#e5d9c9', '#dddddd'],
91
+ contourBathy: false,
92
+ contourBathyDomain: [-2000, 0],
93
+ contourBathyColors: ['#315d9b', '#d5f2ff'],
94
+ contourBathyShadowColor: '#4e5c66',
95
+ contourBathyHighlightColor: 'rgba(224, 242, 255, .5)'
96
+ }
97
+
98
98
  export default defaultOptions