Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libRemoteServices / src / org / gvsig / remoteclient / wmts / struct / WMTSTileMatrixSet.java @ 39504

History | View | Annotate | Download (3.41 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
        public void setLayerBBox(WMTSBoundingBox bbox) {
61
                if(bbox != null) {
62
                        this.bbox = bbox;
63
                        for (int i = 0; i < getTileMatrix().size(); i++) {
64
                                ((WMTSTileMatrix)getTileMatrix().get(i)).setBBoxTileMatrixSet(bbox.toRectangle2D());
65
                        }
66
                }
67
        }
68
    
69
    public abstract WMTSBoundingBox getBoundingBox();
70
    
71
        public String getWellKnownScaleSet() {
72
                return wellKnownScaleSet;
73
        }
74

    
75
        public void setWellKnownScaleSet(String wellKnownScaleSet) {
76
                this.wellKnownScaleSet = wellKnownScaleSet;
77
        }
78
        
79
        public ArrayList getTileMatrix() {
80
                if(tileMatrix == null)
81
                        tileMatrix = new ArrayList();
82
                return tileMatrix;
83
        }
84

    
85
        public String getSupportedCRS() {
86
                if(supportedCRS.compareTo("CRS:84") == 0)
87
                        supportedCRS = "EPSG:4326";
88
                return supportedCRS;
89
        }
90

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