Statistics
| Revision:

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

History | View | Annotate | Download (3.17 KB)

1 34236 nbrodin
/* 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 35469 nbrodin
    protected WMTSBoundingBox bbox                         = null;
37
    private String            supportedCRS                 = null;
38
    private String            wellKnownScaleSet            = null;
39 34257 nbrodin
    //WMTSTileMatrix
40 35469 nbrodin
    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 34236 nbrodin
    /**
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 34257 nbrodin
        public ArrayList getTileMatrix() {
72
                if(tileMatrix == null)
73
                        tileMatrix = new ArrayList();
74
                return tileMatrix;
75
        }
76 34236 nbrodin
77
        public String getSupportedCRS() {
78 38525 nbrodin
                if(supportedCRS.compareTo("CRS:84") == 0)
79
                        supportedCRS = "EPSG:4326";
80 34236 nbrodin
                return supportedCRS;
81
        }
82
83
        public void setSupportedCRS(String supportedCRS) {
84 38525 nbrodin
                if(supportedCRS.compareTo("CRS:84") == 0)
85
                        supportedCRS = "EPSG:4326";
86 34236 nbrodin
                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 34260 nbrodin
                if(bbox != null)
96
                        bbox.print();
97 34236 nbrodin
                System.out.println("supportedCRS:" + getSupportedCRS());
98
                System.out.println("wellKnownScaleSet:" + getWellKnownScaleSet());
99 34257 nbrodin
                for (int i = 0; i < tileMatrix.size(); i++) {
100
                        ((WMTSTileMatrix)tileMatrix.get(i)).print();
101
                }
102 34236 nbrodin
        }
103
}