Revision 22333 branches/v2_0_0_prep/libraries/libFMap_data/src/org/gvsig/fmap/data/vectorial/joinstore/JoinDataCollection.java
JoinDataCollection.java | ||
---|---|---|
183 | 183 |
// this.featureManager = null; |
184 | 184 |
// ; |
185 | 185 |
} |
186 |
public Feature getFeature(int index) { |
|
187 |
FeatureStore store1=joinStore.getPrimaryStore(); |
|
188 |
FeatureStore store2=joinStore.getSecondaryStore(); |
|
189 |
//TODO el featureType y el order hay que modificarlo y reorganizarlo. |
|
190 |
FeatureCollection coll1=null; |
|
191 |
FeatureCollection coll2=null; |
|
192 |
try { |
|
193 |
coll1 = (FeatureCollection)store1.getDataCollection(featureType,filter,order); |
|
186 | 194 |
|
195 |
|
|
196 |
coll2=(FeatureCollection)store2.getDataCollection(featureType,filter,order); |
|
197 |
} catch (ReadException e1) { |
|
198 |
// TODO Auto-generated catch block |
|
199 |
e1.printStackTrace(); |
|
200 |
} |
|
201 |
// TODO falta modificar el featureType para pedir solo los atributos que tenga en el primaryStore. |
|
202 |
Feature feature=coll1.getFeature(index); |
|
203 |
|
|
204 |
Object obj=feature.get(((JoinFeatureStoreParameters)joinStore.getParameters()).getLinkFieldPrimary()); |
|
205 |
|
|
206 |
Iterator iter=null; |
|
207 |
JoinFeature complexFeature=null; |
|
208 |
try { |
|
209 |
iter = joinStore.getSecondaryStore().getDataCollection(joinStore.getPrimaryStore().getDefaultFeatureType(),((JoinFeatureStoreParameters)joinStore.getParameters()).getLinkFieldSecondary() + " = " + obj.toString(),null).iterator(); |
|
210 |
|
|
211 |
Feature fea = null; |
|
212 |
while (iter.hasNext()) { |
|
213 |
fea = (Feature) iter.next(); |
|
214 |
break; |
|
215 |
} |
|
216 |
complexFeature=new JoinFeature(featureType,feature,fea); |
|
217 |
} catch (ReadException e) { |
|
218 |
e.printStackTrace(); |
|
219 |
} |
|
220 |
return complexFeature; |
|
221 |
} |
|
222 |
|
|
187 | 223 |
} |
Also available in: Unified diff