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

Java DescribeResult类代码示例

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

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



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

示例1: execute

import org.geotools.process.factory.DescribeResult; //导入依赖的package包/类
@DescribeResult(name = "result", description = "Clipped feature collection")
public SimpleFeatureCollection execute(
        @DescribeParameter(name = "features", description = "Input feature collection") SimpleFeatureCollection features,
        @DescribeParameter(name = "clip", description = "Geometry to use for clipping (in same CRS as input features)") Geometry clip,
        @DescribeParameter(name = "preserveZ", min=0,description = "Attempt to preserve Z values from the original geometry (interpolate value for new points)") Boolean preserveZ)
        throws ProcessException {
    // only get the geometries in the bbox of the clip
    Envelope box = clip.getEnvelopeInternal();
    String srs = null;
    if(features.getSchema().getCoordinateReferenceSystem() != null) {
        srs = CRS.toSRS(features.getSchema().getCoordinateReferenceSystem());
    }
    BBOX bboxFilter = ff.bbox("", box.getMinX(), box.getMinY(), box.getMaxX(), box.getMaxY(), srs);
    
    // default value for preserve Z
    if(preserveZ == null) {
        preserveZ = false;
    }
    
    // return dynamic collection clipping geometries on the fly
    return new ClippingFeatureCollection(features.subCollection(bboxFilter), clip, preserveZ);
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:23,代码来源:ClipProcess.java


示例2: execute

import org.geotools.process.factory.DescribeResult; //导入依赖的package包/类
/**
 * execute the transformation
 * 
 * @param collection
 * @param attributes
 * @param monitor
 * @return
 * @throws ProcessException
 */
@DescribeResult(name = "result", description = "Aggregated feature collection")
public SimpleFeatureCollection execute(
		// process data
		@DescribeParameter(name = "collection", description = "Input feature collection") SimpleFeatureCollection collection,
		
		// processing parameters
		@DescribeParameter(name = "attributes", description = "Comma-seperated string of attributes to include in the aggregation") String attributes,

		// other
		@DescribeParameter(name = "enableDurationMeasurement",
				description = "Profiling option to log time durations spend in parts of this transformation to geoservers logfile. "
				+ " This will be logged on the INFO level. "
				+ " The default is Disabled (false).",
				defaultValue = "false") boolean enableDurationMeasurement,
				
		ProgressListener monitor
		) throws ProcessException {
		
	SimpleFeatureAggregator aggregator = new SimpleFeatureAggregator(ParameterHelper.splitAt(attributes, ","));
	aggregator.setMeasuringEnabled(enableDurationMeasurement);
	return aggregator.aggregate(collection, AGG_COUNT_ATTRIBUTE_NAME);
}
 
开发者ID:geops,项目名称:trafimage-geoserver-transformations,代码行数:32,代码来源:AggregateSimilarFeaturesProcess.java


示例3: execute

import org.geotools.process.factory.DescribeResult; //导入依赖的package包/类
@DescribeResult(name = "result", description = "This is just a pass-through, the key is to provide enough information within invertQuery to perform a map to screen transform")
public SimpleFeatureCollection execute(
		@DescribeParameter(name = "data", description = "Feature collection containing the data")
		final SimpleFeatureCollection features,
		@DescribeParameter(name = "outputBBOX", description = "Georeferenced bounding box of the output")
		final ReferencedEnvelope argOutputEnv,
		@DescribeParameter(name = "outputWidth", description = "Width of the output raster")
		final Integer argOutputWidth,
		@DescribeParameter(name = "outputHeight", description = "Height of the output raster")
		final Integer argOutputHeight,
		@DescribeParameter(name = "pixelSize", description = "The pixel size to decimate by")
		final Double pixelSize )
		throws ProcessException {
	// vector-to-vector render transform that is just a pass through - the
	// key is to add map to screen transform within invertQuery
	return features;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:18,代码来源:DecimationProcess.java


示例4: execute

import org.geotools.process.factory.DescribeResult; //导入依赖的package包/类
@DescribeResult(name = "result", description = "This is just a pass-through, the key is to provide enough information within invertQuery to perform a map to screen transform")
public SimpleFeatureCollection execute(
		@DescribeParameter(name = "data", description = "Feature collection containing the data")
		final SimpleFeatureCollection features,
		@DescribeParameter(name = "outputBBOX", description = "Georeferenced bounding box of the output")
		final ReferencedEnvelope argOutputEnv,
		@DescribeParameter(name = "outputWidth", description = "Width of the output raster")
		final Integer argOutputWidth,
		@DescribeParameter(name = "outputHeight", description = "Height of the output raster")
		final Integer argOutputHeight,
		@DescribeParameter(name = "pixelSize", description = "The pixel size to base subsampling on")
		final Double pixelSize )
		throws ProcessException {
	// vector-to-vector render transform that is just a pass through - the
	// key is to add map to screen transform within invertQuery
	return features;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:18,代码来源:SubsampleProcess.java


示例5: execute

import org.geotools.process.factory.DescribeResult; //导入依赖的package包/类
@DescribeResult(name = "result", description = "This is just a pass-through, the key is to provide enough information within invertQuery to perform a map to screen transform")
public SimpleFeatureCollection execute(
		@DescribeParameter(name = "data", description = "Feature collection containing the rendered image")
		final SimpleFeatureCollection features )
		throws ProcessException {
	// this is a pass through, only used so that legend rendering works
	// appropriately

	// InternalDistributedRenderProcess is what actually can be used as a
	// render transformation to perform distributed rendering, within WMS
	// map request callbacks this transformation will be replaced with
	// InternalDistributedRenderProcess

	// therefore all other calls outside of WMS map requests, such as
	// requesting the legend will behave as expected

	return features;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:19,代码来源:DistributedRenderProcess.java


示例6: execute

import org.geotools.process.factory.DescribeResult; //导入依赖的package包/类
@DescribeResult(name = "result", description = "This is just a pass-through, the key is to provide enough information within invertQuery to perform a map to screen transform")
public GridCoverage2D execute(
		@DescribeParameter(name = "data", description = "Feature collection containing the rendered image")
		final SimpleFeatureCollection features )
		throws ProcessException {
	// vector-to-raster render transform that take a single feature that
	// wraps a distributed render result and converts it to a GridCoverage2D
	if (features != null) {
		final SimpleFeatureIterator it = features.features();
		if (it.hasNext()) {
			final SimpleFeature resultFeature = features.features().next();
			final DistributedRenderResult actualResult = (DistributedRenderResult) resultFeature.getAttribute(0);
			final DistributedRenderOptions renderOptions = (DistributedRenderOptions) resultFeature.getAttribute(1);
			// convert to the GridCoverage2D required for output
			final GridCoverageFactory gcf = CoverageFactoryFinder
					.getGridCoverageFactory(GeoTools.getDefaultHints());
			final BufferedImage result = actualResult.renderComposite(renderOptions);
			final GridCoverage2D gridCov = gcf.create(
					"Process Results",
					result,
					renderOptions.getEnvelope());
			return gridCov;
		}
	}
	return null;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:27,代码来源:InternalDistributedRenderProcess.java


示例7: execute

import org.geotools.process.factory.DescribeResult; //导入依赖的package包/类
@DescribeResult(name = "scene", description = "Exported Scene")
public SceneType execute(
        @DescribeParameter(name = "coverage", description = "Name of raster") GridCoverage2D sceneCoverage,
        ProgressListener progressListener)
        throws IOException, TransformException {
    
    RenderedImage sceneImage = sceneCoverage.getRenderedImage();
    
    short[] sceneData = ((DataBufferShort) sceneImage.getData().getDataBuffer()).getData();
    
    SceneType sceneType = new SceneType();
    int offset = 0;
    
    for(int y=0; y < sceneImage.getHeight(); y++) {
        for(int x=0; x < sceneImage.getWidth(); x++) {
            sceneType.insertCoordinate(x, y, sceneData[offset++]);
        }
    }
    
    sceneType.setSceneSize(sceneImage.getWidth(), sceneImage.getHeight());
    sceneType.setSceneEnvelope(sceneCoverage.getEnvelope2D());
    
    return sceneType;
}
 
开发者ID:Geocent,项目名称:geoserver-exportscene-plugin,代码行数:25,代码来源:ExportScene.java


示例8: execute

import org.geotools.process.factory.DescribeResult; //导入依赖的package包/类
@DescribeResult(name = "result", description = "Output raster")
public GridCoverage2D execute(

        // process data
        @DescribeParameter(name = "data", description = "Input features") SimpleFeatureCollection obsFeatures,

        // process parameters
        @DescribeParameter(name = "pixelsPerCell", description = "Resolution used for upsampling (in pixels)", defaultValue="1", min = 1) Integer argPixelsPerCell,
        @DescribeParameter(name = "gridStrategy", description = "GeoHash grid strategy", defaultValue="Basic", min = 1) String gridStrategy,
        @DescribeParameter(name = "gridStrategyArgs", description = "Grid strategy arguments", min = 0) List<String> gridStrategyArgs,
        @DescribeParameter(name = "emptyCellValue", description = "Default cell value", min = 0) Float emptyCellValue,
        @DescribeParameter(name = "scaleMin", description = "Scale minimum", defaultValue="0") Float scaleMin,
        @DescribeParameter(name = "scaleMax", description = "Scale maximum", min = 0) Float scaleMax,
        @DescribeParameter(name = "useLog", description = "Whether to use log values (default=false)", defaultValue="false") Boolean useLog,

        // output image parameters
        @DescribeParameter(name = "outputBBOX", description = "Bounding box of the output") ReferencedEnvelope argOutputEnv,
        @DescribeParameter(name = "outputWidth", description = "Width of output raster in pixels") Integer argOutputWidth,
        @DescribeParameter(name = "outputHeight", description = "Height of output raster in pixels") Integer argOutputHeight,

        ProgressListener monitor) throws ProcessException {

    try {
        // construct and populate grid
        final GeoHashGrid geoHashGrid = Strategy.valueOf(gridStrategy.toUpperCase()).createNewInstance();
        geoHashGrid.setParams(gridStrategyArgs);
        geoHashGrid.setEmptyCellValue(emptyCellValue);
        geoHashGrid.setScale(new RasterScale(scaleMin, scaleMax, useLog));
        geoHashGrid.initalize(argOutputEnv, obsFeatures);
        // convert to grid coverage
        final GridCoverage2D nativeCoverage = geoHashGrid.toGridCoverage2D();

        // reproject
        final GridCoverage2D transformedCoverage = (GridCoverage2D) Operations.DEFAULT.resample(nativeCoverage, argOutputEnv.getCoordinateReferenceSystem()); 
        // upscale to approximate output resolution
        final GridCoverage2D scaledCoverage = GridCoverageUtil.scale(transformedCoverage, argOutputWidth*argPixelsPerCell, argOutputHeight*argPixelsPerCell);
        // crop (geohash grid envelope will always contain output bbox)
        final GridCoverage2D croppedCoverage = GridCoverageUtil.crop(scaledCoverage, argOutputEnv);
        return GridCoverageUtil.scale(croppedCoverage, argOutputWidth, argOutputHeight);
    } catch (Exception e) {
        throw new ProcessException("Error executing GeoHashGridProcess", e);
    }
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:44,代码来源:GeoHashGridProcess.java


示例9: octagonalEnvelope

import org.geotools.process.factory.DescribeResult; //导入依赖的package包/类
@DescribeProcess(title = "Octagonal Envelope", description = "Get the octagonal envelope of this Geometry.")
@DescribeResult(description="octagonal of geom")
static public Geometry octagonalEnvelope(@DescribeParameter(name = "geom") Geometry geom) {
    return new OctagonalEnvelope(geom).toGeometry(geom.getFactory());
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:6,代码来源:ProcessTutorial.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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