use of org.geotoolkit.process.ProcessDescriptor in project geotoolkit by Geomatys.
the class NearestTest method testNearest.
/**
* Test nearest process
*/
@Test
public void testNearest() throws FactoryException, ProcessException, NoSuchIdentifierException {
// Inputs
final FeatureCollection featureList = buildFeatureList();
final Geometry geom = buildIntersectionGeometry();
// Process
ProcessDescriptor desc = ProcessFinder.getProcessDescriptor(GeotkProcessingRegistry.NAME, "vector:nearest");
ParameterValueGroup in = desc.getInputDescriptor().createValue();
in.parameter("feature_in").setValue(featureList);
in.parameter("geometry_in").setValue(geom);
org.geotoolkit.process.Process proc = desc.createProcess(in);
// Features out
final FeatureSet featureListOut = (FeatureSet) proc.call().parameter("feature_out").getValue();
// Expected Features out
final FeatureSet featureListResult = buildResultList();
compare(featureListResult, featureListOut);
}
use of org.geotoolkit.process.ProcessDescriptor in project geotoolkit by Geomatys.
the class RegroupTest method testRegroupGeometrySelected.
@Test
public void testRegroupGeometrySelected() throws ProcessException, NoSuchIdentifierException, FactoryException {
// Inputs
final FeatureCollection featureList = buildFeatureList();
// Process
ProcessDescriptor desc = ProcessFinder.getProcessDescriptor(GeotkProcessingRegistry.NAME, "vector:regroup");
ParameterValueGroup in = desc.getInputDescriptor().createValue();
in.parameter("feature_in").setValue(featureList);
in.parameter("regroup_attribute").setValue("type");
in.parameter("geometry_name").setValue("geom2");
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 = buildResultList2();
compare(featureListResult, featureListOut);
}
use of org.geotoolkit.process.ProcessDescriptor in project geotoolkit by Geomatys.
the class SpatialJoinTest method testSpacialJoinIntersection.
/**
* Test SpatialJoin process with Intersection method
*/
@Test
public void testSpacialJoinIntersection() throws ProcessException, NoSuchIdentifierException, FactoryException {
// Inputs
final FeatureSet targetFeatures = buildFeatureListInter1();
final FeatureSet sourceFeatures = buildFeatureListInter2();
// Process
ProcessDescriptor desc = ProcessFinder.getProcessDescriptor(GeotkProcessingRegistry.NAME, "vector:spatialjoin");
ParameterValueGroup in = desc.getInputDescriptor().createValue();
in.parameter("feature_in").setValue(sourceFeatures);
in.parameter("feature_target").setValue(targetFeatures);
in.parameter("intersect").setValue(true);
org.geotoolkit.process.Process proc = desc.createProcess(in);
// Features out
final FeatureSet featureListOut = (FeatureSet) proc.call().parameter("feature_out").getValue();
// Expected Features out
final FeatureSet expectedList = buildResultInter();
compare(expectedList, featureListOut);
}
use of org.geotoolkit.process.ProcessDescriptor in project geotoolkit by Geomatys.
the class AffineTransformTest method testAffineTransform.
@Test
public void testAffineTransform() throws ProcessException, NoSuchIdentifierException, FactoryException {
// Inputs
final FeatureCollection featureList = buildFeatureList();
final AffineTransform transform = new AffineTransform();
transform.setToTranslation(100, 100);
// Process
final ProcessDescriptor desc = ProcessFinder.getProcessDescriptor(GeotkProcessingRegistry.NAME, "vector:affinetransform");
final ParameterValueGroup in = desc.getInputDescriptor().createValue();
in.parameter("feature_in").setValue(featureList);
in.parameter("transform_in").setValue(transform);
final 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();
compare(featureListResult, featureListOut);
}
use of org.geotoolkit.process.ProcessDescriptor in project geotoolkit by Geomatys.
the class ClipTest method testClip.
@Test
public void testClip() throws ProcessException, NoSuchIdentifierException, FactoryException {
// Inputs
final FeatureCollection featureList = buildFeatureList();
final FeatureCollection featuresClip = buildFeatureClip();
// Process
ProcessDescriptor desc = ProcessFinder.getProcessDescriptor(GeotkProcessingRegistry.NAME, "vector:clip");
ParameterValueGroup in = desc.getInputDescriptor().createValue();
in.parameter("feature_in").setValue(featureList);
in.parameter("feature_clip").setValue(featuresClip);
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();
compare(featureListResult, featureListOut);
}
Aggregations