root / trunk / libraries / libDataSourceBaseDrivers / src / org / gvsig / data / datastores / vectorial / file / shp / ShpFeature.java @ 20501
History | View | Annotate | Download (2.2 KB)
1 | 19844 | vcaballero | package org.gvsig.data.datastores.vectorial.file.shp; |
---|---|---|---|
2 | 19401 | vcaballero | |
3 | 20130 | jmvivo | import java.text.DateFormat; |
4 | import java.text.ParseException; |
||
5 | import java.util.Date; |
||
6 | 20414 | vcaballero | import java.util.Iterator; |
7 | 19401 | vcaballero | import java.util.List; |
8 | 20130 | jmvivo | import java.util.Locale; |
9 | 19401 | vcaballero | |
10 | 20130 | jmvivo | import org.gvsig.data.datastores.vectorial.file.dbf.DBFFeature; |
11 | 20437 | vcaballero | import org.gvsig.data.datastores.vectorial.file.dbf.DBFStore; |
12 | 20130 | jmvivo | import org.gvsig.data.datastores.vectorial.file.dbf.utils.DbaseFile; |
13 | import org.gvsig.data.exception.ReadException; |
||
14 | 19441 | vcaballero | import org.gvsig.data.spatialprovisional.IExtent; |
15 | 20501 | vcaballero | import org.gvsig.data.vectorial.DefaultAttributeDescriptor; |
16 | 19401 | vcaballero | import org.gvsig.data.vectorial.Feature; |
17 | 20130 | jmvivo | import org.gvsig.data.vectorial.IFeatureAttributeDescriptor; |
18 | 19401 | vcaballero | import org.gvsig.data.vectorial.IFeatureID; |
19 | import org.gvsig.data.vectorial.IFeatureType; |
||
20 | 20414 | vcaballero | import org.gvsig.data.vectorial.IsNotFeatureSettingException; |
21 | 19401 | vcaballero | |
22 | 20130 | jmvivo | import com.iver.cit.gvsig.fmap.core.IGeometry; |
23 | 19736 | vcaballero | |
24 | 20130 | jmvivo | |
25 | 20437 | vcaballero | public class ShpFeature extends DBFFeature{ |
26 | 20130 | jmvivo | protected static Locale ukLocale = new Locale("en", "UK"); |
27 | 20437 | vcaballero | // private SHPStore store;
|
28 | // private long featureIndex;
|
||
29 | 19401 | vcaballero | |
30 | 20437 | vcaballero | ShpFeature(IFeatureType featureType, SHPStore store,long featureIndex) throws ReadException { |
31 | super(featureType,store,featureIndex);
|
||
32 | load(); |
||
33 | // this.store=store;
|
||
34 | // this.featureIndex=featureIndex;
|
||
35 | |||
36 | 19401 | vcaballero | } |
37 | |||
38 | 20130 | jmvivo | |
39 | 20479 | jmvivo | |
40 | protected void loadValue(IFeatureAttributeDescriptor descriptor) throws ReadException, IsNotFeatureSettingException { |
||
41 | if (descriptor.getDataType().equals(IFeatureAttributeDescriptor.TYPE_GEOMETRY)){
|
||
42 | 20501 | vcaballero | this.setGeometry(((DefaultAttributeDescriptor)descriptor).originalPosition(), ((SHPStore)store).getGeometry(featureIndex) );
|
43 | 20479 | jmvivo | } else {
|
44 | super.loadValue(descriptor);
|
||
45 | 20130 | jmvivo | } |
46 | } |
||
47 | |||
48 | |||
49 | |||
50 | 19401 | vcaballero | public IFeatureID getID() {
|
51 | 20437 | vcaballero | return new ShpFeatureID((SHPStore)this.store,featureIndex); |
52 | 19401 | vcaballero | } |
53 | |||
54 | 19441 | vcaballero | public IExtent getExtent() {
|
55 | 20437 | vcaballero | return ((SHPStore)store).getBoundingBox(featureIndex);
|
56 | 19401 | vcaballero | } |
57 | |||
58 | public List getAllSRS() { |
||
59 | // TODO Auto-generated method stub
|
||
60 | return null; |
||
61 | } |
||
62 | |||
63 | 19415 | vcaballero | public String getDefaultSRS() { |
64 | 19401 | vcaballero | // TODO Auto-generated method stub
|
65 | return null; |
||
66 | } |
||
67 | |||
68 | 20130 | jmvivo | public int[] getGeometryTypes() { |
69 | IGeometry geometry= (IGeometry)getDefaultGeometry(); |
||
70 | if (geometry!=null) |
||
71 | return new int[]{geometry.getGeometryType()}; |
||
72 | return null; |
||
73 | } |
||
74 | 20437 | vcaballero | |
75 | |||
76 | |||
77 | |||
78 | 19401 | vcaballero | } |