From d8c517566ede0aa4c697f8048055fbdb1ab867a6 Mon Sep 17 00:00:00 2001 From: jbyrne Date: Mon, 20 May 2024 14:09:25 -0700 Subject: [PATCH] deploy/sit --- src/jpl/utils/SearchDatasets.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/jpl/utils/SearchDatasets.js b/src/jpl/utils/SearchDatasets.js index 83302fca..8172fb46 100644 --- a/src/jpl/utils/SearchDatasets.js +++ b/src/jpl/utils/SearchDatasets.js @@ -159,14 +159,18 @@ define([ var resolutionAndCoordinateSystemObject = additionalMetadataObject.spatialExtent.horizontalSpatialDomain.resolutionAndCoordinateSystem var relatedUrlsArray = additionalMetadataObject.relatedUrls if (resolutionAndCoordinateSystemObject) { - var resolutionObjects = resolutionAndCoordinateSystemObject.horizontalDataResolution.genericResolutions + var resolutionObjects = resolutionAndCoordinateSystemObject.horizontalDataResolution if (resolutionObjects) { - resolutionObjects.forEach(function(resolutionObject) { - var acrossTrack = resolutionObject.xdimension - var alongTrack = resolutionObject.ydimension - var unit = resolutionObject.unit - datasetObject["Dataset-Resolution"].push({"Dataset-AcrossTrackResolution": acrossTrack, "Dataset-AlongTrackResolution": alongTrack, "Unit": unit}) - }); + if(resolutionObjects.genericResolutions) { + resolutionObjects.genericResolutions.forEach(function(resolutionObject) { + var acrossTrack = resolutionObject.xdimension + var alongTrack = resolutionObject.ydimension + var unit = resolutionObject.unit + datasetObject["Dataset-Resolution"].push({"Dataset-AcrossTrackResolution": acrossTrack, "Dataset-AlongTrackResolution": alongTrack, "Unit": unit}) + }); + } else { + datasetObject["Dataset-Resolution"].push({"error": "Not Available"}) + } } else { // Resolution not available by error datasetObject["Dataset-Resolution"].push({"error": "Not Available"})