Revision 35469
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/struct/WMTSBoundingBox.java | ||
---|---|---|
33 | 33 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
34 | 34 |
*/ |
35 | 35 |
public abstract class WMTSBoundingBox { |
36 |
private double[] lowerCorner = new double[2]; |
|
37 |
private double[] upperCorner = new double[2]; |
|
38 |
private String crs = ""; |
|
39 |
private int dimensions = 2; |
|
36 |
private double[] lowerCorner = new double[2]; |
|
37 |
private double[] upperCorner = new double[2]; |
|
38 |
private String crs = ""; |
|
39 |
private int dimensions = 2; |
|
40 |
protected boolean forceLongitudeFirstAxisOrder = false; |
|
40 | 41 |
|
41 | 42 |
/** |
43 |
* Sets longitude first in the axis order read from the capabilities file |
|
44 |
* @param force |
|
45 |
*/ |
|
46 |
public void setForceLongitudeFirstAxisOrder(boolean force) { |
|
47 |
this.forceLongitudeFirstAxisOrder = force; |
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
42 | 51 |
* Parses this service ID |
43 | 52 |
* @param parser |
44 | 53 |
* @param content |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/struct/WMTSTileMatrixSet.java | ||
---|---|---|
33 | 33 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
34 | 34 |
*/ |
35 | 35 |
public abstract class WMTSTileMatrixSet extends WMTSBaseStruct { |
36 |
protected WMTSBoundingBox bbox = null; |
|
37 |
private String supportedCRS = null; |
|
38 |
private String wellKnownScaleSet = null; |
|
36 |
protected WMTSBoundingBox bbox = null;
|
|
37 |
private String supportedCRS = null;
|
|
38 |
private String wellKnownScaleSet = null;
|
|
39 | 39 |
//WMTSTileMatrix |
40 |
protected ArrayList tileMatrix = null; |
|
41 |
|
|
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 |
|
|
42 | 51 |
/** |
43 | 52 |
* Parses this service ID |
44 | 53 |
* @param parser |
... | ... | |
86 | 95 |
for (int i = 0; i < tileMatrix.size(); i++) { |
87 | 96 |
((WMTSTileMatrix)tileMatrix.get(i)).print(); |
88 | 97 |
} |
89 |
|
|
90 | 98 |
} |
91 | 99 |
} |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/struct/WMTSTileMatrix.java | ||
---|---|---|
37 | 37 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
38 | 38 |
*/ |
39 | 39 |
public abstract class WMTSTileMatrix extends WMTSBaseStruct { |
40 |
private double scaleDenominator = 0; |
|
41 |
private double[] topLeftCorner = null; |
|
42 |
private int tileWidth = 0; |
|
43 |
private int tileHeight = 0; |
|
44 |
private long matrixWidth = 0; |
|
45 |
private long matrixHeight = 0; |
|
46 |
private static final double MTS_X_GRADO = 111319.490793274; |
|
40 |
private double scaleDenominator = 0; |
|
41 |
private double[] topLeftCorner = null; |
|
42 |
private int tileWidth = 0; |
|
43 |
private int tileHeight = 0; |
|
44 |
private long matrixWidth = 0; |
|
45 |
private long matrixHeight = 0; |
|
46 |
private static final double MTS_X_GRADO = 111319.490793274; |
|
47 |
protected boolean forceLongitudeFirstAxisOrder = false; |
|
48 |
|
|
49 |
/** |
|
50 |
* Sets longitude first in the axis order read from the capabilities file |
|
51 |
* @param force |
|
52 |
*/ |
|
53 |
public void setForceLongitudeFirstAxisOrder(boolean force) { |
|
54 |
this.forceLongitudeFirstAxisOrder = force; |
|
55 |
} |
|
47 | 56 |
|
48 | 57 |
public class Tile { |
49 | 58 |
public int wPx, hPx; |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/struct/WMTSLayer.java | ||
---|---|---|
31 | 31 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
32 | 32 |
*/ |
33 | 33 |
public abstract class WMTSLayer extends WMTSBaseStruct { |
34 |
protected WMTSBoundingBox wgs84bbox = null;
|
|
35 |
protected WMTSBoundingBox bbox = null;
|
|
34 |
protected WMTSBoundingBox wgs84bbox = null; |
|
35 |
protected WMTSBoundingBox bbox = null; |
|
36 | 36 |
//WMTSStyle |
37 |
private ArrayList style = null;
|
|
38 |
private ArrayList imageFormat = null;
|
|
39 |
private ArrayList infoFormat = null;
|
|
40 |
private WMTSDimension dimension = null;
|
|
41 |
private String metadata = null;
|
|
37 |
private ArrayList style = null; |
|
38 |
private ArrayList imageFormat = null; |
|
39 |
private ArrayList infoFormat = null; |
|
40 |
private WMTSDimension dimension = null; |
|
41 |
private String metadata = null; |
|
42 | 42 |
//WMTSTileMatrixSetLink |
43 |
private ArrayList tileMatrixSetLinkList = null; |
|
44 |
private WMTSResourceURL resourceURL = null; |
|
45 |
protected WMTSServerDescription status = null; |
|
43 |
private ArrayList tileMatrixSetLinkList = null; |
|
44 |
private WMTSResourceURL resourceURL = null; |
|
45 |
protected WMTSServerDescription status = null; |
|
46 |
protected boolean forceLongitudeFirstAxisOrder = false; |
|
46 | 47 |
|
48 |
/** |
|
49 |
* Sets longitude first in the axis order read from the capabilities file |
|
50 |
* @param force |
|
51 |
*/ |
|
52 |
public void setForceLongitudeFirstAxisOrder(boolean force) { |
|
53 |
this.forceLongitudeFirstAxisOrder = force; |
|
54 |
} |
|
55 |
|
|
47 | 56 |
public WMTSLayer(WMTSServerDescription status) { |
48 | 57 |
this.status = status; |
49 | 58 |
} |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/struct/WMTSTileMatrixSetLink.java | ||
---|---|---|
32 | 32 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
33 | 33 |
*/ |
34 | 34 |
public abstract class WMTSTileMatrixSetLink { |
35 |
private String tileMatrixSetId = null; |
|
36 |
private WMTSTileMatrixSet tileMatrixSet = null; |
|
37 |
private ArrayList tileMatrixLimits = null; |
|
35 |
private String tileMatrixSetId = null; |
|
36 |
private WMTSTileMatrixSet tileMatrixSet = null; |
|
37 |
private ArrayList tileMatrixLimits = null; |
|
38 |
protected boolean forceLongitudeFirstAxisOrder = false; |
|
38 | 39 |
|
40 |
/** |
|
41 |
* Sets longitude first in the axis order read from the capabilities file |
|
42 |
* @param force |
|
43 |
*/ |
|
44 |
public void setForceLongitudeFirstAxisOrder(boolean force) { |
|
45 |
this.forceLongitudeFirstAxisOrder = force; |
|
46 |
} |
|
47 |
|
|
39 | 48 |
/** |
40 | 49 |
* Parses this service |
41 | 50 |
* @param parser |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/wmts_1_0_0/struct/WMTSLayer_1_0_0.java | ||
---|---|---|
83 | 83 |
setMetadata(nextText(parser)); |
84 | 84 |
} else if (compareName(parser, CapabilitiesTags.WMTS_TILEMATRIXSETLINK)) { |
85 | 85 |
WMTSTileMatrixSetLink tileMatrixSetLink = new WMTSTileMatrixSetLink_1_0_0(); |
86 |
tileMatrixSetLink.set |
|
86 | 87 |
tileMatrixSetLink.parse(parser); |
87 | 88 |
getTileMatrixSetLink().add(tileMatrixSetLink); |
88 | 89 |
} else if (compareName(parser, CapabilitiesTags.WMTS_RESOURCEURL)) { |
... | ... | |
105 | 106 |
} |
106 | 107 |
|
107 | 108 |
public WMTSBoundingBox getWGS84BBox() { |
108 |
if(wgs84bbox == null) |
|
109 |
if(wgs84bbox == null) {
|
|
109 | 110 |
wgs84bbox = new WMTSBoundingBox_1_0_0(); |
111 |
wgs84bbox.setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder); |
|
112 |
} |
|
110 | 113 |
return wgs84bbox; |
111 | 114 |
} |
112 | 115 |
|
113 | 116 |
public WMTSBoundingBox getBBox() { |
114 |
if(bbox == null) |
|
117 |
if(bbox == null) {
|
|
115 | 118 |
bbox = new WMTSBoundingBox_1_0_0(); |
119 |
bbox.setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder); |
|
120 |
} |
|
116 | 121 |
return bbox; |
117 | 122 |
} |
118 | 123 |
} |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/wmts_1_0_0/struct/WMTSBoundingBox_1_0_0.java | ||
---|---|---|
36 | 36 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
37 | 37 |
*/ |
38 | 38 |
public class WMTSBoundingBox_1_0_0 extends WMTSBoundingBox { |
39 |
private boolean forceLongitudeFirstAxisOrder = false; |
|
40 | 39 |
|
41 | 40 |
/** |
42 | 41 |
* Parses a WGS84BoundingBox object |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/wmts_1_0_0/struct/WMTSTileMatrixSet_1_0_0.java | ||
---|---|---|
63 | 63 |
setWellKnownScaleSet(nextText(parser)); |
64 | 64 |
} else if (compareName(parser, CapabilitiesTags.WMTS_TILEMATRIX)) { |
65 | 65 |
WMTSTileMatrix tileMatrix = new WMTSTileMatrix_1_0_0(); |
66 |
tileMatrix.setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder); |
|
66 | 67 |
tileMatrix.parse(parser, getTileMatrix()); |
67 | 68 |
} |
68 | 69 |
break; |
... | ... | |
81 | 82 |
} |
82 | 83 |
|
83 | 84 |
public WMTSBoundingBox getBoundingBox() { |
84 |
if(bbox == null) |
|
85 |
if(bbox == null) {
|
|
85 | 86 |
bbox = new WMTSBoundingBox_1_0_0(); |
87 |
bbox.setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder); |
|
88 |
} |
|
86 | 89 |
return bbox; |
87 | 90 |
} |
88 | 91 |
} |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/wmts_1_0_0/struct/WMTSTileMatrix_1_0_0.java | ||
---|---|---|
37 | 37 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
38 | 38 |
*/ |
39 | 39 |
public class WMTSTileMatrix_1_0_0 extends WMTSTileMatrix { |
40 |
private boolean forceLongitudeFirstAxisOrder = false; |
|
41 | 40 |
|
42 | 41 |
/** |
43 | 42 |
* Parses the tile matrix |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/wmts_1_0_0/WMTSProtocolHandler1_0_0.java | ||
---|---|---|
140 | 140 |
case KXmlParser.START_TAG: |
141 | 141 |
if (compareName(parser, CapabilitiesTags.WMTS_LAYER)) { |
142 | 142 |
WMTSLayer layer = content.buildNewLayer(); |
143 |
layer.setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder); |
|
143 | 144 |
layer.parse(parser); |
144 | 145 |
} else if (compareName(parser, CapabilitiesTags.WMTS_OTHERSRC)) { |
145 | 146 |
parseOtherSource(parser); |
146 | 147 |
} else if (compareName(parser, CapabilitiesTags.WMTS_TILEMATRIXSET)) { |
147 | 148 |
WMTSTileMatrixSet mSet = (WMTSTileMatrixSet)content.createVersionObject("WMTSTileMatrixSet"); |
149 |
mSet.setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder); |
|
148 | 150 |
mSet.parse(parser, content.getTileMatrixSet()); |
149 | 151 |
} |
150 | 152 |
break; |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/WMTSClient.java | ||
---|---|---|
55 | 55 |
handler = WMTSProtocolHandlerFactory.negotiate(host); |
56 | 56 |
handler.setHost(host); |
57 | 57 |
} |
58 |
|
|
59 |
/** |
|
60 |
* Sets longitude first in the axis order |
|
61 |
* @param force |
|
62 |
*/ |
|
63 |
public void setForceLongitudeFirstAxisOrder(boolean force) { |
|
64 |
if(handler != null) { |
|
65 |
handler.setForceLongitudeFirstAxisOrder(force); |
|
66 |
} |
|
67 |
} |
|
58 | 68 |
|
59 | 69 |
public String getVersion() { |
60 | 70 |
return handler.getVersion(); |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wmts/WMTSProtocolHandler.java | ||
---|---|---|
68 | 68 |
/** |
69 | 69 |
* Encoding used to parse different xml documents. |
70 | 70 |
*/ |
71 |
protected String encoding = "UTF-8"; |
|
72 |
protected WMTSServiceInformation serviceInfo = null; |
|
73 |
private static int count = 0; |
|
71 |
protected String encoding = "UTF-8"; |
|
72 |
protected WMTSServiceInformation serviceInfo = null; |
|
73 |
private static int count = 0; |
|
74 |
final String tempDirectoryPath = System.getProperty("java.io.tmpdir")+"/tmp-andami"; |
|
75 |
protected boolean forceLongitudeFirstAxisOrder = false; |
|
74 | 76 |
|
75 |
final String tempDirectoryPath = System.getProperty("java.io.tmpdir")+"/tmp-andami"; |
|
76 |
|
|
77 | 77 |
protected abstract WMTSGetFeatureInfoRequest createGetFeatureInfoRequest(WMTSStatus status, int x, int y); |
78 | 78 |
|
79 | 79 |
protected abstract WMTSGetTileRequest createGetTileRequest(WMTSStatus status); |
80 | 80 |
|
81 | 81 |
protected abstract WMTSGetCapabilitiesRequest createGetCapabilitiesRequest(); |
82 | 82 |
|
83 |
/** |
|
84 |
* Sets longitude first in the axis order read from the capabilities file |
|
85 |
* @param force |
|
86 |
*/ |
|
87 |
public void setForceLongitudeFirstAxisOrder(boolean force) { |
|
88 |
this.forceLongitudeFirstAxisOrder = force; |
|
89 |
} |
|
90 |
|
|
83 | 91 |
//************************************************************** |
84 | 92 |
//Esto es temporal hasta que est? la cach? |
85 | 93 |
|
Also available in: Unified diff