public WcsCoverage(GridDataset.Gridset coverage, WcsDataset dataset) { this.dataset = dataset; if (this.dataset == null) { log.error("WcsCoverage(): non-null dataset required."); throw new IllegalArgumentException("Non-null dataset required."); } this.coverage = coverage; if (this.coverage == null) { log.error("WcsCoverage(): non-null coverage required."); throw new IllegalArgumentException("Non-null coverage required."); } this.coordSys = coverage.getGeoCoordSystem(); if (this.coordSys == null) { log.error("WcsCoverage(): Coverage must have non-null coordinate system."); throw new IllegalArgumentException("Non-null coordinate system required."); } this.name = this.coordSys.getName(); this.label = this.coordSys.getName(); this.range = new HashMap<String, WcsRangeField>(); StringBuilder descripSB = new StringBuilder("All parameters on the \"") .append(this.name) .append("\" coordinate system: "); for (GridDatatype curField : this.coverage.getGrids()) { String stdName = curField.findAttValueIgnoreCase("standard_name", ""); descripSB.append(stdName.length() == 0 ? curField.getFullName() : stdName).append(","); WcsRangeField field = new WcsRangeField(curField); range.put(field.getName(), field); } descripSB.setCharAt(descripSB.length() - 1, '.'); this.description = descripSB.toString(); this.nativeCRS = EPSG_OGC_CF_Helper.getWcs1_0CrsId(this.coordSys.getProjection()); this.defaultRequestCrs = "OGC:CRS84"; this.supportedCoverageFormatList = new ArrayList<WcsRequest.Format>(); // this.supportedCoverageFormatList = "application/x-netcdf"; this.supportedCoverageFormatList.add(WcsRequest.Format.GeoTIFF); this.supportedCoverageFormatList.add(WcsRequest.Format.GeoTIFF_Float); this.supportedCoverageFormatList.add(WcsRequest.Format.NetCDF3); }
public Set<String> getRangeFieldNames() { return range.keySet(); }
public Collection<WcsRangeField> getRange() { return range.values(); }
public boolean isRangeFieldName(String fieldName) { return range.containsKey(fieldName); }