javax.media.jai.JAI.getTileCache()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(214)

本文整理了Java中javax.media.jai.JAI.getTileCache()方法的一些代码示例,展示了JAI.getTileCache()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JAI.getTileCache()方法的具体详情如下:
包路径:javax.media.jai.JAI
类名称:JAI
方法名:getTileCache

JAI.getTileCache介绍

暂无

代码示例

代码示例来源:origin: geoserver/geoserver

public TileCache getTileCache() {
  return getJAI().getTileCache();
}

代码示例来源:origin: geoserver/geoserver

if (!(jaiDef.getTileCache() instanceof ConcurrentTileCacheMultiMap)) {
  jaiDef.setTileCache(new ConcurrentTileCacheMultiMap());

代码示例来源:origin: geoserver/geoserver

TileCache jaiCache = jaiDef.getTileCache();
jai.setTileCache(jaiCache);

代码示例来源:origin: geotools/geotools

JAI.KEY_TILE_CACHE, JAI.getDefaultInstance().getTileCache());
if (operation != null) {
  worker.getClass()

代码示例来源:origin: geotools/geotools

setTileCache(tc);
} else {
  setTileCache(JAI.getDefaultInstance().getTileCache());

代码示例来源:origin: bcdev/beam

private static RenderingHints renderingHints(ImageLayout imageLayout) {
  final RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, imageLayout);
  hints.add(new RenderingHints(JAI.KEY_TILE_CACHE, JAI.getDefaultInstance().getTileCache()));
  return hints;
}

代码示例来源:origin: org.rescarta.rc-web/rc-web

public void stopTileCacheDebugging() {
  if (this.tileCacheObserver == null) {
    return;
  }
  ((SunTileCache) JAI.getDefaultInstance().getTileCache()).disableDiagnostics();
  ((SunTileCache) JAI.getDefaultInstance().getTileCache()).deleteObserver(this.tileCacheObserver);
  this.tileCacheObserver = null;
}

代码示例来源:origin: org.rescarta.rc-web/rc-web

public void startTileCacheDebugging() {
  if (this.tileCacheObserver != null) {
    return;
  }
  ((SunTileCache) JAI.getDefaultInstance().getTileCache()).enableDiagnostics();
  this.tileCacheObserver = new Observer() {
    @Override
    public void update(Observable o, Object tile) {
      System.out.println("Tile cache > " + SunTileCache.getCachedTileActions()[((CachedTile) tile).getAction()].getName().toUpperCase() + ": " + ((CachedTile) tile).getOwner().getClass().getName() + "@" + Integer.toHexString(((CachedTile) tile).getOwner().hashCode()));
    }
  };
  ((SunTileCache) JAI.getDefaultInstance().getTileCache()).addObserver(this.tileCacheObserver);
}

代码示例来源:origin: bcdev/beam

@Override
  public void actionPerformed(ActionEvent e) {
    JAI.getDefaultInstance().getTileCache().flush();
    System.gc();
    Debug.trace("JAI tile cache flushed!");
  }
});

代码示例来源:origin: org.geomajas.plugin/geomajas-plugin-printing

@PostConstruct
protected void initJai() {
  TileCache cache = JAI.getDefaultInstance().getTileCache();
  cache.setMemoryCapacity(getJaiTileCacheInMb() * MB);
  log.info("JAI cache size set to " + cache.getMemoryCapacity() / MB + " MB");
}

代码示例来源:origin: bcdev/beam

private static synchronized TileCache getTileCache() {
  if (tileCache == null) {
    boolean useFileTileCache = Boolean.parseBoolean(
        System.getProperty(GPF.USE_FILE_TILE_CACHE_PROPERTY, "false"));
    if (useFileTileCache) {
      tileCache = new SwappingTileCache(JAI.getDefaultInstance().getTileCache().getMemoryCapacity(),
          new DefaultSwapSpace(SwappingTileCache.DEFAULT_SWAP_DIR,
              BeamLogManager.getSystemLogger()));
    } else {
      tileCache = JAI.getDefaultInstance().getTileCache();
    }
    BeamLogManager.getSystemLogger().info(
        String.format("All GPF operators will share an instance of %s with a capacity of %dM",
            tileCache.getClass().getName(),
            tileCache.getMemoryCapacity() / (1024 * 1024)));
  }
  return tileCache;
}

代码示例来源:origin: org.n52.wps/52n-wps-io-geotools

private GTRasterDataBinding parseTiff(File file){
  JAI.getDefaultInstance().getTileCache().setMemoryCapacity(256*1024*1024);
  
  Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER,
      Boolean.TRUE);
  GeoTiffReader reader;
  try {
    reader = new GeoTiffReader(file, hints);
    GridCoverage2D coverage = (GridCoverage2D) reader.read(null);
    return new GTRasterDataBinding(coverage);
  } catch (DataSourceException e) {
    LOGGER.error(e.getMessage(), e);
    throw new RuntimeException(e);
  } catch (IOException e) {
    LOGGER.error(e.getMessage(), e);
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: org.geoserver.extension/gs-wps-core

@Override
  public synchronized void dispose() {
    super.dispose();

    // dispose iterator
    if (iter != null) {
      iter.done();
    }

    // remove from cache
    // TODO improve cache management
    JAI.getDefaultInstance().getTileCache().removeTiles(this);
  }
}

