Revision 42191 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.shp/src/main/java/org/gvsig/fmap/dal/store/shp/SHPNewStoreParameters.java
SHPNewStoreParameters.java | ||
---|---|---|
67 | 67 |
} |
68 | 68 |
|
69 | 69 |
public EditableFeatureType getDefaultFeatureType() { |
70 |
return (EditableFeatureType) this |
|
71 |
.getDynValue(FEATURETYPE_PARAMTER_NAME); |
|
70 |
|
|
71 |
FeatureType featureType = (FeatureType) this.getDynValue(FEATURETYPE_PARAMTER_NAME); |
|
72 |
if(featureType instanceof EditableFeatureType){ |
|
73 |
return (EditableFeatureType)featureType; |
|
74 |
} |
|
75 |
return (EditableFeatureType) featureType.getEditable(); |
|
72 | 76 |
} |
73 | 77 |
|
74 | 78 |
public void setDefaultFeatureType(FeatureType featureType) { |
... | ... | |
82 | 86 |
if (featureType != null) { |
83 | 87 |
FeatureAttributeDescriptor geometryAttribute = |
84 | 88 |
featureType.getAttributeDescriptor(featureType.getDefaultGeometryAttributeName()); |
85 |
if (geometryAttribute != null) {
|
|
89 |
if (geometryAttribute != null) { |
|
86 | 90 |
if (this.getDynValue(GEOMETRYTYPE_PARAMETER_NAME) == null) { |
87 |
//Set the geometryType parameter
|
|
91 |
//Set the geometryType parameter |
|
88 | 92 |
int geometryType = |
89 | 93 |
featureType.getAttributeDescriptor( |
90 | 94 |
geometryAttribute.getName()) |
91 | 95 |
.getGeometryType(); |
92 | 96 |
setGeometryType(geometryType); |
93 | 97 |
} |
94 |
|
|
95 |
//If the CRS parameter has not been fixed, but there is
|
|
98 |
|
|
99 |
//If the CRS parameter has not been fixed, but there is |
|
96 | 100 |
//a geometric attribute with the CRS, this attribute |
97 | 101 |
//can be used. |
98 |
if (getCRS() == null) {
|
|
102 |
if (getCRS() == null) { |
|
99 | 103 |
setCRS(geometryAttribute.getSRS()); |
100 | 104 |
} |
101 | 105 |
} |
102 |
}
|
|
106 |
} |
|
103 | 107 |
} |
104 | 108 |
} |
Also available in: Unified diff