Revision 1961 org.gvsig.raster.wmts/trunk/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/WMTSProtocolHandler1_0_0.java
WMTSProtocolHandler1_0_0.java | ||
---|---|---|
28 | 28 |
import org.gvsig.raster.wmts.ogc.impl.Tags; |
29 | 29 |
import org.gvsig.raster.wmts.ogc.impl.base.WMTSProtocolHandler; |
30 | 30 |
import org.gvsig.raster.wmts.ogc.impl.base.WMTSServerDescription; |
31 |
import org.gvsig.raster.wmts.ogc.impl.base.WMTSServiceInformation; |
|
32 | 31 |
import org.gvsig.raster.wmts.ogc.impl.base.WMTSStatusImpl; |
33 | 32 |
import org.gvsig.raster.wmts.ogc.impl.request.WMTSGetCapabilitiesRequest; |
34 | 33 |
import org.gvsig.raster.wmts.ogc.impl.request.WMTSGetFeatureInfoRequest; |
... | ... | |
48 | 47 |
*/ |
49 | 48 |
public class WMTSProtocolHandler1_0_0 extends WMTSProtocolHandler { |
50 | 49 |
private String gmlTag = Tags.WMTS_GMLTAG; |
51 |
private WMTSServerDescription serverDescription = null; |
|
52 | 50 |
|
53 | 51 |
public WMTSProtocolHandler1_0_0() { |
54 | 52 |
this.version = "1.0.0"; |
55 | 53 |
this.name = "WMS1.0.0"; |
56 |
this.serviceInfo = new WMTSServiceInformation(); |
|
54 |
//this.serviceInfo = new WMTSServiceInformation();
|
|
57 | 55 |
} |
58 | 56 |
|
59 |
/** |
|
60 |
* Sets the status object |
|
61 |
*/ |
|
62 |
public void setServerDescription(WMTSServerDescription serverDescription) { |
|
63 |
this.serverDescription = serverDescription; |
|
64 |
} |
|
65 |
|
|
66 | 57 |
public boolean parseCapabilities(File f) { |
67 | 58 |
int tag; |
68 | 59 |
EncodingXMLParser parser = null; |
69 | 60 |
parser = new EncodingXMLParser(); |
70 |
if(serverDescription != null)
|
|
71 |
serverDescription.clear();
|
|
61 |
if(getServerDescription() != null)
|
|
62 |
getServerDescription().clear();
|
|
72 | 63 |
try { |
73 | 64 |
parser.setInput(f); |
74 | 65 |
parser.nextTag(); |
... | ... | |
80 | 71 |
|
81 | 72 |
case KXmlParser.START_TAG: |
82 | 73 |
if (compareName(parser, Tags.WMTS_SERVICEID)) { |
83 |
serverDescription.getServiceIdentification().parse(parser);
|
|
74 |
getServerDescription().getServiceIdentification().parse(parser);
|
|
84 | 75 |
} else if (compareName(parser, Tags.WMTS_SERVICEPROV )) { |
85 |
serverDescription.getServiceProvider().parse(parser);
|
|
76 |
getServerDescription().getServiceProvider().parse(parser);
|
|
86 | 77 |
} else if (compareName(parser, Tags.WMTS_OPMETADATA)) { |
87 |
parser.skipSubTree();
|
|
78 |
getServerDescription().getOperationsMetadata().parse(parser);
|
|
88 | 79 |
} else if (compareName(parser, Tags.WMTS_CONTENTS )) { |
89 |
parseServiceContent(parser, serverDescription);
|
|
80 |
parseServiceContent(parser, getServerDescription());
|
|
90 | 81 |
} else if (compareName(parser, Tags.WMTS_THEMES )) { |
91 |
serverDescription.getThemes().parse(parser);
|
|
82 |
getServerDescription().getThemes().parse(parser);
|
|
92 | 83 |
} |
93 | 84 |
break; |
94 | 85 |
case KXmlParser.END_TAG: |
... | ... | |
111 | 102 |
} |
112 | 103 |
|
113 | 104 |
//Calcula las referencias a las capas dentro de los temas |
114 |
serverDescription.getThemes().calculateLayers(serverDescription.getLayerList());
|
|
105 |
getServerDescription().getThemes().calculateLayers(getServerDescription().getLayerList());
|
|
115 | 106 |
//Se calculan los temas como lista de capas |
116 |
serverDescription.getLayerListAsThemes().loadThemesWithLayerInfo(serverDescription.getLayerList(), serverDescription);
|
|
107 |
getServerDescription().getLayerListAsThemes().loadThemesWithLayerInfo(getServerDescription().getLayerList(), getServerDescription());
|
|
117 | 108 |
|
118 | 109 |
//Asocia los TileMatrixSet a los TileMatrixLimits |
119 |
for (int i = 0; i < serverDescription.getLayerList().size(); i++) {
|
|
120 |
WMTSLayerImpl layer = (WMTSLayerImpl)serverDescription.getLayerList().get(i);
|
|
121 |
layer.linkTileMatrixSets(serverDescription.getTileMatrixSet());
|
|
110 |
for (int i = 0; i < getServerDescription().getLayerList().size(); i++) {
|
|
111 |
WMTSLayerImpl layer = (WMTSLayerImpl)getServerDescription().getLayerList().get(i);
|
|
112 |
layer.linkTileMatrixSets(getServerDescription().getTileMatrixSet());
|
|
122 | 113 |
} |
123 | 114 |
return true; |
124 | 115 |
} |
... | ... | |
181 | 172 |
} |
182 | 173 |
|
183 | 174 |
public WMTSGetCapabilitiesRequest createGetCapabilitiesRequest() { |
184 |
return new WMTSGetCapabilitiesRequest1_0_0(serverDescription, this);
|
|
175 |
return new WMTSGetCapabilitiesRequest1_0_0(getServerDescription(), this);
|
|
185 | 176 |
} |
186 | 177 |
|
187 | 178 |
public WMTSGetTileRequest createGetTileRequest(WMTSStatusImpl status) { |
Also available in: Unified diff