code: public long count(GeometryEnvelope envelope) {
  		long count = 0;
  		switch (getIndexedType()) {
  		case GEOPACKAGE:
  			count = featureTableIndex.count(envelope);
  			break;
  		case RTREE:
  			count = rTreeIndexTableDao.count(envelope);
  			break;
  		default:
  			count = manualFeatureQuery.count(envelope);
  		}
  		return count;
  	}
docs: Query for feature index count within the Geometry Envelope
  
  @param envelope
  geometry envelope
  @return count