Revision 32538
branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/ArcImsProtFeatureHandler.java | ||
---|---|---|
47 | 47 |
import java.util.StringTokenizer; |
48 | 48 |
import java.util.Vector; |
49 | 49 |
|
50 |
import org.exolab.castor.xml.dtd.parser.ParseException; |
|
50 | 51 |
import org.gvsig.fmap.geom.Geometry; |
51 | 52 |
import org.gvsig.fmap.geom.GeometryLocator; |
52 | 53 |
import org.gvsig.fmap.geom.GeometryManager; |
... | ... | |
124 | 125 |
/* |
125 | 126 |
* Parse response and add geometries to the general Array |
126 | 127 |
*/ |
127 |
String layerId = (String) status.getLayerIds().get(0);
|
|
128 |
String layerId = (String) status.getLayersIdsSelected().get(0);
|
|
128 | 129 |
|
129 | 130 |
// Deal with UTF-8 |
130 | 131 |
Reader reader = null; |
... | ... | |
257 | 258 |
tag = kxmlParser.nextTag(); |
258 | 259 |
|
259 | 260 |
while (tag != KXmlParser.END_DOCUMENT) { |
261 |
|
|
262 |
ArcImsFeature afeat = new ArcImsFeature(); |
|
263 |
|
|
260 | 264 |
switch (tag) { |
261 | 265 |
case KXmlParser.START_TAG: |
262 | 266 |
|
... | ... | |
272 | 276 |
// timeTemp = System.currentTimeMillis(); |
273 | 277 |
geom = parseEnvelopeFromFeatureTag(kxmlParser, |
274 | 278 |
delDec); |
279 |
afeat.putGeometry(geom); |
|
275 | 280 |
} |
276 | 281 |
|
277 | 282 |
// SECOND FIELDS TAG |
278 | 283 |
// timeTemp = System.currentTimeMillis(); |
279 |
values = parseValuesFromFeatureTag(kxmlParser, // the
|
|
284 |
afeat = parseValuesFromFeatureTag(kxmlParser, // the
|
|
280 | 285 |
// kxml |
281 | 286 |
// parser |
282 | 287 |
fieldsInfoA, // Hashmap with names and |
283 | 288 |
// FieldInformation objects) |
284 | 289 |
delDec, // the separators |
285 |
position // the relative positions of |
|
290 |
position, // the relative positions of
|
|
286 | 291 |
// returned values |
292 |
afeat |
|
287 | 293 |
); |
288 | 294 |
|
289 | 295 |
// timeFeat += System.currentTimeMillis() - |
... | ... | |
299 | 305 |
// parser |
300 | 306 |
delTuple, delCoords, delDec // the |
301 | 307 |
// separators |
308 |
|
|
302 | 309 |
); |
310 |
afeat.putGeometry(geom); |
|
303 | 311 |
|
304 | 312 |
// timeGeom += System.currentTimeMillis() - |
305 | 313 |
// timeTemp; |
306 | 314 |
} |
307 | 315 |
|
308 |
// If some geometry is created, we add a IFeature |
|
309 |
// into features ArrayList |
|
310 |
if (withGeometries > 0) { |
|
311 |
features.add(new ArcImsFeature(geom, values));
|
|
312 |
} |
|
313 |
// Else we only need the Value[] array |
|
314 |
else { |
|
315 |
features.add(new ArcImsFeature(values));
|
|
316 |
} |
|
316 |
// // If some geometry is created, we add a IFeature
|
|
317 |
// // into features ArrayList
|
|
318 |
// if (withGeometries > 0) {
|
|
319 |
// features.add(new ArcImsFeature(geom, values));
|
|
320 |
// }
|
|
321 |
// // Else we only need the Value[] array
|
|
322 |
// else {
|
|
323 |
// features.add(new ArcImsFeature(values));
|
|
324 |
// }
|
|
317 | 325 |
} else if (kxmlParser.getName().compareTo( |
318 | 326 |
GetFeaturesTags.FEATURECOUNT) == 0) { |
319 | 327 |
String value = new String(); |
... | ... | |
346 | 354 |
case KXmlParser.TEXT: |
347 | 355 |
break; |
348 | 356 |
} |
349 |
|
|
357 |
if(afeat != null){ |
|
358 |
features.add(afeat); |
|
359 |
} |
|
350 | 360 |
tag = kxmlParser.next(); |
351 | 361 |
} |
352 | 362 |
|
... | ... | |
454 | 464 |
* @throws ArcImsException |
455 | 465 |
* @throws ParseException |
456 | 466 |
*/ |
457 |
private Object[] parseValuesFromFeatureTag(KXmlParser parser,
|
|
458 |
List<FieldInformation> fieldsInfoA, char delDec, int[] position) |
|
467 |
private ArcImsFeature parseValuesFromFeatureTag(KXmlParser parser,
|
|
468 |
List<FieldInformation> fieldsInfoA, char delDec, int[] position, ArcImsFeature afeat )
|
|
459 | 469 |
throws XmlPullParserException, IOException, ArcImsException { |
460 | 470 |
|
461 | 471 |
int currentTag; |
... | ... | |
465 | 475 |
String text; |
466 | 476 |
int type; |
467 | 477 |
|
468 |
Object[] values = new Object[fieldsInfoA.size()]; |
|
478 |
//Object[] values = new Object[fieldsInfoA.size()];
|
|
469 | 479 |
|
470 | 480 |
currentTag = parser.next(); |
471 | 481 |
|
... | ... | |
482 | 492 |
* attribute into the ArrayList of fieldInformation objects |
483 | 493 |
*/ |
484 | 494 |
if (position[f] == -1) { |
485 |
position[f] = getPosition(fieldsInfoA.iterator(), att); |
|
495 |
position[f] = getPosition(fieldsInfoA.iterator(), att);
|
|
486 | 496 |
} |
487 | 497 |
|
488 | 498 |
if (position[f] == -1) { |
... | ... | |
505 | 515 |
|
506 | 516 |
// Add the Value into the correct position |
507 | 517 |
if (text == null) { |
508 |
values[position[f]] = null; |
|
518 |
String fieldName = fieldsInfoA.get(position[f]).getName(); |
|
519 |
afeat.put(fieldName,null); |
|
509 | 520 |
} else { |
521 |
String fieldName = fieldsInfoA.get(position[f]).getName(); |
|
510 | 522 |
switch (type) { |
511 | 523 |
case FieldInformation.BOOLEAN: |
512 |
values[position[f]] = new Boolean(text);
|
|
524 |
afeat.put(fieldName,new Boolean(text));
|
|
513 | 525 |
f++; |
514 | 526 |
break; |
515 | 527 |
case FieldInformation.SHAPE: |
516 | 528 |
case FieldInformation.STRING: |
517 |
values[position[f]] = new String(text);
|
|
529 |
afeat.put(fieldName, new String(text));
|
|
518 | 530 |
f++; |
519 | 531 |
break; |
520 | 532 |
case FieldInformation.DATE: |
521 |
values[position[f]] = new Date(Long.parseLong(text));
|
|
533 |
afeat.put(fieldName, new Date(Long.parseLong(text)));
|
|
522 | 534 |
f++; |
523 | 535 |
break; |
524 | 536 |
case FieldInformation.FLOAT: |
525 | 537 |
String textfloat = text.replace(delDec, '.'); |
526 |
values[position[f]] = new Float(textfloat);
|
|
538 |
afeat.put(fieldName, new Float(textfloat));
|
|
527 | 539 |
f++; |
528 | 540 |
break; |
529 | 541 |
case FieldInformation.DOUBLE: |
530 | 542 |
String textdouble = text.replace(delDec, '.'); |
531 |
values[position[f]] = new Double(textdouble);
|
|
543 |
afeat.put(fieldName, new Double(textdouble));
|
|
532 | 544 |
f++; |
533 | 545 |
break; |
534 | 546 |
case FieldInformation.SMALLINT: |
535 |
values[position[f]] = new Short(text);
|
|
547 |
afeat.put(fieldName, new Short(text));
|
|
536 | 548 |
f++; |
537 | 549 |
break; |
538 | 550 |
case FieldInformation.BIGINT: |
539 |
values[position[f]] = new Long(text);
|
|
551 |
afeat.put(fieldName, new Long(text));
|
|
540 | 552 |
f++; |
541 | 553 |
break; |
542 | 554 |
case FieldInformation.ID: |
543 | 555 |
case FieldInformation.INTEGER: |
544 |
values[position[f]] = new Integer(text);
|
|
556 |
afeat.put(fieldName, new Integer(text));
|
|
545 | 557 |
f++; |
546 | 558 |
break; |
547 | 559 |
default: |
548 |
values[position[f]] = new String(text);
|
|
560 |
afeat.put(fieldName, new String(text));
|
|
549 | 561 |
f++; |
550 | 562 |
} |
551 | 563 |
} |
... | ... | |
570 | 582 |
} |
571 | 583 |
} |
572 | 584 |
|
573 |
return values;
|
|
585 |
return afeat;
|
|
574 | 586 |
|
575 | 587 |
} |
576 | 588 |
|
... | ... | |
813 | 825 |
public Rectangle2D getLayerExtent(ArcImsVectStatus status) |
814 | 826 |
throws ArcImsException { |
815 | 827 |
Rectangle2D envelope = null; |
816 |
String layerId = (String) status.getLayerIds().get(0);
|
|
828 |
String layerId = (String) status.getLayersIdsSelected().get(0);
|
|
817 | 829 |
|
818 | 830 |
// logger.info("Getting Vectorial Layer Extent (" + status.getl) |
819 | 831 |
ServiceInformation si = status.getServiceInfo(); |
... | ... | |
979 | 991 |
/* |
980 | 992 |
* Parse response and return a Rectangle2D |
981 | 993 |
*/ |
982 |
String layerId = (String) statusCloned.getLayerIds().get(0);
|
|
994 |
String layerId = (String) statusCloned.getLayersIdsSelected().get(0);
|
|
983 | 995 |
logger.debug("Start attributes downloading and parsing (" |
984 | 996 |
+ featCount + ") ids retrieved"); |
985 | 997 |
features.add(getFeatures(br, statusCloned.getServiceInfo(), |
... | ... | |
1106 | 1118 |
/* |
1107 | 1119 |
* Parse response and return a Rectangle2D |
1108 | 1120 |
*/ |
1109 |
String layerId = (String) statusCloned.getLayerIds().get(0);
|
|
1121 |
String layerId = (String) statusCloned.getLayersIdsSelected().get(0);
|
|
1110 | 1122 |
logger.debug("Start attributes downloading and parsing (" |
1111 | 1123 |
+ featCount + ") ids retrieved"); |
1112 | 1124 |
features.add(getFeatures(br, statusCloned.getServiceInfo(), |
branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/ArcImsProtocolHandler.java | ||
---|---|---|
1029 | 1029 |
*/ |
1030 | 1030 |
public void getCapabilities(ArcImsStatus status) throws ArcImsException { |
1031 | 1031 |
try { |
1032 |
// build request |
|
1032 | 1033 |
String request = ArcXML.getServiceInfoRequest(getVersion()); |
1033 |
|
|
1034 |
// build url |
|
1034 | 1035 |
URL url = new URL(buildCapabilitiesRequest(status)); |
1035 | 1036 |
logger.info("Requesting ArcIMS Service Information"); |
1036 |
|
|
1037 |
// get capabilities file |
|
1037 | 1038 |
File f = ArcImsDownloadUtils.doRequestPost(url, request, |
1038 | 1039 |
"serviceInfo.xml"); |
1039 |
|
|
1040 |
// parse file |
|
1040 | 1041 |
this.serviceInfo = parseServiceInfo(this.serviceInfo, f); |
1041 | 1042 |
} catch (MalformedURLException e) { |
1042 | 1043 |
logger.error(e.getMessage(), e); |
branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/ArcImsClient.java | ||
---|---|---|
44 | 44 |
* Abstract class the with the necessary logic to connect to a ArcIms and |
45 | 45 |
* interpretate the data. |
46 | 46 |
* |
47 |
* @author vsanjaime version 2.0 |
|
48 |
* |
|
47 | 49 |
*/ |
48 | 50 |
public abstract class ArcImsClient extends RasterClient { |
49 | 51 |
|
... | ... | |
64 | 66 |
|
65 | 67 |
/** |
66 | 68 |
* Constructor |
67 |
* @param host
|
|
68 |
* @param service |
|
69 |
* @param serverURL
|
|
70 |
* @param serviceName
|
|
69 | 71 |
* @param serviceType |
70 | 72 |
*/ |
71 |
public ArcImsClient(String host, String service, String serviceType) {
|
|
73 |
public ArcImsClient(String serverURL, String serviceName, String serviceType) {
|
|
72 | 74 |
|
73 |
this.setHost(host); |
|
74 |
this.setServiceName(service); |
|
75 |
|
|
75 |
// add server and service name |
|
76 |
this.setHost(serverURL); |
|
77 |
this.setServiceName(serviceName); |
|
78 |
// instance ArcImsHandler |
|
76 | 79 |
try { |
77 | 80 |
this.handler = ArcImsProtocolHandlerFactory.negotiate(serviceType); |
78 |
this.handler.setHost(host);
|
|
79 |
this.handler.setService(service); |
|
81 |
this.handler.setHost(serverURL);
|
|
82 |
this.handler.setService(serviceName);
|
|
80 | 83 |
this.handler.getServiceInformation().setType(serviceType); |
81 | 84 |
} catch (Exception e) { |
82 | 85 |
logger.error(e.getMessage(), e); |
... | ... | |
91 | 94 |
* |
92 | 95 |
*/ |
93 | 96 |
public void getCapabilities(ArcImsStatus status) throws ArcImsException { |
94 |
|
|
97 |
// get capabilities |
|
95 | 98 |
this.handler.getCapabilities(status); |
99 |
// layers availables |
|
96 | 100 |
this.layers = this.handler.layers; |
97 | 101 |
} |
98 | 102 |
|
... | ... | |
106 | 110 |
*/ |
107 | 111 |
public String getFeatureInfo(ArcImsStatus status, int x, int y, |
108 | 112 |
int featureCount) throws ArcImsException { |
113 |
// get info of the one feature |
|
109 | 114 |
return this.handler.getElementInfo(status, x, y, featureCount); |
110 | 115 |
} |
111 | 116 |
|
... | ... | |
157 | 162 |
* Gets the Service information included in the Capabilities |
158 | 163 |
* */ |
159 | 164 |
public ServiceInformation getServiceInformation() { |
165 |
// return info of the service from capabilities |
|
160 | 166 |
return this.handler.getServiceInformation(); |
161 | 167 |
} |
162 | 168 |
|
branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/utils/ArcImsDownloadUtils.java | ||
---|---|---|
458 | 458 |
r = r + "&Service="; |
459 | 459 |
r = r + status.getServiceName(); |
460 | 460 |
r = r + "&LayerIds="; |
461 |
r = r + status.getLayerIds().toString();
|
|
461 |
r = r + status.getLayersIdsSelected().toString();
|
|
462 | 462 |
r = r + "&Extent="; |
463 | 463 |
r = r + status.getEnvelopeRect().toString(); |
464 | 464 |
r = r + "&Format="; |
branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/utils/ArcImsFeature.java | ||
---|---|---|
1 | 1 |
package org.gvsig.remoteclient.arcims.utils; |
2 | 2 |
|
3 |
import java.util.HashMap; |
|
4 |
|
|
3 | 5 |
import org.gvsig.fmap.geom.Geometry; |
4 | 6 |
|
5 |
public class ArcImsFeature { |
|
7 |
public class ArcImsFeature extends HashMap<String, Object> { |
|
8 |
|
|
9 |
private static final long serialVersionUID = 1L; |
|
10 |
|
|
11 |
/** |
|
12 |
* |
|
13 |
*/ |
|
14 |
public ArcImsFeature() { |
|
15 |
this.put("geom", null); |
|
16 |
} |
|
6 | 17 |
|
7 |
private Geometry geom; |
|
18 |
/** |
|
19 |
* |
|
20 |
* @param geom |
|
21 |
*/ |
|
22 |
public void putGeometry(Geometry geom){ |
|
23 |
this.remove("geom"); |
|
24 |
this.put("geom",geom); |
|
25 |
} |
|
8 | 26 |
|
9 |
private Object[] attributes; |
|
27 |
/** |
|
28 |
* |
|
29 |
* @param geom |
|
30 |
*/ |
|
31 |
public Geometry getGeometry(){ |
|
32 |
|
|
33 |
return (Geometry)this.get("geom"); |
|
34 |
} |
|
10 | 35 |
|
11 |
public ArcImsFeature(Geometry geom, Object[] attributes){ |
|
12 |
this.geom = geom; |
|
13 |
this.attributes = attributes; |
|
36 |
/** |
|
37 |
* |
|
38 |
* @return |
|
39 |
*/ |
|
40 |
public boolean isValid(){ |
|
41 |
Object obj = this.get("geom"); |
|
42 |
if(obj == null){ |
|
43 |
return false; |
|
44 |
} |
|
45 |
else{ |
|
46 |
return true; |
|
47 |
} |
|
14 | 48 |
} |
15 | 49 |
|
16 |
public ArcImsFeature(Object[] attributes){ |
|
17 |
this.geom = null; |
|
18 |
this.attributes = attributes; |
|
19 |
} |
|
50 |
// /** |
|
51 |
// * |
|
52 |
// * @return |
|
53 |
// */ |
|
54 |
// public int getGeometryType(){ |
|
55 |
// Geometry geom = this.get("geom"); |
|
56 |
// if(geom != null){ |
|
57 |
// |
|
58 |
// }else{ |
|
59 |
// return |
|
60 |
// } |
|
61 |
// |
|
62 |
// } |
|
20 | 63 |
|
21 |
public Object[] getAtributtes() { |
|
22 |
return attributes; |
|
23 |
} |
|
24 |
|
|
25 |
public void setAtributtes(Object[] attributes) { |
|
26 |
this.attributes = attributes; |
|
27 |
} |
|
28 |
|
|
29 |
public Geometry getGeom() { |
|
30 |
return geom; |
|
31 |
} |
|
32 |
|
|
33 |
public void setGeom(Geometry geom) { |
|
34 |
this.geom = geom; |
|
35 |
} |
|
36 |
|
|
37 | 64 |
} |
branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/ArcImsImageClient.java | ||
---|---|---|
29 | 29 |
package org.gvsig.remoteclient.arcims; |
30 | 30 |
|
31 | 31 |
import org.gvsig.remoteclient.arcims.exceptions.ArcImsException; |
32 |
import org.gvsig.remoteclient.arcims.utils.ServiceInfoTags; |
|
32 | 33 |
import org.gvsig.remoteclient.exceptions.ServerErrorException; |
33 | 34 |
|
34 | 35 |
import java.io.File; |
... | ... | |
44 | 45 |
* |
45 | 46 |
* @param host |
46 | 47 |
* @param service |
47 |
* @param serviceType |
|
48 | 48 |
*/ |
49 |
public ArcImsImageClient(String host, String service, String serviceType) {
|
|
50 |
super(host, service, serviceType);
|
|
49 |
public ArcImsImageClient(String host, String service) { |
|
50 |
super(host, service, ServiceInfoTags.vIMAGESERVICE);
|
|
51 | 51 |
} |
52 | 52 |
|
53 | 53 |
/** |
branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/ArcImsStatus.java | ||
---|---|---|
30 | 30 |
|
31 | 31 |
import java.awt.Dimension; |
32 | 32 |
import java.awt.geom.Rectangle2D; |
33 |
import java.util.List; |
|
34 |
import java.util.Map; |
|
35 | 33 |
import java.util.Vector; |
36 | 34 |
|
37 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
38 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
39 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
40 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
|
41 | 35 |
import org.gvsig.fmap.geom.primitive.Point; |
42 | 36 |
import org.gvsig.fmap.geom.primitive.impl.Envelope2D; |
43 | 37 |
import org.gvsig.remoteclient.RemoteClientStatus; |
44 |
import org.gvsig.remoteclient.arcims.utils.FieldInformation; |
|
45 | 38 |
import org.gvsig.remoteclient.arcims.utils.ServiceInformation; |
46 |
import org.gvsig.remoteclient.arcims.utils.ServiceInformationLayerFeatures; |
|
47 | 39 |
|
48 | 40 |
/** |
49 | 41 |
* Describes the status of a ArcImsclient, so it adds to the Remote client |
... | ... | |
59 | 51 |
public class ArcImsStatus extends RemoteClientStatus implements Cloneable { |
60 | 52 |
|
61 | 53 |
private String serverURL; |
62 |
|
|
63 | 54 |
private String serviceType; |
64 |
|
|
55 |
private String serviceName; |
|
65 | 56 |
private String serverVersion; |
66 |
|
|
67 | 57 |
private String newLayerName; |
68 | 58 |
/** |
69 | 59 |
* List of layer to be retrieved by the ArcIms |
70 | 60 |
*/ |
71 |
private Vector<String> layersQuery;
|
|
61 |
private Vector<String> layersIdsSelected;
|
|
72 | 62 |
|
73 | 63 |
/** |
74 | 64 |
* List of layer styles |
... | ... | |
85 | 75 |
*/ |
86 | 76 |
private boolean transparency; |
87 | 77 |
private String onlineResource; |
88 |
private String serviceName; |
|
89 | 78 |
private Vector<Dimension> dimensions; |
90 | 79 |
private ServiceInformation serviceInfo; |
91 | 80 |
public boolean verbose; |
92 |
private List<FeatureType> layersFeatureType; |
|
93 | 81 |
|
94 | 82 |
/** |
95 | 83 |
* Constructor |
96 | 84 |
* |
97 | 85 |
*/ |
98 | 86 |
public ArcImsStatus() { |
99 |
layersQuery = new Vector<String>();
|
|
87 |
layersIdsSelected = new Vector<String>();
|
|
100 | 88 |
styles = new Vector<String>(); |
101 | 89 |
verbose = false; |
102 | 90 |
} |
... | ... | |
127 | 115 |
* |
128 | 116 |
* @return Vector, the list of layers |
129 | 117 |
*/ |
130 |
public Vector<String> getLayerIds() {
|
|
131 |
return layersQuery;
|
|
118 |
public Vector<String> getLayersIdsSelected() {
|
|
119 |
return layersIdsSelected;
|
|
132 | 120 |
} |
133 | 121 |
|
134 | 122 |
/** |
... | ... | |
137 | 125 |
* @param _layers |
138 | 126 |
* Vector, the list of layers to set |
139 | 127 |
*/ |
140 |
public void setLayerIds(Vector<String> _layers) {
|
|
141 |
layersQuery = _layers;
|
|
128 |
public void setLayersIdsSelected(Vector<String> _layers) {
|
|
129 |
layersIdsSelected = _layers;
|
|
142 | 130 |
} |
143 | 131 |
|
144 | 132 |
/** |
... | ... | |
149 | 137 |
* @param alayerName |
150 | 138 |
* name of the layer to be added. |
151 | 139 |
*/ |
152 |
public void addLayerName(String alayerName) {
|
|
153 |
layersQuery.add(alayerName);
|
|
140 |
public void addLayerIdSelected(String alayerName) {
|
|
141 |
layersIdsSelected.add(alayerName);
|
|
154 | 142 |
} |
155 | 143 |
|
156 | 144 |
/** |
... | ... | |
161 | 149 |
* @param alayerName |
162 | 150 |
* @return true if the layer name has been deleted from the list |
163 | 151 |
*/ |
164 |
public boolean removeLayerName(String alayerName) {
|
|
165 |
return layersQuery.remove(alayerName);
|
|
152 |
public boolean removeLayerIdSelected(String alayerName) {
|
|
153 |
return layersIdsSelected.remove(alayerName);
|
|
166 | 154 |
} |
167 | 155 |
|
168 | 156 |
/** |
... | ... | |
289 | 277 |
ArcImsStatus s = (ArcImsStatus) obj; |
290 | 278 |
|
291 | 279 |
// Compare layer names |
292 |
if (!(((s.getLayerIds() == null) && (this.getLayerIds() == null)) || s |
|
293 |
.getLayerIds().equals(this.getLayerIds()))) { |
|
280 |
if (!(((s.getLayersIdsSelected() == null) && (this |
|
281 |
.getLayersIdsSelected() == null)) || s.getLayersIdsSelected() |
|
282 |
.equals(this.getLayersIdsSelected()))) { |
|
294 | 283 |
return false; |
295 | 284 |
} |
296 | 285 |
|
... | ... | |
355 | 344 |
*/ |
356 | 345 |
public Object clone() { |
357 | 346 |
ArcImsStatus newObject = new ArcImsStatus(); |
358 |
Vector<String> v = this.getLayerIds();
|
|
347 |
Vector<String> v = this.getLayersIdsSelected();
|
|
359 | 348 |
|
360 | 349 |
if (v != null) { |
361 |
newObject.setLayerIds((Vector) v.clone());
|
|
350 |
newObject.setLayersIdsSelected((Vector) v.clone());
|
|
362 | 351 |
} |
363 | 352 |
|
364 | 353 |
Envelope2D enve = this.getEnvelope(); |
... | ... | |
441 | 430 |
*/ |
442 | 431 |
public void setServiceInformation(ServiceInformation si) { |
443 | 432 |
this.serviceInfo = si; |
444 |
// |
|
445 |
layersFeatureType.clear(); |
|
446 |
|
|
447 |
|
|
433 |
|
|
448 | 434 |
} |
449 | 435 |
|
450 | 436 |
/** |
... | ... | |
493 | 479 |
public String getLayerQueryString() { |
494 | 480 |
|
495 | 481 |
String lyrs = ""; |
496 |
if (layersQuery.size() > 0) {
|
|
497 |
lyrs = layersQuery.get(0);
|
|
498 |
for (int i = 1; i < layersQuery.size(); i++) {
|
|
499 |
lyrs = lyrs+","+layersQuery.get(i);
|
|
482 |
if (layersIdsSelected.size() > 0) {
|
|
483 |
lyrs = layersIdsSelected.get(0);
|
|
484 |
for (int i = 1; i < layersIdsSelected.size(); i++) {
|
|
485 |
lyrs = lyrs + "," + layersIdsSelected.get(i);
|
|
500 | 486 |
} |
501 | 487 |
} |
502 | 488 |
return lyrs; |
503 | 489 |
} |
504 |
|
|
490 |
|
|
505 | 491 |
/** |
506 | 492 |
* |
507 | 493 |
* @return |
508 | 494 |
*/ |
509 | 495 |
public void setLayerQueryString(String layers) { |
510 | 496 |
|
511 |
layersQuery.clear();
|
|
512 |
String [] lyrs = layers.split(",");
|
|
513 |
if(lyrs.length > 0){
|
|
497 |
layersIdsSelected.clear();
|
|
498 |
String[] lyrs = layers.split(","); |
|
499 |
if (lyrs.length > 0) {
|
|
514 | 500 |
for (int i = 0; i < lyrs.length; i++) { |
515 |
layersQuery.add(lyrs[i]);
|
|
501 |
layersIdsSelected.add(lyrs[i]);
|
|
516 | 502 |
} |
517 |
}
|
|
503 |
} |
|
518 | 504 |
} |
519 | 505 |
|
520 | 506 |
/** |
... | ... | |
549 | 535 |
this.serverVersion = serverVersion; |
550 | 536 |
} |
551 | 537 |
|
552 |
/** |
|
553 |
* |
|
554 |
* @return |
|
555 |
*/ |
|
556 |
public List<FeatureType> getLayersFeatureType() { |
|
557 |
return layersFeatureType; |
|
558 |
} |
|
559 | 538 |
|
560 |
/** |
|
561 |
* |
|
562 |
* @param layersFeatureType |
|
563 |
*/ |
|
564 |
public void setLayersFeatureType(List<FeatureType> layersFeatureType) { |
|
565 |
this.layersFeatureType = layersFeatureType; |
|
566 |
} |
|
567 |
|
|
568 | 539 |
|
569 |
|
|
570 | 540 |
} |
branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/ArcImsProtImageHandler.java | ||
---|---|---|
241 | 241 |
/** |
242 | 242 |
* Vector of Layers IDs to request |
243 | 243 |
*/ |
244 |
Vector<String> idLayers = status.getLayerIds();
|
|
244 |
Vector<String> idLayers = status.getLayersIdsSelected();
|
|
245 | 245 |
|
246 | 246 |
/** |
247 | 247 |
* String with the ArcXML request (GET_FEATURES) |
... | ... | |
290 | 290 |
* Now we are ready to run over the layers to request the info for every |
291 | 291 |
* one |
292 | 292 |
*/ |
293 |
Vector<String> ids = status.getLayerIds();
|
|
293 |
Vector<String> ids = status.getLayersIdsSelected();
|
|
294 | 294 |
int n = ids.size(); |
295 | 295 |
String fields; |
296 | 296 |
|
branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/ArcXMLFeatures.java | ||
---|---|---|
68 | 68 |
/** |
69 | 69 |
* The layer to retrieve |
70 | 70 |
*/ |
71 |
String layerid = (String) status.getLayerIds().get(0);
|
|
71 |
String layerid = (String) status.getLayersIdsSelected().get(0);
|
|
72 | 72 |
|
73 | 73 |
/** |
74 | 74 |
* Gets the Decimal Separator from the status.ServiceInfo |
... | ... | |
282 | 282 |
/** |
283 | 283 |
* The layer to retrieve |
284 | 284 |
*/ |
285 |
String layerid = (String) status.getLayerIds().get(0);
|
|
285 |
String layerid = (String) status.getLayersIdsSelected().get(0);
|
|
286 | 286 |
|
287 | 287 |
/** |
288 | 288 |
* Gets the ServiceInfo from the status |
... | ... | |
365 | 365 |
/** |
366 | 366 |
* The layer to retrieve |
367 | 367 |
*/ |
368 |
String layerid = (String) status.getLayerIds().get(0);
|
|
368 |
String layerid = (String) status.getLayersIdsSelected().get(0);
|
|
369 | 369 |
|
370 | 370 |
/** |
371 | 371 |
* Gets the Decimal Separator from the status.ServiceInfo |
... | ... | |
428 | 428 |
/** |
429 | 429 |
* Finally, we can retrieve the correct ArcXML |
430 | 430 |
*/ |
431 |
return getFeaturesRequest((String) status.getLayerIds().get(0), //layer to retrieve
|
|
431 |
return getFeaturesRequest((String) status.getLayersIdsSelected().get(0), //layer to retrieve
|
|
432 | 432 |
featCount, idNameA, //subfields |
433 | 433 |
status.getWhere(), //where |
434 | 434 |
"", //SRS of the service |
branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/ArcImsFeatureClient.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
import org.gvsig.remoteclient.arcims.exceptions.ArcImsException; |
35 | 35 |
import org.gvsig.remoteclient.arcims.utils.ArcImsFeature; |
36 |
import org.gvsig.remoteclient.arcims.utils.ServiceInfoTags; |
|
36 | 37 |
import org.gvsig.remoteclient.exceptions.ServerErrorException; |
37 | 38 |
|
38 | 39 |
/** |
39 | 40 |
* Class that connects with ArcIMS and retrieves a Feature Layer |
40 | 41 |
* |
41 | 42 |
* @author jsanz |
43 |
* @author vsanjaime version 2.0 |
|
42 | 44 |
* |
43 | 45 |
*/ |
44 | 46 |
public class ArcImsFeatureClient extends ArcImsClient { |
... | ... | |
47 | 49 |
* |
48 | 50 |
* @param host |
49 | 51 |
* @param service |
50 |
* @param serviceType |
|
51 | 52 |
*/ |
52 |
public ArcImsFeatureClient(String host, String service, String serviceType) { |
|
53 |
super(host, service, serviceType); |
|
53 |
public ArcImsFeatureClient(String serverURL, String serviceName) { |
|
54 |
// client to feature services |
|
55 |
super(serverURL, serviceName, ServiceInfoTags.vFEATURESERVICE); |
|
54 | 56 |
|
55 | 57 |
} |
56 | 58 |
|
... | ... | |
64 | 66 |
*/ |
65 | 67 |
public List<List<ArcImsFeature>> getMap(ArcImsVectStatus status) |
66 | 68 |
throws ArcImsException, ServerErrorException { |
69 |
// get features |
|
67 | 70 |
return ((ArcImsProtFeatureHandler) handler).getMap(status); |
68 | 71 |
} |
69 | 72 |
|
branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/ArcXMLImage.java | ||
---|---|---|
58 | 58 |
/** |
59 | 59 |
* Layers that we want to request |
60 | 60 |
*/ |
61 |
Vector<String> layers = status.getLayerIds();
|
|
61 |
Vector<String> layers = status.getLayersIdsSelected();
|
|
62 | 62 |
|
63 | 63 |
/** |
64 | 64 |
* The EPSG code that image requested will have, |
Also available in: Unified diff