Package org.opengis.filter

Examples of org.opengis.filter.FilterFactory2.function()


public void classiferExample() {
    SimpleFeatureCollection collection = null;
    SimpleFeature feature = null;
    // classiferExample start
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
    Function classify = ff.function("Quantile", ff.property("name"), ff.literal(2));
   
    Classifier groups = (Classifier) classify.evaluate(collection);
    // classiferExample end
    // classiferExample2 start
    groups.setTitle(0, "Group A");
View Full Code Here


    groups.setTitle(1, "Group B");
    // classiferExample2 end
   
    // classiferExample3 start
    // groups is a classifier with "Group A" and "Group B"
    Function sort = ff.function("classify", ff.property("name"), ff.literal(groups));
    int slot = (Integer) sort.evaluate(feature);
   
    System.out.println(groups.getTitle(slot)); // ie. "Group A"
    // classiferExample3 end
}
View Full Code Here

public void classiferQuantile() {
    SimpleFeatureCollection collection = null;
    SimpleFeature feature = null;
    // classiferQuantile start
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
    Function classify = ff.function("Quantile", ff.property("zone"), ff.literal(2));
   
    // Zones assigned by a municipal board do not have an intrinsic numerical
    // meaning making them suitable for display using:
    // - qualitative palette where each zone would have the same visual impact
    Classifier groups = (Classifier) classify.evaluate(collection);
View Full Code Here

public void classiferEqualInterval() {
    SimpleFeatureCollection collection = null;
    SimpleFeature feature = null;
    // classiferEqualInterval start
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
    Function classify = ff.function("EqualInterval", ff.property("height"), ff.literal(5));
   
    // this will create a nice smooth series of intervals suitable for presentation
    // with:
    // - sequential color palette to make each height blend smoothly into the next
    // - diverging color palettes if you want to make higher and lower areas stand out more
View Full Code Here

    // STEP 1 - call a classifier function to summarise your content
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
    PropertyName propteryExpression = ff.property("height");
   
    // classify into five categories
    Function classify = ff.function("Quantile", propteryExpression, ff.literal(5));
    Classifier groups = (Classifier) classify.evaluate(featureCollection);
   
    // STEP 2 - look up a predefined palette from color brewer
    String paletteName = "GrBu";
    Color[] colors = brewer.getPalette(paletteName).getColors(5);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.