From 91add5180f857d54f841b5a7efe62e065d3adacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8D=C3=B1igo=20Cobi=C3=A1n?= Date: Thu, 30 Jan 2025 10:26:58 +0100 Subject: [PATCH] Do not use item_assets to obtain asset data As we need to check the protocol for href, we cannot rely on this extension anymore. --- .../klab/stac/STACCollectionParser.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/adapters/klab.ogc/src/main/java/org/integratedmodelling/klab/stac/STACCollectionParser.java b/adapters/klab.ogc/src/main/java/org/integratedmodelling/klab/stac/STACCollectionParser.java index a3ccdfa97..5a4aea9be 100644 --- a/adapters/klab.ogc/src/main/java/org/integratedmodelling/klab/stac/STACCollectionParser.java +++ b/adapters/klab.ogc/src/main/java/org/integratedmodelling/klab/stac/STACCollectionParser.java @@ -25,10 +25,6 @@ public static String readCollectionId(JSONObject collection) { return collection.getString("id"); } - private static JSONObject readItemAssets(JSONObject collection) { - return collection.getJSONObject("item_assets"); - } - /** * Obtains the geometry from the collection data. * Currently, only available for dynamic collections. @@ -82,14 +78,6 @@ public static JSONObject readAssetsFromCollection(String collectionUrl, JSONObje return collection.getJSONObject("assets"); } - // item_assets is a shortcut for obtaining information about the assets - // https://github.com/stac-extensions/item-assets - if (collection.has("item_assets")) { - if (!collection.getJSONObject("item_assets").isEmpty()) { - return STACCollectionParser.readItemAssets(collection); - } - } - // TODO Move the query to another place. String parameters = "?collections=" + collectonId + "&limit=1"; HttpResponse response = Unirest.get(searchEndpoint.get() + parameters).asJson();