Package org.geotools.filter.function

Examples of org.geotools.filter.function.Classifier


    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");
    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


    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);
    // classiferQuantile end
}
View Full Code Here

   
    // 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
    Classifier height = (Classifier) classify.evaluate(collection);
    // classiferEqualInterval end
}
View Full Code Here

    // municipal or crown parkland
    zones[1] = new HashSet(Arrays.asList(new String[] { "Zone 4", "Crown 2", }));
    // industrial
    zones[2] = new HashSet(Arrays.asList(new String[] { "Zone 3" }));
   
    Classifier landuse = new ExplicitClassifier(zones);
    landuse.setTitle(0, "urban");
    landuse.setTitle(1, "park");
    landuse.setTitle(2, "industrial");
    // explicitClassifierExample end
}
View Full Code Here

    Comparable max[] = new Comparable[25];
    for (int i = 0; i < 25; i++) {
        min[i] = (char) ('A' + i);
        max[i] = (char) ('B' + i);
    }
    Classifier alphabetical = new RangedClassifier(min, max);
    // rangedClassifierExample end
}
View Full Code Here

    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

   */
  public List<Rule> quantileClassification(FeatureCollection features,
      String property, int classNumber, boolean open) {

    FeatureType fType;
    Classifier groups = null;
    try {
      Function classify = ff.function("Quantile", ff.property(property),
          ff.literal(classNumber));
      groups = (Classifier) classify.evaluate(features);
      if (groups instanceof RangedClassifier)
View Full Code Here

   * @param property
   * @param classNumber
   * @return
   */
  public List<Rule> equalIntervalClassification(FeatureCollection features, String property, int classNumber, boolean open) {
    Classifier groups = null;
    try {
      Function classify = ff.function("EqualInterval", ff.property(property), ff.literal(classNumber));
      groups = (Classifier) classify.evaluate(features);
      //System.out.println(groups.getSize());
      if (groups instanceof RangedClassifier)
View Full Code Here

   * @param property
   * @return
   */
  public List<Rule> uniqueIntervalClassification(FeatureCollection features,
      String property) {
    Classifier groups = null;
    int classNumber = features.size();
    try {
      Function classify = ff.function("UniqueInterval", ff.property(property), ff.literal(classNumber));
      groups = (Classifier) classify.evaluate(features);
      if (groups instanceof RangedClassifier)
View Full Code Here

   */
  public List<Rule> quantileClassification(FeatureCollection features,
      String property, int classNumber, boolean open) {

    FeatureType fType;
    Classifier groups = null;
    try {
      final Function classify = ff.function("Quantile", ff.property(property),
          ff.literal(classNumber));
      groups = (Classifier) classify.evaluate(features);
      if (groups instanceof RangedClassifier)
View Full Code Here

TOP

Related Classes of org.geotools.filter.function.Classifier

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.