private String createSeriesLabel(DatasetEntity<?> series, String locale) { String station = series.getFeature().getLabelFrom(locale); String procedure = series.getProcedure().getLabelFrom(locale); String phenomenon = series.getPhenomenon().getLabelFrom(locale); String offering = series.getOffering().getLabelFrom(locale); StringBuilder sb = new StringBuilder(); sb.append(phenomenon).append(" "); sb.append(procedure).append(", "); sb.append(station).append(", "); return sb.append(offering).toString(); }
private List<SearchResult> convertToResults(List<MeasurementDatasetEntity> found, String locale) { List<SearchResult> results = new ArrayList<>(); for (MeasurementDatasetEntity searchResult : found) { String pkid = searchResult.getPkid().toString(); String phenomenonLabel = searchResult.getPhenomenon().getLabelFrom(locale); String procedureLabel = searchResult.getProcedure().getLabelFrom(locale); String stationLabel = searchResult.getFeature().getLabelFrom(locale); String offeringLabel = searchResult.getOffering().getLabelFrom(locale); String label = createTimeseriesLabel(phenomenonLabel, procedureLabel, stationLabel, offeringLabel); results.add(new TimeseriesSearchResult(pkid, label)); } return results; }
private StationOutput createCondensed(FeatureEntity entity, DbQuery parameters) { StationOutput stationOutput = new StationOutput(); stationOutput.setGeometry(createPoint(entity)); stationOutput.setId(Long.toString(entity.getPkid())); stationOutput.setLabel(entity.getLabelFrom(parameters.getLocale())); return stationOutput; }
private FeatureOutput createCondensed(FeatureEntity entity, DbQuery parameters) { FeatureOutput result = new FeatureOutput(); result.setId(Long.toString(entity.getPkid())); result.setLabel(entity.getLabelFrom(parameters.getLocale())); result.setDomainId(entity.getDomainId()); checkForHref(result, parameters); return result; }
private StationOutput createCondensed(FeatureEntity entity, DbQuery query) { StationOutput result = new StationOutput(); IoParameters parameters = query.getParameters(); String id = Long.toString(entity.getId()); String label = entity.getLabelFrom(query.getLocale()); Geometry geometry = createPoint(entity, query); result.setId(id); result.setValue(StationOutput.PROPERTIES, label, parameters, result::setLabel); result.setValue(StationOutput.GEOMETRY, geometry, parameters, result::setGeometry); return result; }
private TimeseriesMetadataOutput createCondensed(MeasurementDatasetEntity entity, DbQuery query) throws DataAccessException { TimeseriesMetadataOutput output = new TimeseriesMetadataOutput() ; String locale = query.getLocale(); String phenomenonLabel = entity.getPhenomenon().getLabelFrom(locale); String procedureLabel = entity.getProcedure().getLabelFrom(locale); String stationLabel = entity.getFeature().getLabelFrom(locale); String offeringLabel = entity.getOffering().getLabelFrom(locale); output.setLabel(createTimeseriesLabel(phenomenonLabel, procedureLabel, stationLabel, offeringLabel)); output.setId(entity.getPkid().toString()); output.setUom(entity.getUnitI18nName(locale)); output.setStation(createCondensedStation(entity, query)); return output; }