Revision 1987
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/wfs/IWFSDriver.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.cit.gvsig.fmap.drivers.wfs; |
|
42 |
import java.awt.geom.Rectangle2D; |
|
43 |
import java.net.URL; |
|
44 |
import java.sql.Connection; |
|
45 |
|
|
46 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
47 |
import com.iver.cit.gvsig.fmap.core.IFeature; |
|
48 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
49 |
import com.iver.cit.gvsig.fmap.drivers.IFeatureIterator; |
|
50 |
import com.iver.cit.gvsig.fmap.drivers.VectorialDriver; |
|
51 |
|
|
52 |
public interface IWFSDriver extends VectorialDriver { |
|
53 |
/** |
|
54 |
* @param conn |
|
55 |
* @param tableName |
|
56 |
* @param fields (Todos los campos, el primero ha de ser el de las geometr?as |
|
57 |
* @param whereClause |
|
58 |
* @param id_FID_field El identificador del campo que contiene una clave ?nica. 1=> primer campo, 2 => segundo campo, etc |
|
59 |
* |
|
60 |
*/ |
|
61 |
public void setData(String url,String user,String pwd,String[] layers,boolean protocol,int numFeatures,int timeout,int id_FID_field); |
|
62 |
public Rectangle2D getFullExtent(); |
|
63 |
// public int getShapeType(); |
|
64 |
public IGeometry getShape(int index); |
|
65 |
public URL getHost(); |
|
66 |
//public IFeatureIterator getFeatureIterator(String sql) throws DriverException; |
|
67 |
public IFeatureIterator getFeatureIterator(Rectangle2D r, String strEPSG) throws DriverException; |
|
68 |
//public String getFields(); |
|
69 |
//public String getWhereClause(); |
|
70 |
public void close(); |
|
71 |
public void open() throws com.iver.cit.gvsig.fmap.DriverException; |
|
72 |
/** |
|
73 |
* @param FID |
|
74 |
* @return el n?mero de registro asociado a ese FID. Se usa dentro |
|
75 |
* del DBStrategy para averig?ar si un Feature est? seleccionado |
|
76 |
* o no. |
|
77 |
*/ |
|
78 |
public int getRowIndexByFID(IFeature FID); |
|
79 |
|
|
80 |
|
|
81 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/wfs/WFSDriver.java | ||
---|---|---|
83 | 83 |
* |
84 | 84 |
* @author Vicente Caballero Navarro |
85 | 85 |
*/ |
86 |
public class WFSDriver implements IWFSDriver, ObjectDriver {
|
|
86 |
public class WFSDriver implements IWFSdriver, ObjectDriver {
|
|
87 | 87 |
private Rectangle2D fullExtent = null; |
88 | 88 |
private Rectangle2D extent = null; |
89 | 89 |
private DataStore ds; |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/wfs/IWFSdriver.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.cit.gvsig.fmap.drivers.wfs; |
|
42 |
import java.awt.geom.Rectangle2D; |
|
43 |
import java.net.URL; |
|
44 |
import java.sql.Connection; |
|
45 |
|
|
46 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
47 |
import com.iver.cit.gvsig.fmap.core.IFeature; |
|
48 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
49 |
import com.iver.cit.gvsig.fmap.drivers.IFeatureIterator; |
|
50 |
import com.iver.cit.gvsig.fmap.drivers.VectorialDriver; |
|
51 |
|
|
52 |
public interface IWFSdriver extends VectorialDriver { |
|
53 |
/** |
|
54 |
* @param conn |
|
55 |
* @param tableName |
|
56 |
* @param fields (Todos los campos, el primero ha de ser el de las geometr?as |
|
57 |
* @param whereClause |
|
58 |
* @param id_FID_field El identificador del campo que contiene una clave ?nica. 1=> primer campo, 2 => segundo campo, etc |
|
59 |
* |
|
60 |
*/ |
|
61 |
public void setData(String url,String user,String pwd,String[] layers,boolean protocol,int numFeatures,int timeout,int id_FID_field); |
|
62 |
public Rectangle2D getFullExtent(); |
|
63 |
// public int getShapeType(); |
|
64 |
public IGeometry getShape(int index); |
|
65 |
public URL getHost(); |
|
66 |
//public IFeatureIterator getFeatureIterator(String sql) throws DriverException; |
|
67 |
public IFeatureIterator getFeatureIterator(Rectangle2D r, String strEPSG) throws DriverException; |
|
68 |
//public String getFields(); |
|
69 |
//public String getWhereClause(); |
|
70 |
public void close(); |
|
71 |
public void open() throws com.iver.cit.gvsig.fmap.DriverException; |
|
72 |
/** |
|
73 |
* @param FID |
|
74 |
* @return el n?mero de registro asociado a ese FID. Se usa dentro |
|
75 |
* del DBStrategy para averig?ar si un Feature est? seleccionado |
|
76 |
* o no. |
|
77 |
*/ |
|
78 |
public int getRowIndexByFID(IFeature FID); |
|
79 |
|
|
80 |
|
|
81 |
} |
|
0 | 82 |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/jdbc/mysql/MySqlFeatureIterator.java | ||
---|---|---|
91 | 91 |
* @see com.iver.cit.gvsig.fmap.drivers.jdbc.GeometryIterator#hasNext() |
92 | 92 |
*/ |
93 | 93 |
public boolean hasNext() throws SQLException { |
94 |
if (rs.isLast()) |
|
94 |
if (rs.next()) |
|
95 |
return true; |
|
96 |
else |
|
95 | 97 |
{ |
96 | 98 |
rs.close(); |
97 | 99 |
return false; |
98 | 100 |
} |
99 |
else |
|
100 |
return true; |
|
101 | 101 |
} |
102 | 102 |
|
103 | 103 |
/* (non-Javadoc) |
104 | 104 |
* @see com.iver.cit.gvsig.fmap.drivers.jdbc.GeometryIterator#next() |
105 | 105 |
*/ |
106 | 106 |
public IFeature next() throws SQLException { |
107 |
rs.next(); |
|
108 | 107 |
byte[] data = rs.getBytes(1); |
109 | 108 |
geom = parser.parse(data); |
110 | 109 |
for (int fieldId=2; fieldId <= numColumns; fieldId++ ) |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/WFSAdapter.java | ||
---|---|---|
54 | 54 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
55 | 55 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
56 | 56 |
import com.iver.cit.gvsig.fmap.drivers.IFeatureIterator; |
57 |
import com.iver.cit.gvsig.fmap.drivers.wfs.IWFSDriver;
|
|
57 |
import com.iver.cit.gvsig.fmap.drivers.wfs.IWFSdriver;
|
|
58 | 58 |
import com.iver.cit.gvsig.fmap.drivers.wfs.WFSDriver; |
59 | 59 |
|
60 | 60 |
|
... | ... | |
75 | 75 |
*/ |
76 | 76 |
public void start() { |
77 | 77 |
try { |
78 |
((IWFSDriver)driver).open();
|
|
78 |
((IWFSdriver)driver).open();
|
|
79 | 79 |
} catch (DriverException e) { |
80 | 80 |
// TODO Auto-generated catch block |
81 | 81 |
e.printStackTrace(); |
... | ... | |
88 | 88 |
* al driver que cierre la conexion con el servidor de base de datos |
89 | 89 |
*/ |
90 | 90 |
public void stop() { |
91 |
((IWFSDriver)driver).close();
|
|
91 |
((IWFSdriver)driver).close();
|
|
92 | 92 |
} |
93 | 93 |
|
94 | 94 |
public IFeatureIterator getFeatureIterator(Rectangle2D r, String strEPSG) throws DriverException |
95 | 95 |
{ |
96 |
return ((IWFSDriver)driver).getFeatureIterator(r, strEPSG);
|
|
96 |
return ((IWFSdriver)driver).getFeatureIterator(r, strEPSG);
|
|
97 | 97 |
} |
98 | 98 |
|
99 | 99 |
/*public String getFields() |
... | ... | |
115 | 115 |
*/ |
116 | 116 |
public IGeometry getShape(int index) throws DriverIOException { |
117 | 117 |
IGeometry geom = null; |
118 |
geom = ((IWFSDriver)driver).getShape(index);
|
|
118 |
geom = ((IWFSdriver)driver).getShape(index);
|
|
119 | 119 |
return geom; |
120 | 120 |
} |
121 | 121 |
|
... | ... | |
125 | 125 |
*/ |
126 | 126 |
public int getShapeCount() throws DriverIOException { |
127 | 127 |
try { |
128 |
return ((IWFSDriver)driver).getShapeCount();
|
|
128 |
return ((IWFSdriver)driver).getShapeCount();
|
|
129 | 129 |
} catch (IOException e) { |
130 | 130 |
e.printStackTrace(); |
131 | 131 |
} |
... | ... | |
136 | 136 |
* @see com.iver.cit.gvsig.fmap.layers.ReadableVectorial#getFullExtent() |
137 | 137 |
*/ |
138 | 138 |
public Rectangle2D getFullExtent() { |
139 |
return ((IWFSDriver)driver).getFullExtent();
|
|
139 |
return ((IWFSdriver)driver).getFullExtent();
|
|
140 | 140 |
} |
141 | 141 |
|
142 | 142 |
|
Also available in: Unified diff