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

Java FeatureIndexManager类代码示例

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

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



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

示例1: queryFeatures

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


示例2: displayTiles

import mil.nga.geopackage.features.index.FeatureIndexManager; //导入依赖的package包/类
/**
 * Display tiles
 *
 * @param tiles
 */
private void displayTiles(GeoPackageTileTable tiles) {

    GeoPackage geoPackage = geoPackages.get(tiles.getDatabase());

    TileDao tileDao = geoPackage.getTileDao(tiles.getName());

    BoundedOverlay overlay = GeoPackageOverlayFactory
            .getBoundedOverlay(tileDao);

    TileMatrixSet tileMatrixSet = tileDao.getTileMatrixSet();

    FeatureTileTableLinker linker = new FeatureTileTableLinker(geoPackage);
    List<FeatureDao> featureDaos = linker.getFeatureDaosForTileTable(tileDao.getTableName());
    for (FeatureDao featureDao : featureDaos) {

        // Create the feature tiles
        FeatureTiles featureTiles = new DefaultFeatureTiles(getActivity(), featureDao);

        // Create an index manager
        FeatureIndexManager indexer = new FeatureIndexManager(getActivity(), geoPackage, featureDao);
        featureTiles.setIndexManager(indexer);

        featureOverlayTiles = true;

        // Add the feature overlay query
        FeatureOverlayQuery featureOverlayQuery = new FeatureOverlayQuery(getActivity(), overlay, featureTiles);
        featureOverlayQueries.add(featureOverlayQuery);
    }

    // Set the tiles index to be -2 of it is behind features and tiles drawn from features
    int zIndex = -2;

    // If these tiles are linked to features, set the zIndex to -1 so they are placed before imagery tiles
    if (!featureDaos.isEmpty()) {
        zIndex = -1;
    }

    displayTiles(overlay, tileMatrixSet.getBoundingBox(), tileMatrixSet.getSrs(), zIndex, null);
}
 
开发者ID:ngageoint,项目名称:geopackage-mapcache-android,代码行数:45,代码来源:GeoPackageMapFragment.java


示例3: indexFeatures

import mil.nga.geopackage.features.index.FeatureIndexManager; //导入依赖的package包/类
/**
 * Index features
 *
 * @param activity
 * @param callback
 * @param database
 * @param tableName
 * @param indexLocation
 */
public static void indexFeatures(Activity activity, IIndexerTask callback,
                                 String database, String tableName,
                                 FeatureIndexType indexLocation) {

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

    FeatureDao featureDao = geoPackage.getFeatureDao(tableName);

    FeatureIndexManager indexer = new FeatureIndexManager(activity, geoPackage, featureDao);
    indexer.setIndexLocation(indexLocation);

    ProgressDialog progressDialog = new ProgressDialog(activity);
    final IndexerTask indexTask = new IndexerTask(activity,
            callback, progressDialog, geoPackage, indexer);

    int max = featureDao.count();
    indexTask.setMax(max);
    indexer.setProgress(indexTask);

    progressDialog.setMessage(activity
            .getString(R.string.geopackage_table_index_features_index_title)
            + ": "
            + geoPackage.getName() + " - " + tableName);
    progressDialog.setCancelable(false);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setIndeterminate(false);
    progressDialog.setMax(max);
    progressDialog.setButton(ProgressDialog.BUTTON_NEGATIVE,
            activity.getString(R.string.button_cancel_label),
            new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    indexTask.cancel(true);
                }
            });

    indexTask.execute();
}
 
开发者ID:ngageoint,项目名称:geopackage-mapcache-android,代码行数:49,代码来源:IndexerTask.java


示例4: addTileTable

import mil.nga.geopackage.features.index.FeatureIndexManager; //导入依赖的package包/类
/**
 * Add a tile table to the map
 *
 * @param geoPackage
 * @param name
 * @param data
 */
