Search in sources :

Example 71 with FeatureCollection

use of org.geotoolkit.storage.feature.FeatureCollection in project geotoolkit by Geomatys.

the class MaxLimitProcess method execute.

/**
 *  {@inheritDoc }
 */
@Override
protected void execute() {
    final FeatureCollection inputFeatureList = inputParameters.getValue(FEATURE_IN);
    final int max = inputParameters.getValue(MAX_IN);
    final FeatureCollection resultFeatureList = FeatureStreams.limit(inputFeatureList, max);
    outputParameters.getOrCreate(FEATURE_OUT).setValue(resultFeatureList);
}
Also used : FeatureCollection(org.geotoolkit.storage.feature.FeatureCollection)

Example 72 with FeatureCollection

use of org.geotoolkit.storage.feature.FeatureCollection in project geotoolkit by Geomatys.

the class SortByProcess method execute.

/**
 *  {@inheritDoc }
 */
@Override
protected void execute() {
    final FeatureCollection inputFeatureList = inputParameters.getValue(VectorDescriptor.FEATURE_IN);
    final org.opengis.filter.SortProperty[] sorter = inputParameters.getValue(SortByDescriptor.SORTER_IN);
    final FeatureCollection resultFeatureList = FeatureStreams.sort(inputFeatureList, sorter);
    outputParameters.getOrCreate(VectorDescriptor.FEATURE_OUT).setValue(resultFeatureList);
}
Also used : FeatureCollection(org.geotoolkit.storage.feature.FeatureCollection)

Example 73 with FeatureCollection

use of org.geotoolkit.storage.feature.FeatureCollection in project geotoolkit by Geomatys.

the class DifferenceProcess method execute.

/**
 *  {@inheritDoc }
 */
@Override
protected void execute() {
    final FeatureCollection inputFeatureList = inputParameters.getValue(VectorDescriptor.FEATURE_IN);
    final FeatureCollection inputFeatureClippingList = inputParameters.getValue(DifferenceDescriptor.FEATURE_DIFF);
    final FeatureCollection resultFeatureList = new DifferenceFeatureCollection(inputFeatureList, inputFeatureClippingList);
    outputParameters.getOrCreate(VectorDescriptor.FEATURE_OUT).setValue(resultFeatureList);
}
Also used : FeatureCollection(org.geotoolkit.storage.feature.FeatureCollection)

Example 74 with FeatureCollection

use of org.geotoolkit.storage.feature.FeatureCollection in project geotoolkit by Geomatys.

the class FilterProcess method execute.

/**
 *  {@inheritDoc }
 */
@Override
protected void execute() {
    final FeatureCollection inputFeatureList = inputParameters.getValue(FEATURE_IN);
    final org.opengis.filter.Filter filter = inputParameters.getValue(FILTER_IN);
    final FeatureCollection resultFeatureList = FeatureStreams.filter(inputFeatureList, filter);
    outputParameters.getOrCreate(FEATURE_OUT).setValue(resultFeatureList);
}
Also used : FeatureCollection(org.geotoolkit.storage.feature.FeatureCollection)

Example 75 with FeatureCollection

use of org.geotoolkit.storage.feature.FeatureCollection in project geotoolkit by Geomatys.

the class ComplexToFeatureCollectionConverterTest method testJSONConversion.

/**
 * Test that the conversion from a Data containing a FeatureCollection
 * in geoJSON converts to valid FeatureCollection
 */
@Test
public void testJSONConversion() throws IOException, DataStoreException {
    FeatureCollection featureCollection = ConvertersTestUtils.initAndRunInputConversion(Data.class, FeatureCollection.class, "/inputs/featurecollection.json", WPSMimeType.APP_GEOJSON.val(), WPSEncoding.UTF8.getValue(), null);
    // Test the feature collection
    ConvertersTestUtils.assertFeatureCollectionIsValid(featureCollection);
}
Also used : FeatureCollection(org.geotoolkit.storage.feature.FeatureCollection) Test(org.junit.Test)

Aggregations

FeatureCollection (org.geotoolkit.storage.feature.FeatureCollection)131 Feature (org.opengis.feature.Feature)75 Test (org.junit.Test)49 Coordinate (org.locationtech.jts.geom.Coordinate)49 LinearRing (org.locationtech.jts.geom.LinearRing)39 Query (org.geotoolkit.storage.feature.query.Query)31 FeatureType (org.opengis.feature.FeatureType)27 FeatureIterator (org.geotoolkit.storage.feature.FeatureIterator)24 LineString (org.locationtech.jts.geom.LineString)23 MultiPoint (org.locationtech.jts.geom.MultiPoint)16 ProcessDescriptor (org.geotoolkit.process.ProcessDescriptor)15 ParameterValueGroup (org.opengis.parameter.ParameterValueGroup)15 Geometry (org.locationtech.jts.geom.Geometry)14 AbstractProcessTest (org.geotoolkit.processing.vector.AbstractProcessTest)13 Session (org.geotoolkit.storage.feature.session.Session)12 CheckCloseFeatureIterator (org.geotoolkit.storage.feature.CheckCloseFeatureIterator)10 Point (org.locationtech.jts.geom.Point)10 GenericName (org.opengis.util.GenericName)10 NoSuchElementException (java.util.NoSuchElementException)8 File (java.io.File)7