Skip to content

Commit

Permalink
Do not use item_assets to obtain asset data
Browse files Browse the repository at this point in the history
As we need to check the protocol for href, we cannot rely on this extension anymore.
  • Loading branch information
inigo-cobian committed Jan 30, 2025
1 parent 038752f commit 91add51
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<JsonNode> response = Unirest.get(searchEndpoint.get() + parameters).asJson();
Expand Down

0 comments on commit 91add51

Please sign in to comment.