代码示例来源:origin: bcdev/beam

/**
 * Sets the memory capacity of the default tile cache in megabytes
 *
 * @param megabytes the memory capacity in megabytes
 */
public static void setDefaultTileCacheCapacity(int megabytes) {
  final TileCache tileCache = JAI.getDefaultInstance().getTileCache();
  // JAIJAIJAI
  tileCache.memoryControl();
  tileCache.setMemoryCapacity(megabytes * 1024L * 1024L);
  Debug.trace("JAI tile cache capacity set to " + tileCache.getMemoryCapacity() + " bytes");
}

代码示例来源:origin: bcdev/beam

@BeforeClass
public static void init() throws Exception {
  JAI.getDefaultInstance().getTileCache().setMemoryCapacity(134217728);
}

代码示例来源:origin: bcdev/beam

private SingleBandedOpImage(ImageLayout layout,
              int sourceWidth,
              int sourceHeight,
              Map configuration,
              ResolutionLevel level) {
  super(layout,
     configuration,
     layout.getSampleModel(null),
     layout.getMinX(null),
     layout.getMinY(null),
     layout.getWidth(null),
     layout.getHeight(null));
  levelImageSupport = new LevelImageSupport(sourceWidth,
                       sourceHeight,
                       level);
  if (getTileCache() == null) {
    setTileCache(JAI.getDefaultInstance().getTileCache());
  }
}

代码示例来源:origin: bcdev/beam

@Override
protected void tearDown() throws Exception {
  JAI.getDefaultInstance().getTileCache().flush();
  final OperatorSpiRegistry spiRegistry = GPF.getDefaultInstance().getOperatorSpiRegistry();
  spiRegistry.removeOperatorSpi(n1Spi);
  spiRegistry.removeOperatorSpi(n2Spi);
  spiRegistry.removeOperatorSpi(n3Spi);
  spiRegistry.removeOperatorSpi(n4Spi);
  spiRegistry.removeOperatorSpi(n5Spi);
  spiRegistry.removeOperatorSpi(n6Spi);
  callRecordList.clear();
}

代码示例来源:origin: bcdev/beam

@Override
protected void setUp() throws Exception {
  n1Spi = new N1Spi();
  final OperatorSpiRegistry registry = GPF.getDefaultInstance().getOperatorSpiRegistry();
  registry.addOperatorSpi(n1Spi);
  n2Spi = new N2Spi();
  registry.addOperatorSpi(n2Spi);
  n3Spi = new N3Spi();
  registry.addOperatorSpi(n3Spi);
  n4Spi = new N4Spi();
  registry.addOperatorSpi(n4Spi);
  n5Spi = new N5Spi();
  registry.addOperatorSpi(n5Spi);
  n6Spi = new N6Spi();
  registry.addOperatorSpi(n6Spi);
  callRecordList.clear();
  JAI.getDefaultInstance().getTileCache().flush();
}

代码示例来源:origin: bcdev/beam

@Override
protected void setUp() throws Exception {
  jaiTileCache = JAI.getDefaultInstance().getTileCache();
  testTileCache = new VerbousTileCache(jaiTileCache);
  JAI.getDefaultInstance().setTileCache(testTileCache);
  testTileCache.flush();
  TestOps.clearCalls();
  spi1 = new TestOps.Op1.Spi();
  spi2 = new TestOps.Op2.Spi();
  spi3 = new TestOps.Op3.Spi();
  final OperatorSpiRegistry registry = GPF.getDefaultInstance().getOperatorSpiRegistry();
  registry.addOperatorSpi(spi1);
  registry.addOperatorSpi(spi2);
  registry.addOperatorSpi(spi3);
}

代码示例来源:origin: bcdev/beam

@Override
protected void setUp() throws Exception {
  jaiTileCache = JAI.getDefaultInstance().getTileCache();
  testTileCache = new VerbousTileCache(jaiTileCache);
  JAI.getDefaultInstance().setTileCache(testTileCache);
  testTileCache.flush();
  TestOps.clearCalls();
  spi1 = new TestOps.Op1.Spi();
  spi2 = new TestOps.Op2.Spi();
  spi3 = new TestOps.Op3.Spi();
  final OperatorSpiRegistry registry = GPF.getDefaultInstance().getOperatorSpiRegistry();
  registry.addOperatorSpi(spi1);
  registry.addOperatorSpi(spi2);
  registry.addOperatorSpi(spi3);
}

相关文章