svn-gvsig-desktop / trunk / libraries / libGPE-KML / src / org / gvsig / gpe / kml / writer / v21 / geometries / RegionWriter.java @ 21947
History | View | Annotate | Download (3.17 KB)
1 |
package org.gvsig.gpe.kml.writer.v21.geometries; |
---|---|
2 |
|
3 |
import java.io.IOException; |
4 |
|
5 |
import org.gvsig.gpe.kml.utils.KmlTags; |
6 |
import org.gvsig.gpe.kml.writer.GPEKmlWriterHandlerImplementor; |
7 |
import org.gvsig.gpe.writer.ICoordinateSequence; |
8 |
import org.gvsig.gpe.xml.stream.IXmlStreamWriter; |
9 |
|
10 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
11 |
*
|
12 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
13 |
*
|
14 |
* This program is free software; you can redistribute it and/or
|
15 |
* modify it under the terms of the GNU General Public License
|
16 |
* as published by the Free Software Foundation; either version 2
|
17 |
* of the License, or (at your option) any later version.
|
18 |
*
|
19 |
* This program is distributed in the hope that it will be useful,
|
20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
* GNU General Public License for more details.
|
23 |
*
|
24 |
* You should have received a copy of the GNU General Public License
|
25 |
* along with this program; if not, write to the Free Software
|
26 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
27 |
*
|
28 |
* For more information, contact:
|
29 |
*
|
30 |
* Generalitat Valenciana
|
31 |
* Conselleria d'Infraestructures i Transport
|
32 |
* Av. Blasco Ib??ez, 50
|
33 |
* 46010 VALENCIA
|
34 |
* SPAIN
|
35 |
*
|
36 |
* +34 963862235
|
37 |
* gvsig@gva.es
|
38 |
* www.gvsig.gva.es
|
39 |
*
|
40 |
* or
|
41 |
*
|
42 |
* IVER T.I. S.A
|
43 |
* Salamanca 50
|
44 |
* 46005 Valencia
|
45 |
* Spain
|
46 |
*
|
47 |
* +34 963163400
|
48 |
* dac@iver.es
|
49 |
*/
|
50 |
/* CVS MESSAGES:
|
51 |
*
|
52 |
* $Id: RegionWriter.java 361 2008-01-10 08:41:21Z jpiera $
|
53 |
* $Log$
|
54 |
* Revision 1.2 2007/05/16 09:30:09 jorpiell
|
55 |
* the writting methods has to have the errorHandler argument
|
56 |
*
|
57 |
* Revision 1.1 2007/05/09 08:36:23 jorpiell
|
58 |
* Add the bbox to the layer
|
59 |
*
|
60 |
*
|
61 |
*/
|
62 |
/**
|
63 |
* This class writes a Region Kml tag. Example:
|
64 |
* <p>
|
65 |
* <pre>
|
66 |
* <code>
|
67 |
* <Region>
|
68 |
* <LatLonAltBox>
|
69 |
* <north>43.374</north>
|
70 |
* <south>42.983</south>
|
71 |
* <east>-0.335</east>
|
72 |
* <west>-1.423</west>
|
73 |
* <rotation>39.37878630116985</rotation>
|
74 |
* </LatLonAltBox>
|
75 |
* </Region>
|
76 |
* </code>
|
77 |
* </pre>
|
78 |
* </p>
|
79 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
80 |
* @see http://code.google.com/apis/kml/documentation/kml_tags_21.html#region
|
81 |
*/
|
82 |
public class RegionWriter { |
83 |
|
84 |
/**
|
85 |
* It writes the Region init tag and its fields
|
86 |
* @param writer
|
87 |
* Writer to write the labels
|
88 |
* @param handler
|
89 |
* The writer handler implementor
|
90 |
* @param coords
|
91 |
* A coordinates iterator.
|
92 |
* @throws IOException
|
93 |
*/
|
94 |
public void start(IXmlStreamWriter writer, GPEKmlWriterHandlerImplementor handler, |
95 |
ICoordinateSequence coords) throws IOException{ |
96 |
writer.writeStartElement(KmlTags.REGION); |
97 |
handler.getProfile().getLatLonAltBoxWriter().start(writer, handler, coords); |
98 |
} |
99 |
|
100 |
/**
|
101 |
/**
|
102 |
* It writes the LatLonAltBox end tag and its fields
|
103 |
* @param writer
|
104 |
* Writer to write the labels
|
105 |
* @param handler
|
106 |
* The writer handler implementor
|
107 |
* @throws IOException
|
108 |
*/
|
109 |
public void end(IXmlStreamWriter writer, GPEKmlWriterHandlerImplementor handler) throws IOException{ |
110 |
handler.getProfile().getLatLonAltBoxWriter().end(writer, handler); |
111 |
writer.writeEndElement(); |
112 |
} |
113 |
} |