Revision 22968 branches/v2_0_0_prep/libraries/libFMap_dataFile/src/org/gvsig/fmap/data/feature/file/shp/SHPStore.java
SHPStore.java | ||
---|---|---|
22 | 22 |
import org.gvsig.fmap.data.feature.Feature; |
23 | 23 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor; |
24 | 24 |
import org.gvsig.fmap.data.feature.FeatureCollection; |
25 |
import org.gvsig.fmap.data.feature.FeatureID; |
|
26 | 25 |
import org.gvsig.fmap.data.feature.FeatureType; |
27 | 26 |
import org.gvsig.fmap.data.feature.FeaturesWriter; |
28 | 27 |
import org.gvsig.fmap.data.feature.IsNotAttributeSettingException; |
29 | 28 |
import org.gvsig.fmap.data.feature.file.FileExplorerParameters; |
30 |
import org.gvsig.fmap.data.feature.file.dbf.DBFFeature; |
|
31 |
import org.gvsig.fmap.data.feature.file.dbf.DBFFeatureID; |
|
32 | 29 |
import org.gvsig.fmap.data.feature.file.dbf.DBFStore; |
33 | 30 |
import org.gvsig.fmap.geom.primitive.Envelope; |
34 | 31 |
import org.gvsig.metadata.IMetadata; |
... | ... | |
106 | 103 |
return coll; |
107 | 104 |
} |
108 | 105 |
|
109 |
public Feature getFeatureByID(FeatureID id,FeatureType featureType) throws ReadException { |
|
110 |
if (featureType==null){ |
|
111 |
featureType=getDefaultFeatureType(); |
|
112 |
}else{ |
|
113 |
if (!featureType.isSubtypeOf(this.getDefaultFeatureType())){ |
|
114 |
throw new ReadException("invalid type",this.getName()); |
|
115 |
} |
|
106 |
/** |
|
107 |
* |
|
108 |
* NOT supported in Alter Mode |
|
109 |
* |
|
110 |
* @param index |
|
111 |
* @param featureType |
|
112 |
* @return |
|
113 |
* @throws ReadException |
|
114 |
*/ |
|
115 |
protected Feature getFeatureByIndex(long index, FeatureType featureType) |
|
116 |
throws ReadException { |
|
117 |
if (this.alterMode) { |
|
118 |
throw new ReadException(this.getName(), |
|
119 |
"Unsupported operation in alter mode"); |
|
116 | 120 |
} |
117 |
if (this.alterMode){ |
|
118 |
if (featureManager.contains(id)) { |
|
119 |
return featureManager.getFeature(id,this,featureType); |
|
120 |
} |
|
121 |
} |
|
122 |
long position=((ShpFeatureID)id).getIndex(); |
|
123 |
ShpFeature feature=new ShpFeature(featureType,this,position); |
|
121 |
ShpFeature feature = new ShpFeature(featureType, this, index); |
|
124 | 122 |
return feature; |
125 | 123 |
} |
126 | 124 |
|
... | ... | |
179 | 177 |
} |
180 | 178 |
|
181 | 179 |
public boolean isEditable() { |
182 |
if (super.isEditable() && this.shp.isEditable()) return true; |
|
180 |
if (super.isEditable() && this.shp.isEditable()) { |
|
181 |
return true; |
|
182 |
} |
|
183 | 183 |
return false; |
184 | 184 |
} |
185 | 185 |
|
... | ... | |
202 | 202 |
while(featureIterator.hasNext()){ |
203 | 203 |
Feature feature=(Feature)featureIterator.next(); |
204 | 204 |
Envelope boundExtent=feature.getExtent(); |
205 |
if (boundExtent!=null) |
|
205 |
if (boundExtent!=null) {
|
|
206 | 206 |
extent.add(boundExtent); |
207 |
} |
|
207 | 208 |
} |
208 | 209 |
} |
209 | 210 |
} |
Also available in: Unified diff