Revision 23570 branches/v2_0_0_prep/libraries/libFMap_dataFile/src/org/gvsig/fmap/data/feature/file/shp/ShpFeature.java
ShpFeature.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
ShpFeature(FeatureType featureType, SHPStore store,long featureIndex) throws ReadException { |
27 | 27 |
super(featureType,store,featureIndex); |
28 |
load(); |
|
29 |
// this.store=store; |
|
30 |
// this.featureIndex=featureIndex; |
|
28 |
this.extent = (store).getBoundingBox(featureIndex); |
|
31 | 29 |
|
32 | 30 |
} |
33 | 31 |
|
34 | 32 |
|
35 |
|
|
36 |
|
|
37 |
/* (non-Javadoc) |
|
38 |
* @see org.gvsig.fmap.data.feature.file.dbf.DBFFeature#load() |
|
39 |
*/ |
|
40 |
private void load() throws ReadException { |
|
41 |
this.extent= ((SHPStore)store).getBoundingBox(featureIndex); |
|
42 |
} |
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 | 33 |
protected void loadValue(FeatureAttributeDescriptor descriptor) throws ReadException, IsNotFeatureSettingException { |
48 | 34 |
if (descriptor.getDataType().equals(FeatureAttributeDescriptor.TYPE_GEOMETRY)){ |
49 | 35 |
this.setGeometry(((AttributeDescriptor)descriptor).originalPosition(), ((SHPStore)store).getGeometry(featureIndex) ); |
... | ... | |
55 | 41 |
|
56 | 42 |
|
57 | 43 |
public FeatureID getID() { |
44 |
try { |
|
45 |
this.load(); |
|
46 |
} catch (ReadException e) { |
|
47 |
throw new RuntimeException(e); |
|
48 |
} |
|
58 | 49 |
return new ShpFeatureID((SHPStore)this.store,featureIndex); |
59 | 50 |
} |
60 | 51 |
|
... | ... | |
63 | 54 |
} |
64 | 55 |
|
65 | 56 |
public List getAllSRS() { |
66 |
// TODO Auto-generated method stub |
|
57 |
try { |
|
58 |
this.load(); |
|
59 |
} catch (ReadException e) { |
|
60 |
throw new RuntimeException(e); |
|
61 |
} |
|
62 |
|
|
67 | 63 |
return null; |
68 | 64 |
} |
69 | 65 |
|
... | ... | |
74 | 70 |
|
75 | 71 |
public int[] getGeometryTypes() { |
76 | 72 |
Geometry geometry= (Geometry)getDefaultGeometry(); |
77 |
if (geometry!=null) |
|
73 |
if (geometry!=null) {
|
|
78 | 74 |
return new int[]{geometry.getType()}; |
75 |
} |
|
79 | 76 |
return null; |
80 | 77 |
} |
81 | 78 |
|
82 | 79 |
|
83 | 80 |
|
84 | 81 |
protected Feature cloneFeature() throws DataException { |
82 |
this.load(); |
|
83 |
|
|
85 | 84 |
try { |
86 | 85 |
return new ShpFeature(this.featureType,(SHPStore)this.store,this.featureIndex); |
87 | 86 |
} catch (ReadException e) { |
Also available in: Unified diff