• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Function类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opengis.filter.expression.Function的典型用法代码示例。如果您正苦于以下问题:Java Function类的具体用法?Java Function怎么用?Java Function使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Function类属于org.opengis.filter.expression包,在下文中一共展示了Function类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createExpression

import org.opengis.filter.expression.Function; //导入依赖的package包/类
/**
 * Creates the expression.
 *
 * @param functionName the function name
 * @param argumentList the argument list
 * @return the expression
 */
/*
 * (non-Javadoc)
 * 
 * @see com.sldeditor.filter.v2.function.FunctionNameInterface#createExpression(org.opengis.filter.capability.FunctionName, java.util.List)
 */
@Override
public Expression createExpression(FunctionName functionName, List<Expression> argumentList) {
    if (functionName == null) {
        return null;
    }

    Literal fallback = null;
    Function function = functionFactory.function(functionName.getFunctionName(), argumentList,
            fallback);

    return function;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:25,代码来源:FunctionManager.java


示例2: setOffset

import org.opengis.filter.expression.Function; //导入依赖的package包/类
/**
 * Sets the offset in a symbolizer.
 * 
 * @param symbolizer the symbolizer.
 * @param text the text representing the offsets in the CSV form.
 */
@SuppressWarnings({"rawtypes", "unchecked"})
public static void setOffset( Symbolizer symbolizer, String text ) {
    if (text.indexOf(',') == -1) {
        return;
    }
    String[] split = text.split(",");
    if (split.length != 2) {
        return;
    }
    double xOffset = Double.parseDouble(split[0]);
    double yOffset = Double.parseDouble(split[1]);

    Expression geometry = symbolizer.getGeometry();
    if (geometry != null) {
        if (geometry instanceof FilterFunction_offset) {
            FilterFunction_offset offsetFunction = (FilterFunction_offset) geometry;
            List parameters = offsetFunction.getParameters();
            parameters.set(1, ff.literal(xOffset));
            parameters.set(2, ff.literal(yOffset));
        }
    } else {
        Function function = ff.function("offset", ff.property("the_geom"), ff.literal(xOffset), ff.literal(yOffset));
        symbolizer.setGeometry(function);
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:32,代码来源:Utilities.java


示例3: classiferExample

import org.opengis.filter.expression.Function; //导入依赖的package包/类
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");
    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
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:23,代码来源:BrewerExamples.java


示例4: visit

import org.opengis.filter.expression.Function; //导入依赖的package包/类
@Override
public Object visit(Function function, Object extraData) throws RuntimeException {
    helper.out = out;
    try {
        encodingFunction = true;
        boolean encoded = helper.visitFunction(function, extraData);
        encodingFunction = false;
        
        if(encoded) {
           return extraData; 
        } else {
            return super.visit(function, extraData);
        }
    } catch(IOException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:DennisPallett,项目名称:gt-jdbc-monetdb,代码行数:18,代码来源:MonetDBFilterToSQL.java


示例5: getFunctionName

import org.opengis.filter.expression.Function; //导入依赖的package包/类
/**
 * Maps a function to its native db equivalent
 * 
 * @param function
 * @return
 */
public String getFunctionName(Function function) {
    if(function instanceof FilterFunction_strLength) {
        return "char_length";
    } else if(function instanceof FilterFunction_strToLowerCase) {
        return "lower";
    } else if(function instanceof FilterFunction_strToUpperCase) {
        return "upper";
    } else if(function instanceof FilterFunction_abs ||
            function instanceof FilterFunction_abs_2 ||
            function instanceof FilterFunction_abs_3 ||
            function instanceof FilterFunction_abs_4) {
        return "abs";
    }
    return function.getName();
}
 
开发者ID:DennisPallett,项目名称:gt-jdbc-monetdb,代码行数:22,代码来源:FilterToSqlHelper.java


示例6: createExpression

import org.opengis.filter.expression.Function; //导入依赖的package包/类
/**
 * Creates the expression.
 *
 * @param envVar the env var
 * @return the expression
 */
@Override
public Expression createExpression(EnvVar envVar) {
    if (envVar == null) {
        return null;
    }

    Function function = ff.function("env", ff.literal(envVar.getName()));

    return function;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:17,代码来源:EnvironmentVariableManager.java


示例7: createExpression

import org.opengis.filter.expression.Function; //导入依赖的package包/类
/**
 * Creates the expression.
 *
 * @param functionName the function name
 * @return the expression
 */
@Override
public Expression createExpression(FunctionName functionName) {
    if (functionName == null) {
        return null;
    }

    List<Expression> parameters = null;
    Literal fallback = null;
    Function function = functionFactory.function(functionName.getFunctionName(), parameters,
            fallback);

    return function;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:FilterManager.java


示例8: getExpression

import org.opengis.filter.expression.Function; //导入依赖的package包/类
/**
 * Gets the expression.
 *
 * @param factory the factory
 * @return the expression
 */
public ProcessFunction getExpression(FunctionFactory factory) {
    List<Expression> overallParameterList = new ArrayList<Expression>();

    for (ProcessFunctionParameterValue value : valueList) {
        List<Expression> parameterList = new ArrayList<Expression>();
        parameterList.add(ff.literal(value.name));

        boolean setValue = true;
        if (value.optional) {
            setValue = value.included;
        }

        if (setValue) {
            if (value.objectValue != null) {
                Expression expression = value.objectValue.getExpression();
                if (expression != null) {
                    parameterList.add(expression);
                }
            }
        }

        if (setValue) {
            Function function = factory.function(PARAMETER, parameterList, null);

            overallParameterList.add(function);
        }
    }

    if (this.selectedFunction.getFunctionName() == null) {
        return null;
    }
    Function processFunction = factory.function(this.selectedFunction.getFunctionName(),
            overallParameterList, null);

    return (ProcessFunction) processFunction;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:43,代码来源:FunctionTableModel.java


示例9: ClassifiedStyleCreator

import org.opengis.filter.expression.Function; //导入依赖的package包/类
public ClassifiedStyleCreator() {
Set<Function> funcs = CommonFactoryFinder.getFunctions(GeoTools
	.getDefaultHints());
ArrayList<String> fNames = new ArrayList<String>();
for (Function func : funcs) {
    if (func instanceof ClassificationFunction) {
	classifiers.add(func);
	fNames.add(func.getName());
    }
}
setPalette(DEFAULT_PALETTE);
setNumberOfClasses(DEFAULT_NUMBER_OF_CLASSES);
setClassifier(DEFAULT_CLASSIFIER);
   }
 
开发者ID:ianturton,项目名称:ShapefileViewer,代码行数:15,代码来源:ClassifiedStyleCreator.java


示例10: setClassifier

import org.opengis.filter.expression.Function; //导入依赖的package包/类
public void setClassifier(String name) {
for (Function f : classifiers) {
    if (f.getName().equalsIgnoreCase(name)) {
	setClassifier(f);
	return;
    }
}
   }
 
开发者ID:ianturton,项目名称:ShapefileViewer,代码行数:9,代码来源:ClassifiedStyleCreator.java


示例11: getFunctionNames

import org.opengis.filter.expression.Function; //导入依赖的package包/类
public List<String> getFunctionNames() {
ArrayList<String> ret = new ArrayList<String>();

for (Function f : classifiers) {
    ret.add(f.getName());

}
return ret;
   }
 
开发者ID:ianturton,项目名称:ShapefileViewer,代码行数:10,代码来源:ClassifiedStyleCreator.java


示例12: function

import org.opengis.filter.expression.Function; //导入依赖的package包/类
/**
 * Ritorna una function usando il nome
 */
@Override
public Function function(Name name, List<Expression> args, Literal fallback) {
	if( SnapFunction.NAME.getFunctionName().equals(name)){
           return new SnapFunction( args, fallback );
       }
	else if( Fluxomizer.NAME.getFunctionName().equals(name) ){
		return new Fluxomizer(args, fallback);
	}
       return null; // we do not implement that function
}
 
开发者ID:melvinm99,项目名称:fluxomajic3,代码行数:14,代码来源:FluxomajicFunctionFactory.java


示例13: function

import org.opengis.filter.expression.Function; //导入依赖的package包/类
public Function function(Name name, List<Expression> args, Literal fallback) {
    if(new NameImpl("first").equals(name)){
        return new AbstractFunction( FIRST, args, fallback ){
            public Geometry evaluate(Object object) {
                Geometry geom = eval(object, 0, Geometry.class );
                Coordinate coordinate = geom.getCoordinate();
                return geom.getFactory().createPoint(coordinate);
            }
        };
    }
    return null; // we do not implement that function
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:13,代码来源:ExampleFunctionFactory2.java


示例14: classiferQuantile

import org.opengis.filter.expression.Function; //导入依赖的package包/类
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);
    // classiferQuantile end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:14,代码来源:BrewerExamples.java


示例15: classiferEqualInterval

import org.opengis.filter.expression.Function; //导入依赖的package包/类
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
    Classifier height = (Classifier) classify.evaluate(collection);
    // classiferEqualInterval end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:15,代码来源:BrewerExamples.java


示例16: colorBrewerExample

import org.opengis.filter.expression.Function; //导入依赖的package包/类
void colorBrewerExample(SimpleFeatureCollection featureCollection) {
    // colorBrewerExample start
    // STEP 0 Set up Color Brewer
    ColorBrewer brewer = ColorBrewer.instance();
    
    // 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);
    
    // STEP 3 - ask StyleGenerator to make a set of rules for the Classifier
    // assigning features the correct color based on height
    FeatureTypeStyle style = StyleGenerator.createFeatureTypeStyle(
            groups,
            propteryExpression,
            colors,
            "Generated FeatureTypeStyle for GreeBlue",
            featureCollection.getSchema().getGeometryDescriptor(),
            StyleGenerator.ELSEMODE_IGNORE,
            0.95,
            null);
    // colorBrewerExample end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:31,代码来源:BrewerExamples.java


示例17: visit

import org.opengis.filter.expression.Function; //导入依赖的package包/类
@Override
  public Object visit( Function expression, Object data ) {
if (expression instanceof Sha1SyncFilterFunction) {
	m_sha1SyncFilterFunction = (Sha1SyncFilterFunction) expression;
	found = true;
}
return super.visit(expression, data);
  }
 
开发者ID:xandris,项目名称:geoserver-sync,代码行数:9,代码来源:FindSha1SyncFilterFunction.java


示例18: visit

import org.opengis.filter.expression.Function; //导入依赖的package包/类
@Override
public Object visit(
		final Function expression,
		final Object data ) {
	return new ExtractGeometryFilterVisitorResult(
			infinity(),
			null);
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:9,代码来源:ExtractGeometryFilterVisitor.java


示例19: visit

import org.opengis.filter.expression.Function; //导入依赖的package包/类
@Override
public Object visit(
		final Function expression,
		final Object data ) {
	// used force full range if the expression contains a time
	// property...which is correct?
	return new TemporalConstraints();
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:9,代码来源:ExtractTimeFilterVisitor.java


示例20: containsTime

import org.opengis.filter.expression.Function; //导入依赖的package包/类
private boolean containsTime(
		final Function function ) {
	boolean yes = false;
	for (final Expression expression : function.getParameters()) {
		yes |= expressionContainsTime(expression);
	}
	return yes;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:9,代码来源:ExtractTimeFilterVisitor.java



注:本文中的org.opengis.filter.expression.Function类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SearchBookContentsActivity类代码示例发布时间:2022-05-21
下一篇:
Java Tie类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap