svn-gvsig-desktop / trunk / libraries / libRaster / src / org / gvsig / raster / dataset / serializer / GeoPointRmfSerializer.java @ 12522
History | View | Annotate | Download (16 KB)
1 | 12392 | nacho | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
|
||
4 | *
|
||
5 | * This program is free software; you can redistribute it and/or
|
||
6 | * modify it under the terms of the GNU General Public License
|
||
7 | * as published by the Free Software Foundation; either version 2
|
||
8 | * of the License, or (at your option) any later version.
|
||
9 | *
|
||
10 | * This program is distributed in the hope that it will be useful,
|
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | * GNU General Public License for more details.
|
||
14 | *
|
||
15 | * You should have received a copy of the GNU General Public License
|
||
16 | * along with this program; if not, write to the Free Software
|
||
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
18 | */
|
||
19 | package org.gvsig.raster.dataset.serializer; |
||
20 | |||
21 | 12522 | nacho | import java.awt.geom.AffineTransform; |
22 | import java.awt.geom.Point2D; |
||
23 | 12392 | nacho | import java.io.IOException; |
24 | import java.io.Reader; |
||
25 | import java.io.StringReader; |
||
26 | import java.util.ArrayList; |
||
27 | |||
28 | import org.gvsig.raster.dataset.io.rmf.ClassSerializer; |
||
29 | import org.gvsig.raster.dataset.io.rmf.ParsingException; |
||
30 | 12522 | nacho | import org.gvsig.raster.datastruct.Extent; |
31 | 12392 | nacho | import org.gvsig.raster.datastruct.GeoPoint; |
32 | 12522 | nacho | import org.gvsig.raster.datastruct.ViewPortData; |
33 | 12392 | nacho | import org.kxml2.io.KXmlParser; |
34 | import org.xmlpull.v1.XmlPullParserException; |
||
35 | |||
36 | /**
|
||
37 | * <P>
|
||
38 | * Clase para convertir a XML la informaci?n de una lista de puntos de control y obtener esta informaci?n desde XML.
|
||
39 | * Esta clase implementa el interfaz IRmfBlock con los m?todos de escritura y
|
||
40 | * lectura. Estos ser?n utilizados por el gestor de ficheros RMF para escribir y
|
||
41 | * leer datos.
|
||
42 | * </P>
|
||
43 | * <P>
|
||
44 | * La estructura XML es la siguiente:
|
||
45 | * </P>
|
||
46 | * <P>
|
||
47 | * \<GeoPoint n="0"\><BR>
|
||
48 | * \<PixelX\>17.85306122448992\</PixelX\><BR>
|
||
49 | * \<PixelY\>15.632653061225255\</PixelY\><BR>
|
||
50 | * \<MapX\>4.62857142857149\</MapX\><BR>
|
||
51 | * \<MapY\>1945.74693877551\</MapY\><BR>
|
||
52 | * \<Active\>true\</Active\><BR>
|
||
53 | * \<LeftCenterPoint\><BR>
|
||
54 | * \<X\>5.104234119122292\</X\><BR>
|
||
55 | * \<Y\>1945.2980070494339\</Y\><BR>
|
||
56 | * \</LeftCenterPoint\><BR>
|
||
57 | * \<RightCenterPoint\><BR>
|
||
58 | * \<X\>4.62857142857149\</X\><BR>
|
||
59 | * \<Y\>1945.74693877551\</Y\><BR>
|
||
60 | * \</RightCenterPoint\><BR>
|
||
61 | * \<LeftViewPort\><BR>
|
||
62 | * \<Proj\>EPSG:23030\</Proj\><BR>
|
||
63 | * \<Bbox\><BR>
|
||
64 | * \<Px\>-244.94276588087763\</Px\><BR>
|
||
65 | * \<Py\>1782.9341499065767\</Py\><BR>
|
||
66 | * \<WCWidth\>500.094\</WCWidth\><BR>
|
||
67 | * \<WCHeight\>324.7277142857142\</WCHeight\><BR>
|
||
68 | * \</Bbox\><BR>
|
||
69 | * \<Pdim\><BR>
|
||
70 | * \<Width\>140\</Width\><BR>
|
||
71 | * \<Height\>140</Height\><BR>
|
||
72 | * \</Pdim\><BR>
|
||
73 | * \<Zoom\>1.0\</Zoom\><BR>
|
||
74 | * \</LeftViewPort\><BR>
|
||
75 | * \<RightViewPort\><BR>
|
||
76 | * \<Proj\>EPSG:23030\</Proj\><BR>
|
||
77 | * \<Bbox\><BR>
|
||
78 | * \<Px\>-245.41842857142848\</Px\><BR>
|
||
79 | * \<Py\>1783.3830816326529\</Py\><BR>
|
||
80 | * \<WCWidth\>500.09399999999994\</WCWidth\><BR>
|
||
81 | * \<WCHeight\>324.72771428571446\</WCHeight\><BR>
|
||
82 | * \</Bbox\><BR>
|
||
83 | * \<Pdim\><BR>
|
||
84 | * \<Width\>140\</Width\><BR>
|
||
85 | * \<Height\>140\</Height\><BR>
|
||
86 | * \</Pdim\><BR>
|
||
87 | * \<Zoom\>1.0\</Zoom\><BR>
|
||
88 | * \</RightViewPort\><BR>
|
||
89 | * \</GeoPoint\><BR>
|
||
90 | * </P>
|
||
91 | *
|
||
92 | * @version 23/04/2007
|
||
93 | * @author Nacho Brodin (nachobrodin@gmail.com)
|
||
94 | *
|
||
95 | */
|
||
96 | public class GeoPointRmfSerializer extends ClassSerializer { |
||
97 | |||
98 | //TAGS
|
||
99 | public static final String MAIN_TAG = "GeoPoints"; |
||
100 | public static final String GEOPOINT = "GeoPoint"; |
||
101 | public static final String PIXELX = "PixelX"; |
||
102 | public static final String PIXELY = "PixelY"; |
||
103 | public static final String MAPX = "MapX"; |
||
104 | public static final String MAPY = "MapY"; |
||
105 | public static final String ACTIVE = "Active"; |
||
106 | public static final String LEFTCP = "LeftCenterPoint"; |
||
107 | public static final String RIGHTCP = "RightCenterPoint"; |
||
108 | public static final String X = "X"; |
||
109 | public static final String Y = "Y"; |
||
110 | public static final String LEFTVP = "LeftViewPort"; |
||
111 | public static final String RIGHTVP = "RightViewPort"; |
||
112 | public static final String PROJ = "Proj"; |
||
113 | public static final String BBOX = "Bbox"; |
||
114 | public static final String PX = "Px"; |
||
115 | public static final String PY = "Py"; |
||
116 | public static final String WCWIDTH = "WCWidth"; |
||
117 | public static final String WCHEIGHT = "WCHeight"; |
||
118 | public static final String PDIM = "Pdim"; |
||
119 | public static final String WIDTH = "Width"; |
||
120 | public static final String HEIGHT = "Height"; |
||
121 | public static final String ZOOM = "Zoom"; |
||
122 | |||
123 | private GeoPoint[] gpList = null; |
||
124 | |||
125 | /**
|
||
126 | * Constructor. Asigna la tabla a serializar.
|
||
127 | * @param ColorTable tabla a convertir en XML
|
||
128 | */
|
||
129 | public GeoPointRmfSerializer(GeoPoint[] gp) { |
||
130 | this.gpList = gp;
|
||
131 | } |
||
132 | |||
133 | /**
|
||
134 | * Constructor.
|
||
135 | */
|
||
136 | public GeoPointRmfSerializer() {
|
||
137 | } |
||
138 | |||
139 | 12522 | nacho | /**
|
140 | * Parsea un bloque correspondiente a un punto central
|
||
141 | * @param gp
|
||
142 | * @param parser
|
||
143 | * @param parseableTag
|
||
144 | * @throws NumberFormatException
|
||
145 | * @throws XmlPullParserException
|
||
146 | * @throws IOException
|
||
147 | */
|
||
148 | private void parserCenterPoint(GeoPoint gp, KXmlParser parser, String parseableTag) throws NumberFormatException, XmlPullParserException, IOException { |
||
149 | boolean end = false; |
||
150 | boolean tagOk = false; |
||
151 | int tag = parser.next();
|
||
152 | while (!end) {
|
||
153 | switch(tag) {
|
||
154 | case KXmlParser.START_TAG:
|
||
155 | if(parser.getName() != null){ |
||
156 | if (parser.getName().compareTo(parseableTag) == 0) |
||
157 | tagOk = true;
|
||
158 | } |
||
159 | break;
|
||
160 | case KXmlParser.END_TAG:
|
||
161 | if (parser.getName().compareTo(parseableTag) == 0) |
||
162 | end = true;
|
||
163 | break;
|
||
164 | case KXmlParser.TEXT:
|
||
165 | if(tagOk) {
|
||
166 | if(parseableTag.compareTo("LeftCenterPoint") == 0) { |
||
167 | double x = Double.valueOf(parserString(parser, X, null)).doubleValue(); |
||
168 | double y = Double.valueOf(parserString(parser, Y, null)).doubleValue(); |
||
169 | gp.leftCenterPoint = new Point2D.Double(x, y); |
||
170 | } |
||
171 | if(parseableTag.compareTo("RightCenterPoint") == 0) { |
||
172 | double x = Double.valueOf(parserString(parser, X, null)).doubleValue(); |
||
173 | double y = Double.valueOf(parserString(parser, Y, null)).doubleValue(); |
||
174 | gp.rightCenterPoint = new Point2D.Double(x, y); |
||
175 | } |
||
176 | tagOk = false;
|
||
177 | } |
||
178 | break;
|
||
179 | } |
||
180 | if (!end)
|
||
181 | tag = parser.next(); |
||
182 | } |
||
183 | 12392 | nacho | } |
184 | |||
185 | 12522 | nacho | /**
|
186 | * Parsea un bloque correspondiente a un punto central
|
||
187 | * @param gp
|
||
188 | * @param parser
|
||
189 | * @param parseableTag
|
||
190 | * @throws NumberFormatException
|
||
191 | * @throws XmlPullParserException
|
||
192 | * @throws IOException
|
||
193 | */
|
||
194 | private void parserBoundingBox(GeoPoint gp, KXmlParser parser, String parseableTag) throws NumberFormatException, XmlPullParserException, IOException { |
||
195 | boolean end = false; |
||
196 | boolean tagOk = false; |
||
197 | int tag = parser.next();
|
||
198 | while (!end) {
|
||
199 | switch(tag) {
|
||
200 | case KXmlParser.START_TAG:
|
||
201 | if(parser.getName() != null){ |
||
202 | if (parser.getName().compareTo(BBOX) == 0) |
||
203 | tagOk = true;
|
||
204 | } |
||
205 | break;
|
||
206 | case KXmlParser.END_TAG:
|
||
207 | if (parser.getName().compareTo(BBOX) == 0) |
||
208 | end = true;
|
||
209 | break;
|
||
210 | case KXmlParser.TEXT:
|
||
211 | if(tagOk) {
|
||
212 | if(parseableTag.compareTo("LeftViewPort") == 0) { |
||
213 | double x = Double.valueOf(parserString(parser, PX, null)).doubleValue(); |
||
214 | double y = Double.valueOf(parserString(parser, PY, null)).doubleValue(); |
||
215 | double w = Double.valueOf(parserString(parser, WCWIDTH, null)).doubleValue(); |
||
216 | double h = Double.valueOf(parserString(parser, WCHEIGHT, null)).doubleValue(); |
||
217 | gp.leftViewPort.setExtent(new Extent(x, y, x + w, y - h));
|
||
218 | } |
||
219 | if(parseableTag.compareTo("RightViewPort") == 0) { |
||
220 | double x = Double.valueOf(parserString(parser, PX, null)).doubleValue(); |
||
221 | double y = Double.valueOf(parserString(parser, PY, null)).doubleValue(); |
||
222 | double w = Double.valueOf(parserString(parser, WCWIDTH, null)).doubleValue(); |
||
223 | double h = Double.valueOf(parserString(parser, WCHEIGHT, null)).doubleValue(); |
||
224 | gp.rightViewPort.setExtent(new Extent(x, y, x + w, y - h));
|
||
225 | } |
||
226 | tagOk = false;
|
||
227 | } |
||
228 | break;
|
||
229 | } |
||
230 | if (!end)
|
||
231 | tag = parser.next(); |
||
232 | } |
||
233 | 12392 | nacho | } |
234 | |||
235 | 12522 | nacho | /**
|
236 | * Parsea un bloque correspondiente a un punto central
|
||
237 | * @param gp
|
||
238 | * @param parser
|
||
239 | * @param parseableTag
|
||
240 | * @throws NumberFormatException
|
||
241 | * @throws XmlPullParserException
|
||
242 | * @throws IOException
|
||
243 | */
|
||
244 | private void parserDimension(GeoPoint gp, KXmlParser parser, String parseableTag) throws NumberFormatException, XmlPullParserException, IOException { |
||
245 | boolean end = false; |
||
246 | boolean tagOk = false; |
||
247 | int tag = parser.next();
|
||
248 | while (!end) {
|
||
249 | switch(tag) {
|
||
250 | case KXmlParser.START_TAG:
|
||
251 | if(parser.getName() != null){ |
||
252 | if (parser.getName().compareTo(PDIM) == 0) |
||
253 | tagOk = true;
|
||
254 | } |
||
255 | break;
|
||
256 | case KXmlParser.END_TAG:
|
||
257 | if (parser.getName().compareTo(PDIM) == 0) |
||
258 | end = true;
|
||
259 | break;
|
||
260 | case KXmlParser.TEXT:
|
||
261 | if(tagOk) {
|
||
262 | if(parseableTag.compareTo("LeftViewPort") == 0) { |
||
263 | double x = Double.valueOf(parserString(parser, WIDTH, null)).doubleValue(); |
||
264 | double y = Double.valueOf(parserString(parser, HEIGHT, null)).doubleValue(); |
||
265 | //gp.leftViewPort.setSize(x, y);
|
||
266 | } |
||
267 | if(parseableTag.compareTo("RightViewPort") == 0) { |
||
268 | double x = Double.valueOf(parserString(parser, WIDTH, null)).doubleValue(); |
||
269 | double y = Double.valueOf(parserString(parser, HEIGHT, null)).doubleValue(); |
||
270 | //gp.rightViewPort.setSize(x, y);
|
||
271 | } |
||
272 | tagOk = false;
|
||
273 | } |
||
274 | break;
|
||
275 | } |
||
276 | if (!end)
|
||
277 | tag = parser.next(); |
||
278 | } |
||
279 | } |
||
280 | |||
281 | /**
|
||
282 | * Parsea un viewport contenido en un punto de control
|
||
283 | * @param gp
|
||
284 | * @param parser
|
||
285 | * @param parseableTag
|
||
286 | * @throws XmlPullParserException
|
||
287 | * @throws IOException
|
||
288 | */
|
||
289 | private void parserViewPort(GeoPoint gp, KXmlParser parser, String parseableTag) throws XmlPullParserException, IOException { |
||
290 | boolean end = false; |
||
291 | if(parseableTag.compareTo("LeftViewPort") == 0) { |
||
292 | gp.leftViewPort = new ViewPortData();
|
||
293 | gp.leftViewPort.mat = new AffineTransform(); |
||
294 | } |
||
295 | if(parseableTag.compareTo("RightViewPort") == 0) { |
||
296 | gp.rightViewPort = new ViewPortData();
|
||
297 | gp.rightViewPort.mat = new AffineTransform(); |
||
298 | } |
||
299 | int tag = parser.next();
|
||
300 | while (!end) {
|
||
301 | switch(tag) {
|
||
302 | case KXmlParser.START_TAG:
|
||
303 | if(parser.getName() != null){ |
||
304 | if (parser.getName().compareTo(parseableTag) == 0) { |
||
305 | String proj = parserString(parser, PROJ, null); |
||
306 | parserBoundingBox(gp, parser, parseableTag); |
||
307 | parserDimension(gp, parser, parseableTag); |
||
308 | if(parseableTag.compareTo("LeftViewPort") == 0) |
||
309 | gp.zoomLeft = Double.valueOf(parserString(parser, ZOOM, null)).doubleValue(); |
||
310 | if(parseableTag.compareTo("RightViewPort") == 0) |
||
311 | gp.zoomRight = Double.valueOf(parserString(parser, ZOOM, null)).doubleValue(); |
||
312 | } |
||
313 | } |
||
314 | break;
|
||
315 | case KXmlParser.END_TAG:
|
||
316 | if (parser.getName().compareTo(parseableTag) == 0) |
||
317 | end = true;
|
||
318 | break;
|
||
319 | case KXmlParser.TEXT:
|
||
320 | break;
|
||
321 | } |
||
322 | if (!end)
|
||
323 | tag = parser.next(); |
||
324 | } |
||
325 | } |
||
326 | |||
327 | /**
|
||
328 | * Parsea un punto de control completo
|
||
329 | * @param gp
|
||
330 | * @param parser
|
||
331 | * @param xml
|
||
332 | * @param tag
|
||
333 | * @throws XmlPullParserException
|
||
334 | * @throws IOException
|
||
335 | */
|
||
336 | public void parserGeoPoint(GeoPoint gp, KXmlParser parser, String xml, int tag) throws XmlPullParserException, IOException { |
||
337 | double px = Double.parseDouble(parserString(parser, PIXELX, null)); |
||
338 | double py = Double.parseDouble(parserString(parser, PIXELY, null)); |
||
339 | gp.pixelPoint = new Point2D.Double(px, py); |
||
340 | double mx = Double.parseDouble(parserString(parser, MAPX, null)); |
||
341 | double my = Double.parseDouble(parserString(parser, MAPY, null)); |
||
342 | gp.mapPoint = new Point2D.Double(mx, my); |
||
343 | gp.active = Boolean.valueOf(parserString(parser, ACTIVE, null)).booleanValue(); |
||
344 | parserCenterPoint(gp, parser, "LeftCenterPoint");
|
||
345 | parserCenterPoint(gp, parser, "RightCenterPoint");
|
||
346 | parserViewPort(gp, parser, "LeftViewPort");
|
||
347 | parserViewPort(gp, parser, "RightViewPort");
|
||
348 | } |
||
349 | |||
350 | 12392 | nacho | /*
|
351 | * (non-Javadoc)
|
||
352 | * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#read(java.lang.String)
|
||
353 | */
|
||
354 | public void read(String xml) throws ParsingException { |
||
355 | ArrayList list = new ArrayList(); |
||
356 | 12522 | nacho | GeoPoint gp = null;
|
357 | boolean init = false; |
||
358 | int nPoint = -1; |
||
359 | boolean tagOk = false; |
||
360 | 12392 | nacho | |
361 | KXmlParser parser = new KXmlParser();
|
||
362 | Reader reader = new StringReader(xml); |
||
363 | try {
|
||
364 | parser.setInput(reader); |
||
365 | } catch (XmlPullParserException e) {
|
||
366 | throw new ParsingException(xml); |
||
367 | } |
||
368 | try {
|
||
369 | int tag = parser.nextTag();
|
||
370 | |||
371 | if ( parser.getEventType() != KXmlParser.END_DOCUMENT ){
|
||
372 | parser.require(KXmlParser.START_TAG, null, MAIN_TAG);
|
||
373 | while(tag != KXmlParser.END_DOCUMENT) {
|
||
374 | switch(tag) {
|
||
375 | case KXmlParser.START_TAG:
|
||
376 | 12522 | nacho | if (parser.getName().compareTo(MAIN_TAG) == 0) |
377 | init = true;
|
||
378 | if(init) {
|
||
379 | if (parser.getName().compareTo(GEOPOINT) == 0) { |
||
380 | gp = new GeoPoint();
|
||
381 | tagOk = true;
|
||
382 | nPoint++; |
||
383 | } |
||
384 | 12392 | nacho | } |
385 | break;
|
||
386 | case KXmlParser.END_TAG:
|
||
387 | break;
|
||
388 | 12522 | nacho | case KXmlParser.TEXT:
|
389 | if(tagOk) {
|
||
390 | parserGeoPoint(gp, parser, xml,tag); |
||
391 | tagOk = false;
|
||
392 | list.add(gp); |
||
393 | } |
||
394 | 12392 | nacho | break;
|
395 | } |
||
396 | tag = parser.next(); |
||
397 | } |
||
398 | parser.require(KXmlParser.END_DOCUMENT, null, null); |
||
399 | } |
||
400 | |||
401 | } catch (XmlPullParserException e) {
|
||
402 | throw new ParsingException(xml); |
||
403 | } catch (IOException e) { |
||
404 | throw new ParsingException(xml); |
||
405 | } |
||
406 | |||
407 | gpList = new GeoPoint[list.size()];
|
||
408 | 12522 | nacho | for (int i = 0; i < list.size(); i++) |
409 | 12392 | nacho | gpList[i] = (GeoPoint)list.get(i); |
410 | 12522 | nacho | |
411 | 12392 | nacho | } |
412 | |||
413 | /*
|
||
414 | * (non-Javadoc)
|
||
415 | * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#write()
|
||
416 | */
|
||
417 | public String write() { |
||
418 | StringBuffer b = new StringBuffer(); |
||
419 | |||
420 | b.append("<" + MAIN_TAG + ">\n"); |
||
421 | for (int i = 0; i < gpList.length; i++) { |
||
422 | 12522 | nacho | b.append("\t<" + GEOPOINT + " n=\"" + i + "\">\n"); |
423 | 12392 | nacho | putProperty(b, PIXELX, gpList[i].pixelPoint.getX(), 2);
|
424 | putProperty(b, PIXELY, gpList[i].pixelPoint.getY(), 2);
|
||
425 | putProperty(b, MAPX, gpList[i].mapPoint.getX(), 2);
|
||
426 | putProperty(b, MAPY, gpList[i].mapPoint.getY(), 2);
|
||
427 | putProperty(b, ACTIVE, String.valueOf(gpList[i].active), 2); |
||
428 | |||
429 | b.append("\t\t<" + LEFTCP + ">\n"); |
||
430 | putProperty(b, X, gpList[i].leftCenterPoint.getX(), 3);
|
||
431 | putProperty(b, Y, gpList[i].leftCenterPoint.getY(), 3);
|
||
432 | b.append("\t\t</" + LEFTCP + ">\n"); |
||
433 | |||
434 | b.append("\t\t<" + RIGHTCP + ">\n"); |
||
435 | putProperty(b, X, gpList[i].rightCenterPoint.getX(), 3);
|
||
436 | putProperty(b, Y, gpList[i].rightCenterPoint.getY(), 3);
|
||
437 | b.append("\t\t</" + RIGHTCP + ">\n"); |
||
438 | |||
439 | b.append("\t\t<" + LEFTVP + ">\n"); |
||
440 | |||
441 | 12522 | nacho | String proj = ""; |
442 | 12511 | nacho | if(gpList[i].leftViewPort.getProjection() != null) |
443 | 12522 | nacho | proj = gpList[i].leftViewPort.getProjection().getAbrev(); |
444 | putProperty(b, PROJ, proj, 3);
|
||
445 | 12392 | nacho | b.append("\t\t\t<" + BBOX + ">\n"); |
446 | putProperty(b, PX, gpList[i].leftViewPort.getExtent().getMin().getX(), 4);
|
||
447 | putProperty(b, PY, gpList[i].leftViewPort.getExtent().getMax().getY(), 4);
|
||
448 | putProperty(b, WCWIDTH, gpList[i].leftViewPort.getExtent().width(), 4);
|
||
449 | putProperty(b, WCHEIGHT, gpList[i].leftViewPort.getExtent().height(), 4);
|
||
450 | b.append("\t\t\t</" + BBOX + ">\n"); |
||
451 | |||
452 | b.append("\t\t\t<" + PDIM + ">\n"); |
||
453 | putProperty(b, WIDTH, GeoPoint.WIDTH_WINDOW, 4);
|
||
454 | putProperty(b, HEIGHT, GeoPoint.HEIGHT_WINDOW, 4);
|
||
455 | 12522 | nacho | b.append("\t\t\t</" + PDIM + ">\n"); |
456 | putProperty(b, ZOOM, gpList[i].zoomLeft, 3);
|
||
457 | 12392 | nacho | |
458 | b.append("\t\t</" + LEFTVP + ">\n"); |
||
459 | |||
460 | b.append("\t\t<" + RIGHTVP + ">\n"); |
||
461 | |||
462 | 12522 | nacho | proj = "";
|
463 | 12511 | nacho | if(gpList[i].rightViewPort.getProjection() != null) |
464 | 12522 | nacho | proj = gpList[i].rightViewPort.getProjection().getAbrev(); |
465 | putProperty(b, PROJ, proj, 3);
|
||
466 | 12392 | nacho | b.append("\t\t\t<" + BBOX + ">\n"); |
467 | putProperty(b, PX, gpList[i].rightViewPort.getExtent().getMin().getX(), 4);
|
||
468 | putProperty(b, PY, gpList[i].rightViewPort.getExtent().getMax().getY(), 4);
|
||
469 | putProperty(b, WCWIDTH, gpList[i].rightViewPort.getExtent().width(), 4);
|
||
470 | putProperty(b, WCHEIGHT, gpList[i].rightViewPort.getExtent().height(), 4);
|
||
471 | b.append("\t\t\t</" + BBOX + ">\n"); |
||
472 | |||
473 | b.append("\t\t\t<" + PDIM + ">\n"); |
||
474 | putProperty(b, WIDTH, GeoPoint.WIDTH_WINDOW, 4);
|
||
475 | putProperty(b, HEIGHT, GeoPoint.HEIGHT_WINDOW, 4);
|
||
476 | 12522 | nacho | b.append("\t\t\t</" + PDIM + ">\n"); |
477 | putProperty(b, ZOOM, gpList[i].zoomRight, 3);
|
||
478 | 12392 | nacho | |
479 | b.append("\t\t</" + RIGHTVP + ">\n"); |
||
480 | |||
481 | 12511 | nacho | b.append("\t</" + GEOPOINT + ">\n"); |
482 | 12392 | nacho | } |
483 | 12511 | nacho | b.append("</" + MAIN_TAG + ">\n"); |
484 | 12392 | nacho | return b.toString();
|
485 | } |
||
486 | |||
487 | /*
|
||
488 | * (non-Javadoc)
|
||
489 | * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#getResult()
|
||
490 | */
|
||
491 | public Object getResult() { |
||
492 | return gpList;
|
||
493 | } |
||
494 | |||
495 | /*
|
||
496 | * (non-Javadoc)
|
||
497 | * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#getMainTag()
|
||
498 | */
|
||
499 | public String getMainTag() { |
||
500 | return MAIN_TAG;
|
||
501 | } |
||
502 | } |