当前位置: 首页>>代码示例>>Java>>正文


Java Operation.getParameters方法代码示例

本文整理汇总了Java中org.geoserver.platform.Operation.getParameters方法的典型用法代码示例。如果您正苦于以下问题:Java Operation.getParameters方法的具体用法?Java Operation.getParameters怎么用?Java Operation.getParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.geoserver.platform.Operation的用法示例。


在下文中一共展示了Operation.getParameters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doWrite

import org.geoserver.platform.Operation; //导入方法依赖的package包/类
protected void doWrite(FeatureTypeInfo[] featureTypeInfos, OutputStream output,
        Operation describeFeatureType) throws IOException {

    //create the schema
    Object request = describeFeatureType.getParameters()[0];
    DescribeFeatureTypeRequest req = DescribeFeatureTypeRequest.adapt(request);
    
    XSDSchema schema = schemaBuilder.build(featureTypeInfos, req.getBaseURL());

    //serialize
    schema.updateElement();
    final String encoding = gs.getSettings().getCharset();
    XSDResourceImpl.serialize(output, schema.getElement(), encoding);
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:15,代码来源:XmlSchemaEncoder_ISO.java

示例2: write

import org.geoserver.platform.Operation; //导入方法依赖的package包/类
@Override
public void write(Object value, OutputStream output, Operation operation) throws IOException, ServiceException {
	StreamingMVTMap map = (StreamingMVTMap) value; 
	// if no generalisation factor / level requested from outside => use default config (factor for level mid)
	// use as fallback
	//double genFactor = getGenFactorForGenLevel(defaultGenLevel);
	Double genFactor = null;
	Double smallGeometryThreshold = DEFAULT_SMALL_GEOMETRY_THRESHOLD;
	Map<Integer, Double> genFactorTable = getGenFactorForGenLevel(defaultGenLevel); 
	if(operation.getParameters()[0] instanceof GetMapRequest) {
		// check configuration based on parameters
		GetMapRequest request = (GetMapRequest) operation.getParameters()[0];
		// if a generalisation factor is given we use it
		Object reqGenFactor = request.getEnv().get(PARAM_GENERALISATION_FACTOR);
		Object reqGenLevel = request.getEnv().get(PARAM_GENERALISATION_LEVEL);
	
		if(reqGenFactor != null && NumberUtils.isNumber((String)reqGenFactor)) {
			genFactor = NumberUtils.toDouble((String)reqGenFactor, DEFAULT_GENERALISATION_FACTOR);
		}
		// if no generalisation factor is given but a generalisation level is requested 
		// we have to look up the currently suiting generalisation
		else if(reqGenLevel != null) {
			genFactorTable = getGenFactorForRequestedLevel(reqGenLevel);
		}    		
		Object reqSkipSmallGeoms = request.getEnv().get(PARAM_SMALL_GEOM_THRESHOLD);
		if(reqSkipSmallGeoms != null) {
			smallGeometryThreshold = NumberUtils.toDouble((String)reqSkipSmallGeoms, DEFAULT_SMALL_GEOMETRY_THRESHOLD);
		}
	}
    try {
    	// passed in generlalisation factor is overriding default configuration (table for zooms)
    	if(genFactor != null) {
    		map.encode(output, smallGeometryThreshold, genFactor);
    	}
    	else {
    		map.encode(output, smallGeometryThreshold, genFactorTable, DEFAULT_GENERALISATION_FACTOR);
    	}
    } finally {
        map.dispose();
    }
}
 
开发者ID:stefan0722,项目名称:gs-mvt,代码行数:42,代码来源:MVTStreamingMapResponse.java


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