Interactive interface for browsing global, full-resolution satellite imagery
WV-2356 (#3916)
Jason Kentf2b114e6a0db
diff --git a/.github/workflows/build-test-app.yml b/.github/workflows/build-test-app.ymlindex ecca44ebf..6e1a17873 100644--- a/.github/workflows/build-test-app.yml+++ b/.github/workflows/build-test-app.yml@@ -44,7 +44,7 @@ jobs:if: ${{ runner.os == 'macOS' }}run: |npm run start &- sleep 5+ sleep 10npm run e2e:headless:chrome:localStorageDisablednpm run e2e:headless:chrome@@ -52,7 +52,7 @@ jobs:if: ${{ runner.os == 'Windows' }}run: |npm run start &- sleep 5+ sleep 10npm run e2e:headless:firefox:localStorageDisablednpm run e2e:headless:firefoxdiff --git a/tasks/python3/getVisMetadata.py b/tasks/python3/getVisMetadata.pyindex 4ff14b4e3..9480ab48f 100755--- a/tasks/python3/getVisMetadata.py+++ b/tasks/python3/getVisMetadata.py@@ -12,9 +12,16 @@ parser = OptionParser(usage="Usage: %s <config> <output_dir>" % prog)prog = os.path.basename(__file__)features_file = args[0]-input_file = args[1]+layer_order_file = args[1]output_file = args[2]+# These are alias or otherwise layers that don't exist in GIBS+skip_layers = [+ 'Land_Water_Map',+ 'Land_Mask',+ 'World_Database_on_Protected_Areas',+]+# NOTE: Only using these properties at this timeuse_keys = ['conceptIds',@@ -29,6 +36,7 @@ use_keys = []layer_metadata = {}daacMap = {}+failed_requests = []def get_daac(metadata):if metadata.get('conceptIds', None) is None:@@ -56,16 +64,28 @@ async def get_metadata(client, layer_id, base_url):for key in metadata_keys:if key not in use_keys:layer_metadata[layer_id].pop(key, None)+except Exception as e:- print('%s WARNING: Failed to retrieve metadata config for [%s]' % (prog, layer_id))+ global failed_requests+ if layer_id not in failed_requests:+ failed_requests.append(layer_id)+ print('%s WARNING: Failed to retrieve metadata config for [%s], will retry...' % (prog, layer_id))+ else:+ print('%s WARNING: Failed to retrieve metadata config for [%s] on second attempt' % (prog, layer_id))async def main(url):- with open(input_file, 'rt', encoding="utf-8") as layer_order:+ global skip_layers++ with open(layer_order_file, 'rt', encoding="utf-8") as layer_order:layer_ids = json.load(layer_order).get('layerOrder')- print('%s: Pulling vis metadata for %s layers... ' % (prog, len(layer_ids)))+ filtered_ids = list(filter(lambda l: l not in skip_layers, layer_ids))+ print('%s: Pulling vis metadata for %s layers... ' % (prog, len(filtered_ids)))++ limits = httpx.Limits(max_keepalive_connections=10, max_connections=10)+ async with httpx.AsyncClient(limits=limits) as client:+ await asyncio.gather(*[get_metadata(client, layer_id, url) for layer_id in filtered_ids])+ await asyncio.gather(*[get_metadata(client, layer_id, url) for layer_id in failed_requests])- async with httpx.AsyncClient() as client:- await asyncio.gather(*[get_metadata(client, layer, url) for layer in layer_ids])with open(output_file, "w", encoding="utf-8") as fp:# Format of this object will determine how this data is combined into wv.jsonjson.dump({ 'layers': layer_metadata}, fp, indent=2, sort_keys=True)