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

Java FeatureRow类代码示例

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

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



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

示例1: getColumnName

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Get the column name by checking for a DataColumns name, otherwise returns the provided column name
 *
 * @param dataColumnsDao data columns dao
 * @param featureRow     feature row
 * @param columnName     column name
 * @return column name
 */
private String getColumnName(DataColumnsDao dataColumnsDao, FeatureRow featureRow, String columnName) {

    String newColumnName = columnName;

    if (dataColumnsDao != null) {
        try {
            DataColumns dataColumn = dataColumnsDao.getDataColumn(featureRow.getTable().getTableName(), columnName);
            if (dataColumn != null) {
                newColumnName = dataColumn.getName();
            }
        } catch (SQLException e) {
            Log.e(FeatureOverlayQuery.class.getSimpleName(),
                    "Failed to search for Data Column name for column: " + columnName
                            + ", Feature Table: " + featureRow.getTable().getTableName(), e);
        }
    }

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


示例2: index

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Index the feature row. This method assumes that indexing has been
 * completed and maintained as the last indexed time is updated.
 *
 * @param row feature row
 * @return true if indexed
 */
public boolean index(FeatureRow row) {
    TableIndex tableIndex = getTableIndex();
    if (tableIndex == null) {
        throw new GeoPackageException(
                "GeoPackage table is not indexed. GeoPackage: "
                        + getGeoPackage().getName() + ", Table: "
                        + getTableName());
    }
    boolean indexed = index(tableIndex, row.getId(), row.getGeometry());

    // Update the last indexed time
    updateLastIndexed();

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


示例3: getFeatureRow

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Get the feature row for the Geometry Index
 *
 * @param geometryIndex geometry index
 * @return feature row
 */
public FeatureRow getFeatureRow(GeometryIndex geometryIndex) {

    long geomId = geometryIndex.getGeomId();

    // Get the row or lock for reading
    FeatureRow row = featureRowSync.getRowOrLock(geomId);
    if (row == null) {
        // Query for the row and set in the sync
        try {
            row = featureDao.queryForIdRow(geomId);
        } finally {
            featureRowSync.setRow(geomId, row);
        }
    }

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


示例4: index

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Index the feature row. This method assumes that indexing has been completed and
 * maintained as the last indexed time is updated.
 *
 * @param type index location type
 * @param row  feature row to index
 * @return true if indexed
 */
public boolean index(FeatureIndexType type, FeatureRow row) {
    boolean indexed = false;
    if (type == null) {
        throw new GeoPackageException("FeatureIndexType is required to index");
    }
    switch (type) {
        case GEOPACKAGE:
            indexed = featureTableIndex.index(row);
            break;
        case METADATA:
            indexed = featureIndexer.index(row);
            break;
        default:
            throw new GeoPackageException("Unsupported FeatureIndexType: " + type);
    }
    return indexed;
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:26,代码来源:FeatureIndexManager.java


示例5: getFeatureRow

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Get the feature row for the Geometry Metadata
 *
 * @param geometryMetadata
 * @return feature row
 * @since 1.1.0
 */
public FeatureRow getFeatureRow(GeometryMetadata geometryMetadata) {

    long geomId = geometryMetadata.getId();

    // Get the row or lock for reading
    FeatureRow row = featureRowSync.getRowOrLock(geomId);
    if (row == null) {
        // Query for the row and set in the sync
        try {
            row = featureDao.queryForIdRow(geomId);
        } finally {
            featureRowSync.setRow(geomId, row);
        }
    }

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


示例6: drawTile

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Bitmap drawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureIndexResults results) {

    // Create bitmap and canvas
    Bitmap bitmap = createNewBitmap();
    Canvas canvas = new Canvas(bitmap);

    ProjectionTransform transform = getProjectionToWebMercatorTransform(featureDao.getProjection());

    for (FeatureRow featureRow : results) {
        drawFeature(zoom, webMercatorBoundingBox, transform, canvas, featureRow);
    }

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


示例7: FeatureRowProcessor

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param task
 * @param database
 * @param featureDao
 * @param row
 * @param count
 * @param maxFeatures
 * @param editable
 * @param converter
 * @param filterBoundingBox
 * @param maxLongitude
 * @param filter
 */
public FeatureRowProcessor(MapFeaturesUpdateTask task, String database, FeatureDao featureDao,
                           FeatureRow row, AtomicInteger count, int maxFeatures,
                           boolean editable, GoogleMapShapeConverter converter,
                           BoundingBox filterBoundingBox, double maxLongitude, boolean filter) {
    this.task = task;
    this.database = database;
    this.featureDao = featureDao;
    this.row = row;
    this.count = count;
    this.maxFeatures = maxFeatures;
    this.editable = editable;
    this.converter = converter;
    this.filterBoundingBox = filterBoundingBox;
    this.maxLongitude = maxLongitude;
    this.filter = filter;
}
 
开发者ID:ngageoint,项目名称:geopackage-mapcache-android,代码行数:32,代码来源:GeoPackageMapFragment.java


示例8: infoFeatureClick

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Info feature click
 *
 * @param marker
 * @param markerFeature
 */
private void infoFeatureClick(final Marker marker, MarkerFeature markerFeature) {
    final GeoPackage geoPackage = manager.open(markerFeature.database);
    final FeatureDao featureDao = geoPackage
            .getFeatureDao(markerFeature.tableName);

    final FeatureRow featureRow = featureDao.queryForIdRow(markerFeature.featureId);

    if (featureRow != null) {
        final GeoPackageGeometryData geomData = featureRow.getGeometry();
        final GeometryType geometryType = geomData.getGeometry()
                .getGeometryType();

        String title = getTitle(geometryType, marker);
        infoExistingFeatureOption(geoPackage, featureRow, title, geomData);
    } else {
        geoPackage.close();
    }
}
 
开发者ID:ngageoint,项目名称:geopackage-mapcache-android,代码行数:25,代码来源:GeoPackageMapFragment.java


示例9: index

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Index the feature row. This method assumes that indexing has been
 * completed and maintained as the last indexed time is updated.
 *
 * @param row
 *            feature row
 * @return true if indexed
 */
public boolean index(FeatureRow row) {
	TableIndex tableIndex = getTableIndex();
	if (tableIndex == null) {
		throw new GeoPackageException(
				"GeoPackage table is not indexed. GeoPackage: "
						+ getGeoPackage().getName() + ", Table: "
						+ getTableName());
	}
	boolean indexed = index(tableIndex, row.getId(), row.getGeometry());

	// Update the last indexed time
	updateLastIndexed();

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


示例10: getFeatureRow

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Get the feature row for the Geometry Index
 * 
 * @param geometryIndex
 *            geometry index
 * @return feature row
 */
public FeatureRow getFeatureRow(GeometryIndex geometryIndex) {

	long geomId = geometryIndex.getGeomId();

	// Get the row or lock for reading
	FeatureRow row = featureRowSync.getRowOrLock(geomId);
	if (row == null) {
		// Query for the row and set in the sync
		try {
			row = featureDao.queryForIdRow(geomId);
		} finally {
			featureRowSync.setRow(geomId, row);
		}
	}

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


示例11: drawTile

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public BufferedImage drawTile(int zoom, BoundingBox webMercatorBoundingBox,
		CloseableIterator<GeometryIndex> results) {

	// Create image and graphics
	BufferedImage image = createNewImage();
	Graphics2D graphics = getGraphics(image);

	// WGS84 to web mercator projection and google shape converter
	ProjectionTransform webMercatorTransform = getWebMercatorTransform();

	while (results.hasNext()) {
		GeometryIndex geometryIndex = results.next();
		FeatureRow featureRow = getFeatureIndex().getFeatureRow(
				geometryIndex);
		drawFeature(zoom, webMercatorBoundingBox, webMercatorTransform,
				graphics, featureRow);
	}

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


示例12: drawFeature

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Draw the feature
 *
 * @param zoom
 *            zoom level
 * @param boundingBox
 * @param transform
 * @param graphics
 * @param row
 */
private void drawFeature(int zoom, BoundingBox boundingBox,
		ProjectionTransform transform, Graphics2D graphics, FeatureRow row) {
	try {
		GeoPackageGeometryData geomData = row.getGeometry();
		if (geomData != null) {
			Geometry geometry = geomData.getGeometry();
			double simplifyTolerance = TileBoundingBoxUtils
					.toleranceDistance(zoom, tileWidth, tileHeight);
			drawGeometry(simplifyTolerance, boundingBox, transform,
					graphics, geometry);
		}
	} catch (Exception e) {
		log.log(Level.SEVERE, "Failed to draw feature in tile. Table: "
				+ featureDao.getTableName(), e);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:27,代码来源:DefaultFeatureTiles.java


示例13: indexRows

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Index the feature rows in the cursor
 *
 * @param tableIndex table index
 * @param cursor     feature cursor
 * @return count
 */
private int indexRows(TableIndex tableIndex, FeatureCursor cursor) {

    int count = 0;

    try {
        while ((progress == null || progress.isActive())
                && cursor.moveToNext()) {
            try {
                FeatureRow row = cursor.getRow();
                if (row.isValid()) {
                    boolean indexed = index(tableIndex,
                            row.getId(), row.getGeometry());
                    if (indexed) {
                        count++;
                    }
                    if (progress != null) {
                        progress.addProgress(1);
                    }
                }
            } catch (Exception e) {
                Log.e(FeatureTableIndex.class.getSimpleName(), "Failed to index feature. Table: "
                        + tableIndex.getTableName() + ", Position: " + cursor.getPosition(), e);
            }
        }
    } finally {
        cursor.close();
    }

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


示例14: deleteIndex

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Delete the feature index for the feature row from the index types
 *
 * @param row   feature row
 * @param types feature index types
 * @return true if deleted from any type
 * @since 2.0.0
 */
public boolean deleteIndex(FeatureRow row, List<FeatureIndexType> types) {
    boolean deleted = false;
    for (FeatureIndexType type : types) {
        if (deleteIndex(type, row)) {
            deleted = true;
        }
    }
    return deleted;
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:18,代码来源:FeatureIndexManager.java


示例15: index

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Index the feature row. This method assumes that indexing has been completed and
 * maintained as the last indexed time is updated.
 *
 * @param row
 * @return true if indexed
 */
public boolean index(FeatureRow row) {

    long geoPackageId = geometryMetadataDataSource.getGeoPackageId(featureDao.getDatabase());
    boolean indexed = index(geoPackageId, row, true);

    // Update the last indexed time
    updateLastIndexed(db, geoPackageId);

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


示例16: drawFeature

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Draw the feature on the canvas
 *
 * @param zoom        zoom level
 * @param boundingBox
 * @param transform
 * @param canvas
 * @param row
 */
private void drawFeature(int zoom, BoundingBox boundingBox, ProjectionTransform transform, Canvas canvas, FeatureRow row) {
    try {
        GeoPackageGeometryData geomData = row.getGeometry();
        if (geomData != null) {
            Geometry geometry = geomData.getGeometry();
            double simplifyTolerance = TileBoundingBoxUtils.toleranceDistance(zoom, tileWidth, tileHeight);
            drawShape(simplifyTolerance, boundingBox, transform, canvas, geometry);
        }
    } catch (Exception e) {
        Log.e(DefaultFeatureTiles.class.getSimpleName(), "Failed to draw feature in tile. Table: "
                + featureDao.getTableName(), e);
    }
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:23,代码来源:DefaultFeatureTiles.java


示例17: validateGeometryIndex

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
/**
 * Validate a Geometry Index result
 *
 * @param featureTableIndex
 * @param geometryIndex
 */
private static void validateGeometryIndex(
        FeatureTableIndex featureTableIndex, GeometryIndex geometryIndex) {
    FeatureRow featureRow = featureTableIndex.getFeatureRow(geometryIndex);
    TestCase.assertNotNull(featureRow);
    TestCase.assertEquals(featureTableIndex.getTableName(),
            geometryIndex.getTableName());
    TestCase.assertEquals(geometryIndex.getGeomId(), featureRow.getId());
    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);

    TestCase.assertEquals(envelope.getMinX(), geometryIndex.getMinX());
    TestCase.assertEquals(envelope.getMaxX(), geometryIndex.getMaxX());
    TestCase.assertEquals(envelope.getMinY(), geometryIndex.getMinY());
    TestCase.assertEquals(envelope.getMaxY(), geometryIndex.getMaxY());
    if (envelope.isHasZ()) {
        TestCase.assertEquals(envelope.getMinZ(), geometryIndex.getMinZ());
        TestCase.assertEquals(envelope.getMaxZ(), geometryIndex.getMaxZ());
    } else {
        TestCase.assertNull(geometryIndex.getMinZ());
        TestCase.assertNull(geometryIndex.getMaxZ());
    }
    if (envelope.isHasM()) {
        TestCase.assertEquals(envelope.getMinM(), geometryIndex.getMinM());
        TestCase.assertEquals(envelope.getMaxM(), geometryIndex.getMaxM());
    } else {
        TestCase.assertNull(geometryIndex.getMinM());
        TestCase.assertNull(geometryIndex.getMaxM());
    }
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:44,代码来源:FeatureTableIndexUtils.java


示例18: setPoint

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
public static void setPoint(FeatureRow featureRow, double x, double y) {
    GeoPackageGeometryData geomData = new GeoPackageGeometryData(
            ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
    Point point = new Point(false, false, x, y);
    geomData.setGeometry(point);
    featureRow.setGeometry(geomData);
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:8,代码来源:FeatureTileUtils.java


示例19: insertLine

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
public static long insertLine(FeatureDao featureDao, double[][] points) {
    FeatureRow featureRow = featureDao.newRow();
    GeoPackageGeometryData geomData = new GeoPackageGeometryData(
            ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
    LineString lineString = getLineString(points);
    geomData.setGeometry(lineString);
    featureRow.setGeometry(geomData);
    return featureDao.insert(featureRow);
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:10,代码来源:FeatureTileUtils.java


示例20: insertPolygon

import mil.nga.geopackage.features.user.FeatureRow; //导入依赖的package包/类
public static long insertPolygon(FeatureDao featureDao, double[][]... points) {
    FeatureRow featureRow = featureDao.newRow();
    GeoPackageGeometryData geomData = new GeoPackageGeometryData(
            ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
    Polygon polygon = new Polygon(false, false);
    for (double[][] ring : points) {
        LineString lineString = getLineString(ring);
        polygon.addRing(lineString);
    }
    geomData.setGeometry(polygon);
    featureRow.setGeometry(geomData);
    return featureDao.insert(featureRow);
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:14,代码来源:FeatureTileUtils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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