本文整理汇总了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);
}
示例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();
}
}