Revision 11121
trunk/libraries/libGPE/src/org/gvsig/gpe/AbstractGPEDriver.java | ||
---|---|---|
1 |
package org.gvsig.gpe; |
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
/* CVS MESSAGES: |
|
43 |
* |
|
44 |
* $Id$ |
|
45 |
* $Log$ |
|
46 |
* Revision 1.1 2007-02-28 11:52:06 csanchez |
|
47 |
* Nueva libreria para el motor de persistencia GML |
|
48 |
* |
|
49 |
* |
|
50 |
*/ |
|
51 |
/** |
|
52 |
* @author Carlos S?nchez Peri??n (sanchez_carper@gva.es) |
|
53 |
*/ |
|
54 |
public abstract class AbstractGPEDriver { |
|
55 |
private IGPEContentHandler myIGPEContentHandler; |
|
56 |
private IGPEGeometriesHandler myIGPEGeometriesHandler; |
|
57 |
|
|
58 |
public AbstractGPEDriver(IGPEContentHandler myIGPEContentHandler, IGPEGeometriesHandler myIGPEGeometriesHandler) { |
|
59 |
super(); |
|
60 |
// TODO Ap?ndice de constructor generado autom?ticamente |
|
61 |
this.myIGPEContentHandler = myIGPEContentHandler; |
|
62 |
this.myIGPEGeometriesHandler = myIGPEGeometriesHandler; |
|
63 |
} |
|
64 |
} |
trunk/libraries/libGPE/src/org/gvsig/gpe/IGPEGeometriesHandler.java | ||
---|---|---|
1 |
package org.gvsig.gpe; |
|
2 |
|
|
3 |
import java.util.Vector; |
|
4 |
|
|
5 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
6 |
* |
|
7 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
8 |
* |
|
9 |
* This program is free software; you can redistribute it and/or |
|
10 |
* modify it under the terms of the GNU General Public License |
|
11 |
* as published by the Free Software Foundation; either version 2 |
|
12 |
* of the License, or (at your option) any later version. |
|
13 |
* |
|
14 |
* This program is distributed in the hope that it will be useful, |
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
17 |
* GNU General Public License for more details. |
|
18 |
* |
|
19 |
* You should have received a copy of the GNU General Public License |
|
20 |
* along with this program; if not, write to the Free Software |
|
21 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
22 |
* |
|
23 |
* For more information, contact: |
|
24 |
* |
|
25 |
* Generalitat Valenciana |
|
26 |
* Conselleria d'Infraestructures i Transport |
|
27 |
* Av. Blasco Ib??ez, 50 |
|
28 |
* 46010 VALENCIA |
|
29 |
* SPAIN |
|
30 |
* |
|
31 |
* +34 963862235 |
|
32 |
* gvsig@gva.es |
|
33 |
* www.gvsig.gva.es |
|
34 |
* |
|
35 |
* or |
|
36 |
* |
|
37 |
* IVER T.I. S.A |
|
38 |
* Salamanca 50 |
|
39 |
* 46005 Valencia |
|
40 |
* Spain |
|
41 |
* |
|
42 |
* +34 963163400 |
|
43 |
* dac@iver.es |
|
44 |
*/ |
|
45 |
/* CVS MESSAGES: |
|
46 |
* |
|
47 |
* $Id$ |
|
48 |
* $Log$ |
|
49 |
* Revision 1.1 2007-02-28 11:52:06 csanchez |
|
50 |
* Nueva libreria para el motor de persistencia GML |
|
51 |
* |
|
52 |
* |
|
53 |
*/ |
|
54 |
/** |
|
55 |
* @author Carlos S?nchez Peri??n (sanchez_carper@gva.es) |
|
56 |
*/ |
|
57 |
public interface IGPEGeometriesHandler { |
|
58 |
|
|
59 |
/** |
|
60 |
* @param args |
|
61 |
*/ |
|
62 |
public Object startPoint(String srsName, double X, double Y, double Z); |
|
63 |
|
|
64 |
public Object startLineString(String srsName, Vector pointsVector); |
|
65 |
|
|
66 |
public Object startPoligon(String srsName, Vector outerBoundaryr, Vector innerBoundary); |
|
67 |
|
|
68 |
public Object startLinearRing(String srsName, Vector pointsVector); |
|
69 |
|
|
70 |
public Object startMultiPonint(String srsName, Vector X, Vector Y, Vector Z); |
|
71 |
|
|
72 |
public Object startMultiLineString(String srsName, Vector LinesVector); |
|
73 |
|
|
74 |
public Object startMultiPolygon(String srsName, Object polygonVector); |
|
75 |
|
|
76 |
} |
trunk/libraries/libGPE/src/org/gvsig/gpe/GPEErrorHandler.java | ||
---|---|---|
1 |
package org.gvsig.gpe; |
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
/* CVS MESSAGES: |
|
43 |
* |
|
44 |
* $Id$ |
|
45 |
* $Log$ |
|
46 |
* Revision 1.1 2007-04-11 08:46:21 csanchez |
|
47 |
* Actualizacion protoripo libGPE |
|
48 |
* |
|
49 |
* |
|
50 |
*/ |
|
51 |
/** |
|
52 |
* @author Carlos S?nchez Peri??n (sanchez_carper@gva.es) |
|
53 |
*/ |
|
54 |
public abstract class GPEErrorHandler implements IGPEErrorHandler { |
|
55 |
|
|
56 |
public Object badLayer(String error, Object layer) { |
|
57 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
58 |
return null; |
|
59 |
} |
|
60 |
|
|
61 |
public Object badElement(String error, Object element) { |
|
62 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
63 |
return null; |
|
64 |
} |
|
65 |
|
|
66 |
public Object badArea(String error, Object bBox) { |
|
67 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
68 |
return null; |
|
69 |
} |
|
70 |
|
|
71 |
public Object badGeometry(String error, Object geometry) { |
|
72 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
73 |
return null; |
|
74 |
} |
|
75 |
|
|
76 |
public Object badFeature(String error, Object feature) { |
|
77 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
78 |
return null; |
|
79 |
} |
|
80 |
|
|
81 |
} |
|
0 | 82 |
trunk/libraries/libGPE/src/org/gvsig/gpe/GPEContentHandler.java | ||
---|---|---|
1 |
package org.gvsig.gpe; |
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
/* CVS MESSAGES: |
|
43 |
* |
|
44 |
* $Id$ |
|
45 |
* $Log$ |
|
46 |
* Revision 1.1 2007-04-11 08:46:21 csanchez |
|
47 |
* Actualizacion protoripo libGPE |
|
48 |
* |
|
49 |
* |
|
50 |
*/ |
|
51 |
/** |
|
52 |
* @author Carlos S?nchez Peri??n (sanchez_carper@gva.es) |
|
53 |
*/ |
|
54 |
public abstract class GPEContentHandler implements IGPEContentHandler { |
|
55 |
|
|
56 |
public Object startLayer(Object parent, Object bBox, String id, |
|
57 |
String name, String description) { |
|
58 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
59 |
return null; |
|
60 |
} |
|
61 |
|
|
62 |
public void endLayer(Object layer) { |
|
63 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
64 |
|
|
65 |
} |
|
66 |
|
|
67 |
public Object startElement(Object parent, String name, Object value, |
|
68 |
Object type) { |
|
69 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
70 |
return null; |
|
71 |
} |
|
72 |
|
|
73 |
public void endElement(Object element) { |
|
74 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
75 |
|
|
76 |
} |
|
77 |
|
|
78 |
public Object startBbox(double[] x, double[] y, double[] z, String id, |
|
79 |
String srs) { |
|
80 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
81 |
return null; |
|
82 |
} |
|
83 |
|
|
84 |
public void endBbox(Object bbox) { |
|
85 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
86 |
|
|
87 |
} |
|
88 |
|
|
89 |
public Object startPoint(double x, double y, double z, String id, String srs) { |
|
90 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
91 |
return null; |
|
92 |
} |
|
93 |
|
|
94 |
public void endPoint(Object point) { |
|
95 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
96 |
|
|
97 |
} |
|
98 |
|
|
99 |
public Object startLineString(double x, double y, double z, String id, |
|
100 |
String srs) { |
|
101 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
102 |
return null; |
|
103 |
} |
|
104 |
|
|
105 |
public void endLineString(Object line) { |
|
106 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
107 |
|
|
108 |
} |
|
109 |
|
|
110 |
public Object startLinearRing(double x, double y, double z, String id, |
|
111 |
String srs) { |
|
112 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
113 |
return null; |
|
114 |
} |
|
115 |
|
|
116 |
public void endLinearRing(Object linearRing) { |
|
117 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
118 |
|
|
119 |
} |
|
120 |
|
|
121 |
public Object startPolygon(double x, double y, double z, String id, |
|
122 |
String srs) { |
|
123 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
124 |
return null; |
|
125 |
} |
|
126 |
|
|
127 |
public void endPolygon(Object polygon) { |
|
128 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
129 |
|
|
130 |
} |
|
131 |
|
|
132 |
public void addInnerBoundary(Object polygon, Object linearRing) { |
|
133 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
134 |
|
|
135 |
} |
|
136 |
|
|
137 |
public void addOuterBoundary(Object polygon, Object linearRing) { |
|
138 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
139 |
|
|
140 |
} |
|
141 |
|
|
142 |
public boolean isViewInBox(Object bbox, Object view) { |
|
143 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
144 |
return false; |
|
145 |
} |
|
146 |
|
|
147 |
public boolean isGeometryInBox(Object bbox, Object geometry) { |
|
148 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
149 |
return false; |
|
150 |
} |
|
151 |
|
|
152 |
public void addFeature(Object layer, Object feature) { |
|
153 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
154 |
|
|
155 |
} |
|
156 |
|
|
157 |
public void addBbox(Object item, Object bbox) { |
|
158 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
159 |
|
|
160 |
} |
|
161 |
|
|
162 |
public void addElement(Object feature, Object element) { |
|
163 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
164 |
|
|
165 |
} |
|
166 |
|
|
167 |
public void addGeometry(Object feature, Object geometry) { |
|
168 |
// TODO Ap?ndice de m?todo generado autom?ticamente |
|
169 |
|
|
170 |
} |
|
171 |
|
|
172 |
} |
|
0 | 173 |
trunk/libraries/libGPE/src/org/gvsig/gpe/GPEParser.java | ||
---|---|---|
46 | 46 |
* |
47 | 47 |
* $Id$ |
48 | 48 |
* $Log$ |
49 |
* Revision 1.1 2007-04-11 08:19:32 csanchez |
|
49 |
* Revision 1.2 2007-04-11 08:46:21 csanchez |
|
50 |
* Actualizacion protoripo libGPE |
|
51 |
* |
|
52 |
* Revision 1.1 2007/04/11 08:19:32 csanchez |
|
50 | 53 |
* actualizacion |
51 | 54 |
* |
52 | 55 |
* |
... | ... | |
55 | 58 |
* @author Carlos S?nchez Peri??n (sanchez_carper@gva.es) |
56 | 59 |
*/ |
57 | 60 |
|
61 |
|
|
58 | 62 |
public abstract class GPEParser { |
59 |
GPEErrorHandler errorHandler; |
|
60 |
GPEContentHandler contentHandler; |
|
63 |
private GPEErrorHandler errorHandler; |
|
64 |
private GPEContentHandler contentHandler; |
|
65 |
private File parserFile = null; |
|
61 | 66 |
|
67 |
|
|
62 | 68 |
/** |
63 | 69 |
* |
64 | 70 |
* AQUI SE IMPLEMENTA LA BASE PARA PODER PARSEAR CUALQUIER FICHERO: |
... | ... | |
70 | 76 |
* -SI EXISTE, LLAMADA AL PARSER DEL FORMATO CONCRETO |
71 | 77 |
* |
72 | 78 |
**/ |
73 |
void parse(File fichero){ |
|
79 |
public GPEParser(File file){ |
|
80 |
//file to parse... |
|
81 |
this.parserFile = file; |
|
82 |
errorHandler = new GPEErrorHandler(); |
|
83 |
contentHandler = new GPEContentHandler(); |
|
84 |
} |
|
85 |
public void parse(File fichero){ |
|
74 | 86 |
|
75 | 87 |
} |
76 |
abstract boolean accept(File file); |
|
88 |
abstract public boolean accept(File file);
|
|
77 | 89 |
|
78 |
void parserRegister(){ |
|
79 |
|
|
80 |
} |
|
81 | 90 |
|
82 | 91 |
} |
trunk/libraries/libGPE/src/org/gvsig/gpe/IGPEErrorHandler.java | ||
---|---|---|
1 |
package org.gvsig.gpe; |
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
/* CVS MESSAGES: |
|
43 |
* |
|
44 |
* $Id$ |
|
45 |
* $Log$ |
|
46 |
* Revision 1.1 2007-04-11 08:46:21 csanchez |
|
47 |
* Actualizacion protoripo libGPE |
|
48 |
* |
|
49 |
* |
|
50 |
*/ |
|
51 |
/** |
|
52 |
* @author Carlos S?nchez Peri??n (sanchez_carper@gva.es) |
|
53 |
*/ |
|
54 |
public interface IGPEErrorHandler { |
|
55 |
|
|
56 |
public Object badLayer(String error, Object layer); |
|
57 |
|
|
58 |
public Object badElement(String error, Object element); |
|
59 |
|
|
60 |
public Object badArea(String error, Object bBox); |
|
61 |
|
|
62 |
public Object badGeometry(String error, Object geometry); |
|
63 |
|
|
64 |
public Object badFeature(String error, Object feature); |
|
65 |
|
|
66 |
} |
|
0 | 67 |
trunk/libraries/libGPE/src/org/gvsig/gpe/IGPEContentHandler.java | ||
---|---|---|
1 | 1 |
package org.gvsig.gpe; |
2 | 2 |
|
3 |
import java.awt.geom.Rectangle2D; |
|
4 | 3 |
|
5 | 4 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
6 | 5 |
* |
... | ... | |
46 | 45 |
* |
47 | 46 |
* $Id$ |
48 | 47 |
* $Log$ |
49 |
* Revision 1.2 2007-04-11 07:35:43 jorpiell |
|
48 |
* Revision 1.3 2007-04-11 08:46:20 csanchez |
|
49 |
* Actualizacion protoripo libGPE |
|
50 |
* |
|
51 |
* Revision 1.2 2007/04/11 07:35:43 jorpiell |
|
50 | 52 |
* Se ha actualizado despu?s de mirar la especificaci?n de GML 2.x. Faltan las geometr?as multiples |
51 | 53 |
* |
52 | 54 |
* Revision 1.1 2007/02/28 11:52:06 csanchez |
Also available in: Unified diff