本文整理汇总了Java中org.geotools.geometry.jts.ReferencedEnvelope.centre方法的典型用法代码示例。如果您正苦于以下问题:Java ReferencedEnvelope.centre方法的具体用法?Java ReferencedEnvelope.centre怎么用?Java ReferencedEnvelope.centre使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.geotools.geometry.jts.ReferencedEnvelope
的用法示例。
在下文中一共展示了ReferencedEnvelope.centre方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RasterizedSpatialiteLasLayer
import org.geotools.geometry.jts.ReferencedEnvelope; //导入方法依赖的package包/类
public RasterizedSpatialiteLasLayer( String title, ASpatialDb db, Integer tileSize, boolean transparentBackground,
boolean doIntensity ) throws Exception {
super(makeLevels(title, tileSize, transparentBackground, db, doIntensity));
String plus = doIntensity ? INTENSITY : ELEVATION;
this.layerName = title + " " + plus;
this.setUseTransparentTextures(true);
try {
Envelope tableBounds = db.getTableBounds(LasSourcesTable.TABLENAME);
GeometryColumn spatialiteGeometryColumns = db.getGeometryColumnsForTable(LasCellsTable.TABLENAME);
CoordinateReferenceSystem dataCrs = CRS.decode("EPSG:" + spatialiteGeometryColumns.srid);
CoordinateReferenceSystem targetCRS = DefaultGeographicCRS.WGS84;
ReferencedEnvelope env = new ReferencedEnvelope(tableBounds, dataCrs);
ReferencedEnvelope envLL = env.transform(targetCRS, true);
centre = envLL.centre();
} catch (Exception e) {
e.printStackTrace();
centre = CrsUtilities.WORLD.centre();
}
}
示例2: getCenter
import org.geotools.geometry.jts.ReferencedEnvelope; //导入方法依赖的package包/类
@Override
public Coordinate getCenter() {
try {
ReferencedEnvelope bounds = getfeatureCollection().getBounds();
return bounds.centre();
} catch (Exception e) {
e.printStackTrace();
}
return new Coordinate(0, 0);
}