Package org.geomajas.layer.pipeline

Examples of org.geomajas.layer.pipeline.GetTileContainer


      VectorLayer layer = configurationService.getVectorLayer(layerId);
      RasterizingContainer rasterizeContainer = cacheManagerService.get(layer, CacheCategory.RASTER, key,
          RasterizingContainer.class);
      // if not in cache, try the rebuild cache and invoke the pipeline directly
      if (rasterizeContainer == null) {
        GetTileContainer tileContainer = new GetTileContainer();
        PipelineContext context = pipelineService.createContext();
        context.put(RasterizingPipelineCode.IMAGE_ID_KEY, key);
        context.put(PipelineCode.LAYER_ID_KEY, layerId);
        context.put(PipelineCode.LAYER_KEY, layer);

        // get data from rebuild cache
        RebuildCacheContainer rebuildCacheContainer = cacheManagerService.get(layer, CacheCategory.REBUILD, key,
            RebuildCacheContainer.class);
        if (null == rebuildCacheContainer) {
          log.error("Data to rebuild the raster image is no longer available for key " + key);
          response.sendError(HttpServletResponse.SC_NO_CONTENT);
          return;
        }
        recorder.record(CacheCategory.REBUILD, "Got rebuild info from cache");
        TileMetadata tileMetadata = rebuildCacheContainer.getMetadata();
        context.put(PipelineCode.TILE_METADATA_KEY, tileMetadata);
        Crs crs = geoService.getCrs2(tileMetadata.getCrs());
        context.put(PipelineCode.CRS_KEY, crs);
        CrsTransform layerToMap = geoService.getCrsTransform(layer.getCrs(), crs);
        context.put(PipelineCode.CRS_TRANSFORM_KEY, layerToMap);
        Envelope layerExtent = dtoConverterService.toInternal(layer.getLayerInfo().getMaxExtent());
        Envelope tileExtent = geoService.transform(layerExtent, layerToMap);
        context.put(PipelineCode.TILE_MAX_EXTENT_KEY, tileExtent);
        // can't stop here, we have only prepared the context, not built the tile !
        InternalTile tile = new InternalTileImpl(tileMetadata.getCode(), tileExtent, tileMetadata.getScale());
        tileContainer.setTile(tile);
        securityContextAdder.restoreSecurityContext(rebuildCacheContainer.getContext());

        pipelineService.execute(RasterizingPipelineCode.PIPELINE_GET_VECTOR_TILE_RASTERIZING, layerId, context,
            tileContainer);
        rasterizeContainer = context.get(RasterizingPipelineCode.CONTAINER_KEY, RasterizingContainer.class);
View Full Code Here


    context.put(PipelineCode.CRS_TRANSFORM_KEY, layerToMap);
    Envelope layerExtent = dtoConverterService.toInternal(layer.getLayerInfo().getMaxExtent());
    Envelope tileExtent = geoService.transform(layerExtent, layerToMap);
    context.put(PipelineCode.TILE_MAX_EXTENT_KEY, tileExtent);
    InternalTile tile = new InternalTileImpl(tileMetadata.getCode(), tileExtent, tileMetadata.getScale());
    GetTileContainer response = new GetTileContainer();
    response.setTile(tile);
    pipelineService.execute(PipelineCode.PIPELINE_GET_VECTOR_TILE, layerId, context, response);
    log.debug("getTile response InternalTile {}", response);
    log.debug("getTile done on layer {}, time {}s", layerId, (System.currentTimeMillis() - ts) / 1000.0);
    return response.getTile();
  }
View Full Code Here

TOP

Related Classes of org.geomajas.layer.pipeline.GetTileContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.