本文整理了Java中org.deegree.geometry.GeometryFactory.createEnvelope()
方法的一些代码示例,展示了GeometryFactory.createEnvelope()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeometryFactory.createEnvelope()
方法的具体详情如下:
包路径:org.deegree.geometry.GeometryFactory
类名称:GeometryFactory
方法名:createEnvelope
暂无
代码示例来源:origin: deegree/deegree3
/**
* @param ps
* @param b
* @param index
* @throws SQLException
*/
private Envelope getEnvelope( float[] location, float width, float height, float depth ) {
return geomFac.createEnvelope( new double[] { location[0], location[1], location[2] },
new double[] { location[0] + width, location[1] + depth, location[2] + height },
null );
}
代码示例来源:origin: deegree/deegree3
/**
* @param translationVector
* @param coordinateSystem
* @return a default 3d envelope at 0,0 from the scene.
*/
private static Envelope createDefaultEnvelope( double[] translationVector, ICRS coordinateSystem ) {
return geomFac.createEnvelope( new double[] { 0, 0, 0 }, new double[] { DEFAULT_SPAN, DEFAULT_SPAN,
DEFAULT_SPAN }, coordinateSystem );
}
代码示例来源:origin: deegree/deegree3
/**
* @param env
* @param crs
* @return reverse of the other createEnvelope method
*/
public static final Envelope createEnvelope( float[] env, CRS crs ) {
if ( env.length == 4 ) {
return fac.createEnvelope( env[0], env[1], env[2], env[3], crs );
}
if ( env.length == 6 ) {
return fac.createEnvelope( new double[] { env[0], env[1], env[2] },
new double[] { env[3], env[4], env[5] }, crs );
}
throw new IllegalArgumentException( "The envelope must be 2 or 3 dimensional." );
}
代码示例来源:origin: deegree/deegree3
private Envelope getDefaultBBox() {
return new GeometryFactory().createEnvelope( new double[] { -sphereSize, -sphereSize, -sphereSize },
new double[] { sphereSize, sphereSize, sphereSize }, null );
}
代码示例来源:origin: deegree/deegree3
/**
* @param buffer
* @return
* @throws IOException
*/
private Envelope readEnvelope( DataInputStream in )
throws IOException {
double[] min = new double[3];
double[] max = new double[3];
min[0] = in.readDouble();
min[1] = in.readDouble();
min[2] = in.readDouble();
max[0] = in.readDouble();
max[1] = in.readDouble();
max[2] = in.readDouble();
return geomFac.createEnvelope( min, max, null );
}
代码示例来源:origin: deegree/deegree3
@SuppressWarnings("boxing")
protected static Envelope createEnvelope( String bboxStr, ICRS srs ) {
String[] coordList = bboxStr.split( "," );
int n = coordList.length / 2;
List<Double> lowerCorner = new ArrayList<Double>();
for ( int i = 0; i < n; i++ ) {
lowerCorner.add( Double.parseDouble( coordList[i] ) );
}
List<Double> upperCorner = new ArrayList<Double>();
for ( int i = n; i < 2 * n; i++ ) {
upperCorner.add( Double.parseDouble( coordList[i] ) );
}
GeometryFactory gf = new GeometryFactory();
return gf.createEnvelope( lowerCorner, upperCorner, srs );
}
代码示例来源:origin: deegree/deegree3
private Envelope readEnvelope( ByteBuffer bb ) {
Envelope result = null;
if ( ( bb.position() + ( 6 * ( AllocatedHeapMemory.DOUBLE_SIZE ) ) ) < bb.capacity() ) {
double[] min = new double[] { bb.getDouble(), bb.getDouble(), bb.getDouble() };
double[] max = new double[] { bb.getDouble(), bb.getDouble(), bb.getDouble() };
String crs = ObjectSerializer.readString( bb );
result = new GeometryFactory().createEnvelope( min, max, CRSManager.getCRSRef( crs ) );
}
return result;
}
代码示例来源:origin: deegree/deegree3
@Override
public SimpleRaster getSubRaster( double x, double y, double x2, double y2 ) {
// what about the precision model? Formerly: getRasterReference().getDelta() was used
Envelope env = getGeometryFactory().createEnvelope( new double[] { x, y }, new double[] { x2, y2 }, null );
return getSubRaster( env );
}
代码示例来源:origin: deegree/deegree3
@Override
public MultiRangedRaster getSubRaster( double x, double y, double x2, double y2 ) {
// what about the precision model? Formerly: getRasterReference().getDelta() was used
Envelope env = getGeometryFactory().createEnvelope( new double[] { x, y }, new double[] { x2, y2 }, null );
return getSubRaster( env );
}
代码示例来源:origin: deegree/deegree3
@Override
public void setValue( double[] lower, double[] upper, String crsName ) {
setValue( geomFac.createEnvelope( lower, upper, CRSManager.getCRSRef( crsName ) ) );
}
代码示例来源:origin: deegree/deegree3
private void getAndSetSubImage( BufferedImage targetImage, List<LayerRef> layers, int xMin, int width,
int yMin, int height, RasterGeoReference rasterEnv, ICRS crs, String format,
boolean transparent, boolean errorsInImage )
throws IOException {
double[] min = rasterEnv.getWorldCoordinate( xMin, yMin + height );
double[] max = rasterEnv.getWorldCoordinate( xMin + width, yMin );
Envelope env = new GeometryFactory().createEnvelope( min, max, crs );
Pair<BufferedImage, String> response = getMap( layers, styles, width, height, env, crs, format,
transparent, errorsInImage, false, null );
if ( response.second != null ) {
throw new IOException( response.second );
}
targetImage.getGraphics().drawImage( response.first, xMin, yMin, null );
}
}
代码示例来源:origin: deegree/deegree3
private Envelope calculateMainBBox( List<BoundingBox> bbox ) {
if ( bbox == null || bbox.isEmpty() )
return null;
double west = bbox.get( 0 ).getWestBoundLongitude();
double east = bbox.get( 0 ).getEastBoundLongitude();
double south = bbox.get( 0 ).getSouthBoundLatitude();
double north = bbox.get( 0 ).getNorthBoundLatitude();
for ( BoundingBox b : bbox ) {
west = Math.min( west, b.getWestBoundLongitude() );
east = Math.max( east, b.getEastBoundLongitude() );
south = Math.min( south, b.getSouthBoundLatitude() );
north = Math.max( north, b.getNorthBoundLatitude() );
}
GeometryFactory gf = new GeometryFactory();
return gf.createEnvelope( west, south, east, north, CRSUtils.EPSG_4326 );
}
代码示例来源:origin: deegree/deegree3
private TypedObjectNode[] getResultBBox( List<BoundingBox> bbox ) {
if ( bbox == null || bbox.isEmpty() )
return new TypedObjectNode[0];
double west = bbox.get( 0 ).getWestBoundLongitude();
double east = bbox.get( 0 ).getEastBoundLongitude();
double south = bbox.get( 0 ).getSouthBoundLatitude();
double north = bbox.get( 0 ).getNorthBoundLatitude();
for ( BoundingBox b : bbox ) {
west = Math.min( west, b.getWestBoundLongitude() );
east = Math.max( east, b.getEastBoundLongitude() );
south = Math.min( south, b.getSouthBoundLatitude() );
north = Math.max( north, b.getNorthBoundLatitude() );
}
GeometryFactory gf = new GeometryFactory();
return new TypedObjectNode[] { gf.createEnvelope( west, south, east, north, CRSUtils.EPSG_4326 ) };
}
代码示例来源:origin: deegree/deegree3
/**
* @param ps
* @param b
* @param index
* @throws SQLException
*/
private Envelope getEnvelope( BillBoard b ) {
float[] location = b.getLocation();
float width = b.getWidth() * 0.5f;
float height = b.getHeight();
return geomFac.createEnvelope( new double[] { location[0] - width, location[1] - width, location[2] },
new double[] { location[0] + width, location[1] + width, location[2] + height },
null );
}
代码示例来源:origin: deegree/deegree3
/**
* @param crs
*/
public void setCoordinateSystem( ICRS crs ) {
this.crs = crs;
bbox = fac.createEnvelope( bbox.getMin().getAsArray(), bbox.getMax().getAsArray(), crs );
}
代码示例来源:origin: deegree/deegree3
/**
* @param crs
*/
public void setCoordinateSystem( ICRS crs ) {
this.crs = crs;
if ( envelope != null ) {
// rb: this is not correct, the values of the envelope should be converted to the given crs, shouldn't they.
this.envelope = geomFactory.createEnvelope( envelope.getMin().getAsArray(), envelope.getMax().getAsArray(),
crs );
}
}
代码示例来源:origin: deegree/deegree3
private static RenderablePrototype createBoxPrototype() {
RenderableQualityModel rqm = new RenderableQualityModel();
RenderableGeometry rg = new BOXGeometry();
rqm.addQualityModelPart( rg );
Envelope env = new GeometryFactory().createEnvelope( 0, 0, 1, 1, null );
return new RenderablePrototype( "box", "yeah", env, rqm );
}
代码示例来源:origin: deegree/deegree3
private Envelope parseEnvelope()
throws OWSException {
// get the values from a spatial subset
OMElement envelope = parseEnvelopeElement();
String srsName = parseSRSName( envelope, "EPSG:4326" );
List<OMElement> posElems = getElements( envelope, new XPath( "gml:pos", wcsNSContext ) );
if ( posElems.size() != 2 ) {
throw new OWSException( "invalid envelope, need two gml:pos", OWSException.INVALID_PARAMETER_VALUE,
"spatialSubset" );
}
double[] min = parseNums( "gml:pos", posElems.get( 0 ) );
double[] max = parseNums( "gml:pos", posElems.get( 1 ) );
ICRS crs = CRSManager.getCRSRef( srsName );
GeometryFactory geomFactory = new GeometryFactory();
return geomFactory.createEnvelope( min, max, crs );
}
代码示例来源:origin: deegree/deegree3
List<LegendItem> prepareLegend( Style style, Graphics2D g, int width, int height ) {
Pair<Integer, Integer> p = getLegendSize( style );
Envelope box = geofac.createEnvelope( 0, 0, p.first, p.second, null );
Java2DRenderer renderer = new Java2DRenderer( g, width, height, box );
Java2DTextRenderer textRenderer = new Java2DTextRenderer( renderer );
Java2DRasterRenderer rasterRenderer = new Java2DRasterRenderer( g, width, height, box );
return LegendItemBuilder.prepareLegend( style, renderer, textRenderer, rasterRenderer );
}
代码示例来源:origin: deegree/deegree3
public Envelope calcClickBox( int radius ) {
radius = parameters.get( "RADIUS" ) == null ? radius : parseInt( parameters.get( "RADIUS" ) );
GeometryFactory fac = new GeometryFactory();
double dw = envelope.getSpan0() / width;
double dh = envelope.getSpan1() / height;
int r2 = radius / 2;
r2 = r2 <= 0 ? 1 : r2;
return fac.createEnvelope( new double[] { envelope.getMin().get0() + ( x - r2 ) * dw,
envelope.getMax().get1() - ( y + r2 ) * dh },
new double[] { envelope.getMin().get0() + ( x + r2 ) * dw,
envelope.getMax().get1() - ( y - r2 ) * dh },
envelope.getCoordinateSystem() );
}
}
内容来源于网络,如有侵权,请联系作者删除!