/** * Returns the coverage backed by the provided datasetId * * @param datasetId * @return the coverage, or null if not found, or if not a coverage */ public CoverageInfo getDatasetCoverage(String datasetId) { if (!datasetId.endsWith(DATASET_SUFFIX)) { LOGGER.fine( "Invalid dataset id " + datasetId + " it does not end with " + DATASET_SUFFIX); return null; } String coverageName = datasetId.substring(0, datasetId.length() - DATASET_SUFFIX.length()); LayerInfo layer = NCNameResourceCodec.getCoverage(catalog, coverageName); if (layer == null) { LOGGER.fine( "Invalid dataset id " + datasetId + " does not match any published dataset"); return null; } CoverageInfo ci = (CoverageInfo) layer.getResource(); if (!isValidDataset(ci)) { LOGGER.fine( "Invalid dataset id " + datasetId + " does not match any published dataset"); return null; } return ci; }
/** * Returns the coverage containing the specified coverage, or null if the syntax is incorrect, * the coverage does not exist, or it's not a dataset */ public CoverageInfo getGranuleCoverage(String granuleId) { // does it have the expected lexical structure? if (!granuleId.contains(GRANULE_SEPARATOR)) { return null; } String[] splitted = granuleId.split(GRANULE_SEPARATOR); if (splitted.length != 2) { return null; } // do we have the coverage? LayerInfo li = NCNameResourceCodec.getCoverage(catalog, splitted[0]); if (li == null) { return null; } // is it a EO dataset? CoverageInfo ci = (CoverageInfo) li.getResource(); if (isValidDataset(ci)) { return ci; } else { return null; } }
if (geoserver != null) { Catalog gsCatalog = geoserver.getCatalog(); LayerInfo info = NCNameResourceCodec.getCoverage(gsCatalog, coverageId); if (info != null) { map = info.getResource().getMetadata();
LayerInfo layer = NCNameResourceCodec.getCoverage(catalog, newCoverageID); if (layer != null) { coverages.add((CoverageInfo) layer.getResource());
if (geoserver != null) { Catalog gsCatalog = geoserver.getCatalog(); LayerInfo info = NCNameResourceCodec.getCoverage(gsCatalog, coverageId); if (info != null) { map = info.getResource().getMetadata();
LayerInfo layer = NCNameResourceCodec.getCoverage(catalog, newCoverageID); if (layer == null) { badCoverageIds.add(encodedCoverageId);
/** * Extracts the NetCDF encoding settings from the coverage identifier * * @param coverageId * @return */ static NetCDFLayerSettingsContainer getSettings(String coverageId) { GeoServer geoserver = GeoServerExtensions.bean(GeoServer.class); MetadataMap map = null; if (geoserver != null) { Catalog gsCatalog = geoserver.getCatalog(); LayerInfo info = NCNameResourceCodec.getCoverage(gsCatalog, coverageId); if (info != null) { map = info.getResource().getMetadata(); } } if (map != null && !map.isEmpty() && map.containsKey(NetCDFSettingsContainer.NETCDFOUT_KEY)) { NetCDFLayerSettingsContainer settings = (NetCDFLayerSettingsContainer) map.get( NetCDFSettingsContainer.NETCDFOUT_KEY, NetCDFLayerSettingsContainer.class); return settings; } return null; } }
final LayerInfo linfo = NCNameResourceCodec.getCoverage(catalog, request.getCoverageId()); if (linfo == null) { throw new WCS20Exception(