@mapcatch/util 2.0.6 → 2.0.8
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/catchUtil.min.cjs.js +2928 -0
- package/dist/catchUtil.min.esm.js +44502 -42814
- package/dist/catchUtil.min.js +248 -248
- package/package.json +11 -2
- package/src/constants/annotation_color.js +0 -7
- package/src/constants/annotation_draw_style.js +0 -228
- package/src/constants/annotation_label_style.js +0 -76
- package/src/constants/annotation_style.js +0 -118
- package/src/constants/bmap_types.js +0 -44
- package/src/constants/cameras.js +0 -5
- package/src/constants/crs.js +0 -42099
- package/src/constants/crs_types.js +0 -22
- package/src/constants/default_layers.js +0 -149
- package/src/constants/dsm_colors.js +0 -10
- package/src/constants/error_codes.js +0 -44
- package/src/constants/height_colors.js +0 -1
- package/src/constants/index.js +0 -20
- package/src/constants/layer_folders.js +0 -6
- package/src/constants/layer_groups.js +0 -34
- package/src/constants/layer_groups_multispectral.js +0 -34
- package/src/constants/layer_icons.js +0 -19
- package/src/constants/map_style.js +0 -11
- package/src/constants/measurement_fields.js +0 -208
- package/src/constants/task_params.js +0 -33
- package/src/constants/tools.js +0 -20
- package/src/event/event.js +0 -191
- package/src/event/event_bus.js +0 -5
- package/src/event/index.js +0 -2
- package/src/gl-operations/constants.js +0 -9
- package/src/gl-operations/default_options.js +0 -98
- package/src/gl-operations/index.js +0 -533
- package/src/gl-operations/reglCommands/contours.js +0 -27
- package/src/gl-operations/reglCommands/default.js +0 -46
- package/src/gl-operations/reglCommands/hillshading.js +0 -340
- package/src/gl-operations/reglCommands/index.js +0 -6
- package/src/gl-operations/reglCommands/multiLayers.js +0 -303
- package/src/gl-operations/reglCommands/transitions.js +0 -111
- package/src/gl-operations/reglCommands/util.js +0 -71
- package/src/gl-operations/renderer.js +0 -210
- package/src/gl-operations/shaders/fragment/convertDem.js +0 -26
- package/src/gl-operations/shaders/fragment/convolutionSmooth.js +0 -55
- package/src/gl-operations/shaders/fragment/diffCalc.js +0 -34
- package/src/gl-operations/shaders/fragment/drawResult.js +0 -47
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +0 -79
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +0 -60
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +0 -31
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +0 -61
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +0 -27
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +0 -26
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +0 -54
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +0 -81
- package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +0 -55
- package/src/gl-operations/shaders/fragment/interpolateColor.js +0 -66
- package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +0 -50
- package/src/gl-operations/shaders/fragment/interpolateValue.js +0 -137
- package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +0 -36
- package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +0 -46
- package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +0 -54
- package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +0 -62
- package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +0 -70
- package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +0 -78
- package/src/gl-operations/shaders/fragment/single.js +0 -93
- package/src/gl-operations/shaders/transform.js +0 -22
- package/src/gl-operations/shaders/util/computeColor.glsl +0 -85
- package/src/gl-operations/shaders/util/getTexelValue.glsl +0 -10
- package/src/gl-operations/shaders/util/isCloseEnough.glsl +0 -9
- package/src/gl-operations/shaders/util/rgbaToFloat.glsl +0 -18
- package/src/gl-operations/shaders/vertex/double.js +0 -17
- package/src/gl-operations/shaders/vertex/multi3.js +0 -20
- package/src/gl-operations/shaders/vertex/multi4.js +0 -23
- package/src/gl-operations/shaders/vertex/multi5.js +0 -26
- package/src/gl-operations/shaders/vertex/multi6.js +0 -29
- package/src/gl-operations/shaders/vertex/single.js +0 -13
- package/src/gl-operations/shaders/vertex/singleNotTransformed.js +0 -12
- package/src/gl-operations/texture_manager.js +0 -141
- package/src/gl-operations/util.js +0 -336
- package/src/index.js +0 -20
- package/src/measure/index.js +0 -209
- package/src/measure/tile_cache.js +0 -88
- package/src/mvs/index.js +0 -26
- package/src/mvs/protos/index.js +0 -12
- package/src/mvs/protos/proto_10.js +0 -155
- package/src/observation_pretict.js +0 -168
- package/src/photo-parser/exif/gps_tags.js +0 -33
- package/src/photo-parser/exif/ifd1_tags.js +0 -22
- package/src/photo-parser/exif/index.js +0 -143
- package/src/photo-parser/exif/parse_image.js +0 -290
- package/src/photo-parser/exif/string_values.js +0 -137
- package/src/photo-parser/exif/tags.js +0 -75
- package/src/photo-parser/exif/tiff_tags.js +0 -35
- package/src/photo-parser/exif/util.js +0 -103
- package/src/photo-parser/image-size/detector.js +0 -24
- package/src/photo-parser/image-size/fromFile.js +0 -55
- package/src/photo-parser/image-size/index.js +0 -2
- package/src/photo-parser/image-size/lookup.js +0 -37
- package/src/photo-parser/image-size/types/bmp.js +0 -10
- package/src/photo-parser/image-size/types/cur.js +0 -16
- package/src/photo-parser/image-size/types/dds.js +0 -10
- package/src/photo-parser/image-size/types/gif.js +0 -11
- package/src/photo-parser/image-size/types/heif.js +0 -35
- package/src/photo-parser/image-size/types/icns.js +0 -112
- package/src/photo-parser/image-size/types/ico.js +0 -74
- package/src/photo-parser/image-size/types/index.js +0 -43
- package/src/photo-parser/image-size/types/j2c.js +0 -11
- package/src/photo-parser/image-size/types/jp2.js +0 -22
- package/src/photo-parser/image-size/types/jpg.js +0 -157
- package/src/photo-parser/image-size/types/ktx.js +0 -18
- package/src/photo-parser/image-size/types/png.js +0 -36
- package/src/photo-parser/image-size/types/pnm.js +0 -74
- package/src/photo-parser/image-size/types/psd.js +0 -10
- package/src/photo-parser/image-size/types/svg.js +0 -100
- package/src/photo-parser/image-size/types/tga.js +0 -14
- package/src/photo-parser/image-size/types/tiff.js +0 -92
- package/src/photo-parser/image-size/types/utils.js +0 -83
- package/src/photo-parser/image-size/types/webp.js +0 -67
- package/src/photo-parser/index.js +0 -185
- package/src/report/annotations_report.js +0 -446
- package/src/report/index.js +0 -2
- package/src/report/map_util.js +0 -81
- package/src/report/pdf_creator.js +0 -247
- package/src/report/report.js +0 -581
- package/src/transform.js +0 -207
- 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
|
-
|