/** * Checks the coverage described by the specified geometry and sample model does not exceeds the * output WCS limits * * @param info * @param gridRange2D * @param sampleModel */ public static void checkOutputLimits( WCSInfo info, GridEnvelope2D gridRange2D, SampleModel sampleModel) { // do we have to check a limit at all? long limit = info.getMaxOutputMemory() * 1024; if (limit <= 0) { return; } // compute the coverage memory usage and compare with limit long actual = getCoverageSize(gridRange2D, sampleModel); if (actual > limit) { throw new WcsException( "This request is trying to generate too much data, " + "the limit is " + formatBytes(limit) + " but the actual amount of bytes to be " + "written in the output is " + formatBytes(actual)); } }
long limit = wcs.getMaxOutputMemory() * 1024; if (limit <= 0) { return;
@Override protected void wrapInternal(Map properties, SimpleHash model, WCSInfo wcsInfo) { WorkspaceInfo workspaceInfo = wcsInfo.getWorkspace(); properties.put("workspaceName", workspaceInfo != null ? workspaceInfo.getName() : "NO_WORKSPACE"); properties.put("enabled", wcsInfo.isEnabled() ? "true" : "false"); properties.put("name", wcsInfo.getName()); properties.put("title", wcsInfo.getTitle()); properties.put("maintainer", wcsInfo.getMaintainer()); properties.put("abstract", wcsInfo.getAbstract()); properties.put("accessConstraints", wcsInfo.getAccessConstraints()); properties.put("fees", wcsInfo.getFees()); properties.put("versions", wcsInfo.getVersions()); properties.put("keywords", wcsInfo.getKeywords()); properties.put("metadataLink", wcsInfo.getMetadataLink()); properties.put("citeCompliant", wcsInfo.isCiteCompliant() ? "true" : "false"); properties.put("onlineResource", wcsInfo.getOnlineResource()); properties.put("schemaBaseURL", wcsInfo.getSchemaBaseURL()); properties.put("verbose", wcsInfo.isVerbose() ? "true" : "false"); properties.put("isSubsamplingEnabled", wcsInfo.isSubsamplingEnabled() ? "true" : "false"); properties.put("overviewPolicy", wcsInfo.getOverviewPolicy()); properties.put("maxInputMemory", String.valueOf(wcsInfo.getMaxInputMemory())); properties.put("maxOutputMemory", String.valueOf(wcsInfo.getMaxOutputMemory())); } });
coverageName, reader.getCoordinateReferenceSystem(), dimensions); long outputLimit = wcs.getMaxOutputMemory() * 1024; long inputLimit = wcs.getMaxInputMemory() * 1024;