/** * Checks if this dimension has a resolution * * @param domain */ public boolean hasResolution(String domain) { Utilities.ensureNonNull("name", domain); return metadataNames.contains(domain.toUpperCase() + "_DOMAIN_RESOLUTION"); }
/** Default implementation, implementers should override. */ @Override public boolean canProduce(String outputFormat) { Utilities.ensureNonNull("outputFormat", outputFormat); return outputFormats.contains(outputFormat) || mimeTypes.values().contains(outputFormat); }
/** * True if the reader has a dimension with the given name * * @throws IOException */ public boolean hasDomain(String name) throws IOException { Utilities.ensureNonNull("name", name); return "true" .equalsIgnoreCase(reader.getMetadataValue("HAS_" + name.toUpperCase() + "_DOMAIN")); }
public ReaderDimensionsAccessor(GridCoverage2DReader reader) throws IOException { Utilities.ensureNonNull("reader", reader); this.reader = reader; final String[] dimensions = reader.getMetadataNames(); if (dimensions != null) { metadataNames.addAll(Arrays.asList(dimensions)); } }
Map<String, String> fileExtensions, Map<String, String> mimeTypes) { Utilities.ensureNonNull("outputFormats", outputFormats); Utilities.ensureNonNull("GeoServer", geoserver); Utilities.ensureNonNull("fileExtensions", fileExtensions); Utilities.ensureNonNull("mimeTypes", mimeTypes); if (outputFormats.isEmpty()) { throw new IllegalArgumentException("Empty list of outputFormats provided");
/** * Extracts the custom domain lowest value (using String sorting) * * @throws IOException */ public String getCustomDomainDefaultValue(String name) throws IOException { Utilities.ensureNonNull("name", name); // see if we have an optimize way to get the minimum String minimum = reader.getMetadataValue(name.toUpperCase() + "_DOMAIN_MINIMUM"); if (minimum != null) { return minimum; } // ok, get the full domain then List<String> domain = getDomain(name); if (domain.isEmpty()) { return null; } else { return domain.get(0); } }
@Override public String getMimeType(String outputFormat) { Utilities.ensureNonNull("outputFormat", outputFormat); if (mimeTypes.containsKey(outputFormat)) { return (String) mimeTypes.get(outputFormat); } if (mimeTypes.values().contains(outputFormat)) { return outputFormat; } return null; }
Utilities.ensureNonNull("storeInfo", storeInfo); final Catalog catalog = storeInfo.getCatalog(); CoverageInfo info = null;
/** * Update the specified {@link CoverageInfo} with the updated {@link CoverageView} stored within * its metadata * * @param name * @param storeInfo * @param builder * @param coverageInfo */ public void updateCoverageInfo( String name, CoverageStoreInfo storeInfo, CatalogBuilder builder, CoverageInfo coverageInfo) throws Exception { Utilities.ensureNonNull("coverageInfo", coverageInfo); // clean up coverage dimensions for the update coverageInfo.getDimensions().clear(); CoverageInfo info = buildCoverageInfo(builder, storeInfo, coverageInfo, name); coverageInfo.getMetadata().put(CoverageView.COVERAGE_VIEW, this); coverageInfo.getDimensions().addAll(info.getDimensions()); }
public void encode( GridCoverage2D sourceCoverage, String outputFormat, Map<String, String> econdingParameters, OutputStream output) throws IOException { Utilities.ensureNonNull("sourceCoverage", sourceCoverage); Utilities.ensureNonNull("econdingParameters", econdingParameters); GeoTiffWriterHelper writerHelper = new GeoTiffWriterHelper(sourceCoverage); // compression handleCompression(econdingParameters, writerHelper); // tiling handleTiling(econdingParameters, sourceCoverage, writerHelper); // interleaving handleInterleaving(econdingParameters, sourceCoverage, writerHelper); if (geoserver.getService(WCSInfo.class).isLatLon()) { final ParameterValueGroup gp = writerHelper.getGeotoolsWriteParams(); gp.parameter(GeoTiffFormat.RETAIN_AXES_ORDER.getName().toString()).setValue(true); } try { writerHelper.write(output); } finally { sourceCoverage.dispose(false); } }
/** * @param updateFeatures if true update catalog with loaded granules * @param imageMosaicConfigHandler configuration handler being used * @param granuleAcceptors list of acceptors to deterrmine granule inclusion */ public ImageMosaicWalker( ImageMosaicConfigHandler configHandler, ImageMosaicEventHandlers eventHandler) { Utilities.ensureNonNull("config handler", configHandler); Utilities.ensureNonNull("event handler", eventHandler); this.configHandler = configHandler; this.eventHandler = eventHandler; }
protected DefaultFileDriver( final String name, final String description, final String title, final Hints implementationHints, final List<String> fileExtensions, final EnumSet<DriverCapabilities> driverCapabilities) { super(name, description, title, driverCapabilities, implementationHints); Utilities.ensureNonNull("fileExtensions", fileExtensions); this.fileExtensions = new ArrayList<String>(fileExtensions); }
@Override protected boolean checkName(String coverageName) { Utilities.ensureNonNull("coverageName", coverageName); return tiles.keySet().contains(coverageName); }
@Override PiecewiseTransform1D<DefaultPiecewiseTransform1DElement> generatePiecewise( Map<String, Object> params) { Utilities.ensureNonNull("params", params); double minimum = (double) params.get(KEY_MIN); double maximum = (double) params.get(KEY_MAX); return generateClampingPiecewise(minimum, maximum, minimum, maximum); } },
public void addGranule( final String typeName, final SimpleFeature granule, final Transaction transaction) throws IOException { Utilities.ensureNonNull("typeName", typeName); Utilities.ensureNonNull("granule", granule); Utilities.ensureNonNull("transaction", transaction); final DefaultFeatureCollection collection = new DefaultFeatureCollection(); collection.add(granule); addGranules(typeName, collection, transaction); }
/** * Set the provided layout for this {@link GridCoverage2DReader}- * * @param layout the {@link ImageLayout} to set. It must be nont null */ protected void setlayout(ImageLayout layout) { Utilities.ensureNonNull("layout", layout); this.imageLayout = (ImageLayout) layout.clone(); }
@Override public int compare(DateRange firstDateRange, DateRange secondDateRange) { Utilities.ensureNonNull("firstDateRange", firstDateRange); Utilities.ensureNonNull("secondDateRange", secondDateRange); final long beginFirst = firstDateRange.getMinValue().getTime(); final long endFirst = firstDateRange.getMaxValue().getTime(); final long beginSecond = secondDateRange.getMinValue().getTime(); final long endSecond = secondDateRange.getMaxValue().getTime(); return NumberRangeComparator.doubleCompare(beginFirst, endFirst, beginSecond, endSecond); } }
@Override public int compare(DateRange firstDateRange, DateRange secondDateRange) { Utilities.ensureNonNull("firstDateRange", firstDateRange); Utilities.ensureNonNull("secondDateRange", secondDateRange); final long beginFirst = firstDateRange.getMinValue().getTime(); final long endFirst = firstDateRange.getMaxValue().getTime(); final long beginSecond = secondDateRange.getMinValue().getTime(); final long endSecond = secondDateRange.getMaxValue().getTime(); return NumberRangeComparator.doubleCompare( beginFirst, endFirst, beginSecond, endSecond); } }
public void setRequestedGridGeometry(GridGeometry2D gridGeometry) { Utilities.ensureNonNull("girdGeometry", gridGeometry); requestedBBox = new ReferencedEnvelope((Envelope) gridGeometry.getEnvelope2D()); requestedRasterArea = gridGeometry.getGridRange2D().getBounds(); requestedGridGeometry = gridGeometry; requestedGridToWorld = (AffineTransform) gridGeometry.getGridToCRS2D(); }
public void createType(SimpleFeatureType featureType) throws IOException { Utilities.ensureNonNull("featureType", featureType); checkMosaicSchema(featureType); checkStore(); getTileIndexStore().createSchema(featureType); String typeName = featureType.getTypeName(); if (typeName != null) { addTypeName(typeName, true); } extractBasicProperties(typeName); }