@mapcatch/util 2.2.10 → 2.2.12

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.
@@ -75800,8 +75800,9 @@ function parsePhotos(r, n) {
75800
75800
  width: _0.width,
75801
75801
  height: _0.height,
75802
75802
  ext: E0,
75803
+ camera_serial_number: _0.camera_serial_number,
75803
75804
  parameters: _0.pre_calib_param || null
75804
- }, l0 = o.find((A0) => A0.width === n0.width && A0.height === n0.height && A0.ext === n0.ext && _$1.isEqual(A0.parameters, n0.parameters));
75805
+ }, l0 = o.find((A0) => A0.width === n0.width && A0.height === n0.height && A0.ext === n0.ext && _$1.isEqual(A0.parameters, n0.parameters) && A0.camera_serial_number === n0.camera_serial_number);
75805
75806
  l0 || (l0 = n0, l0.fileList = [], o.push(l0)), l0.fileList.push({
75806
75807
  name: e0.split("\\").pop(),
75807
75808
  filesize: _0.filesize,
@@ -86046,11 +86047,12 @@ class GeoidCoordinateTransformer {
86046
86047
  if (!fs.existsSync(o))
86047
86048
  throw new Error("tiff not exists");
86048
86049
  this.destroy(), this.tiff = await geotiff.fromFile(o), this.image = await this.tiff.getImage(), this.width = this.image.getWidth(), this.height = this.image.getHeight();
86049
- const l = this.image.getGeoKeys(), s = VAFgVHdDsUKZGZRjaSIfx.toProj4(l), [c, m] = this.image.getOrigin(), [p, H] = this.image.getResolution(), d = p * this.width, x = H * this.height;
86050
- this.projection = proj4("WGS84", s.proj4), this.coord2pixel = ([Y, e0]) => {
86051
- let { x: _0, y: E0 } = this.projection.forward({ x: Y, y: e0 }), n0 = (_0 - c) / d, l0 = (E0 - m) / x;
86052
- const A0 = this.width * n0, T0 = this.height * l0, J = Math.floor(A0), o0 = Math.floor(T0);
86053
- return J < 0 || J >= this.width || o0 < 0 || o0 >= this.height ? null : [A0, T0, J, o0];
86050
+ const l = this.image.getGeoKeys(), s = VAFgVHdDsUKZGZRjaSIfx.toProj4(l), [c, m] = this.image.getOrigin(), [p, H] = this.image.getResolution(), d = this.image.getBoundingBox(), x = p * this.width, Y = H * this.height;
86051
+ this.projection = proj4("WGS84", s.proj4), this.coord2pixel = ([e0, _0]) => {
86052
+ (d[0] > 180 || d[2] > 180) && e0 < 0 ? e0 = e0 + 360 : (d[0] < -180 || d[2] < -180) && e0 > 0 && (e0 = e0 - 360);
86053
+ let { x: E0, y: n0 } = this.projection.forward({ x: e0, y: _0 }), l0 = (E0 - c) / x, A0 = (n0 - m) / Y;
86054
+ const T0 = this.width * l0, J = this.height * A0, o0 = Math.floor(T0), q = Math.floor(J);
86055
+ return o0 < 0 || o0 >= this.width || q < 0 || q >= this.height ? null : [T0, J, o0, q];
86054
86056
  }, this.memory && (this.data = await this.image.readRasters({ interleave: !0, samples: [0] }));
86055
86057
  }
86056
86058
  destroy() {