本文整理了Java中org.geotools.data.ows.Layer.getEnvelope()
方法的一些代码示例,展示了Layer.getEnvelope()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Layer.getEnvelope()
方法的具体详情如下:
包路径:org.geotools.data.ows.Layer
类名称:Layer
方法名:getEnvelope
[英]Look up an envelope for the provided CoordinateReferenceSystem.
Please note that the lookup is performed based on the SRS Name of the provided CRS which is assumed to be one of its identifiers. This method returns the first envelope found; this may not be valid for sparse data sets that indicate data location using multiple envelopes for a provided CRS.
[中]查找提供的坐标参考系统的信封。
请注意,查找是基于提供的CRS的SRS名称执行的,该名称被假定为其标识符之一。此方法返回找到的第一个信封;这可能对稀疏数据集无效,稀疏数据集使用多个信封指示所提供CRS的数据位置。
代码示例来源:origin: org.geotools/gt-wms
/**
* Given a layer and a coordinate reference system, will locate an envelope for that layer in
* that CRS. If the layer is declared to support that CRS, but no envelope can be found, it will
* try to calculate an appropriate bounding box.
*
* <p>If null is returned, no valid bounding box could be found and one couldn't be transformed
* from another.
*
* @param layer
* @param crs
* @return an Envelope containing a valid bounding box, or null if none are found
*/
public GeneralEnvelope getEnvelope(Layer layer, CoordinateReferenceSystem crs) {
return layer.getEnvelope(crs);
}
}
代码示例来源:origin: org.geotools/gt2-wms
/**
* Given a layer and a coordinate reference system, will locate an envelope
* for that layer in that CRS. If the layer is declared to support that CRS,
* but no envelope can be found, it will try to calculate an appropriate
* bounding box.
*
* If null is returned, no valid bounding box could be found and one couldn't
* be transformed from another.
*
* @param layer
* @param crs
* @return an Envelope containing a valid bounding box, or null if none are found
*/
public GeneralEnvelope getEnvelope(Layer layer, CoordinateReferenceSystem crs) {
return layer.getEnvelope(crs);
}
}
代码示例来源:origin: org.geotools/gt-wms
/**
* Returns the layer bounds
*
* @return
*/
public void updateBounds() {
ReferencedEnvelope result = reference(layers.get(0).getLayer().getEnvelope(crs));
for (int i = 1; i < layers.size(); i++) {
ReferencedEnvelope layerEnvelope = reference(layers.get(i).getLayer().getEnvelope(crs));
result.expandToInclude(layerEnvelope);
}
this.bounds = result;
this.originalEnvelope = new GeneralEnvelope(result);
}
代码示例来源:origin: org.geotools/gt-wms
env = layer.getEnvelope(DefaultGeographicCRS.WGS84);
} else {
CRSEnvelope bbox;
} catch (NoSuchAuthorityCodeException e) {
crs = DefaultGeographicCRS.WGS84;
env = layer.getEnvelope(crs);
} catch (FactoryException e) {
crs = DefaultGeographicCRS.WGS84;
env = layer.getEnvelope(crs);
代码示例来源:origin: stackoverflow.com
private BufferedImage getLayer(Layer l) {
GetMapRequest getMapRequest = wms.createGetMapRequest();
getMapRequest.addLayer(l);
getMapRequest.setBBox(l.getEnvelope(DefaultGeographicCRS.WGS84));
getMapRequest.setDimensions(200, 400);
getMapRequest.setFormat("image/png");
getMapRequest.setSRS("CRS:84");
System.out.println(getMapRequest.getFinalURL());
try {
GetMapResponse response = wms.issueRequest(getMapRequest);
BufferedImage image = ImageIO.read(response.getInputStream());
return image;
} catch (ServiceException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
代码示例来源:origin: org.geomajas.plugin/geomajas-plugin-deskmanager
Envelope generalEnvelope = owsLayer.getEnvelope(crs);
extendBbox = toBbox(generalEnvelope);
crsEnvelope = new CRSEnvelope(generalEnvelope);
代码示例来源:origin: org.geomajas/geomajas-project-deskmanager
Envelope generalEnvelope = owsLayer.getEnvelope(crs);
extendBbox = toBbox(generalEnvelope);
crsEnvelope = new CRSEnvelope(generalEnvelope);
内容来源于网络,如有侵权,请联系作者删除!