Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libRemoteServices / src / org / gvsig / remoteclient / wmts / wmts_1_0_0 / struct / WMTSTileMatrixSet_1_0_0.java @ 37802

History | View | Annotate | Download (3.29 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.remoteclient.wmts.wmts_1_0_0.struct;
23

    
24
import java.io.IOException;
25
import java.util.ArrayList;
26

    
27
import org.gvsig.remoteclient.utils.CapabilitiesTags;
28
import org.gvsig.remoteclient.wmts.struct.WMTSBoundingBox;
29
import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrix;
30
import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrixSet;
31
import org.kxml2.io.KXmlParser;
32
import org.xmlpull.v1.XmlPullParserException;
33

    
34

    
35
/**
36
 * <p>Defines a OGC style. Theme that describes the appeareance of certain layer.</p>
37
 * @author Nacho Brodin (nachobrodin@gmail.com)
38
 */
39
public class WMTSTileMatrixSet_1_0_0 extends WMTSTileMatrixSet {
40
        
41
        public void parse(KXmlParser parser, ArrayList matrixSetList) throws IOException, XmlPullParserException {
42
            int currentTag;
43
            boolean end = false;
44
            
45
            currentTag = parser.next();
46
            
47
            while (!end) {
48
                         switch(currentTag) {
49
                                case KXmlParser.START_TAG:
50
                                        if (compareName(parser, CapabilitiesTags.WMTS_IDENTIFIER)) {
51
                                                setIdentifier(nextText(parser));
52
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_TITLE)) {
53
                                                setTitle(nextText(parser));
54
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_ABSTRACT)) {
55
                                                setAbstract(nextText(parser));
56
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_KEYWORDS)) {
57
                                                parser.skipSubTree();
58
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_BOUNDINGBOX)) {
59
                                                getBoundingBox().parse(parser);
60
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_SUPPORTEDCRS)) {
61
                                                setSupportedCRS(nextText(parser));
62
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_WELLKNOWNSCALESET)) {
63
                                                setWellKnownScaleSet(nextText(parser));
64
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_TILEMATRIX)) {
65
                                                WMTSTileMatrix tileMatrix = new WMTSTileMatrix_1_0_0();
66
                                                tileMatrix.setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder);
67
                                                tileMatrix.parse(parser, getTileMatrix()); 
68
                                        }
69
                                        break;
70
                                case KXmlParser.END_TAG:
71
                                        if (compareName(parser, CapabilitiesTags.WMTS_TILEMATRIXSET)) {
72
                                                end = true;
73
                                                matrixSetList.add(this);
74
                                        }
75
                                        break;
76
                                case KXmlParser.TEXT:                                        
77
                                break;
78
                         }
79
             if (!end)
80
                 currentTag = parser.next();
81
            }
82
    }
83
        
84
        public WMTSBoundingBox getBoundingBox() {
85
                if(bbox == null) {
86
                        bbox = new WMTSBoundingBox_1_0_0();
87
                        bbox.setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder);
88
                }
89
                return bbox;
90
        }
91
}