bruce-models 4.6.8 → 4.6.9
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/bruce-models.es5.js +15 -3
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +15 -3
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/common/geometry.js +14 -2
- package/dist/lib/common/geometry.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/common/geometry.d.ts +1 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -4468,7 +4468,7 @@
|
|
|
4468
4468
|
* @returns returns GeoJSON or null if conversion failed or resulted in an empty object.
|
|
4469
4469
|
*/
|
|
4470
4470
|
function ToGeoJsonFeature(params) {
|
|
4471
|
-
const { geometry, properties, altitude } = params;
|
|
4471
|
+
const { geometry, properties, altitude, noAltitude } = params;
|
|
4472
4472
|
// Primary collection of geometries.
|
|
4473
4473
|
// We will return a single feature that contains many geometries.
|
|
4474
4474
|
// That way we can attach properties to the top-level.
|
|
@@ -4523,6 +4523,9 @@
|
|
|
4523
4523
|
const points = ParsePoints(polygon.LinearRing);
|
|
4524
4524
|
return removeConsecutiveDuplicates(points.map(coord => {
|
|
4525
4525
|
const { longitude: lon, latitude: lat, altitude: alt } = coord;
|
|
4526
|
+
if (noAltitude) {
|
|
4527
|
+
return [lon, lat];
|
|
4528
|
+
}
|
|
4526
4529
|
return (altitude != null ? [lon, lat, altitude] : [lon, lat, alt !== undefined ? alt : 0]);
|
|
4527
4530
|
}));
|
|
4528
4531
|
}));
|
|
@@ -4537,6 +4540,9 @@
|
|
|
4537
4540
|
const points = ParsePoints(geometry.LineString);
|
|
4538
4541
|
const coordinates = removeConsecutiveDuplicates(points.map(coord => {
|
|
4539
4542
|
const { longitude: lon, latitude: lat, altitude: alt } = coord;
|
|
4543
|
+
if (noAltitude) {
|
|
4544
|
+
return [lon, lat];
|
|
4545
|
+
}
|
|
4540
4546
|
return (altitude != null ? [lon, lat, altitude] : [lon, lat, alt !== undefined ? alt : 0]);
|
|
4541
4547
|
}));
|
|
4542
4548
|
if (coordinates.length >= 2) {
|
|
@@ -4550,7 +4556,13 @@
|
|
|
4550
4556
|
const points = ParsePoints(geometry.Point);
|
|
4551
4557
|
if (points.length) {
|
|
4552
4558
|
const { longitude: lon, latitude: lat, altitude: alt } = points[0];
|
|
4553
|
-
|
|
4559
|
+
let coordinates;
|
|
4560
|
+
if (noAltitude) {
|
|
4561
|
+
coordinates = [lon, lat];
|
|
4562
|
+
}
|
|
4563
|
+
else {
|
|
4564
|
+
coordinates = altitude != null ? [lon, lat, altitude] : [lon, lat, alt !== undefined ? alt : 0];
|
|
4565
|
+
}
|
|
4554
4566
|
jGeometry = {
|
|
4555
4567
|
coordinates: coordinates,
|
|
4556
4568
|
type: exports.GeoJson.EType.Point
|
|
@@ -13750,7 +13762,7 @@
|
|
|
13750
13762
|
})(exports.DataSource || (exports.DataSource = {}));
|
|
13751
13763
|
|
|
13752
13764
|
// This is updated with the package.json version on build.
|
|
13753
|
-
const VERSION = "4.6.
|
|
13765
|
+
const VERSION = "4.6.9";
|
|
13754
13766
|
|
|
13755
13767
|
exports.VERSION = VERSION;
|
|
13756
13768
|
exports.AbstractApi = AbstractApi;
|