Skip to content

Commit

Permalink
add summaries and status into collection
Browse files Browse the repository at this point in the history
  • Loading branch information
HavierD committed May 21, 2024
1 parent 81f57a1 commit 612fc35
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
13 changes: 13 additions & 0 deletions features/src/main/resources/schema/features/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,8 @@ components:
type: string
description: a description of the features in the collection
example: An address.
summaries:
$ref: '#/components/schemas/summaries'
links:
type: array
example:
Expand Down Expand Up @@ -901,6 +903,17 @@ components:
type: array
items:
type: number
summaries:
type: object
properties:
score:
type: string
description: score of the data
example: 0.8
status:
type: string
description: status of the data
example: onGoing
timeStamp:
type: string
description: This property indicates the time and date when the response was generated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ default <F extends StacCollectionModel> Collection getCollection(F m, String hos
.collect(Collectors.toList()));
}

if (m.getSummaries() != null) {
var summariesModel= m.getSummaries();
Summaries summaries = new Summaries();
summaries.setScore(String.valueOf(summariesModel.getScore()));
summaries.setStatus(summariesModel.getStatus());
collection.setSummaries(summaries);
}

return collection;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ public enum CQLCollectionsField {
category(StacBasicField.DiscoveryCategories.searchField, StacBasicField.DiscoveryCategories.displayField),
providers(StacBasicField.Providers.searchField, StacBasicField.Providers.displayField),
discovery_categories(StacBasicField.DiscoveryCategories.searchField, StacBasicField.DiscoveryCategories.displayField),
id(StacBasicField.UUID.searchField, StacBasicField.UUID.displayField);
id(StacBasicField.UUID.searchField, StacBasicField.UUID.displayField),
links(StacBasicField.Links.searchField, StacBasicField.Links.displayField),
status(StacSummeries.Status.searchField, StacSummeries.Status.displayField),
;

private final String searchField;
private final String displayField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ public enum StacBasicField {
DiscoveryCategories(
"discovery_categories", // This result in the whole themes section return
"summaries.discovery_categories"
);
),
Links("links", "links")
;

public final String searchField; // Field in STAC object
public final String displayField; // Field that is named externally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ public enum StacSummeries {
Temporal("summaries.temporal", "extent.temporal", List.of(TemporalStart, TemporalEnd)),
UpdateFrequency("summaries.update_frequency", "summaries.update_frequency"),
DatasetProvider("summaries.dataset_provider", "summaries.dataset_provider"),
DatasetGroup("summaries.dataset_group", "summaries.dataset_group");

DatasetGroup("summaries.dataset_group", "summaries.dataset_group"),
Status("summaries.status", "summaries.status")
;
public final String searchField;
public final String displayField;
public final List<StacSummeries> subfields;
Expand Down

0 comments on commit 612fc35

Please sign in to comment.