Statistics
| Revision:

root / trunk / libraries / libGPE-GML / src / org / gvsig / gpe / gml / writer / v2 / geometries / LineStringWriter.java @ 19366

History | View | Annotate | Download (3.21 KB)

1
package org.gvsig.gpe.gml.writer.v2.geometries;
2

    
3
import java.io.IOException;
4

    
5
import org.gvsig.gpe.gml.utils.GMLTags;
6
import org.gvsig.gpe.gml.writer.GPEGmlWriterHandlerImplementor;
7
import org.gvsig.gpe.xml.writer.IWriter;
8

    
9
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
10
 *
11
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
12
 *
13
 * This program is free software; you can redistribute it and/or
14
 * modify it under the terms of the GNU General Public License
15
 * as published by the Free Software Foundation; either version 2
16
 * of the License, or (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
26
 *
27
 * For more information, contact:
28
 *
29
 *  Generalitat Valenciana
30
 *   Conselleria d'Infraestructures i Transport
31
 *   Av. Blasco Ib??ez, 50
32
 *   46010 VALENCIA
33
 *   SPAIN
34
 *
35
 *      +34 963862235
36
 *   gvsig@gva.es
37
 *      www.gvsig.gva.es
38
 *
39
 *    or
40
 *
41
 *   IVER T.I. S.A
42
 *   Salamanca 50
43
 *   46005 Valencia
44
 *   Spain
45
 *
46
 *   +34 963163400
47
 *   dac@iver.es
48
 */
49
/* CVS MESSAGES:
50
 *
51
 * $Id: LineStringWriter.java 351 2008-01-09 13:10:48Z jpiera $
52
 * $Log$
53
 * Revision 1.6  2007/05/16 13:00:48  csanchez
54
 * Actualizaci?n de libGPE-GML
55
 *
56
 * Revision 1.5  2007/05/14 11:18:12  jorpiell
57
 * Add the ErrorHandler to all the methods
58
 *
59
 * Revision 1.4  2007/05/08 10:24:16  jorpiell
60
 * Add comments to create javadocs
61
 *
62
 * Revision 1.3  2007/04/14 16:07:30  jorpiell
63
 * The writer has been created
64
 *
65
 * Revision 1.2  2007/04/12 17:06:44  jorpiell
66
 * First GML writing tests
67
 *
68
 * Revision 1.1  2007/04/12 10:23:41  jorpiell
69
 * Add some writers and the GPEXml parser
70
 *
71
 *
72
 */
73
/**
74
 * It writes a gml:LineStringType object. Example:
75
 * <p>
76
 * <pre>
77
 * <code>
78
 * &lt;LineString&gt;
79
 * &lt;coord&gt;&lt;X&gt;56.1&lt;/X&gt;&lt;Y&gt;0.45&lt;/Y&gt;&lt;/coord&gt;
80
 * &lt;coord&gt;&lt;X&gt;67.23&lt;/X&gt;&lt;Y&gt;0.98&lt;/Y&gt;&lt;/coord&gt;
81
 * &lt;/LineString&gt;
82
 * </code>
83
 * </pre>
84
 * </p> 
85
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
86
 */
87
public class LineStringWriter extends GeometryWriter{
88
        
89
        /**
90
         * It writes a gml:lineString init tag
91
         * @param writer
92
         * Writer to write the labels
93
         * @param handler
94
         * The writer handler implementor
95
         * @param id
96
         * Geometry ID
97
         * @param x
98
         * X coordinates 
99
         * @param y
100
         * Y coordinates 
101
         * @param z
102
         * Z coordinates 
103
         * @param srs
104
         * Spatial reference system
105
         * @throws IOException
106
         */
107
        public void start(IWriter writer, GPEGmlWriterHandlerImplementor handler, String id, double[] x, double[] y,
108
                        double[] z, String srs) throws IOException{
109
                super.start(writer, handler, id, srs);
110
                handler.getProfile().getCoordinatesWriter().write(writer, handler, x, y, z);                
111
        }
112
        
113
        /*
114
         * (non-Javadoc)
115
         * @see org.gvsig.gpe.gml.writer.v2.geometries.GeometriesWriter#getGeometryName()
116
         */
117
        public String getGeometryName() {
118
                return GMLTags.GML_LINESTRING;
119
        }
120
}