private void addTileTable(GeoPackage geoPackage, String name, GeoPackageMapData data) {

    GeoPackageTableMapData tableData = new GeoPackageTableMapData(name, false);
    data.addTable(tableData);

    // Create a new GeoPackage tile provider and add to the map
    TileDao tileDao = geoPackage.getTileDao(name);
    BoundedOverlay geoPackageTileOverlay = GeoPackageOverlayFactory.getBoundedOverlay(tileDao);

    // Check for linked feature tables
    FeatureTileTableLinker linker = new FeatureTileTableLinker(geoPackage);
    List<FeatureDao> featureDaos = linker.getFeatureDaosForTileTable(tileDao.getTableName());
    for (FeatureDao featureDao : featureDaos) {

        // Create the feature tiles
        FeatureTiles featureTiles = new DefaultFeatureTiles(context, featureDao);

        // Create an index manager
        FeatureIndexManager indexer = new FeatureIndexManager(context, geoPackage, featureDao);
        featureTiles.setIndexManager(indexer);

        // Add the feature overlay query
        FeatureOverlayQuery featureOverlayQuery = new FeatureOverlayQuery(context, geoPackageTileOverlay, featureTiles);
        tableData.addFeatureOverlayQuery(featureOverlayQuery);
    }

    // Set the tiles index to be -2 of it is behind features and tiles drawn from features
    int zIndex = -2;

    // If these tiles are linked to features, set the zIndex to -1 so they are placed before imagery tiles
    if (!featureDaos.isEmpty()) {
        zIndex = -1;
    }

    TileOverlayOptions overlayOptions = createTileOverlayOptions(geoPackageTileOverlay, zIndex);
    TileOverlay tileOverlay = map.addTileOverlay(overlayOptions);
    tableData.setTileOverlay(tileOverlay);
}
 
开发者ID:ngageoint,项目名称:disconnected-content-explorer-android,代码行数:46,代码来源:GeoPackageMapOverlays.java


示例5: validateFeatureRow

import mil.nga.geopackage.features.index.FeatureIndexManager; //导入依赖的package包/类
/**
 * Validate a Feature Row result
 *
 * @param featureIndexManager
 * @param featureRow
 * @param queryEnvelope
 */
