Revision 7045 trunk/extensions/extWFS2/src/com/iver/cit/gvsig/fmap/layers/FLyrWFS.java
FLyrWFS.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.awt.geom.Rectangle2D; |
4 | 4 |
import java.io.IOException; |
5 |
import java.net.ConnectException; |
|
5 | 6 |
import java.net.MalformedURLException; |
6 | 7 |
import java.net.URL; |
7 | 8 |
import java.util.HashMap; |
9 |
import java.util.Map; |
|
8 | 10 |
import java.util.Vector; |
9 | 11 |
|
10 | 12 |
import javax.swing.ImageIcon; |
11 | 13 |
|
14 |
import org.cresques.cts.ProjectionPool; |
|
15 |
import org.cresques.geo.Projection; |
|
12 | 16 |
import org.gvsig.remoteClient.wfs.WFSAttribute; |
13 | 17 |
import org.gvsig.remoteClient.wfs.WFSStatus; |
14 | 18 |
|
... | ... | |
19 | 23 |
import com.iver.cit.gvsig.fmap.drivers.VectorialDriver; |
20 | 24 |
import com.iver.cit.gvsig.fmap.drivers.WFSException; |
21 | 25 |
import com.iver.cit.gvsig.fmap.drivers.wfs.FMapWFSDriver; |
26 |
import com.iver.cit.gvsig.fmap.drivers.wfs.FMapWFSDriverFactory; |
|
22 | 27 |
import com.iver.cit.gvsig.fmap.rendering.LegendFactory; |
23 | 28 |
|
24 | 29 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
... | ... | |
65 | 70 |
* |
66 | 71 |
* $Id$ |
67 | 72 |
* $Log$ |
68 |
* Revision 1.9 2006-07-05 12:05:41 jorpiell |
|
73 |
* Revision 1.10 2006-09-05 15:41:52 jorpiell |
|
74 |
* A?adida la funcionalidad de cargar WFS desde el cat?logo |
|
75 |
* |
|
76 |
* Revision 1.9 2006/07/05 12:05:41 jorpiell |
|
69 | 77 |
* Se ha modificado para que avise si se han recuperado las mismas features que marca el campo buffer |
70 | 78 |
* |
71 | 79 |
* Revision 1.8 2006/06/21 12:52:10 jorpiell |
... | ... | |
119 | 127 |
public FLyrWFS(){ |
120 | 128 |
super(); |
121 | 129 |
} |
130 |
|
|
131 |
/** |
|
132 |
* Constructor to load a new layer from a catalog |
|
133 |
* search |
|
134 |
* @param args |
|
135 |
* Params to load a new layer |
|
136 |
* @throws WFSException |
|
137 |
* @throws IOException |
|
138 |
* @throws MalformedURLException |
|
139 |
* @throws ConnectException |
|
140 |
* @throws DriverIOException |
|
141 |
*/ |
|
142 |
public FLyrWFS(Map args) throws WFSException, ConnectException, MalformedURLException, IOException, DriverIOException{ |
|
143 |
String[] sLayer = (String[])args.get("layer"); |
|
144 |
String user = (String)args.get("user"); |
|
145 |
String pwd = (String)args.get("pwd"); |
|
146 |
String host = (String)args.get("host"); |
|
147 |
String projection = (String)args.get("projection"); |
|
148 |
|
|
149 |
FMapWFSDriver driver = FMapWFSDriverFactory.getFMapDriverForURL(new URL(host)); |
|
150 |
WFSLayerNode[] layers = driver.getLayerList(); |
|
151 |
WFSLayerNode layer = driver.getLayerInfo(sLayer[0]); |
|
152 |
|
|
153 |
layer.setSelectedFields(layer.getFields()); |
|
154 |
|
|
155 |
WFSAttribute[] atts = new WFSAttribute[layer.getFields().size()]; |
|
156 |
for (int i=0 ; i<atts.length ; i++){ |
|
157 |
atts[i] = (WFSAttribute)layer.getFields().get(i); |
|
158 |
} |
|
159 |
|
|
160 |
setHost(host); |
|
161 |
setName(sLayer[0]); |
|
162 |
setLayerName(sLayer[0]); |
|
163 |
setWfsLayerNode(layer); |
|
164 |
setFields(atts); |
|
165 |
setUserName(user); |
|
166 |
setPassword(pwd); |
|
167 |
setNumfeatures(10000); |
|
168 |
setTimeout(10000); |
|
169 |
setWfsDriver(driver); |
|
170 |
setProjection(ProjectionPool.get(projection)); |
|
171 |
|
|
172 |
load(); |
|
173 |
} |
|
174 |
|
|
122 | 175 |
|
123 | 176 |
/** |
124 | 177 |
* Loads the features from the server |
Also available in: Unified diff