本文整理汇总了Java中mil.nga.geopackage.projection.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH属性的典型用法代码示例。如果您正苦于以下问题:Java ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH属性的具体用法?Java ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH怎么用?Java ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类mil.nga.geopackage.projection.ProjectionConstants
的用法示例。
在下文中一共展示了ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBoundingBox
/**
* Get the WGS84 bounding box of the current map view screen.
* The max longitude will be larger than the min resulting in values larger than 180.0.
*
* @param map google map
* @return current bounding box
*/
public static BoundingBox getBoundingBox(GoogleMap map) {
LatLngBounds visibleBounds = map.getProjection()
.getVisibleRegion().latLngBounds;
LatLng southwest = visibleBounds.southwest;
LatLng northeast = visibleBounds.northeast;
double minLatitude = southwest.latitude;
double maxLatitude = northeast.latitude;
double minLongitude = southwest.longitude;
double maxLongitude = northeast.longitude;
if (maxLongitude < minLongitude) {
maxLongitude += (2 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH);
}
BoundingBox boundingBox = new BoundingBox(minLongitude, minLatitude, maxLongitude, maxLatitude);
return boundingBox;
}
示例2: getWGS84BoundingBox
/**
* Get the WGS84 tile bounding box from the tile grid and zoom level
*
* @param tileGrid
* tile grid
* @param zoom
* zoom
*
* @return wgs84 bounding box
* @since 1.2.0
*/
public static BoundingBox getWGS84BoundingBox(TileGrid tileGrid, int zoom) {
int tilesPerLat = tilesPerWGS84LatSide(zoom);
int tilesPerLon = tilesPerWGS84LonSide(zoom);
double tileSizeLat = tileSizeLatPerWGS84Side(tilesPerLat);
double tileSizeLon = tileSizeLonPerWGS84Side(tilesPerLon);
double minLon = (-1 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH)
+ (tileGrid.getMinX() * tileSizeLon);
double maxLon = (-1 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH)
+ ((tileGrid.getMaxX() + 1) * tileSizeLon);
double minLat = ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT
- ((tileGrid.getMaxY() + 1) * tileSizeLat);
double maxLat = ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT
- (tileGrid.getMinY() * tileSizeLat);
BoundingBox box = new BoundingBox(minLon, minLat, maxLon, maxLat);
return box;
}
示例3: expandBoundingBox
/**
* 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);
}
}
示例4: adjustGoogleBounds
/**
* Adjust the tile matrix set and web mercator bounds for Google tile format
*/
private void adjustGoogleBounds() {
// Set the tile matrix set bounding box to be the world
BoundingBox standardWgs84Box = new BoundingBox(-ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH,
ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE,
ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH,
ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE);
ProjectionTransform wgs84ToWebMercatorTransform = ProjectionFactory.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM)
.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
tileGridBoundingBox = wgs84ToWebMercatorTransform.transform(standardWgs84Box);
}
示例5: isGoogleTiles
/**
* Determine if the tiles are in the Google tile coordinate format
*
* @return
*/
public boolean isGoogleTiles() {
// Convert the bounding box to wgs84
BoundingBox boundingBox = tileMatrixSet.getBoundingBox();
BoundingBox wgs84BoundingBox = projection.getTransformation(
ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM).transform(
boundingBox);
boolean googleTiles = false;
// Verify the bounds are the entire world
if (wgs84BoundingBox.getMinLatitude() <= ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE
&& wgs84BoundingBox.getMaxLatitude() >= ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE
&& wgs84BoundingBox.getMinLongitude() <= -ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH
&& wgs84BoundingBox.getMaxLongitude() >= ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH) {
googleTiles = true;
// Verify each tile matrix is the correct width and height
for (TileMatrix tileMatrix : tileMatrices) {
long zoomLevel = tileMatrix.getZoomLevel();
long tilesPerSide = TileBoundingBoxUtils
.tilesPerSide((int) zoomLevel);
if (tileMatrix.getMatrixWidth() != tilesPerSide
|| tileMatrix.getMatrixHeight() != tilesPerSide) {
googleTiles = false;
break;
}
}
}
return googleTiles;
}
示例6: BoundingBox
/**
* Constructor
*/
public BoundingBox() {
this(-ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH,
-ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT,
ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH,
ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT);
}
示例7: getTileGridWGS84
/**
* Get the tile grid that includes the entire tile bounding box
*
* @param boundingBox
* wgs84 bounding box
* @param zoom
* zoom level
*
* @return tile grid
* @since 1.2.0
*/
public static TileGrid getTileGridWGS84(BoundingBox boundingBox, int zoom) {
int tilesPerLat = tilesPerWGS84LatSide(zoom);
int tilesPerLon = tilesPerWGS84LonSide(zoom);
double tileSizeLat = tileSizeLatPerWGS84Side(tilesPerLat);
double tileSizeLon = tileSizeLonPerWGS84Side(tilesPerLon);
int minX = (int) ((boundingBox.getMinLongitude() + ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH) / tileSizeLon);
double tempMaxX = (boundingBox.getMaxLongitude() + ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH)
/ tileSizeLon;
int maxX = (int) tempMaxX;
if (tempMaxX % 1 == 0) {
maxX--;
}
maxX = Math.min(maxX, tilesPerLon - 1);
int minY = (int) (((boundingBox.getMaxLatitude() - ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT) * -1) / tileSizeLat);
double tempMaxY = ((boundingBox.getMinLatitude() - ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT) * -1)
/ tileSizeLat;
int maxY = (int) tempMaxY;
if (tempMaxY % 1 == 0) {
maxY--;
}
maxY = Math.min(maxY, tilesPerLat - 1);
TileGrid grid = new TileGrid(minX, minY, maxX, maxY);
return grid;
}
示例8: adjustGoogleBounds
/**
* Adjust the tile matrix set and web mercator bounds for Google tile format
*/
private void adjustGoogleBounds() {
// Set the tile matrix set bounding box to be the world
BoundingBox standardWgs84Box = new BoundingBox(
-ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH,
ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE,
ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH,
ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE);
ProjectionTransform wgs84ToWebMercatorTransform = ProjectionFactory
.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM)
.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
tileGridBoundingBox = wgs84ToWebMercatorTransform
.transform(standardWgs84Box);
}
示例9: isGoogleTiles
/**
* Determine if the tiles are in the Google tile coordinate format
*
* @return true if Google tile format
*/
public boolean isGoogleTiles() {
// Convert the bounding box to wgs84
BoundingBox boundingBox = tileMatrixSet.getBoundingBox();
BoundingBox wgs84BoundingBox = projection.getTransformation(
ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM).transform(
boundingBox);
boolean googleTiles = false;
// Verify the bounds are the entire world
if (wgs84BoundingBox.getMinLatitude() <= ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE
&& wgs84BoundingBox.getMaxLatitude() >= ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE
&& wgs84BoundingBox.getMinLongitude() <= -ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH
&& wgs84BoundingBox.getMaxLongitude() >= ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH) {
googleTiles = true;
// Verify each tile matrix is the correct width and height
for (TileMatrix tileMatrix : tileMatrices) {
long zoomLevel = tileMatrix.getZoomLevel();
long tilesPerSide = TileBoundingBoxUtils
.tilesPerSide((int) zoomLevel);
if (tileMatrix.getMatrixWidth() != tilesPerSide
|| tileMatrix.getMatrixHeight() != tilesPerSide) {
googleTiles = false;
break;
}
}
}
return googleTiles;
}
示例10: tileSizeLonPerWGS84Side
/**
* Get the tile height in degrees longitude
*
* @param tilesPerLon
* tiles per longitude side
*
* @return degrees
* @since 1.2.0
*/
public static double tileSizeLonPerWGS84Side(int tilesPerLon) {
return (2 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH)
/ tilesPerLon;
}