Revision 39585
trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/impl/spatialjoin/fmap/IntersectSpatialJoinVisitor.java | ||
---|---|---|
248 | 248 |
|
249 | 249 |
public ILayerDefinition getResultLayerDefinition(){ |
250 | 250 |
if(this.resultLayerDefinition == null){ |
251 |
ArrayList fields = new ArrayList();
|
|
251 |
ArrayList<FieldDescription> fields = new ArrayList<FieldDescription>();
|
|
252 | 252 |
resultLayerDefinition = new SHPLayerDefinition(); |
253 | 253 |
//result layer will be exactly similar to firstLayer with |
254 | 254 |
//new attributes |
... | ... | |
260 | 260 |
} |
261 | 261 |
|
262 | 262 |
//first layer attributes |
263 |
int numFields = 0; |
|
264 | 263 |
try { |
265 |
numFields = sourceRecordset.getFieldCount(); |
|
264 |
for (FieldDescription fieldDesc : sourceRecordset.getFieldsDescription()) { |
|
265 |
fields.add(fieldDesc); |
|
266 |
} |
|
266 | 267 |
} catch (ReadDriverException e) { |
267 |
// TODO Auto-generated catch block |
|
268 |
e.printStackTrace(); |
|
268 |
e.printStackTrace(); |
|
269 | 269 |
} |
270 | 270 |
|
271 |
FieldDescription fieldDesc = null; |
|
272 |
for(int i = 0; i < numFields; i++){ |
|
273 |
fieldDesc = new FieldDescription(); |
|
274 |
try { |
|
275 |
fieldDesc.setFieldName(sourceRecordset.getFieldName(i)); |
|
276 |
int fieldType = sourceRecordset.getFieldType(i); |
|
277 |
fieldDesc.setFieldType(fieldType); |
|
278 |
fieldDesc.setFieldLength(DefinitionUtils. |
|
279 |
getDataTypeLength(fieldType)); |
|
280 |
fieldDesc.setFieldDecimalCount(DefinitionUtils.NUM_DECIMALS); |
|
281 |
} catch (ReadDriverException e) { |
|
282 |
// TODO Auto-generated catch block |
|
283 |
e.printStackTrace(); |
|
284 |
} |
|
285 |
fields.add(fieldDesc); |
|
286 |
}//for |
|
287 |
|
|
288 | 271 |
//target layer attributes |
289 | 272 |
Iterator fieldsIt = fields_sumarizeFunc.keySet().iterator(); |
273 |
FieldDescription fieldDesc; |
|
290 | 274 |
while(fieldsIt.hasNext()){ |
291 | 275 |
String field = (String) fieldsIt.next(); |
292 | 276 |
SummarizationFunction[] functions = |
Also available in: Unified diff