Package org.geomajas.service.pipeline

Examples of org.geomajas.service.pipeline.PipelineContext


    log.debug("saveOrUpdate start on layer {}", layerId);
    long ts = System.currentTimeMillis();
    VectorLayer layer = getVectorLayer(layerId);
    CrsTransform mapToLayer = geoService.getCrsTransform(crs, layer.getCrs());
    CrsTransform layerToMap = geoService.getCrsTransform(layer.getCrs(), crs);
    PipelineContext context = pipelineService.createContext();
    context.put(PipelineCode.LAYER_ID_KEY, layerId);
    context.put(PipelineCode.LAYER_KEY, layer);
    context.put(PipelineCode.CRS_TRANSFORM_KEY, mapToLayer);
    context.put(PipelineCode.CRS_BACK_TRANSFORM_KEY, layerToMap);
    context.put(PipelineCode.OLD_FEATURES_KEY, oldFeatures);
    context.put(PipelineCode.NEW_FEATURES_KEY, newFeatures);
    context.put(PipelineCode.CRS_KEY, crs);
    pipelineService.execute(PipelineCode.PIPELINE_SAVE_OR_UPDATE, layerId, context, null);
    log.debug("saveOrUpdate done on layer {}, time {}s", layerId, (System.currentTimeMillis() - ts) / 1000.0);
  }
View Full Code Here


    CrsTransform transformation = null;
    if ((featureIncludes & FEATURE_INCLUDE_GEOMETRY) != 0 && crs != null && !crs.equals(layer.getCrs())) {
      transformation = geoService.getCrsTransform(layer.getCrs(), crs);
    }
    GetFeaturesContainer container = new GetFeaturesContainer();
    PipelineContext context = pipelineService.createContext();
    context.put(PipelineCode.LAYER_ID_KEY, layerId);
    context.put(PipelineCode.LAYER_KEY, layer);
    context.put(PipelineCode.CRS_TRANSFORM_KEY, transformation);
    context.put(PipelineCode.CRS_KEY, crs);
    context.put(PipelineCode.FILTER_KEY, queryFilter);
    context.put(PipelineCode.STYLE_KEY, style);
    context.put(PipelineCode.FEATURE_INCLUDES_KEY, featureIncludes);
    context.put(PipelineCode.OFFSET_KEY, offset);
    context.put(PipelineCode.MAX_RESULT_SIZE_KEY, maxResultSize);
    pipelineService.execute(PipelineCode.PIPELINE_GET_FEATURES, layerId, context, container);
    log.debug("getFeatures done on layer {}, time {}s", layerId, (System.currentTimeMillis() - ts) / 1000.0);
    return container.getFeatures();
  }
View Full Code Here

      throws GeomajasException {
    log.debug("getBounds start on layer {}", layerId);
    long ts = System.currentTimeMillis();
    VectorLayer layer = getVectorLayer(layerId);
    GetBoundsContainer container = new GetBoundsContainer();
    PipelineContext context = pipelineService.createContext();
    context.put(PipelineCode.LAYER_ID_KEY, layerId);
    context.put(PipelineCode.LAYER_KEY, layer);
    context.put(PipelineCode.CRS_KEY, crs);
    context.put(PipelineCode.CRS_TRANSFORM_KEY, geoService.getCrsTransform(layer.getCrs(), crs));
    context.put(PipelineCode.FILTER_KEY, queryFilter);
    pipelineService.execute(PipelineCode.PIPELINE_GET_BOUNDS, layerId, context, container);
    log.debug("getBounds done on layer {}, time {}s", layerId, (System.currentTimeMillis() - ts) / 1000.0);
    return container.getEnvelope();
  }
View Full Code Here

  public InternalTile getTile(TileMetadata tileMetadata) throws GeomajasException {
    log.debug("getTile start tileMetadata {}", tileMetadata);
    long ts = System.currentTimeMillis();
    String layerId = tileMetadata.getLayerId();
    VectorLayer layer = getVectorLayer(layerId);
    PipelineContext context = pipelineService.createContext();
    context.put(PipelineCode.LAYER_ID_KEY, layerId);
    context.put(PipelineCode.LAYER_KEY, layer);
    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);
    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);
View Full Code Here

  public List<Attribute<?>> getAttributes(String layerId, String attributeName, Filter filter)
      throws GeomajasException {
    log.debug("saveOrUpdate start on layer {}", layerId);
    long ts = System.currentTimeMillis();
    VectorLayer layer = getVectorLayer(layerId);
    PipelineContext context = pipelineService.createContext();
    context.put(PipelineCode.LAYER_ID_KEY, layerId);
    context.put(PipelineCode.LAYER_KEY, layer);
    context.put(PipelineCode.FILTER_KEY, filter);
    context.put(PipelineCode.ATTRIBUTE_NAME_KEY, attributeName);
    GetAttributesContainer container = new GetAttributesContainer();
    pipelineService.execute(PipelineCode.PIPELINE_GET_ATTRIBUTES, layerId, context, container);
    log.debug("saveOrUpdate done on layer {}, time {}s", layerId, (System.currentTimeMillis() - ts) / 1000.0);
    return container.getAttributes();
  }
View Full Code Here

  }

  /** @inheritDoc */
  public void execute(PipelineInfo<RESPONSE> pipeline, PipelineContext startContext, RESPONSE response)
      throws GeomajasException {
    PipelineContext context = startContext;
    if (null == context) {
      context = createContext();
    }
    long ps = 0;
    if (log.isDebugEnabled()) {
      ps = System.currentTimeMillis();
      log.debug("execute pipeline {}", pipeline.getPipelineName());
    }
    for (PipelineStep<RESPONSE> step : pipeline.getPipeline()) {
      if (context.isFinished()) {
        log.debug("context finished, pipeline {} execution done.", pipeline.getPipelineName());
        break;
      }
      long ts = 0;
      if (log.isDebugEnabled()) {
View Full Code Here

  }

  // ----------------------------------------------------------

  private PipelineContext getPipelineContext(int offset, int limit) {
    PipelineContext pip = new PipelineContextImpl();
    pip.put(PipelineCode.LAYER_KEY, testLayer);
    pip.put(PipelineCode.OFFSET_KEY, offset);
    pip.put(PipelineCode.MAX_RESULT_SIZE_KEY, limit);

    pip.put(PipelineCode.FILTER_KEY, Filter.INCLUDE);
    pip.put(PipelineCode.FEATURE_INCLUDES_KEY, 0);
    pip.put(PipelineCode.LAYER_ID_KEY, testLayer.getId());
    pip.put(PipelineCode.STYLE_KEY, new NamedStyleInfo());

    return pip;
  }
View Full Code Here

  }

  // ----------------------------------------------------------

  private PipelineContext getPipelineContext(int offset, int limit) {
    PipelineContext pip = new PipelineContextImpl();
    pip.put(PipelineCode.LAYER_KEY, testLayer);
    pip.put(PipelineCode.OFFSET_KEY, offset);
    pip.put(PipelineCode.MAX_RESULT_SIZE_KEY, limit);

    pip.put(PipelineCode.FILTER_KEY, Filter.INCLUDE);
    pip.put(PipelineCode.FEATURE_INCLUDES_KEY, 0);
    pip.put(PipelineCode.LAYER_ID_KEY, testLayer.getId());
    pip.put(PipelineCode.STYLE_KEY, new NamedStyleInfo());

    return pip;
  }
View Full Code Here

TOP

Related Classes of org.geomajas.service.pipeline.PipelineContext

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.