Revision 38382 branches/v2_0_0_prep/extensions/extDalTransformJoin/src/org/gvsig/app/join/dal/feature/JoinTransform.java
JoinTransform.java | ||
---|---|---|
136 | 136 |
this.originalFeatureType = this.getFeatureStore() |
137 | 137 |
.getDefaultFeatureType(); |
138 | 138 |
|
139 |
// keep index of geometry and att desc ============== |
|
140 |
int orig_geom_field_index = |
|
141 |
this.originalFeatureType.getDefaultGeometryAttributeIndex(); |
|
142 |
FeatureAttributeDescriptor orig_geom_field_att = |
|
143 |
this.originalFeatureType.getDefaultGeometryAttribute(); |
|
144 |
|
|
139 | 145 |
// Create the feature type and copy the store 1 type |
140 | 146 |
EditableFeatureType editableFeatureType = this.getFeatureStore().getDefaultFeatureType().getEditable(); |
141 | 147 |
FeatureAttributeDescriptor[] featureAttributeDescriptors = editableFeatureType.getAttributeDescriptors(); |
... | ... | |
144 | 150 |
} |
145 | 151 |
addFeatureType(editableFeatureType, featureAttributeDescriptors, prefix1, store1NamesMap); |
146 | 152 |
|
153 |
// =========== set the new geom field name and restore geometry values |
|
154 |
if (orig_geom_field_index >= 0) { |
|
155 |
EditableFeatureAttributeDescriptor ed_att = null; |
|
156 |
ed_att = (EditableFeatureAttributeDescriptor) |
|
157 |
editableFeatureType.getAttributeDescriptor(orig_geom_field_index); |
|
158 |
ed_att.setSRS(orig_geom_field_att.getSRS()); |
|
159 |
ed_att.setObjectClass(orig_geom_field_att.getObjectClass()); |
|
160 |
ed_att.setGeometryType(orig_geom_field_att.getGeomType()); |
|
161 |
ed_att.setDefaultValue(orig_geom_field_att.getDefaultValue()); |
|
162 |
|
|
163 |
String new_geom_field_name = ed_att.getName(); |
|
164 |
editableFeatureType.setDefaultGeometryAttributeName(new_geom_field_name); |
|
165 |
} |
|
166 |
// ===================================================================== |
|
167 |
|
|
147 | 168 |
// Add the store 2 fields |
148 | 169 |
FeatureType featureType2 = store2.getDefaultFeatureType(); |
149 | 170 |
|
Also available in: Unified diff