本文整理汇总了Java中mil.nga.wkb.geom.GeometryEnvelope.hasM方法的典型用法代码示例。如果您正苦于以下问题:Java GeometryEnvelope.hasM方法的具体用法?Java GeometryEnvelope.hasM怎么用?Java GeometryEnvelope.hasM使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mil.nga.wkb.geom.GeometryEnvelope
的用法示例。
在下文中一共展示了GeometryEnvelope.hasM方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populate
import mil.nga.wkb.geom.GeometryEnvelope; //导入方法依赖的package包/类
/**
* Populate a new geometry metadata from an envelope
*
* @param geoPackageId
* @param tableName
* @param geomId
* @param envelope
* @return
*/
public GeometryMetadata populate(long geoPackageId, String tableName, long geomId, GeometryEnvelope envelope) {
GeometryMetadata metadata = new GeometryMetadata();
metadata.setGeoPackageId(geoPackageId);
metadata.setTableName(tableName);
metadata.setId(geomId);
metadata.setMinX(envelope.getMinX());
metadata.setMaxX(envelope.getMaxX());
metadata.setMinY(envelope.getMinY());
metadata.setMaxY(envelope.getMaxY());
if (envelope.hasZ()) {
metadata.setMinZ(envelope.getMinZ());
metadata.setMaxZ(envelope.getMaxZ());
}
if (envelope.hasM()) {
metadata.setMinM(envelope.getMinM());
metadata.setMaxM(envelope.getMaxM());
}
return metadata;
}
示例2: populate
import mil.nga.wkb.geom.GeometryEnvelope; //导入方法依赖的package包/类
/**
* Populate a new geometry index from an envelope
*
* @param tableIndex
* table index
* @param geomId
* geometry id
* @param envelope
* geometry envelope
* @return geometry index
*/
public GeometryIndex populate(TableIndex tableIndex, long geomId,
GeometryEnvelope envelope) {
GeometryIndex geometryIndex = new GeometryIndex();
geometryIndex.setTableIndex(tableIndex);
geometryIndex.setGeomId(geomId);
geometryIndex.setMinX(envelope.getMinX());
geometryIndex.setMaxX(envelope.getMaxX());
geometryIndex.setMinY(envelope.getMinY());
geometryIndex.setMaxY(envelope.getMaxY());
if (envelope.hasZ()) {
geometryIndex.setMinZ(envelope.getMinZ());
geometryIndex.setMaxZ(envelope.getMaxZ());
}
if (envelope.hasM()) {
geometryIndex.setMinM(envelope.getMinM());
geometryIndex.setMaxM(envelope.getMaxM());
}
return geometryIndex;
}
示例3: queryBuilder
import mil.nga.wkb.geom.GeometryEnvelope; //导入方法依赖的package包/类
/**
* Build a query builder to query for Geometry Index objects within the
* Geometry Envelope
*
* @param envelope
* @return query builder
*/
public QueryBuilder<GeometryIndex, GeometryIndexKey> queryBuilder(
GeometryEnvelope envelope) {
QueryBuilder<GeometryIndex, GeometryIndexKey> qb = geometryIndexDao
.queryBuilder();
try {
Where<GeometryIndex, GeometryIndexKey> where = qb.where();
where.eq(GeometryIndex.COLUMN_TABLE_NAME, tableName).and()
.le(GeometryIndex.COLUMN_MIN_X, envelope.getMaxX()).and()
.ge(GeometryIndex.COLUMN_MAX_X, envelope.getMinX()).and()
.le(GeometryIndex.COLUMN_MIN_Y, envelope.getMaxY()).and()
.ge(GeometryIndex.COLUMN_MAX_Y, envelope.getMinY());
if (envelope.hasZ()) {
where.and().le(GeometryIndex.COLUMN_MIN_Z, envelope.getMaxZ())
.and()
.ge(GeometryIndex.COLUMN_MAX_Z, envelope.getMinZ());
}
if (envelope.hasM()) {
where.and().le(GeometryIndex.COLUMN_MIN_M, envelope.getMaxM())
.and()
.ge(GeometryIndex.COLUMN_MAX_M, envelope.getMinM());
}
} catch (SQLException e) {
throw new GeoPackageException(
"Failed to build query for Geometry Indices. GeoPackage: "
+ geoPackage.getName() + ", Table Name: "
+ tableName + ", Column Name: " + columnName, e);
}
return qb;
}
示例4: getIndicator
import mil.nga.wkb.geom.GeometryEnvelope; //导入方法依赖的package包/类
/**
* Get the envelope flag indicator
*
* 1 for xy, 2 for xyz, 3 for xym, 4 for xyzm (null would be 0)
*
* @return indicator
*/
public static int getIndicator(GeometryEnvelope envelope) {
int indicator = 1;
if (envelope.hasZ()) {
indicator++;
}
if (envelope.hasM()) {
indicator += 2;
}
return indicator;
}
示例5: updateHasZandM
import mil.nga.wkb.geom.GeometryEnvelope; //导入方法依赖的package包/类
/**
* Update teh has z and m values
*
* @param envelope
* @param geometry
*/
private static void updateHasZandM(GeometryEnvelope envelope,
Geometry geometry) {
if (!envelope.hasZ() && geometry.hasZ()) {
envelope.setHasZ(true);
}
if (!envelope.hasM() && geometry.hasM()) {
envelope.setHasM(true);
}
}
示例6: query
import mil.nga.wkb.geom.GeometryEnvelope; //导入方法依赖的package包/类
/**
* Query for all table geometry metadata matching the envelope
*
* @param geoPackageId
* @param tableName
* @param envelope
* @return cursor that must be closed
*/
public Cursor query(long geoPackageId, String tableName, GeometryEnvelope envelope) {
StringBuilder selection = new StringBuilder();
selection.append(GeometryMetadata.COLUMN_GEOPACKAGE_ID).append(" = ? AND ")
.append(GeometryMetadata.COLUMN_TABLE_NAME).append(" = ?");
selection.append(" AND ").append(GeometryMetadata.COLUMN_MIN_X).append(" <= ?");
selection.append(" AND ").append(GeometryMetadata.COLUMN_MAX_X).append(" >= ?");
selection.append(" AND ").append(GeometryMetadata.COLUMN_MIN_Y).append(" <= ?");
selection.append(" AND ").append(GeometryMetadata.COLUMN_MAX_Y).append(" >= ?");
int args = 6;
if (envelope.hasZ()) {
args += 2;
selection.append(" AND ").append(GeometryMetadata.COLUMN_MIN_Z).append(" <= ?");
selection.append(" AND ").append(GeometryMetadata.COLUMN_MAX_Z).append(" >= ?");
}
if (envelope.hasM()) {
args += 2;
selection.append(" AND ").append(GeometryMetadata.COLUMN_MIN_M).append(" <= ?");
selection.append(" AND ").append(GeometryMetadata.COLUMN_MAX_M).append(" >= ?");
}
String[] selectionArgs = new String[args];
int argCount = 0;
selectionArgs[argCount++] = String.valueOf(geoPackageId);
selectionArgs[argCount++] = tableName;
selectionArgs[argCount++] = String.valueOf(envelope.getMaxX());
selectionArgs[argCount++] = String.valueOf(envelope.getMinX());
selectionArgs[argCount++] = String.valueOf(envelope.getMaxY());
selectionArgs[argCount++] = String.valueOf(envelope.getMinY());
if (envelope.hasZ()) {
selectionArgs[argCount++] = String.valueOf(envelope.getMaxZ());
selectionArgs[argCount++] = String.valueOf(envelope.getMinZ());
}
if (envelope.hasM()) {
selectionArgs[argCount++] = String.valueOf(envelope.getMaxM());
selectionArgs[argCount++] = String.valueOf(envelope.getMinM());
}
Cursor cursor = db.query(
GeometryMetadata.TABLE_NAME,
GeometryMetadata.COLUMNS, selection.toString(), selectionArgs, null, null, null);
return cursor;
}
示例7: validateFeatureRow
import mil.nga.wkb.geom.GeometryEnvelope; //导入方法依赖的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());
}
}
}