use of gov.usgs.cida.coastalhazards.model.summary.Full in project coastal-hazards by USGS-CIDA.
the class StormUtil method buildFullText.
private static Full buildFullText(Map<String, String> titleParts, String title, String surgeDescription) {
Full full = new Full();
String fullText = "This dataset contains a coastal erosion hazards analysis for " + titleParts.get("name") + ". The analysis is based on a storm-impact scaling model " + "that combines observations of beach morphology with hydrodynamic models to predict how sandy beaches, " + "the first line of defense for many coasts exposed to tropical storms and hurricanes, will respond during " + "a direct landfall. Storm-induced total water levels, due to both surge and waves, are compared to beach " + "and dune elevations to determine the probabilities of three types of coastal change - collision (dune erosion), " + "overwash, and inundation. " + surgeDescription + " Maximum wave heights in 20-m water depth, obtained from the " + "NOAA WaveWatch3 model 7-day forecast, were used to compute wave runup elevations at the shoreline. " + "Dune elevations were extracted from lidar topographic surveys. \n\nDisclaimer: This product is based on " + "published research results of the USGS National Assessment of Coastal Change Hazards Project and is " + "intended to indicate the potential for coastal change caused by storm surge and wave runup. This product is " + "based on an analysis that simplifies complex coastal change processes to two important aspects - " + "measured dune elevations and predicted total water levels. As such, the actual changes " + "that occur during extreme storms may be different than what is described here. Results " + "apply to open coast environments and do not consider potential coastal change along " + "inland waters. The public should not base evacuation decisions on this product. Citizens " + "should follow the evacuation advice of local emergency management authorities. ";
full.setTitle(title);
full.setText(fullText);
full.setPublications(new ArrayList<>());
return full;
}
use of gov.usgs.cida.coastalhazards.model.summary.Full in project coastal-hazards by USGS-CIDA.
the class StormUtil method buildStormTemplateSummary.
public static Summary buildStormTemplateSummary(Layer layer) {
Summary summary = new Summary();
Document cswDoc = getStormCswDocument(layer);
if (cswDoc != null) {
String title = MetadataUtil.extractFirstStringFromCswDoc(cswDoc, "/*/metadata/idinfo/citation/citeinfo/title");
Map<String, String> titleParts = parseTitleParts(title);
String cswAbstract = MetadataUtil.extractFirstStringFromCswDoc(cswDoc, "/*/metadata/idinfo/descript/abstract");
List<String> dataSrcList = MetadataUtil.extractStringsFromCswDoc(cswDoc, "/*/metadata/dataqual/lineage/srcinfo/srccite/citeinfo/title");
String surgeDescription = buildSurgeDescription(cswDoc);
Tiny tiny = buildTinyText(titleParts);
Medium medium = buildMediumText(titleParts);
Full full = buildFullText(titleParts, title, surgeDescription);
Legend legend = buildLegendText(titleParts);
summary.setTiny(tiny);
summary.setMedium(medium);
summary.setFull(full);
summary.setLegend(legend);
}
return summary;
}
use of gov.usgs.cida.coastalhazards.model.summary.Full in project coastal-hazards by USGS-CIDA.
the class TemplateResource method gatherTemplateSummary.
protected Summary gatherTemplateSummary(Summary previousSummary, List<Item> children) {
Summary newSummary = Summary.copyValues(previousSummary, null);
String keywords = previousSummary.getKeywords();
Set<String> keywordSet = keywordsFromString(keywords);
Set<Publication> publicationSet = new LinkedHashSet<>();
Full full = previousSummary.getFull();
List<Publication> publications = full.getPublications();
publicationSet.addAll(publications);
if (children != null) {
for (Item item : children) {
Set<String> childKeywords = keywordsFromString(item.getSummary().getKeywords());
keywordSet.addAll(childKeywords);
List<Publication> childPubs = item.getSummary().getFull().getPublications();
for (Publication pub : childPubs) {
publicationSet.add(Publication.copyValues(pub, null));
}
}
}
String newKeywords = StringUtils.join(keywordSet, "|");
newSummary.setKeywords(newKeywords);
newSummary.getFull().setPublications(Lists.newArrayList(publicationSet));
return newSummary;
}
use of gov.usgs.cida.coastalhazards.model.summary.Full in project coastal-hazards by USGS-CIDA.
the class FullSummaryAdapter method deserialize.
@Override
public Full deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
Full result = new Full();
if (json instanceof JsonObject) {
JsonObject fullJson = (JsonObject) json;
result.setTitle(fullJson.getAsJsonPrimitive("title").getAsString());
result.setText(fullJson.getAsJsonPrimitive("text").getAsString());
List<Publication> fullPubList = new LinkedList<>();
JsonObject publications = fullJson.getAsJsonObject("publications");
for (PublicationType type : PublicationType.values()) {
JsonArray typedArray = publications.getAsJsonArray(type.name());
if (typedArray != null) {
List<Map<String, Object>> typeList = context.deserialize(typedArray, ArrayList.class);
for (Map<String, Object> pubMap : typeList) {
if (!pubMap.containsKey(Publication.TITLE) || !pubMap.containsKey(Publication.LINK)) {
throw new IllegalStateException("Expected publication, was not a publication");
}
Publication pub = new Publication();
pub.setTitle((String) pubMap.get(Publication.TITLE));
pub.setLink((String) pubMap.get(Publication.LINK));
pub.setType(type);
fullPubList.add(pub);
}
}
}
result.setPublications(fullPubList);
}
return result;
}
Aggregations