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.
@@ -4580,8 +4580,9 @@ var Geometry;
4580
4580
  // Converts polygons to GeoJSON coordinates.
4581
4581
  // This will close the polygon if it's not already closed and remove consecutive duplicates.
4582
4582
  const coordinates = closePolygonCoordinates(sortedPolygons.map(polygon => {
4583
- return removeConsecutiveDuplicates(polygon.LinearRing.split(' ').map(coord => {
4584
- const [lon, lat, alt] = coord.split(',').map(Number);
4583
+ const points = ParsePoints(polygon.LinearRing);
4584
+ return removeConsecutiveDuplicates(points.map(coord => {
4585
+ const { longitude: lon, latitude: lat, altitude: alt } = coord;
4585
4586
  return (altitude != null ? [lon, lat, altitude] : [lon, lat, alt !== undefined ? alt : 0]);
4586
4587
  }));
4587
4588
  }));
@@ -4593,8 +4594,9 @@ var Geometry;
4593
4594
  }
4594
4595
  }
4595
4596
  if (!jGeometry && geometry.LineString) {
4596
- const coordinates = removeConsecutiveDuplicates(geometry.LineString.split(' ').map(coord => {
4597
- const [lon, lat, alt] = coord.split(',').map(Number);
4597
+ const points = ParsePoints(geometry.LineString);
4598
+ const coordinates = removeConsecutiveDuplicates(points.map(coord => {
4599
+ const { longitude: lon, latitude: lat, altitude: alt } = coord;
4598
4600
  return (altitude != null ? [lon, lat, altitude] : [lon, lat, alt !== undefined ? alt : 0]);
4599
4601
  }));
4600
4602
  if (coordinates.length >= 2) {
@@ -4605,12 +4607,15 @@ var Geometry;
4605
4607
  }
4606
4608
  }
4607
4609
  if (!jGeometry && geometry.Point) {
4608
- const [lon, lat, alt] = geometry.Point.split(',').map(Number);
4609
- const coordinates = altitude != null ? [lon, lat, altitude] : [lon, lat, alt !== undefined ? alt : 0];
4610
- jGeometry = {
4611
- coordinates: coordinates,
4612
- type: GeoJson.EType.Point
4613
- };
4610
+ const points = ParsePoints(geometry.Point);
4611
+ if (points.length) {
4612
+ const { longitude: lon, latitude: lat, altitude: alt } = points[0];
4613
+ const coordinates = altitude != null ? [lon, lat, altitude] : [lon, lat, alt !== undefined ? alt : 0];
4614
+ jGeometry = {
4615
+ coordinates: coordinates,
4616
+ type: GeoJson.EType.Point
4617
+ };
4618
+ }
4614
4619
  }
4615
4620
  if (jGeometry) {
4616
4621
  collection.push(jGeometry);
@@ -14021,7 +14026,7 @@ var DataSource;
14021
14026
  })(DataSource || (DataSource = {}));
14022
14027
 
14023
14028
  // This is updated with the package.json version on build.
14024
- const VERSION = "4.6.6";
14029
+ const VERSION = "4.6.7";
14025
14030
 
14026
14031
  export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityTypeVisualSettings, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
14027
14032
  //# sourceMappingURL=bruce-models.es5.js.map