@@ -34,7 +34,6 @@ import org.opengis.feature.simple.SimpleFeature
34
34
import org .opengis .filter ._
35
35
36
36
import scala .collection .JavaConverters ._
37
- import scala .util .Try
38
37
39
38
case class Attribute (name : Text , value : Text )
40
39
@@ -59,7 +58,6 @@ class SpatioTemporalIntersectingIterator
59
58
60
59
protected var indexSource : SortedKeyValueIterator [Key , Value ] = null
61
60
protected var dataSource : SortedKeyValueIterator [Key , Value ] = null
62
- protected var decoder : IndexEntryDecoder = null
63
61
protected var topKey : Key = null
64
62
protected var topValue : Value = null
65
63
protected var nextKey : Key = null
@@ -70,9 +68,6 @@ class SpatioTemporalIntersectingIterator
70
68
protected var testSimpleFeature : SimpleFeature = null
71
69
protected var dateAttributeName : Option [String ] = None
72
70
73
- // Used by aggregators that extend STII
74
- protected var curFeature : SimpleFeature = null
75
-
76
71
protected var deduplicate : Boolean = false
77
72
78
73
// each batch-scanner thread maintains its own (imperfect!) list of the
@@ -90,9 +85,6 @@ class SpatioTemporalIntersectingIterator
90
85
91
86
dateAttributeName = getDtgFieldName(featureType)
92
87
93
- val schemaEncoding = options.get(DEFAULT_SCHEMA_NAME )
94
- decoder = IndexSchema .getIndexEntryDecoder(schemaEncoding)
95
-
96
88
if (options.containsKey(DEFAULT_FILTER_PROPERTY_NAME )) {
97
89
val filterString = options.get(DEFAULT_FILTER_PROPERTY_NAME )
98
90
filter = ECQL .toFilter(filterString)
@@ -188,12 +180,6 @@ class SpatioTemporalIntersectingIterator
188
180
itr.next()
189
181
}
190
182
191
- /**
192
- * Attempt to decode the given key. This should only succeed in the cases
193
- * where the key corresponds to an index-entry (not a data-entry).
194
- */
195
- def decodeKey (key: Key ): Option [SimpleFeature ] = Try (decoder.decode(key)).toOption
196
-
197
183
/**
198
184
* Advances the index-iterator to the next qualifying entry, and then
199
185
* updates the data-iterator to match what ID the index-iterator found
@@ -207,23 +193,17 @@ class SpatioTemporalIntersectingIterator
207
193
skipDataEntries(indexSource)
208
194
209
195
while (nextValue == null && indexSource.hasTop && indexSource.getTopKey != null ) {
210
- // only consider this index entry if we could fully decode the key
211
- decodeKey(indexSource.getTopKey).map { decodedKey =>
212
- curFeature = decodedKey
213
- // the value contains the full-resolution geometry and time; use them
214
- lazy val decodedValue = IndexEntry .decodeIndexValue(indexSource.getTopValue)
215
- lazy val isSTAcceptable = wrappedSTFilter(decodedValue.geom, decodedValue.dtgMillis)
216
-
217
- // see whether this box is acceptable
218
- // (the tests are ordered from fastest to slowest to take advantage of
219
- // short-circuit evaluation)
220
- if (isIdUnique(decodedValue.id) && isSTAcceptable) {
221
- // stash this ID
222
- rememberId(decodedValue.id)
223
-
224
- // advance the data-iterator to its corresponding match
225
- seekData(decodedValue)
226
- }
196
+ // the value contains the full-resolution geometry and time; use them
197
+ val decodedValue = IndexEntry .decodeIndexValue(indexSource.getTopValue)
198
+ def isSTAcceptable = wrappedSTFilter(decodedValue.geom, decodedValue.dtgMillis)
199
+ // see whether this box is acceptable
200
+ // (the tests are ordered from fastest to slowest to take advantage of
201
+ // short-circuit evaluation)
202
+ if (isIdUnique(decodedValue.id) && isSTAcceptable) {
203
+ // stash this ID
204
+ rememberId(decodedValue.id)
205
+ // advance the data-iterator to its corresponding match
206
+ seekData(decodedValue)
227
207
}
228
208
229
209
// you MUST advance to the next key
@@ -312,8 +292,7 @@ object SpatioTemporalIntersectingIterator extends IteratorHelpers
312
292
* This trait contains many methods and values of general use to companion Iterator objects
313
293
*/
314
294
trait IteratorHelpers {
315
- def setOptions (cfg : IteratorSetting , schema : String , filter : Option [Filter ]) {
316
- cfg.addOption(DEFAULT_SCHEMA_NAME , schema)
295
+ def setOptions (cfg : IteratorSetting , filter : Option [Filter ]) {
317
296
filter.foreach { f => cfg.addOption(DEFAULT_FILTER_PROPERTY_NAME , ECQL .toCQL(f)) }
318
297
}
319
298
}
0 commit comments