Java Code Examples for mil.nga.geopackage.geom.GeoPackageGeometryData#getOrBuildEnvelope()

The following examples show how to use mil.nga.geopackage.geom.GeoPackageGeometryData#getOrBuildEnvelope() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FeatureRow.java    From geopackage-android with MIT License 5 votes vote down vote up
/**
 * Get the geometry envelope
 *
 * @return geometry envelope
 * @since 3.1.0
 */
public GeometryEnvelope getGeometryEnvelope() {
    GeoPackageGeometryData data = getGeometry();
    GeometryEnvelope envelope = null;
    if (data != null) {
        envelope = data.getOrBuildEnvelope();
    }
    return envelope;
}
 
Example 2
Source File: FeatureTableCoreIndex.java    From geopackage-core-java with MIT License 5 votes vote down vote up
/**
 * Index the geometry id and geometry data
 * 
 * @param tableIndex
 *            table index
 * @param geomId
 *            geometry id
 * @param geomData
 *            geometry data
 * 
 * @return true if indexed
 */
protected boolean index(TableIndex tableIndex, long geomId,
		GeoPackageGeometryData geomData) {

	boolean indexed = false;

	if (geomData != null) {

		// Get or build the envelope
		GeometryEnvelope envelope = geomData.getOrBuildEnvelope();

		// Create the new index row
		if (envelope != null) {
			GeometryIndex geometryIndex = geometryIndexDao
					.populate(tableIndex, geomId, envelope);
			try {
				geometryIndexDao.createOrUpdate(geometryIndex);
				indexed = true;
			} catch (SQLException e) {
				throw new GeoPackageException(
						"Failed to create or update Geometry Index. GeoPackage: "
								+ geoPackage.getName() + ", Table Name: "
								+ tableName + ", Geom Id: " + geomId,
						e);
			}
		}
	}

	return indexed;
}
 
Example 3
Source File: RTreeIndexCoreExtension.java    From geopackage-core-java with MIT License 5 votes vote down vote up
/**
 * Get or build a geometry envelope from the Geometry Data
 * 
 * @param data
 *            geometry data
 * @return geometry envelope
 */
protected GeometryEnvelope getEnvelope(GeoPackageGeometryData data) {
	GeometryEnvelope envelope = null;
	if (data != null) {
		envelope = data.getOrBuildEnvelope();
	}
	return envelope;
}
 
Example 4
Source File: FeatureRow.java    From geopackage-java with MIT License 5 votes vote down vote up
/**
 * Get the geometry envelope
 * 
 * @return geometry envelope
 * @since 3.1.0
 */
public GeometryEnvelope getGeometryEnvelope() {
	GeoPackageGeometryData data = getGeometry();
	GeometryEnvelope envelope = null;
	if (data != null) {
		envelope = data.getOrBuildEnvelope();
	}
	return envelope;
}