Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / drivers / SHPLayerDefinition.java @ 6458

History | View | Annotate | Download (3.68 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 4440 2006-03-15 12:12:22Z fjp $
47
 * $Log$
48
 * Revision 1.3  2006-03-15 12:12:22  fjp
49
 * Creaci?n desde cero de un tema POR FIN.
50
 *
51
 * Revision 1.2  2006/02/13 16:46:20  azabala
52
 * *** empty log message ***
53
 *
54
 * Revision 1.1  2006/02/06 19:26:23  azabala
55
 * It defines a SHP Layer (first version of cvs)
56
 *
57
 *
58
 */
59
package com.iver.cit.gvsig.fmap.drivers;
60

    
61
import java.io.File;
62

    
63
import com.iver.cit.gvsig.fmap.drivers.shp.DbaseFileWriterNIO;
64
import com.iver.cit.gvsig.fmap.drivers.shp.write.SHPFileWrite;
65

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

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

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

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

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

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

    
103
        private int[] fieldLenght;
104

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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