Package org.geomajas.layer.pipeline

Examples of org.geomajas.layer.pipeline.GetFeaturesContainer


    VectorLayer layer = getVectorLayer(layerId);
    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


    securityManager.clearSecurityContext();
  }

  @Test
  public void testNoSecurityNorOffsetNorLimit() throws Exception {
    GetFeaturesContainer result = new GetFeaturesContainer();
    gfes.execute(getPipelineContext(0, Integer.MAX_VALUE), result);

    Assert.assertEquals(20, result.getFeatures().size());
    Assert.assertEquals("1", result.getFeatures().get(0).getId());
    Assert.assertEquals("20", result.getFeatures().get(19).getId());
  }
View Full Code Here

    Assert.assertEquals("20", result.getFeatures().get(19).getId());
  }

  @Test
  public void testOffset() throws Exception {
    GetFeaturesContainer result = new GetFeaturesContainer();
    gfes.execute(getPipelineContext(5, Integer.MAX_VALUE), result);

    Assert.assertEquals(15, result.getFeatures().size());
    Assert.assertEquals("6", result.getFeatures().get(0).getId());
    Assert.assertEquals("20", result.getFeatures().get(14).getId());
  }
View Full Code Here

    Assert.assertEquals("20", result.getFeatures().get(14).getId());
  }

  @Test
  public void testLimit() throws Exception {
    GetFeaturesContainer result = new GetFeaturesContainer();
    gfes.execute(getPipelineContext(0, 10), result);

    Assert.assertEquals(10, result.getFeatures().size());
    Assert.assertEquals("1", result.getFeatures().get(0).getId());
    Assert.assertEquals("10", result.getFeatures().get(9).getId());
  }
View Full Code Here

    Assert.assertEquals("10", result.getFeatures().get(9).getId());
  }

  @Test
  public void testOffsetAndLimit() throws Exception {
    GetFeaturesContainer result = new GetFeaturesContainer();
    gfes.execute(getPipelineContext(5, 10), result);

    Assert.assertEquals(10, result.getFeatures().size());
    Assert.assertEquals("6", result.getFeatures().get(0).getId());
    Assert.assertEquals("15", result.getFeatures().get(9).getId());
  }
View Full Code Here

    securityManager.clearSecurityContext();
  }

  @Test
  public void testSecurity() throws Exception {
    GetFeaturesContainer result = new GetFeaturesContainer();
    gfes.execute(getPipelineContext(0, Integer.MAX_VALUE), result);

    Assert.assertEquals(10, result.getFeatures().size());
    Assert.assertEquals("2", result.getFeatures().get(0).getId());
    Assert.assertEquals("20", result.getFeatures().get(9).getId());
  }
View Full Code Here

    Assert.assertEquals("20", result.getFeatures().get(9).getId());
  }

  @Test
  public void testSecurityAndOffsetAndLimit() throws Exception {
    GetFeaturesContainer result = new GetFeaturesContainer();
    gfes.execute(getPipelineContext(5, 3), result);

    Assert.assertEquals(3, result.getFeatures().size());
    Assert.assertEquals("12", result.getFeatures().get(0).getId());
    Assert.assertEquals("16", result.getFeatures().get(2).getId());
  }
View Full Code Here

TOP

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

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.