private static void validateFeatureRow(
        FeatureIndexManager featureIndexManager, FeatureRow featureRow, GeometryEnvelope queryEnvelope) {
    TestCase.assertNotNull(featureRow);
    GeoPackageGeometryData geometryData = featureRow.getGeometry();
    GeometryEnvelope envelope = geometryData.getEnvelope();
    if (envelope == null) {
        Geometry geometry = geometryData.getGeometry();
        if (geometry != null) {
            envelope = GeometryEnvelopeBuilder.buildEnvelope(geometry);
        }
    }

    TestCase.assertNotNull(envelope);

    if (queryEnvelope != null) {
        TestCase.assertTrue(envelope.getMinX() <= queryEnvelope.getMaxX());
        TestCase.assertTrue(envelope.getMaxX() >= queryEnvelope.getMinX());
        TestCase.assertTrue(envelope.getMinY() <= queryEnvelope.getMaxY());
        TestCase.assertTrue(envelope.getMaxY() >= queryEnvelope.getMinY());
        if (envelope.isHasZ()) {
            if (queryEnvelope.hasZ()) {
                TestCase.assertTrue(envelope.getMinZ() <= queryEnvelope.getMaxZ());
                TestCase.assertTrue(envelope.getMaxZ() >= queryEnvelope.getMinZ());
            }
        } else {
            TestCase.assertFalse(queryEnvelope.hasZ());
            TestCase.assertNull(queryEnvelope.getMinZ());
            TestCase.assertNull(queryEnvelope.getMaxZ());
        }
        if (envelope.isHasM()) {
            if (queryEnvelope.hasM()) {
                TestCase.assertTrue(envelope.getMinM() <= queryEnvelope.getMaxM());
                TestCase.assertTrue(envelope.getMaxM() >= queryEnvelope.getMinM());
            }
        } else {
            TestCase.assertFalse(queryEnvelope.hasM());
            TestCase.assertNull(queryEnvelope.getMinM());
            TestCase.assertNull(queryEnvelope.getMaxM());
        }
    }
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:49,代码来源:FeatureIndexManagerUtils.java


示例6: addGeoPackageTileCacheOverlay

import mil.nga.geopackage.features.index.FeatureIndexManager; //导入依赖的package包/类
/**
 * Add the GeoPackage Tile Table Cache Overlay
 * @param enabledCacheOverlays
 * @param tileTableCacheOverlay
 * @param geoPackage
 * @param linkedToFeatures
 */
private void addGeoPackageTileCacheOverlay(Map<String, CacheOverlay> enabledCacheOverlays, GeoPackageTileTableCacheOverlay tileTableCacheOverlay, GeoPackage geoPackage, boolean linkedToFeatures){
	// Retrieve the cache overlay if it already exists (and remove from cache overlays)
	CacheOverlay cacheOverlay = cacheOverlays.remove(tileTableCacheOverlay.getCacheName());
	if(cacheOverlay != null){
		// If the existing cache overlay is being replaced, create a new cache overlay
		if(tileTableCacheOverlay.getParent().isAdded()){
			cacheOverlay = null;
		}
	}
	if(cacheOverlay == null){
		// Create a new GeoPackage tile provider and add to the map
		TileDao tileDao = geoPackage.getTileDao(tileTableCacheOverlay.getName());
		BoundedOverlay geoPackageTileProvider = GeoPackageOverlayFactory.getBoundedOverlay(tileDao);
		TileOverlayOptions overlayOptions = null;
		if(linkedToFeatures){
			overlayOptions = createFeatureTileOverlayOptions(geoPackageTileProvider);
		}else {
			overlayOptions = createTileOverlayOptions(geoPackageTileProvider);
		}
		TileOverlay tileOverlay = map.addTileOverlay(overlayOptions);
		tileTableCacheOverlay.setTileOverlay(tileOverlay);

		// Check for linked feature tables
		tileTableCacheOverlay.clearFeatureOverlayQueries();
		FeatureTileTableLinker linker = new FeatureTileTableLinker(geoPackage);
		List<FeatureDao> featureDaos = linker.getFeatureDaosForTileTable(tileDao.getTableName());
		for(FeatureDao featureDao: featureDaos){

			// Create the feature tiles
			FeatureTiles featureTiles = new DefaultFeatureTiles(getActivity(), featureDao);

			// Create an index manager
			FeatureIndexManager indexer = new FeatureIndexManager(getActivity(), geoPackage, featureDao);
			featureTiles.setIndexManager(indexer);

			// Add the feature overlay query
			FeatureOverlayQuery featureOverlayQuery = new FeatureOverlayQuery(getActivity(), geoPackageTileProvider, featureTiles);
			tileTableCacheOverlay.addFeatureOverlayQuery(featureOverlayQuery);
		}

		cacheOverlay = tileTableCacheOverlay;
	}
	// Add the cache overlay to the enabled cache overlays
	enabledCacheOverlays.put(cacheOverlay.getCacheName(), cacheOverlay);
}
 
开发者ID:ngageoint,项目名称:mage-android,代码行数:53,代码来源:MapFragment.java


示例7: displayFeatureTiles

import mil.nga.geopackage.features.index.FeatureIndexManager; //导入依赖的package包/类
/**
 * Display feature tiles
 *
 * @param featureOverlayTable
 */
private void displayFeatureTiles(GeoPackageFeatureOverlayTable featureOverlayTable) {

    GeoPackage geoPackage = geoPackages.get(featureOverlayTable.getDatabase());
    FeatureDao featureDao = featureDaos.get(featureOverlayTable.getDatabase()).get(featureOverlayTable.getFeatureTable());

    BoundingBox boundingBox = new BoundingBox(featureOverlayTable.getMinLon(),
            featureOverlayTable.getMinLat(), featureOverlayTable.getMaxLon(), featureOverlayTable.getMaxLat());

    // Load tiles
    FeatureTiles featureTiles = new DefaultFeatureTiles(getActivity(), featureDao);

    featureTiles.setMaxFeaturesPerTile(featureOverlayTable.getMaxFeaturesPerTile());
    if (featureOverlayTable.getMaxFeaturesPerTile() != null) {
        featureTiles.setMaxFeaturesTileDraw(new NumberFeaturesTile(getActivity()));
    }

    FeatureIndexManager indexer = new FeatureIndexManager(getActivity(), geoPackage, featureDao);
    featureTiles.setIndexManager(indexer);

    Paint pointPaint = featureTiles.getPointPaint();
    pointPaint.setColor(Color.parseColor(featureOverlayTable.getPointColor()));

    pointPaint.setAlpha(featureOverlayTable.getPointAlpha());
    featureTiles.setPointRadius(featureOverlayTable.getPointRadius());

    Paint linePaint = featureTiles.getLinePaint();
    linePaint.setColor(Color.parseColor(featureOverlayTable.getLineColor()));

    linePaint.setAlpha(featureOverlayTable.getLineAlpha());
    linePaint.setStrokeWidth(featureOverlayTable.getLineStrokeWidth());

    Paint polygonPaint = featureTiles.getPolygonPaint();
    polygonPaint.setColor(Color.parseColor(featureOverlayTable.getPolygonColor()));

    polygonPaint.setAlpha(featureOverlayTable.getPolygonAlpha());
    polygonPaint.setStrokeWidth(featureOverlayTable.getPolygonStrokeWidth());

    featureTiles.setFillPolygon(featureOverlayTable.isPolygonFill());
    if (featureTiles.isFillPolygon()) {
        Paint polygonFillPaint = featureTiles.getPolygonFillPaint();
        polygonFillPaint.setColor(Color.parseColor(featureOverlayTable.getPolygonFillColor()));

        polygonFillPaint.setAlpha(featureOverlayTable.getPolygonFillAlpha());
    }

    featureTiles.calculateDrawOverlap();

    FeatureOverlay overlay = new FeatureOverlay(featureTiles);
    overlay.setBoundingBox(boundingBox, ProjectionFactory.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM));
    overlay.setMinZoom(featureOverlayTable.getMinZoom());
    overlay.setMaxZoom(featureOverlayTable.getMaxZoom());

    FeatureTileTableLinker linker = new FeatureTileTableLinker(geoPackage);
    List<TileDao> tileDaos = linker.getTileDaosForFeatureTable(featureDao.getTableName());
    overlay.ignoreTileDaos(tileDaos);

    GeometryColumns geometryColumns = featureDao.getGeometryColumns();
    Contents contents = geometryColumns.getContents();

    GeoPackageUtils.prepareFeatureTiles(featureTiles);

    featureOverlayTiles = true;

    FeatureOverlayQuery featureOverlayQuery = new FeatureOverlayQuery(getActivity(), overlay);
    featureOverlayQueries.add(featureOverlayQuery);

    displayTiles(overlay, contents.getBoundingBox(), contents.getSrs(), -1, boundingBox);
}
 
