bruce-models 4.6.6 → 4.6.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.
@@ -4520,8 +4520,9 @@
4520
4520
  // Converts polygons to GeoJSON coordinates.
4521
4521
  // This will close the polygon if it's not already closed and remove consecutive duplicates.
4522
4522
  const coordinates = closePolygonCoordinates(sortedPolygons.map(polygon => {
4523
- return removeConsecutiveDuplicates(polygon.LinearRing.split(' ').map(coord => {
4524
- const [lon, lat, alt] = coord.split(',').map(Number);
4523
+ const points = ParsePoints(polygon.LinearRing);
4524
+ return removeConsecutiveDuplicates(points.map(coord => {
4525
+ const { longitude: lon, latitude: lat, altitude: alt } = coord;
4525
4526
  return (altitude != null ? [lon, lat, altitude] : [lon, lat, alt !== undefined ? alt : 0]);
4526
4527
  }));
4527
4528
  }));
@@ -4533,8 +4534,9 @@
4533
4534
  }
4534
4535
  }
4535
4536
  if (!jGeometry && geometry.LineString) {
4536
- const coordinates = removeConsecutiveDuplicates(geometry.LineString.split(' ').map(coord => {
4537
- const [lon, lat, alt] = coord.split(',').map(Number);
4537
+ const points = ParsePoints(geometry.LineString);
4538
+ const coordinates = removeConsecutiveDuplicates(points.map(coord => {
4539
+ const { longitude: lon, latitude: lat, altitude: alt } = coord;
4538
4540
  return (altitude != null ? [lon, lat, altitude] : [lon, lat, alt !== undefined ? alt : 0]);
4539
4541
  }));
4540
4542
  if (coordinates.length >= 2) {
@@ -4545,12 +4547,15 @@
4545
4547
  }
4546
4548
  }
4547
4549
  if (!jGeometry && geometry.Point) {
4548
- const [lon, lat, alt] = geometry.Point.split(',').map(Number);
4549
- const coordinates = altitude != null ? [lon, lat, altitude] : [lon, lat, alt !== undefined ? alt : 0];
4550
- jGeometry = {
4551
- coordinates: coordinates,
4552
- type: exports.GeoJson.EType.Point
4553
- };
4550
+ const points = ParsePoints(geometry.Point);
4551
+ if (points.length) {
4552
+ const { longitude: lon, latitude: lat, altitude: alt } = points[0];
4553
+ const coordinates = altitude != null ? [lon, lat, altitude] : [lon, lat, alt !== undefined ? alt : 0];
4554
+ jGeometry = {
4555
+ coordinates: coordinates,
4556
+ type: exports.GeoJson.EType.Point
4557
+ };
4558
+ }
4554
4559
  }
4555
4560
  if (jGeometry) {
4556
4561
  collection.push(jGeometry);
@@ -13746,7 +13751,7 @@
13746
13751
  })(exports.DataSource || (exports.DataSource = {}));
13747
13752
 
13748
13753
  // This is updated with the package.json version on build.
13749
- const VERSION = "4.6.6";
13754
+ const VERSION = "4.6.7";
13750
13755
 
13751
13756
  exports.VERSION = VERSION;
13752
13757
  exports.AbstractApi = AbstractApi;