当前位置: 首页>>代码示例>>Java>>正文


Java BoundingBox.setMaxLatitude方法代码示例

本文整理汇总了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);
    }

}
 
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:40,代码来源:GoogleMapShape.java

示例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;
}
 
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:21,代码来源:TileBoundingBoxUtils.java


注:本文中的mil.nga.geopackage.BoundingBox.setMaxLatitude方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。