本文整理汇总了Java中org.geotools.geometry.GeneralEnvelope类的典型用法代码示例。如果您正苦于以下问题:Java GeneralEnvelope类的具体用法?Java GeneralEnvelope怎么用?Java GeneralEnvelope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GeneralEnvelope类属于org.geotools.geometry包,在下文中一共展示了GeneralEnvelope类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getOriginalEnvelope
import org.geotools.geometry.GeneralEnvelope; //导入依赖的package包/类
@Override
public GeneralEnvelope getOriginalEnvelope(
final String coverageName ) {
final DataStatistics<?> statistics = geowaveStatisticsStore.getDataStatistics(
new ByteArrayId(
coverageName),
BoundingBoxDataStatistics.STATS_TYPE,
authorizationSPI.getAuthorizations());
// try to use both the bounding box and the overview statistics to
// determine the width and height at the highest resolution
if (statistics instanceof BoundingBoxDataStatistics) {
final BoundingBoxDataStatistics<?> bboxStats = (BoundingBoxDataStatistics<?>) statistics;
final GeneralEnvelope env = new GeneralEnvelope(
new Rectangle2D.Double(
bboxStats.getMinX(),
bboxStats.getMinY(),
bboxStats.getWidth(),
bboxStats.getHeight()));
env.setCoordinateReferenceSystem(GeoWaveGTRasterFormat.DEFAULT_CRS);
return env;
}
return null;
}
开发者ID:locationtech,项目名称:geowave,代码行数:24,代码来源:GeoWaveRasterReader.java
示例2: queryForTiles
import org.geotools.geometry.GeneralEnvelope; //导入依赖的package包/类
private CloseableIterator<GridCoverage> queryForTiles(
final Rectangle pixelDimension,
final GeneralEnvelope requestEnvelope,
final double levelResX,
final double levelResY,
final RasterDataAdapter adapter )
throws IOException {
return queryForTiles(
adapter,
new IndexOnlySpatialQuery(
new GeometryFactory().toGeometry(new Envelope(
requestEnvelope.getMinimum(0),
requestEnvelope.getMaximum(0),
requestEnvelope.getMinimum(1),
requestEnvelope.getMaximum(1)))),
new double[] {
levelResX * adapter.getTileSize(),
levelResY * adapter.getTileSize()
});
}
开发者ID:locationtech,项目名称:geowave,代码行数:21,代码来源:GeoWaveRasterReader.java
示例3: cropEnvelope
import org.geotools.geometry.GeneralEnvelope; //导入依赖的package包/类
public FT_Coverage cropEnvelope(Envelope env) {
GridCoverage2D coverage = this.coverage();
final CoverageProcessor processor = new CoverageProcessor();
final ParameterValueGroup param = processor.getOperation("CoverageCrop")
.getParameters();
final GeneralEnvelope cropEnv = new GeneralEnvelope(env);
param.parameter("Source").setValue(coverage);
param.parameter("Envelope").setValue(cropEnv);
GridCoverage2D cropped = (GridCoverage2D) processor.doOperation(param);
return new FT_Coverage(cropped);
}
开发者ID:IGNF,项目名称:geoxygene,代码行数:14,代码来源:FT_Coverage.java
示例4: renderGridCoverage
import org.geotools.geometry.GeneralEnvelope; //导入依赖的package包/类
public GridCoverage2D renderGridCoverage(
final String coverageName,
final Rectangle dim,
final GeneralEnvelope generalEnvelope,
Color backgroundColor,
Color outputTransparentColor,
final Interpolation interpolation )
throws IOException {
if (backgroundColor == null) {
backgroundColor = AbstractGridFormat.BACKGROUND_COLOR.getDefaultValue();
}
if (outputTransparentColor == null) {
outputTransparentColor = GeoWaveGTRasterFormat.OUTPUT_TRANSPARENT_COLOR.getDefaultValue();
}
final GeoWaveRasterReaderState state = new GeoWaveRasterReaderState(
coverageName);
state.setRequestedEnvelope(generalEnvelope);
// /////////////////////////////////////////////////////////////////////
//
// Loading tiles trying to optimize as much as possible
//
// /////////////////////////////////////////////////////////////////////
final GridCoverage2D coverage = loadTiles(
coverageName,
backgroundColor,
outputTransparentColor,
interpolation,
dim,
state,
crs,
getOriginalEnvelope(coverageName));
return coverage;
}
开发者ID:locationtech,项目名称:geowave,代码行数:36,代码来源:GeoWaveRasterReader.java
示例5: getIntersection
import org.geotools.geometry.GeneralEnvelope; //导入依赖的package包/类
private static org.opengis.geometry.Envelope getIntersection(
final org.opengis.geometry.Envelope originalEnvelope,
final org.opengis.geometry.Envelope indexedEnvelope ) {
if (originalEnvelope == null) {
return indexedEnvelope;
}
if (indexedEnvelope == null) {
return originalEnvelope;
}
final int dimensions = originalEnvelope.getDimension();
final double[] minDP = new double[dimensions];
final double[] maxDP = new double[dimensions];
for (int d = 0; d < dimensions; d++) {
// to perform the intersection of the original envelope and the
// indexed envelope, use the max of the mins per dimension and the
// min of the maxes
minDP[d] = Math.max(
originalEnvelope.getMinimum(d),
indexedEnvelope.getMinimum(d));
maxDP[d] = Math.min(
originalEnvelope.getMaximum(d),
indexedEnvelope.getMaximum(d));
}
return new GeneralEnvelope(
minDP,
maxDP);
}
开发者ID:locationtech,项目名称:geowave,代码行数:28,代码来源:RasterBoundingBoxStatistics.java
示例6: addSource
import org.geotools.geometry.GeneralEnvelope; //导入依赖的package包/类
protected void addSource( File imageMosaicSource ) throws IOException {
URL imageMosaicUrl = imageMosaicSource.toURI().toURL();
final AbstractGridFormat imageMosaicFormat = (AbstractGridFormat) GridFormatFinder.findFormat(imageMosaicUrl);
final ImageMosaicReader imReader = (ImageMosaicReader) imageMosaicFormat.getReader(imageMosaicUrl);
// ImageMosaicReader imReader = new ImageMosaicReader(imageMosaicSource);
if (readers.size() == 0) {
File propertiesFile = FileUtilities.substituteExtention(imageMosaicSource, "properties");
HashMap<String, String> propertiesMap = FileUtilities
.readFileToHashMap(propertiesFile.getAbsolutePath(), null, false);
String xyREs = propertiesMap.get("Levels");
String[] split = xyREs.split(",");
xRes = Double.parseDouble(split[0]);
yRes = Double.parseDouble(split[1]);
locationField = propertiesMap.get("LocationAttribute");
crs = imReader.getCoordinateReferenceSystem();
GeneralEnvelope originalEnvelope = imReader.getOriginalEnvelope();
llCorner = originalEnvelope.getLowerCorner().getCoordinate();
urCorner = originalEnvelope.getUpperCorner().getCoordinate();
SimpleFeatureCollection vectorBounds = OmsVectorReader.readVector(imageMosaicSource.getAbsolutePath());
boundsGeometries = FeatureUtilities.featureCollectionToGeometriesList(vectorBounds, true, locationField);
Envelope singleTileEnv = boundsGeometries.get(0).getEnvelopeInternal();
Envelope allTilesEnv = new Envelope();
for( Geometry boundsGeometry : boundsGeometries ) {
allTilesEnv.expandToInclude(boundsGeometry.getEnvelopeInternal());
}
if (allTilesEnv.getWidth() > singleTileEnv.getWidth()) {
isSingleInX = false;
}
if (allTilesEnv.getHeight() > singleTileEnv.getHeight()) {
isSingleInY = false;
}
}
readers.add(imReader);
}
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:43,代码来源:HMModelIM.java
示例7: transformRequestEnvelope
import org.geotools.geometry.GeneralEnvelope; //导入依赖的package包/类
/**
* transforms (if necessary) the requested envelope into the CRS used by
* this reader.
*
* @throws DataSourceException
*/
public static void transformRequestEnvelope(
final GeoWaveRasterReaderState state,
final CoordinateReferenceSystem crs )
throws DataSourceException {
if (CRS.equalsIgnoreMetadata(
state.getRequestedEnvelope().getCoordinateReferenceSystem(),
crs)) {
state.setRequestEnvelopeXformed(state.getRequestedEnvelope());
return; // and finish
}
try {
/** Buffered factory for coordinate operations. */
// transforming the envelope back to the dataset crs in
final MathTransform transform = OPERATION_FACTORY.createOperation(
state.getRequestedEnvelope().getCoordinateReferenceSystem(),
crs).getMathTransform();
if (transform.isIdentity()) { // Identity Transform ?
state.setRequestEnvelopeXformed(state.getRequestedEnvelope());
return; // and finish
}
state.setRequestEnvelopeXformed(CRS.transform(
transform,
state.getRequestedEnvelope()));
state.getRequestEnvelopeXformed().setCoordinateReferenceSystem(
crs);
// if (config.getIgnoreAxisOrder() == false) { // check for axis
// order
// required
final int indexX = indexOfX(crs);
final int indexY = indexOfY(crs);
final int indexRequestedX = indexOfX(state.getRequestedEnvelope().getCoordinateReferenceSystem());
final int indexRequestedY = indexOfY(state.getRequestedEnvelope().getCoordinateReferenceSystem());
// x Axis problem ???
if ((indexX == indexRequestedY) && (indexY == indexRequestedX)) {
state.setAxisSwap(true);
final Rectangle2D tmp = new Rectangle2D.Double(
state.getRequestEnvelopeXformed().getMinimum(
1),
state.getRequestEnvelopeXformed().getMinimum(
0),
state.getRequestEnvelopeXformed().getSpan(
1),
state.getRequestEnvelopeXformed().getSpan(
0));
state.setRequestEnvelopeXformed(new GeneralEnvelope(
tmp));
state.getRequestEnvelopeXformed().setCoordinateReferenceSystem(
crs);
}
else if ((indexX == indexRequestedX) && (indexY == indexRequestedY)) {
// everything is fine
}
else {
throw new DataSourceException(
"Unable to resolve the X Axis problem");
}
// }
}
catch (final Exception e) {
throw new DataSourceException(
"Unable to create a coverage for this source",
e);
}
}
开发者ID:locationtech,项目名称:geowave,代码行数:79,代码来源:GeoWaveRasterReader.java
示例8: getRequestedEnvelope
import org.geotools.geometry.GeneralEnvelope; //导入依赖的package包/类
/**
* @return the requestedEnvelope
*/
public GeneralEnvelope getRequestedEnvelope() {
return requestedEnvelope;
}
开发者ID:locationtech,项目名称:geowave,代码行数:7,代码来源:GeoWaveRasterReaderState.java
示例9: setRequestedEnvelope
import org.geotools.geometry.GeneralEnvelope; //导入依赖的package包/类
/**
* @param requestedEnvelope
* the requestedEnvelope to set
*/
public void setRequestedEnvelope(
GeneralEnvelope requestedEnvelope ) {
this.requestedEnvelope = requestedEnvelope;
}
开发者ID:locationtech,项目名称:geowave,代码行数:9,代码来源:GeoWaveRasterReaderState.java
示例10: getRequestEnvelopeXformed
import org.geotools.geometry.GeneralEnvelope; //导入依赖的package包/类
/**
* @return the requestEnvelopeXformed
*/
public GeneralEnvelope getRequestEnvelopeXformed() {
return requestEnvelopeXformed;
}
开发者ID:locationtech,项目名称:geowave,代码行数:7,代码来源:GeoWaveRasterReaderState.java
示例11: setRequestEnvelopeXformed
import org.geotools.geometry.GeneralEnvelope; //导入依赖的package包/类
/**
* @param requestEnvelopeXformed
* the requestEnvelopeXformed to set
*/
public void setRequestEnvelopeXformed(
GeneralEnvelope requestEnvelopeXformed ) {
this.requestEnvelopeXformed = requestEnvelopeXformed;
}
开发者ID:locationtech,项目名称:geowave,代码行数:9,代码来源:GeoWaveRasterReaderState.java
注:本文中的org.geotools.geometry.GeneralEnvelope类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论