本文整理汇总了Java中mil.nga.geopackage.projection.ProjectionConstants类的典型用法代码示例。如果您正苦于以下问题:Java ProjectionConstants类的具体用法?Java ProjectionConstants怎么用?Java ProjectionConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectionConstants类属于mil.nga.geopackage.projection包,在下文中一共展示了ProjectionConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getBoundingBox
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* 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;
}
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:28,代码来源:MapUtils.java
示例2: GoogleMapShapeConverter
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Constructor with specified projection, see
* {@link FeatureDao#getProjection}
*
* @param projection
*/
public GoogleMapShapeConverter(Projection projection) {
this.projection = projection;
if (projection != null) {
toWgs84 = projection
.getTransformation(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
Projection wgs84 = toWgs84.getToProjection();
fromWgs84 = wgs84.getTransformation(projection);
toWebMercator = projection.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
Projection webMercator = toWebMercator.getToProjection();
fromWebMercator = webMercator.getTransformation(projection);
} else {
toWgs84 = null;
fromWgs84 = null;
toWebMercator = null;
fromWebMercator = null;
}
}
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:24,代码来源:GoogleMapShapeConverter.java
示例3: testLocation
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Test a single location
*
* @param latitude
* @param longitude
* @throws Exception
*/
private void testLocation(double latitude, double longitude)
throws Exception {
if (PRINT) {
System.out.println("Latitude: " + latitude);
System.out.println("Longitude: " + longitude);
}
for (ElevationTilesAlgorithm algorithm : ElevationTilesAlgorithm
.values()) {
Double elevation = ElevationTilesTiffTestUtils.getElevation(
geoPackage, algorithm, latitude, longitude,
ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
if (PRINT) {
System.out.println(algorithm.name() + ": " + elevation);
}
}
}
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:26,代码来源:ElevationTilesTiffImportTest.java
示例4: testLocation
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Test a single location
*
* @param latitude
* @param longitude
* @throws Exception
*/
private void testLocation(double latitude, double longitude)
throws Exception {
if (PRINT) {
System.out.println("Latitude: " + latitude);
System.out.println("Longitude: " + longitude);
}
for (ElevationTilesAlgorithm algorithm : ElevationTilesAlgorithm
.values()) {
Double elevation = ElevationTilesPngTestUtils.getElevation(geoPackage,
algorithm, latitude, longitude,
ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
if (PRINT) {
System.out.println(algorithm.name() + ": " + elevation);
}
}
}
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:26,代码来源:ElevationTilesPngImportTest.java
示例5: createFeatureDao
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Create feature dao
*
* @return
*/
public static FeatureDao createFeatureDao(GeoPackage geoPackage) {
BoundingBox boundingBox = new BoundingBox();
GeometryColumns geometryColumns = new GeometryColumns();
geometryColumns.setId(new TableColumnKey("feature_tiles",
"geom"));
geometryColumns.setGeometryType(GeometryType.GEOMETRY);
geometryColumns.setZ((byte) 0);
geometryColumns.setM((byte) 0);
geoPackage.createFeatureTableWithMetadata(
geometryColumns, boundingBox, ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
FeatureDao featureDao = geoPackage.getFeatureDao(geometryColumns);
return featureDao;
}
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:24,代码来源:FeatureTileUtils.java
示例6: getZoomLevel
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Get the approximate zoom level of where the bounding box of the user data
* fits into the world
*
* @return zoom level
* @since 1.1.0
*/
public int getZoomLevel() {
Projection projection = getProjection();
if (projection == null) {
throw new GeoPackageException(
"No projection was set which is required to determine the zoom level");
}
int zoomLevel = 0;
BoundingBox boundingBox = getBoundingBox();
if (boundingBox != null) {
if (projection.getUnit() instanceof DegreeUnit) {
boundingBox = TileBoundingBoxUtils
.boundDegreesBoundingBoxWithWebMercatorLimits(boundingBox);
}
ProjectionTransform webMercatorTransform = projection
.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
BoundingBox webMercatorBoundingBox = webMercatorTransform
.transform(boundingBox);
zoomLevel = TileBoundingBoxUtils
.getZoomLevel(webMercatorBoundingBox);
}
return zoomLevel;
}
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:30,代码来源:UserCoreDao.java
示例7: getWebMercatorBoundingBox
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Get the Web Mercator tile bounding box from the Google Maps API tile
* coordinates and zoom level
*
* @param x
* x coordinate
* @param y
* y coordinate
* @param zoom
* zoom level
* @return bounding box
*/
public static BoundingBox getWebMercatorBoundingBox(long x, long y, int zoom) {
double tileSize = tileSizeWithZoom(zoom);
double minLon = (-1 * ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)
+ (x * tileSize);
double maxLon = (-1 * ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)
+ ((x + 1) * tileSize);
double minLat = ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH
- ((y + 1) * tileSize);
double maxLat = ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH
- (y * tileSize);
BoundingBox box = new BoundingBox(minLon, minLat, maxLon, maxLat);
return box;
}
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:30,代码来源:TileBoundingBoxUtils.java
示例8: getTileGrid
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Get the tile grid that includes the entire tile bounding box
*
* @param webMercatorBoundingBox
* web mercator bounding box
* @param zoom
* zoom level
* @return tile grid
*/
public static TileGrid getTileGrid(BoundingBox webMercatorBoundingBox,
int zoom) {
int tilesPerSide = tilesPerSide(zoom);
double tileSize = tileSize(tilesPerSide);
int minX = (int) ((webMercatorBoundingBox.getMinLongitude() + ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH) / tileSize);
double tempMaxX = (webMercatorBoundingBox.getMaxLongitude() + ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)
/ tileSize;
int maxX = (int) (tempMaxX - ProjectionConstants.WEB_MERCATOR_PRECISION);
maxX = Math.min(maxX, tilesPerSide - 1);
int minY = (int) (((webMercatorBoundingBox.getMaxLatitude() - ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH) * -1) / tileSize);
double tempMaxY = ((webMercatorBoundingBox.getMinLatitude() - ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH) * -1)
/ tileSize;
int maxY = (int) (tempMaxY - ProjectionConstants.WEB_MERCATOR_PRECISION);
maxY = Math.min(maxY, tilesPerSide - 1);
TileGrid grid = new TileGrid(minX, minY, maxX, maxY);
return grid;
}
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:32,代码来源:TileBoundingBoxUtils.java
示例9: getZoomLevel
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Get the zoom level of where the web mercator bounding box fits into the
* complete world
*
* @param webMercatorBoundingBox
* web mercator bounding box
* @return zoom level
*/
public static int getZoomLevel(BoundingBox webMercatorBoundingBox) {
double worldLength = ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH * 2;
int widthTiles = (int) (worldLength / (webMercatorBoundingBox
.getMaxLongitude() - webMercatorBoundingBox.getMinLongitude()));
int heightTiles = (int) (worldLength / (webMercatorBoundingBox
.getMaxLatitude() - webMercatorBoundingBox.getMinLatitude()));
int tilesPerSide = Math.min(widthTiles, heightTiles);
tilesPerSide = Math.max(tilesPerSide, 1);
int zoom = zoomFromTilesPerSide(tilesPerSide);
return zoom;
}
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:25,代码来源:TileBoundingBoxUtils.java
示例10: getWGS84BoundingBox
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* 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;
}
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:33,代码来源:TileBoundingBoxUtils.java
示例11: testLocation
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Test a single location
*
* @param latitude
* @param longitude
* @throws Exception
*/
private void testLocation(double latitude, double longitude)
throws Exception {
if (PRINT) {
System.out.println("Latitude: " + latitude);
System.out.println("Longitude: " + longitude);
}
for (ElevationTilesAlgorithm algorithm : ElevationTilesAlgorithm
.values()) {
Double elevation = ElevationTilesTiffTestUtils.getElevation(
geoPackage, algorithm, latitude, longitude,
ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
if (PRINT) {
System.out.println(algorithm.name() + ": " + elevation);
}
}
}
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:26,代码来源:ElevationTilesTiffImportTest.java
示例12: testLocation
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Test a single location
*
* @param latitude
* @param longitude
* @throws Exception
*/
private void testLocation(double latitude, double longitude)
throws Exception {
if (PRINT) {
System.out.println("Latitude: " + latitude);
System.out.println("Longitude: " + longitude);
}
for (ElevationTilesAlgorithm algorithm : ElevationTilesAlgorithm
.values()) {
Double elevation = ElevationTilesPngTestUtils.getElevation(
geoPackage, algorithm, latitude, longitude,
ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
if (PRINT) {
System.out.println(algorithm.name() + ": " + elevation);
}
}
}
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:26,代码来源:ElevationTilesPngImportTest.java
示例13: createFeatureDao
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Create feature dao
*
* @return feature dao
*/
public static FeatureDao createFeatureDao(GeoPackage geoPackage) {
BoundingBox boundingBox = new BoundingBox();
GeometryColumns geometryColumns = new GeometryColumns();
geometryColumns.setId(new TableColumnKey(TABLE_NAME, "geom"));
geometryColumns.setGeometryType(GeometryType.GEOMETRY);
geometryColumns.setZ((byte) 0);
geometryColumns.setM((byte) 0);
geoPackage.createFeatureTableWithMetadata(geometryColumns, boundingBox,
ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
FeatureDao featureDao = geoPackage.getFeatureDao(geometryColumns);
return featureDao;
}
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:23,代码来源:FeatureTileUtils.java
示例14: OsmMapShapeConverter
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Constructor with specified projection, see
*
* @param projection
*/
public OsmMapShapeConverter(Projection projection, MarkerOptions options, PolylineOptions polylineOptions,
PolygonOptions polygonOptions) {
Log.i(IMapView.LOGTAG, "Geopackage support is BETA. Please report any issues");
this.projection = projection;
this.polylineOptions=polylineOptions;
this.polygonOptions=polygonOptions;
this.makerOptions=options;
if (projection != null) {
toWgs84 = projection
.getTransformation(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
Projection wgs84 = toWgs84.getToProjection();
fromWgs84 = wgs84.getTransformation(projection);
} else {
toWgs84 = null;
fromWgs84 = null;
}
}
开发者ID:osmdroid,项目名称:osmdroid,代码行数:23,代码来源:OsmMapShapeConverter.java
示例15: expandBoundingBox
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的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
示例16: queryFeatures
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Query for features in the bounding box
*
* @param boundingBox query bounding box
* @param projection bounding box projection
* @return feature index results, must be closed
*/
public FeatureIndexResults queryFeatures(BoundingBox boundingBox, Projection projection) {
if (projection == null) {
projection = ProjectionFactory.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
}
// Query for features
FeatureIndexManager indexManager = featureTiles.getIndexManager();
if (indexManager == null) {
throw new GeoPackageException("Index Manager is not set on the Feature Tiles and is required to query indexed features");
}
FeatureIndexResults results = indexManager.query(boundingBox, projection);
return results;
}
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:22,代码来源:FeatureOverlayQuery.java
示例17: setBoundingBox
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Set the bounding box, provided as the indicated projection
*
* @param boundingBox
* @param projection
*/
public void setBoundingBox(BoundingBox boundingBox, Projection projection) {
ProjectionTransform projectionToWebMercator = projection
.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
webMercatorBoundingBox = projectionToWebMercator
.transform(boundingBox);
}
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:13,代码来源:BoundedOverlay.java
示例18: getBoundingBox
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Get the bounding box as the provided projection
*
* @param projection
*/
public BoundingBox getBoundingBox(Projection projection) {
ProjectionTransform webMercatorToProjection = ProjectionFactory
.getProjection(ProjectionConstants.EPSG_WEB_MERCATOR)
.getTransformation(projection);
return webMercatorToProjection
.transform(webMercatorBoundingBox);
}
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:13,代码来源:BoundedOverlay.java
示例19: getTileCount
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* Get the tile count of tiles to be generated
*
* @return tile count
*/
public int getTileCount() {
if (tileCount == null) {
long count = 0;
BoundingBox requestBoundingBox = null;
if (projection.getUnit() instanceof DegreeUnit) {
requestBoundingBox = boundingBox;
} else {
ProjectionTransform transform = projection.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
requestBoundingBox = transform.transform(boundingBox);
}
for (int zoom = minZoom; zoom <= maxZoom; zoom++) {
// Get the tile grid that includes the entire bounding box
TileGrid tileGrid = null;
if (projection.getUnit() instanceof DegreeUnit) {
tileGrid = TileBoundingBoxUtils.getTileGridWGS84(requestBoundingBox, zoom);
} else {
tileGrid = TileBoundingBoxUtils.getTileGrid(requestBoundingBox, zoom);
}
count += tileGrid.count();
tileGrids.put(zoom, tileGrid);
}
tileCount = (int) Math.min(count, Integer.MAX_VALUE);
}
return tileCount;
}
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:33,代码来源:TileGenerator.java
示例20: adjustGoogleBounds
import mil.nga.geopackage.projection.ProjectionConstants; //导入依赖的package包/类
/**
* 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);
}
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:14,代码来源:TileGenerator.java
注:本文中的mil.nga.geopackage.projection.ProjectionConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论