Revision 35624
branches/dal_time_support/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeatureQuery.java | ||
---|---|---|
40 | 40 |
import org.gvsig.tools.dynobject.DynStruct; |
41 | 41 |
import org.gvsig.tools.evaluator.AndEvaluator; |
42 | 42 |
import org.gvsig.tools.evaluator.Evaluator; |
43 |
import org.gvsig.tools.evaluator.EvaluatorFieldsInfo; |
|
43 | 44 |
import org.gvsig.tools.persistence.PersistentState; |
44 | 45 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
45 | 46 |
|
... | ... | |
295 | 296 |
|
296 | 297 |
private void addFilterAttributes(Evaluator evaluator){ |
297 | 298 |
if (evaluator != null){ |
298 |
String[] fieldNames = evaluator.getFieldsInfo().getFieldNames(); |
|
299 |
EvaluatorFieldsInfo fieldsInfo = evaluator.getFieldsInfo(); |
|
300 |
if (fieldsInfo == null){ |
|
301 |
// FieldsInfo is not available in this evaluator |
|
302 |
return; |
|
303 |
} |
|
304 |
String[] fieldNames = fieldsInfo.getFieldNames(); |
|
305 |
if (fieldNames== null){ |
|
306 |
// fieldNames is not available in this evaluator |
|
307 |
return; |
|
308 |
} |
|
309 |
|
|
299 | 310 |
for (int i=0 ; i<fieldNames.length ; i++){ |
300 | 311 |
addAttributeName(fieldNames[i]); |
301 | 312 |
} |
branches/dal_time_support/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/SpatialManager.java | ||
---|---|---|
210 | 210 |
featureStore.getDefaultFeatureType() |
211 | 211 |
.getDefaultGeometryAttributeIndex()); |
212 | 212 |
Envelope fullEnvelope = null; |
213 |
try { |
|
214 |
fullEnvelope = GeometryLocator.getGeometryManager().createEnvelope( |
|
215 |
attr.getGeometrySubType()); |
|
216 |
} catch (Exception e) { |
|
217 |
// FIXME Exception |
|
218 |
throw new RuntimeException(e); |
|
219 |
} |
|
213 |
|
|
220 | 214 |
FeatureSet set = null; |
221 | 215 |
DisposableIterator iterator = null; |
222 | 216 |
try { |
223 | 217 |
set = featureStore.getFeatureSet(); |
224 | 218 |
iterator = set.fastIterator(); |
219 |
//First while to initialize the feature envelope |
|
225 | 220 |
while (iterator.hasNext()) { |
221 |
Feature feature = (Feature) iterator.next(); |
|
222 |
Envelope envelope = feature.getDefaultEnvelope(); |
|
223 |
if (envelope != null){ |
|
224 |
fullEnvelope = (Envelope)envelope.clone(); |
|
225 |
break; |
|
226 |
} |
|
227 |
} |
|
228 |
//Second while to add new evelopes tho the full envelope |
|
229 |
while (iterator.hasNext()) { |
|
226 | 230 |
Feature feature = (Feature) iterator.next(); |
227 |
Envelope envelope = feature.getDefaultEnvelope(); |
|
231 |
Envelope envelope = feature.getDefaultEnvelope();
|
|
228 | 232 |
if(envelope!=null){ |
229 | 233 |
fullEnvelope.add(envelope); |
230 | 234 |
} |
231 | 235 |
} |
232 |
} finally { |
|
236 |
//Creating an empty envelope by default |
|
237 |
if (fullEnvelope == null){ |
|
238 |
fullEnvelope = GeometryLocator.getGeometryManager().createEnvelope( |
|
239 |
attr.getGeometrySubType()); |
|
240 |
} |
|
241 |
} catch (Exception e) { |
|
242 |
throw new RuntimeException(e); |
|
243 |
} finally { |
|
233 | 244 |
if (iterator != null) { |
234 | 245 |
iterator.dispose(); |
235 | 246 |
} |
Also available in: Unified diff