Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.remoteclient / src / main / java / org / gvsig / remoteclient / wms / wms_1_3_0 / request / WMSGetMapRequest1_1_3.java @ 40769

History | View | Annotate | Download (3.17 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24

    
25
package org.gvsig.remoteclient.wms.wms_1_3_0.request;
26

    
27
import java.util.Vector;
28

    
29
import org.gvsig.remoteclient.utils.CapabilitiesTags;
30
import org.gvsig.remoteclient.utils.Utilities;
31
import org.gvsig.remoteclient.wms.WMSProtocolHandler;
32
import org.gvsig.remoteclient.wms.WMSStatus;
33
import org.gvsig.remoteclient.wms.wms_1_1_0.request.WMSGetMapRequest1_1_0;
34

    
35
/**
36
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
37
 */
38
public class WMSGetMapRequest1_1_3 extends WMSGetMapRequest1_1_0{
39

    
40
        public WMSGetMapRequest1_1_3(WMSStatus status,
41
                        WMSProtocolHandler protocolHandler) {
42
                super(status, protocolHandler);                
43
        }
44

    
45
        /*
46
         * (non-Javadoc)
47
         * @see org.gvsig.remoteclient.wms.request.WMSRequest#getPartialQuery(org.gvsig.remoteclient.wms.WMSStatus)
48
         */
49
        protected String getPartialQuery(WMSStatus status){
50
                
51
                double coord1 = status.getExtent().getMinX();
52
                double coord2 = status.getExtent().getMinY();
53
                double coord3 = status.getExtent().getMaxX();
54
                double coord4 = status.getExtent().getMaxY();
55
                
56
                //Cambio de coordenadas para coordenadas no proyectadas establecido en la v1.3.0 del protocolo WMS
57
                if(!status.isProjected() && !status.getSrs().equals("CRS:84")) {
58
                        coord1 = status.getExtent().getMinY();
59
                        coord2 = status.getExtent().getMinX();
60
                        coord3 = status.getExtent().getMaxY();
61
                        coord4 = status.getExtent().getMaxX();
62
                }
63
                
64
                StringBuffer req = new StringBuffer();
65
                req.append("LAYERS=" + Utilities.Vector2CS(status.getLayerNames()))
66
                .append("&CRS=" + status.getSrs())
67
                .append("&BBOX=" + coord1 + "," )
68
                .append(coord2 + ",")
69
                .append(coord3 + ",")
70
                .append(coord4)
71
                .append("&WIDTH=" + status.getWidth())
72
                .append("&HEIGHT=" + status.getHeight())
73
                .append("&FORMAT=" + status.getFormat())
74
                .append("&STYLES=");
75
                Vector v = status.getStyles();
76
                if (v!=null && v.size()>0)
77
                        req.append(Utilities.Vector2CS(v));
78
                v = status.getDimensions();
79
                if (v!=null && v.size()>0)
80
                        req.append("&" + Utilities.Vector2URLParamString(v));
81
                if (status.getTransparency()) {
82
                        req.append("&TRANSPARENT=TRUE");
83
                }
84
                return req.toString();
85
        }
86

    
87
        /* (non-Javadoc)
88
         * @see org.gvsig.remoteclient.wms.wms_1_1_0.request.WMSGetMapRequest1_1_0#getExceptionsFormat()
89
         */
90
        protected String getExceptionsFormat() {
91
                return CapabilitiesTags.EXCEPTIONS_1_3_0;
92
        }
93
        
94
        
95

    
96
}
97