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


Java Operation类代码示例

本文整理汇总了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();
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:22,代码来源:XmlSchemaEncoder_ISO.java

示例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);
    }
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:23,代码来源:XmlSchemaEncoder_ISO.java

示例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 );
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:8,代码来源:GML2OutputFormat_ISO.java

示例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);
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:15,代码来源:XmlSchemaEncoder_ISO.java

示例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;
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:15,代码来源:WFSDescribeFeatureTypeOutputFormat_ISO.java

示例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";
}
 
开发者ID:xandris,项目名称:geoserver-sync,代码行数:9,代码来源:SyncChecksumOutputFormat.java

示例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);
}
 
开发者ID:xandris,项目名称:geoserver-sync,代码行数:8,代码来源:SyncChecksumOutputFormat.java

示例8: getMimeType

import org.geoserver.platform.Operation; //导入依赖的package包/类
public String getMimeType(Object value, Operation operation)
    throws ServiceException {
    return "text/xml";
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:5,代码来源:XmlSchemaEncoder_ISO.java

示例9: getMimeType

import org.geoserver.platform.Operation; //导入依赖的package包/类
@Override
public String getMimeType(Object value, Operation operation) throws ServiceException {
    return MIME_TYPE;
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:5,代码来源:GML2OutputFormat_ISO.java

示例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";
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:6,代码来源:XmlSchemaEncoder_ISO.java

示例11: getMimeType

import org.geoserver.platform.Operation; //导入依赖的package包/类
public String getMimeType(Object value, Operation operation) {
    return "text/xml; subtype=gml/3.1.1";
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:4,代码来源:GML3OutputFormat_ISO.java

示例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);
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:9,代码来源:WFSDescribeFeatureTypeOutputFormat_ISO.java

示例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();
    }
}
 
开发者ID:stefan0722,项目名称:gs-mvt,代码行数:42,代码来源:MVTStreamingMapResponse.java

示例14: getMimeType

import org.geoserver.platform.Operation; //导入依赖的package包/类
@Override
public String getMimeType(Object value, Operation operation) {
    return "text/xml; subtype=gml/3.1.1";
}
 
开发者ID:xandris,项目名称:geoserver-sync,代码行数:5,代码来源:SyncGMLOutputFormat.java

示例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
	
}
 
开发者ID:xandris,项目名称:geoserver-sync,代码行数:7,代码来源:SyncGMLOutputFormat.java


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