• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ProjectionFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中mil.nga.geopackage.projection.ProjectionFactory的典型用法代码示例。如果您正苦于以下问题:Java ProjectionFactory类的具体用法?Java ProjectionFactory怎么用?Java ProjectionFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProjectionFactory类属于mil.nga.geopackage.projection包,在下文中一共展示了ProjectionFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: FeatureDao

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param database
 * @param db
 * @param featureDb
 * @param geometryColumns
 * @param table
 */
public FeatureDao(String database, GeoPackageConnection db, FeatureConnection featureDb, GeometryColumns geometryColumns,
                  FeatureTable table) {
    super(database, db, featureDb, table);

    this.featureDb = featureDb;
    this.geometryColumns = geometryColumns;
    if (geometryColumns.getContents() == null) {
        throw new GeoPackageException(GeometryColumns.class.getSimpleName()
                + " " + geometryColumns.getId() + " has null "
                + Contents.class.getSimpleName());
    }
    if (geometryColumns.getSrs() == null) {
        throw new GeoPackageException(GeometryColumns.class.getSimpleName()
                + " " + geometryColumns.getId() + " has null "
                + SpatialReferenceSystem.class.getSimpleName());
    }

    projection = ProjectionFactory.getProjection(geometryColumns.getSrs());
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:29,代码来源:FeatureDao.java


示例2: getBoundingBox

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public BoundingBox getBoundingBox() {
    Contents contents = geometryColumns.getContents();

    BoundingBox boundingBox = contents.getBoundingBox();
    if (boundingBox != null) {
        Projection contentsProjection = ProjectionFactory
                .getProjection(contents.getSrs());
        if (!projection.equals(contentsProjection)) {
            ProjectionTransform transform = contentsProjection
                    .getTransformation(projection);
            boundingBox = transform.transform(boundingBox);
        }
    }

    return boundingBox;
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:21,代码来源:FeatureDao.java


示例3: ElevationTilesCore

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Constructor
 * 
 * @param geoPackage
 *            GeoPackage
 * @param tileMatrixSet
 *            tile matrix set
 * @param width
 *            specified results width
 * @param height
 *            specified results height
 * @param requestProjection
 *            request projection
 */
protected ElevationTilesCore(GeoPackageCore geoPackage,
		TileMatrixSet tileMatrixSet, Integer width, Integer height,
		Projection requestProjection) {
	super(geoPackage);

	this.tileMatrixSet = tileMatrixSet;
	griddedCoverageDao = geoPackage.getGriddedCoverageDao();
	griddedTileDao = geoPackage.getGriddedTileDao();
	queryGriddedCoverage();

	this.width = width;
	this.height = height;
	this.requestProjection = requestProjection;
	elevationProjection = ProjectionFactory.getProjection(tileMatrixSet
			.getSrs());
	elevationBoundingBox = tileMatrixSet.getBoundingBox();

	// Check if the projections have the same units
	if (requestProjection != null) {
		sameProjection = (requestProjection.getUnit().name
				.equals(elevationProjection.getUnit().name));
	} else {
		sameProjection = true;
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:40,代码来源:ElevationTilesCore.java


示例4: loadTiles

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Load tiles from a URL
 *
 * @param activity
 * @param callback
 * @param active
 * @param database
 * @param tableName
 * @param tileUrl
 * @param minZoom
 * @param maxZoom
 * @param compressFormat
 * @param compressQuality
 * @param googleTiles
 * @param boundingBox
 * @param epsg
 */
public static void loadTiles(Activity activity, ILoadTilesTask callback,
                             GeoPackageDatabases active, String database, String tableName,
                             String tileUrl, int minZoom, int maxZoom,
                             CompressFormat compressFormat, Integer compressQuality,
                             boolean googleTiles, BoundingBox boundingBox, long epsg) {

    GeoPackageManager manager = GeoPackageFactory.getManager(activity);
    GeoPackage geoPackage = manager.open(database);

    Projection projection = ProjectionFactory.getProjection(epsg);
    BoundingBox bbox = transform(boundingBox, projection);

    TileGenerator tileGenerator = new UrlTileGenerator(activity, geoPackage,
            tableName, tileUrl, minZoom, maxZoom, bbox, projection);
    setTileGenerator(activity, tileGenerator, minZoom, maxZoom, compressFormat, compressQuality, googleTiles, boundingBox);

    loadTiles(activity, callback, active, geoPackage, tableName, tileGenerator);
}
 
开发者ID:ngageoint,项目名称:geopackage-mapcache-android,代码行数:36,代码来源:LoadTilesTask.java


示例5: FeatureDao

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Constructor
 * 
 * @param database
 * @param db
 * @param featureDb
 * @param geometryColumns
 * @param table
 */
public FeatureDao(String database, GeoPackageConnection db,
		FeatureConnection featureDb, GeometryColumns geometryColumns,
		FeatureTable table) {
	super(database, db, featureDb, table);

	this.featureDb = featureDb;
	this.geometryColumns = geometryColumns;
	if (geometryColumns.getContents() == null) {
		throw new GeoPackageException(GeometryColumns.class.getSimpleName()
				+ " " + geometryColumns.getId() + " has null "
				+ Contents.class.getSimpleName());
	}
	if (geometryColumns.getSrs() == null) {
		throw new GeoPackageException(GeometryColumns.class.getSimpleName()
				+ " " + geometryColumns.getId() + " has null "
				+ SpatialReferenceSystem.class.getSimpleName());
	}

	projection = ProjectionFactory.getProjection(geometryColumns.getSrs());
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:30,代码来源:FeatureDao.java


示例6: getBoundingBox

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public BoundingBox getBoundingBox() {
	Contents contents = geometryColumns.getContents();
	Projection contentsProjection = ProjectionFactory
			.getProjection(contents.getSrs());

	BoundingBox boundingBox = contents.getBoundingBox();
	if (!projection.equals(contentsProjection)) {
		ProjectionTransform transform = contentsProjection
				.getTransformation(projection);
		boundingBox = transform.transform(boundingBox);
	}

	return boundingBox;
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:19,代码来源:FeatureDao.java


示例7: projectGeometry

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Project the geometry into the provided projection
 *
 * @param geometryData geometry data
 * @param projection   projection
 */
public void projectGeometry(GeoPackageGeometryData geometryData, Projection projection) {

    if (geometryData.getGeometry() != null) {

        try {
            SpatialReferenceSystemDao srsDao = DaoManager.createDao(featureDao.getDb().getConnectionSource(), SpatialReferenceSystem.class);
            int srsId = geometryData.getSrsId();
            SpatialReferenceSystem srs = srsDao.queryForId((long) srsId);

            if (!projection.equals(srs.getOrganization(), srs.getOrganizationCoordsysId())) {

                Projection geomProjection = ProjectionFactory.getProjection(srs);
                ProjectionTransform transform = geomProjection.getTransformation(projection);

                Geometry projectedGeometry = transform.transform(geometryData.getGeometry());
                geometryData.setGeometry(projectedGeometry);
                SpatialReferenceSystem projectionSrs = srsDao.getOrCreateCode(projection.getAuthority(), Long.parseLong(projection.getCode()));
                geometryData.setSrsId((int) projectionSrs.getSrsId());
            }
        } catch (SQLException e) {
            throw new GeoPackageException("Failed to project geometry to projection with Authority: "
                    + projection.getAuthority() + ", Code: " + projection.getCode(), e);
        }
    }

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


示例8: queryFeatures

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的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


示例9: getBoundingBox

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的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


示例10: adjustGoogleBounds

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的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


示例11: TileCreator

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Constructor, specified tile size and projection
 *
 * @param tileDao           tile dao
 * @param width             requested width
 * @param height            requested height
 * @param requestProjection requested projection
 */
public TileCreator(TileDao tileDao, Integer width, Integer height, Projection requestProjection) {
    this.tileDao = tileDao;
    this.width = width;
    this.height = height;
    this.requestProjection = requestProjection;

    tileMatrixSet = tileDao.getTileMatrixSet();
    tilesProjection = ProjectionFactory.getProjection(tileDao.getTileMatrixSet().getSrs());
    tileSetBoundingBox = tileMatrixSet.getBoundingBox();

    // Check if the projections have the same units
    sameProjection = (requestProjection.getUnit().name.equals(tilesProjection.getUnit().name));
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:22,代码来源:TileCreator.java


示例12: getElevation

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Get the elevation at the coordinate
 *
 * @param geoPackage GeoPackage
 * @param algorithm  algorithm
 * @param latitude   latitude
 * @param longitude  longitude
 * @return elevation
 * @throws Exception
 */
public static Double getElevation(GeoPackage geoPackage,
                                  ElevationTilesAlgorithm algorithm, double latitude,
                                  double longitude, long epsg) throws Exception {

    Double elevation = null;

    List<String> elevationTables = ElevationTilesPng.getTables(geoPackage);
    TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();

    for (String elevationTable : elevationTables) {

        TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
        TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);

        Projection requestProjection = ProjectionFactory
                .getProjection(epsg);

        // Test getting the elevation of a single coordinate
        ElevationTilesPng elevationTiles = new ElevationTilesPng(geoPackage,
                tileDao, requestProjection);
        elevationTiles.setAlgorithm(algorithm);
        elevation = elevationTiles.getElevation(latitude, longitude);
    }

    return elevation;
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:37,代码来源:ElevationTilesPngTestUtils.java


示例13: getElevations

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Get the elevations for the bounding box
 *
 * @param geoPackage  GeoPackage
 * @param algorithm   algorithm
 * @param boundingBox bounding box
 * @param width       results width
 * @param width       results height
 * @return elevation tile results
 * @throws Exception
 */
public static ElevationTileResults getElevations(GeoPackage geoPackage,
                                                 ElevationTilesAlgorithm algorithm, BoundingBox boundingBox,
                                                 int width, int height, long epsg) throws Exception {

    ElevationTileResults elevations = null;

    List<String> elevationTables = ElevationTilesPng.getTables(geoPackage);
    TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();

    for (String elevationTable : elevationTables) {

        TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
        TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);

        Projection requestProjection = ProjectionFactory
                .getProjection(epsg);

        // Test getting the elevation of a single coordinate
        ElevationTilesPng elevationTiles = new ElevationTilesPng(geoPackage,
                tileDao, requestProjection);
        elevationTiles.setAlgorithm(algorithm);
        elevationTiles.setWidth(width);
        elevationTiles.setHeight(height);
        elevations = elevationTiles.getElevations(boundingBox);
    }

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


示例14: getElevation

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Get the elevation at the coordinate
 *
 * @param geoPackage GeoPackage
 * @param algorithm  algorithm
 * @param latitude   latitude
 * @param longitude  longitude
 * @return elevation
 * @throws Exception
 */
public static Double getElevation(GeoPackage geoPackage,
                                  ElevationTilesAlgorithm algorithm, double latitude,
                                  double longitude, long epsg) throws Exception {

    Double elevation = null;

    List<String> elevationTables = ElevationTilesTiff.getTables(geoPackage);
    TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();

    for (String elevationTable : elevationTables) {

        TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
        TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);

        Projection requestProjection = ProjectionFactory
                .getProjection(epsg);

        // Test getting the elevation of a single coordinate
        ElevationTilesTiff elevationTiles = new ElevationTilesTiff(
                geoPackage, tileDao, requestProjection);
        elevationTiles.setAlgorithm(algorithm);
        elevation = elevationTiles.getElevation(latitude, longitude);
    }

    return elevation;
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:37,代码来源:ElevationTilesTiffTestUtils.java


示例15: getElevations

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Get the elevations for the bounding box
 *
 * @param geoPackage  GeoPackage
 * @param algorithm   algorithm
 * @param boundingBox bounding box
 * @param width       results width
 * @param width       results height
 * @return elevation tile results
 * @throws Exception
 */
public static ElevationTileResults getElevations(GeoPackage geoPackage,
                                                 ElevationTilesAlgorithm algorithm, BoundingBox boundingBox,
                                                 int width, int height, long epsg) throws Exception {

    ElevationTileResults elevations = null;

    List<String> elevationTables = ElevationTilesTiff.getTables(geoPackage);
    TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();

    for (String elevationTable : elevationTables) {

        TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
        TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);

        Projection requestProjection = ProjectionFactory
                .getProjection(epsg);

        // Test getting the elevation of a single coordinate
        ElevationTilesTiff elevationTiles = new ElevationTilesTiff(
                geoPackage, tileDao, requestProjection);
        elevationTiles.setAlgorithm(algorithm);
        elevationTiles.setWidth(width);
        elevationTiles.setHeight(height);
        elevations = elevationTiles.getElevations(boundingBox);
    }

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


示例16: testTileGenerator

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Test tile generator
 *
 * @throws java.io.IOException
 * @throws java.sql.SQLException
 */
public void testTileGenerator() throws IOException, SQLException {

    int minZoom = 0;
    int maxZoom = 4;

    FeatureDao featureDao = FeatureTileUtils.createFeatureDao(geoPackage);

    FeatureTileUtils.insertFeatures(geoPackage, featureDao);

    FeatureTiles featureTiles = FeatureTileUtils.createFeatureTiles(activity, geoPackage, featureDao);

    BoundingBox boundingBox = new BoundingBox();
    boundingBox = TileBoundingBoxUtils.boundWgs84BoundingBoxWithWebMercatorLimits(boundingBox);
    boundingBox = ProjectionFactory.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM)
            .getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR)
            .transform(boundingBox);
    TileGenerator tileGenerator = new FeatureTileGenerator(activity, geoPackage,
            "gen_feature_tiles", featureTiles, minZoom, maxZoom, boundingBox,
            ProjectionFactory.getProjection(ProjectionConstants.EPSG_WEB_MERCATOR));
    tileGenerator.setGoogleTiles(false);

    int tiles = tileGenerator.generateTiles();

    int expectedTiles = 0;
    for (int i = minZoom; i <= maxZoom; i++) {
        int tilesPerSide = TileBoundingBoxUtils.tilesPerSide(i);
        expectedTiles += (tilesPerSide * tilesPerSide);
    }

    assertEquals(expectedTiles, tiles);

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


示例17: TileCreator

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param tileDao
 * @param width
 * @param height
 * @param requestProjection
 * @param imageFormat
 */
public TileCreator(TileDao tileDao, Integer width, Integer height,
		Projection requestProjection, String imageFormat) {
	this.tileDao = tileDao;
	this.width = width;
	this.height = height;
	this.requestProjection = requestProjection;
	this.imageFormat = imageFormat;

	if (imageFormat == null && (width != null || height != null)) {
		throw new GeoPackageException(
				"The width and height request size can not be specified when requesting raw tiles (no image format specified)");
	}

	tileMatrixSet = tileDao.getTileMatrixSet();
	tilesProjection = ProjectionFactory.getProjection(tileDao
			.getTileMatrixSet().getSrs());
	tileSetBoundingBox = tileMatrixSet.getBoundingBox();

	// Check if the projections have the same units
	sameProjection = (requestProjection.getUnit().name
			.equals(tilesProjection.getUnit().name));

	if (imageFormat == null && !sameProjection) {
		throw new GeoPackageException(
				"The requested projection must be the same as the stored tiles when requesting raw tiles (no image format specified)");
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:37,代码来源:TileCreator.java


示例18: adjustGoogleBounds

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的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-java,代码行数:17,代码来源:TileGenerator.java


示例19: getElevation

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Get the elevation at the coordinate
 * 
 * @param geoPackage
 *            GeoPackage
 * @param algorithm
 *            algorithm
 * @param latitude
 *            latitude
 * @param longitude
 *            longitude
 * @return elevation
 * @throws Exception
 */
public static Double getElevation(GeoPackage geoPackage,
		ElevationTilesAlgorithm algorithm, double latitude,
		double longitude, long epsg) throws Exception {

	Double elevation = null;

	List<String> elevationTables = ElevationTilesPng.getTables(geoPackage);
	TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();

	for (String elevationTable : elevationTables) {

		TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
		TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);

		Projection requestProjection = ProjectionFactory
				.getProjection(epsg);

		// Test getting the elevation of a single coordinate
		ElevationTilesPng elevationTiles = new ElevationTilesPng(
				geoPackage, tileDao, requestProjection);
		elevationTiles.setAlgorithm(algorithm);
		elevation = elevationTiles.getElevation(latitude, longitude);
	}

	return elevation;
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:41,代码来源:ElevationTilesPngTestUtils.java


示例20: getElevations

import mil.nga.geopackage.projection.ProjectionFactory; //导入依赖的package包/类
/**
 * Get the elevations for the bounding box
 * 
 * @param geoPackage
 *            GeoPackage
 * @param algorithm
 *            algorithm
 * @param boundingBox
 *            bounding box
 * @param width
 *            results width
 * @param height
 *            results height
 * @return elevation tile results
 * @throws Exception
 */
public static ElevationTileResults getElevations(GeoPackage geoPackage,
		ElevationTilesAlgorithm algorithm, BoundingBox boundingBox,
		int width, int height, long epsg) throws Exception {

	ElevationTileResults elevations = null;

	List<String> elevationTables = ElevationTilesPng.getTables(geoPackage);
	TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();

	for (String elevationTable : elevationTables) {

		TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
		TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);

		Projection requestProjection = ProjectionFactory
				.getProjection(epsg);

		// Test getting the elevation of a single coordinate
		ElevationTilesPng elevationTiles = new ElevationTilesPng(
				geoPackage, tileDao, requestProjection);
		elevationTiles.setAlgorithm(algorithm);
		elevationTiles.setWidth(width);
		elevationTiles.setHeight(height);
		elevations = elevationTiles.getElevations(boundingBox);
	}

	return elevations;
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:45,代码来源:ElevationTilesPngTestUtils.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CommandUsageException类代码示例发布时间:2022-05-22
下一篇:
Java LightweightHttpWagon类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap