本文整理汇总了Java中mil.nga.geopackage.BoundingBox.setMaxLatitude方法的典型用法代码示例。如果您正苦于以下问题:Java BoundingBox.setMaxLatitude方法的具体用法?Java BoundingBox.setMaxLatitude怎么用?Java BoundingBox.setMaxLatitude使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mil.nga.geopackage.BoundingBox
的用法示例。
在下文中一共展示了BoundingBox.setMaxLatitude方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: expandBoundingBox
import mil.nga.geopackage.BoundingBox; //导入方法依赖的package包/类
/**
* Expand the bounding box by the LatLng
*
* @param boundingBox
* @param latLng
*/
private void expandBoundingBox(BoundingBox boundingBox, LatLng latLng) {
double latitude = latLng.latitude;
double longitude = latLng.longitude;
if (boundingBox.getMinLongitude() <= 3 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH && boundingBox.getMaxLongitude() >= 3 * -ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH) {
if (longitude < boundingBox.getMinLongitude()) {
if (boundingBox.getMinLongitude()
- longitude > (longitude + (2 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH)) - boundingBox.getMaxLongitude()) {
longitude += (2 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH);
}
} else if (longitude > boundingBox.getMaxLongitude()) {
if (longitude - boundingBox.getMaxLongitude() > boundingBox.getMinLongitude()
- (longitude - (2 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH))) {
longitude -= (2 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH);
}
}
}
if (latitude < boundingBox.getMinLatitude()) {
boundingBox.setMinLatitude(latitude);
}
if (latitude > boundingBox.getMaxLatitude()) {
boundingBox.setMaxLatitude(latitude);
}
if (longitude < boundingBox.getMinLongitude()) {
boundingBox.setMinLongitude(longitude);
}
if (longitude > boundingBox.getMaxLongitude()) {
boundingBox.setMaxLongitude(longitude);
}
}
示例2: boundDegreesBoundingBoxWithWebMercatorLimits
import mil.nga.geopackage.BoundingBox; //导入方法依赖的package包/类
/**
* Bound the upper and lower bounds of the degrees bounding box with web
* mercator limits
*
* @param boundingBox
* degrees bounding box
* @return bounding box
* @since 1.3.1
*/
public static BoundingBox boundDegreesBoundingBoxWithWebMercatorLimits(
BoundingBox boundingBox) {
BoundingBox bounded = new BoundingBox(boundingBox);
if (bounded.getMinLatitude() < ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE) {
bounded.setMinLatitude(ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE);
}
if (bounded.getMaxLatitude() > ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE) {
bounded.setMaxLatitude(ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE);
}
return bounded;
}