Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libRemoteServices / src / org / gvsig / remoteclient / wmts / struct / WMTSTileMatrixSet.java @ 38525

History | View | Annotate | Download (3.17 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.struct;
23

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

    
27
import org.kxml2.io.KXmlParser;
28
import org.xmlpull.v1.XmlPullParserException;
29

    
30

    
31
/**
32
 * <p>Defines a OGC style. Theme that describes the appeareance of certain layer.</p>
33
 * @author Nacho Brodin (nachobrodin@gmail.com)
34
 */
35
public abstract class WMTSTileMatrixSet extends WMTSBaseStruct {
36
    protected WMTSBoundingBox bbox                         = null;
37
    private String            supportedCRS                 = null;
38
    private String            wellKnownScaleSet            = null;
39
    //WMTSTileMatrix
40
    protected ArrayList       tileMatrix                   = null;
41
    protected boolean         forceLongitudeFirstAxisOrder = false;
42
        
43
        /**
44
         * Sets longitude first in the axis order read from the capabilities file
45
         * @param force
46
         */
47
        public void setForceLongitudeFirstAxisOrder(boolean force) {
48
                this.forceLongitudeFirstAxisOrder = force;
49
        }
50
        
51
    /**
52
     * Parses this service ID
53
     * @param parser
54
     * @param content
55
     * @throws IOException
56
     * @throws XmlPullParserException
57
     */
58
        public abstract void parse(KXmlParser parser, ArrayList list) throws IOException, XmlPullParserException; 
59
    
60
    
61
    public abstract WMTSBoundingBox getBoundingBox();
62
    
63
        public String getWellKnownScaleSet() {
64
                return wellKnownScaleSet;
65
        }
66

    
67
        public void setWellKnownScaleSet(String wellKnownScaleSet) {
68
                this.wellKnownScaleSet = wellKnownScaleSet;
69
        }
70
        
71
        public ArrayList getTileMatrix() {
72
                if(tileMatrix == null)
73
                        tileMatrix = new ArrayList();
74
                return tileMatrix;
75
        }
76

    
77
        public String getSupportedCRS() {
78
                if(supportedCRS.compareTo("CRS:84") == 0)
79
                        supportedCRS = "EPSG:4326";
80
                return supportedCRS;
81
        }
82

    
83
        public void setSupportedCRS(String supportedCRS) {
84
                if(supportedCRS.compareTo("CRS:84") == 0)
85
                        supportedCRS = "EPSG:4326";
86
                this.supportedCRS = supportedCRS;
87
        }
88
        
89
        public void parse(KXmlParser parser) throws IOException,
90
                        XmlPullParserException {
91
        }
92
        
93
        public void print() {
94
                System.out.println("*****WMTSTileMatrixSet******");
95
                if(bbox != null)
96
                        bbox.print();
97
                System.out.println("supportedCRS:" + getSupportedCRS());
98
                System.out.println("wellKnownScaleSet:" + getWellKnownScaleSet());
99
                for (int i = 0; i < tileMatrix.size(); i++) {
100
                        ((WMTSTileMatrix)tileMatrix.get(i)).print();        
101
                }
102
        }
103
}