本文整理汇总了Java中org.geoserver.platform.Operation类的典型用法代码示例。如果您正苦于以下问题:Java Operation类的具体用法?Java Operation怎么用?Java Operation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Operation类属于org.geoserver.platform包,在下文中一共展示了Operation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import org.geoserver.platform.Operation; //导入依赖的package包/类
protected void write(FeatureTypeInfo[] featureTypeInfos, OutputStream output,
Operation describeFeatureType) throws IOException {
WFSInfo wfs = getInfo();
//generates response, using general function
String xmlResponse = generateTypes(featureTypeInfos, (DescribeFeatureTypeType) describeFeatureType.getParameters()[0]);
if (!wfs.getGeoServer().getSettings().isVerbose()) {
//strip out the formatting. This is pretty much the only way we
//can do this, as the user files are going to have newline
//characters and whatnot, unless we can get rid of formatting
//when we read the file, which could be worth looking into if
//this slows things down.
xmlResponse = xmlResponse.replaceAll(">\n[ \\t\\n]*", ">");
xmlResponse = xmlResponse.replaceAll("\n[ \\t\\n]*", " ");
}
Writer writer = new OutputStreamWriter(output, wfs.getGeoServer().getSettings().getCharset());
writer.write(xmlResponse);
writer.flush();
}
示例2: write
import org.geoserver.platform.Operation; //导入依赖的package包/类
protected void write(FeatureTypeInfo[] featureTypeInfos, OutputStream output,
Operation describeFeatureType) throws IOException {
//hack for SOAP request, when encoding as SOAP response the schema is actually required
// to be encoded in base64
if (Dispatcher.REQUEST.get() != null && Dispatcher.REQUEST.get().isSOAP()) {
output.write(("<wfs:DescribeFeatureTypeResponse xmlns:wfs='"
+ getWFSNamespaceURI() + "'>").getBytes());
ByteArrayOutputStream bout = new ByteArrayOutputStream();
doWrite(featureTypeInfos, bout, describeFeatureType);
output.write(Base64.encodeBase64(bout.toByteArray()));
output.write("</wfs:DescribeFeatureTypeResponse>".getBytes());
}
else {
//normal write
doWrite(featureTypeInfos, output, describeFeatureType);
}
}
示例3: write
import org.geoserver.platform.Operation; //导入依赖的package包/类
protected void write(FeatureCollectionResponse featureCollection, OutputStream output,
Operation getFeature) throws IOException, ServiceException {
GetFeatureRequest3D request = GetFeatureRequest3D.adapt(getFeature.getParameters()[0]);
prepare(request.getOutputFormat(), featureCollection, request);
encode(output, featureCollection, request );
}
示例4: 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);
}
示例5: canHandle
import org.geoserver.platform.Operation; //导入依赖的package包/类
/**
* Ensures that the operation being executed is a DescribeFeatureType operation.
* <p>
* This method may be extended to add additional checks, it should not be
* overriden.
* </p>
*/
public boolean canHandle(Operation operation) {
if ("DescribeFeatureType".equalsIgnoreCase(operation.getId())) {
return true;
}
return false;
}
示例6: getMimeType
import org.geoserver.platform.Operation; //导入依赖的package包/类
@Override
public String getMimeType(Object value, Operation operation)
throws ServiceException {
// return the mime type of the format here, the parent
// class returns 'text/xml'
// return super.getMimeType(value, operation);
return "text/plain";
}
示例7: canHandleInternal
import org.geoserver.platform.Operation; //导入依赖的package包/类
@Override
protected boolean canHandleInternal(Operation operation) {
//any additional checks that need to be performed to
// determine when the output format should be "engaged"
// should go here
return super.canHandleInternal(operation);
}
示例8: getMimeType
import org.geoserver.platform.Operation; //导入依赖的package包/类
public String getMimeType(Object value, Operation operation)
throws ServiceException {
return "text/xml";
}
示例9: getMimeType
import org.geoserver.platform.Operation; //导入依赖的package包/类
@Override
public String getMimeType(Object value, Operation operation) throws ServiceException {
return MIME_TYPE;
}
示例10: getMimeType
import org.geoserver.platform.Operation; //导入依赖的package包/类
public String getMimeType(Object value, Operation operation)
throws ServiceException {
return getOutputFormat();
//return "text/xml; subtype=gml/3.1.1";
}
示例11: getMimeType
import org.geoserver.platform.Operation; //导入依赖的package包/类
public String getMimeType(Object value, Operation operation) {
return "text/xml; subtype=gml/3.1.1";
}
示例12: write
import org.geoserver.platform.Operation; //导入依赖的package包/类
/**
* Calls through to {@link #write(FeatureTypeInfo[], OutputStream, Operation)}.
*/
public final void write(Object value, OutputStream output, Operation operation)
throws IOException, ServiceException {
write((FeatureTypeInfo[]) value, output, operation);
}
示例13: 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();
}
}
示例14: getMimeType
import org.geoserver.platform.Operation; //导入依赖的package包/类
@Override
public String getMimeType(Object value, Operation operation) {
return "text/xml; subtype=gml/3.1.1";
}
示例15: write
import org.geoserver.platform.Operation; //导入依赖的package包/类
@Override
protected void write(FeatureCollectionResponse arg0, OutputStream arg1,
Operation arg2) throws IOException, ServiceException {
// TODO Auto-generated method stub
}