本文整理汇总了Java中org.geotools.process.factory.DescribeParameter类的典型用法代码示例。如果您正苦于以下问题:Java DescribeParameter类的具体用法?Java DescribeParameter怎么用?Java DescribeParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DescribeParameter类属于org.geotools.process.factory包,在下文中一共展示了DescribeParameter类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.geotools.process.factory.DescribeParameter; //导入依赖的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);
}
示例2: execute
import org.geotools.process.factory.DescribeParameter; //导入依赖的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.DescribeParameter; //导入依赖的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;
}
示例4: execute
import org.geotools.process.factory.DescribeParameter; //导入依赖的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;
}
示例5: execute
import org.geotools.process.factory.DescribeParameter; //导入依赖的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;
}
示例6: execute
import org.geotools.process.factory.DescribeParameter; //导入依赖的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;
}
示例7: execute
import org.geotools.process.factory.DescribeParameter; //导入依赖的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;
}
示例8: invertQuery
import org.geotools.process.factory.DescribeParameter; //导入依赖的package包/类
public Query invertQuery(
@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,
final Query targetQuery,
final GridGeometry targetGridGeometry )
throws ProcessException {
// add to the query hints
targetQuery.getHints().put(
OUTPUT_WIDTH,
argOutputWidth);
targetQuery.getHints().put(
OUTPUT_HEIGHT,
argOutputHeight);
targetQuery.getHints().put(
OUTPUT_BBOX,
argOutputEnv);
if (pixelSize != null) {
targetQuery.getHints().put(
PIXEL_SIZE,
pixelSize);
}
return targetQuery;
}
示例9: invertQuery
import org.geotools.process.factory.DescribeParameter; //导入依赖的package包/类
public Query invertQuery(
@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,
final Query targetQuery,
final GridGeometry targetGridGeometry )
throws ProcessException {
// add to the query hints
targetQuery.getHints().put(
OUTPUT_WIDTH,
argOutputWidth);
targetQuery.getHints().put(
OUTPUT_HEIGHT,
argOutputHeight);
targetQuery.getHints().put(
OUTPUT_BBOX,
argOutputEnv);
if (pixelSize != null) {
targetQuery.getHints().put(
PIXEL_SIZE,
pixelSize);
}
return targetQuery;
}
示例10: execute
import org.geotools.process.factory.DescribeParameter; //导入依赖的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);
}
}
示例11: octagonalEnvelope
import org.geotools.process.factory.DescribeParameter; //导入依赖的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());
}
示例12: invertQuery
import org.geotools.process.factory.DescribeParameter; //导入依赖的package包/类
public Query invertQuery(
@DescribeParameter(name = "outputBBOX", description = "Georeferenced bounding box of the output") ReferencedEnvelope envelope,
Query targetQuery, GridGeometry targetGridGeometry
) throws ProcessException {
final BBOXRemovingFilterVisitor visitor = new BBOXRemovingFilterVisitor();
Filter filter = (Filter) targetQuery.getFilter().accept(visitor, null);
final String geometryName = visitor.getGeometryPropertyName();
if (geometryName != null) {
final BBOX bbox;
try {
if (envelope.getCoordinateReferenceSystem() != null) {
envelope = envelope.transform(DefaultGeographicCRS.WGS84,false);
}
bbox = FILTER_FACTORY.bbox(geometryName, envelope.getMinX(), envelope.getMinY(), envelope.getMaxX(), envelope.getMaxY(), "EPSG:4326");
} catch (Exception e) {
throw new ProcessException("Unable to create bbox filter for feature source", e);
}
filter = (Filter) FILTER_FACTORY.and(filter, bbox).accept(new SimplifyingFilterVisitor(), null);
targetQuery.setFilter(filter);
}
final List<PropertyName> properties = new ArrayList<>();
properties.add(FILTER_FACTORY.property("_aggregation"));
targetQuery.setProperties(properties);
return targetQuery;
}