开发者ID:ngageoint,项目名称:geopackage-mapcache-android,代码行数:74,代码来源:GeoPackageMapFragment.java


示例8: IndexerTask

import mil.nga.geopackage.features.index.FeatureIndexManager; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param activity
 * @param callback
 * @param progressDialog
 * @param geoPackage
 * @param indexer
 */
public IndexerTask(Activity activity, IIndexerTask callback,
                   ProgressDialog progressDialog, GeoPackage geoPackage, FeatureIndexManager indexer) {
    this.activity = activity;
    this.callback = callback;
    this.progressDialog = progressDialog;
    this.geoPackage = geoPackage;
    this.indexer = indexer;
}
 
开发者ID:ngageoint,项目名称:geopackage-mapcache-android,代码行数:18,代码来源:IndexerTask.java


示例9: getIndexManager

import mil.nga.geopackage.features.index.FeatureIndexManager; //导入依赖的package包/类
/**
 * Get the index manager
 *
 * @return index manager or null
 * @since 1.1.0
 */
public FeatureIndexManager getIndexManager() {
    return indexManager;
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:10,代码来源:FeatureTiles.java


示例10: setIndexManager

import mil.nga.geopackage.features.index.FeatureIndexManager; //导入依赖的package包/类
/**
 * Set the index
 *
 * @param indexManager
 * @since 1.1.0
 */
public void setIndexManager(FeatureIndexManager indexManager) {
    this.indexManager = indexManager;
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:10,代码来源:FeatureTiles.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java CodeInsightActions类代码示例发布时间:2022-05-22
下一篇:
Java GotoClassModel2类代码示例发布时间: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