本文整理汇总了Java中mil.nga.geopackage.features.user.FeatureRow类的典型用法代码示例。如果您正苦于以下问题:Java FeatureRow类的具体用法?Java FeatureRow怎么用?Java FeatureRow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FeatureRow类属于mil.nga.geopackage.features.user包,在下文中一共展示了FeatureRow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}