bruce-models 7.1.90 → 7.1.91

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.
@@ -17442,6 +17442,96 @@
17442
17442
  ImportLcc.ImportEntities = ImportEntities;
17443
17443
  })(exports.ImportLcc || (exports.ImportLcc = {}));
17444
17444
 
17445
+ (function (ImportTif) {
17446
+ /**
17447
+ * A few vertical CRSs a user is likely to be choosing between. Any EPSG vertical code is
17448
+ * accepted, so this is a convenience rather than the permitted set.
17449
+ */
17450
+ let EVerticalDatum;
17451
+ (function (EVerticalDatum) {
17452
+ // Heights are already on the ellipsoid, or the source is not elevation.
17453
+ EVerticalDatum[EVerticalDatum["None"] = 0] = "None";
17454
+ EVerticalDatum[EVerticalDatum["NAVD88"] = 5703] = "NAVD88";
17455
+ EVerticalDatum[EVerticalDatum["EGM96"] = 5773] = "EGM96";
17456
+ EVerticalDatum[EVerticalDatum["EGM2008"] = 3855] = "EGM2008";
17457
+ EVerticalDatum[EVerticalDatum["NZVD2016"] = 7839] = "NZVD2016";
17458
+ })(EVerticalDatum = ImportTif.EVerticalDatum || (ImportTif.EVerticalDatum = {}));
17459
+ /**
17460
+ * Reads an analysis out of a completed Pending Action.
17461
+ * @param action the completed analyze action
17462
+ * @returns the result, or null when the action carries none
17463
+ */
17464
+ function ReadAnalysis(action) {
17465
+ if (!(action === null || action === void 0 ? void 0 : action.Result)) {
17466
+ return null;
17467
+ }
17468
+ try {
17469
+ const parsed = typeof action.Result === "string" ? JSON.parse(action.Result) : action.Result;
17470
+ // A successful action wraps its answer; older ones returned it bare.
17471
+ const result = (parsed === null || parsed === void 0 ? void 0 : parsed.success) && (parsed === null || parsed === void 0 ? void 0 : parsed.result) ? parsed.result : parsed;
17472
+ return result && typeof result === "object" ? result : null;
17473
+ }
17474
+ catch (_a) {
17475
+ return null;
17476
+ }
17477
+ }
17478
+ ImportTif.ReadAnalysis = ReadAnalysis;
17479
+ /**
17480
+ * Whether the user has to be asked what the heights are referenced to.
17481
+ * @param analysis the analysis result
17482
+ * @returns true for elevation that declares no vertical CRS
17483
+ */
17484
+ function NeedsVerticalDatum(analysis) {
17485
+ if (!analysis) {
17486
+ return false;
17487
+ }
17488
+ return (analysis.type === exports.Tileset.EType.Terrain) && (analysis.verticalDeclared !== true);
17489
+ }
17490
+ ImportTif.NeedsVerticalDatum = NeedsVerticalDatum;
17491
+ /**
17492
+ * Whether the user has to be asked which CRS the source is in.
17493
+ * @param analysis the analysis result
17494
+ * @returns true when no horizontal CRS could be resolved at all
17495
+ */
17496
+ function NeedsHorizontalCrs(analysis) {
17497
+ if (!analysis) {
17498
+ return false;
17499
+ }
17500
+ return !(analysis.epsg && analysis.epsg > 0);
17501
+ }
17502
+ ImportTif.NeedsHorizontalCrs = NeedsHorizontalCrs;
17503
+ /**
17504
+ * Starts an analysis of an uploaded raster.
17505
+ * @param params
17506
+ * @returns the Pending Action to poll
17507
+ */
17508
+ function Analyze(params) {
17509
+ return __awaiter(this, void 0, void 0, function* () {
17510
+ let { api, analyze, req: reqParams } = params;
17511
+ if (!api) {
17512
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17513
+ }
17514
+ return api.POST("import/analyze/tif", analyze, exports.Api.PrepReqParams(reqParams));
17515
+ });
17516
+ }
17517
+ ImportTif.Analyze = Analyze;
17518
+ /**
17519
+ * Imports an analysed raster: the API creates the tileset and starts generating it.
17520
+ * @param params
17521
+ * @returns the created tileset and the Pending Action to poll
17522
+ */
17523
+ function Import(params) {
17524
+ return __awaiter(this, void 0, void 0, function* () {
17525
+ let { api, fileImport, req: reqParams } = params;
17526
+ if (!api) {
17527
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17528
+ }
17529
+ return api.POST("import/tif", fileImport, exports.Api.PrepReqParams(reqParams));
17530
+ });
17531
+ }
17532
+ ImportTif.Import = Import;
17533
+ })(exports.ImportTif || (exports.ImportTif = {}));
17534
+
17445
17535
  (function (ImportedFile) {
17446
17536
  /**
17447
17537
  * Returns cache identifier for a imported file record.
@@ -22893,7 +22983,7 @@
22893
22983
  })(exports.UrlUtils || (exports.UrlUtils = {}));
22894
22984
 
22895
22985
  // This is updated with the package.json version on build.
22896
- const VERSION = "7.1.90";
22986
+ const VERSION = "7.1.91";
22897
22987
 
22898
22988
  exports.VERSION = VERSION;
22899
22989
  exports.AbstractApi = AbstractApi;