Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap / src / org / gvsig / fmap / drivers / reading / SHPLayerDefinition.java @ 20989

History | View | Annotate | Download (3.62 KB)

1
/*
2
 * Created on 06-feb-2006
3
 *
4
 * gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
5
 *
6
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
7
 *
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation; either version 2
11
 * of the License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
21
 *
22
 * For more information, contact:
23
 *
24
 *  Generalitat Valenciana
25
 *   Conselleria d'Infraestructures i Transport
26
 *   Av. Blasco Ib??ez, 50
27
 *   46010 VALENCIA
28
 *   SPAIN
29
 *
30
 *      +34 963862235
31
 *   gvsig@gva.es
32
 *      www.gvsig.gva.es
33
 *
34
 *    or
35
 *
36
 *   IVER T.I. S.A
37
 *   Salamanca 50
38
 *   46005 Valencia
39
 *   Spain
40
 *
41
 *   +34 963163400
42
 *   dac@iver.es
43
 */
44
/* CVS MESSAGES:
45
 *
46
 * $Id: SHPLayerDefinition.java 20989 2008-05-28 11:05:57Z jmvivo $
47
 * $Log$
48
 * Revision 1.4  2007-03-06 17:08:54  caballero
49
 * Exceptions
50
 *
51
 * Revision 1.3  2006/03/15 12:12:22  fjp
52
 * Creaci?n desde cero de un tema POR FIN.
53
 *
54
 * Revision 1.2  2006/02/13 16:46:20  azabala
55
 * *** empty log message ***
56
 *
57
 * Revision 1.1  2006/02/06 19:26:23  azabala
58
 * It defines a SHP Layer (first version of cvs)
59
 *
60
 *
61
 */
62
package org.gvsig.fmap.drivers.reading;
63

    
64
import java.io.File;
65

    
66

    
67
/**
68
 * It has all definition information to create a persistent shapefile datastore.
69
 * 
70
 * @author azabala
71
 * 
72
 */
73
public class SHPLayerDefinition extends LayerDefinition {
74
        /**
75
         * path of shp file
76
         */
77
        private String shpPath;
78

    
79
        /**
80
         * path of shx file
81
         */
82
        private String shxPath;
83

    
84
        /**
85
         * path of dbf file
86
         */
87
        private String dbfPath;
88

    
89
        /**
90
         * kind of geometry (shape) that will save the shp file
91
         */
92
        private int shapeType;
93

    
94
        /**
95
         * data type of DBF file fields
96
         */
97
        private int[] fieldTypes;
98

    
99
        /**
100
         * name of DBF file fields
101
         */
102
        private String[] fieldNames;
103

    
104
        private int[] fieldLenght;
105

    
106
        private int[] decimalCount;
107
        
108
        private File shpFile;
109

    
110
        public SHPLayerDefinition(File file) {
111
                setFile(file);
112
        }
113
        
114
        public SHPLayerDefinition(){
115
                
116
        }
117

    
118
        public void setFile(File f) {
119
                shpFile = f;
120
                shpPath = f.getAbsolutePath();
121

    
122
                String strFichshx = f.getAbsolutePath().replaceAll("\\.shp", ".shx");
123
                shxPath = strFichshx.replaceAll("\\.SHP", ".SHX");
124

    
125
                String strFichDbf = f.getAbsolutePath().replaceAll("\\.shp", ".dbf");
126
                dbfPath = strFichDbf.replaceAll("\\.SHP", ".DBF");
127

    
128
        }
129
        
130
        public File getFile()
131
        {
132
                return shpFile;
133
        }
134

    
135
        public String getDbfPath() {
136
                return dbfPath;
137
        }
138

    
139
        
140
        public int[] getDecimalCount() {
141
                return decimalCount;
142
        }
143

    
144
        public void setDecimalCount(int[] decimalCount) {
145
                this.decimalCount = decimalCount;
146
        }
147

    
148
        public int[] getFieldLenght() {
149
                return fieldLenght;
150
        }
151

    
152
        public void setFieldLenght(int[] fieldLenght) {
153
                this.fieldLenght = fieldLenght;
154
        }
155

    
156
        public String[] getFieldNames() {
157
                return fieldNames;
158
        }
159

    
160
        public void setFieldNames(String[] fieldNames) {
161
                this.fieldNames = fieldNames;
162
        }
163

    
164
        public int[] getFieldTypes() {
165
                return fieldTypes;
166
        }
167

    
168
        public void setFieldTypes(int[] fieldTypes) {
169
                this.fieldTypes = fieldTypes;
170
        }
171

    
172
        public int getShapeType() {
173
                return shapeType;
174
        }
175

    
176
        public void setShapeType(int shapeType) {
177
                this.shapeType = shapeType;
178
        }
179

    
180
        public String getShpPath() {
181
                return shpPath;
182
        }
183

    
184
        public String getShxPath() {
185
                return shxPath;
186
        }
187
}