Exemplo n.º 1
0
  @Test
  public void testIntersection() throws ProcessException, NoSuchIdentifierException {

    // Inputs
    final FeatureCollection<?> featureList = buildFeatureList();
    final FeatureCollection<?> featureUnionList = buildFeatureUnionList();

    // Process
    ProcessDescriptor desc = ProcessFinder.getProcessDescriptor("vector", "union");

    ParameterValueGroup in = desc.getInputDescriptor().createValue();
    in.parameter("feature_in").setValue(featureList);
    in.parameter("feature_union").setValue(featureUnionList);
    in.parameter("input_geometry_name").setValue("geom1");
    org.geotoolkit.process.Process proc = desc.createProcess(in);

    // Features out
    final FeatureCollection<?> featureListOut =
        (FeatureCollection<?>) proc.call().parameter("feature_out").getValue();

    // Expected Features out
    final FeatureCollection<?> featureListResult = buildResultList();

    assertEquals(featureListOut.getFeatureType(), featureListResult.getFeatureType());
    assertEquals(featureListOut.getID(), featureListResult.getID());
    assertEquals(featureListOut.size(), featureListResult.size());
    assertTrue(featureListOut.containsAll(featureListResult));
  }