private int indexRows ( TableIndex tableIndex , FeatureResultSet resultSet ) { int count = - 1 ; try { while ( ( progress == null || progress . isActive ( ) ) && resultSet . moveToNext ( ) ) { if ( count < 0 ) { count ++ ; } try { FeatureRow row = resultSet . getRow ( ) ; boolean indexed = index ( tableIndex , row . getId ( ) , row . getGeometry ( ) ) ; if ( indexed ) { count ++ ; } if ( progress != null ) { progress . addProgress ( 1 ) ; } } catch ( Exception e ) { log . log ( Level . SEVERE , "Failed to index feature. Table: " + tableIndex . getTableName ( ) + ", Position: " + resultSet . getPosition ( ) , e ) ; } } } finally { resultSet . close ( ) ; } return count ; }
Index the feature rows in the cursor