private boolean index ( long geoPackageId , FeatureRow row , boolean possibleUpdate ) { boolean indexed = false ; GeoPackageGeometryData geomData = row . getGeometry ( ) ; if ( geomData != null ) { // Get the envelope GeometryEnvelope envelope = geomData . getEnvelope ( ) ; // If no envelope, build one from the geometry if ( envelope == null ) { Geometry geometry = geomData . getGeometry ( ) ; if ( geometry != null ) { envelope = GeometryEnvelopeBuilder . buildEnvelope ( geometry ) ; } } // Create the new index row if ( envelope != null ) { GeometryMetadata metadata = geometryMetadataDataSource . populate ( geoPackageId , featureDao . getTableName ( ) , row . getId ( ) , envelope ) ; if ( possibleUpdate ) { geometryMetadataDataSource . createOrUpdate ( metadata ) ; } else { geometryMetadataDataSource . create ( metadata ) ; } indexed = true ; } } return indexed ; }
Index the feature row