Statistics
| Revision:

root / org.gvsig.gpe / library / trunk / org.gvsig.gpe / org.gvsig.gpe.prov / org.gvsig.gpe.prov.gml / src / org / gvsig / gpe / prov / gml / writer / v2 / geometries / LinearRingWriter.java @ 110

History | View | Annotate | Download (3.36 KB)

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

    
3
import java.io.IOException;
4

    
5
import org.gvsig.gpe.lib.api.writer.ICoordinateSequence;
6
import org.gvsig.gpe.prov.gml.utils.GMLTags;
7
import org.gvsig.gpe.prov.gml.writer.GPEGmlWriterHandlerImplementor;
8
import org.gvsig.xml.lib.api.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: LinearRingWriter.java 351 2008-01-09 13:10:48Z jpiera $
53
 * $Log$
54
 * Revision 1.7  2007/06/28 13:05:09  jorpiell
55
 * The Qname has been updated to the 1.5 JVM machine. The schema validation is made in the GPEWriterHandlerImplementor class
56
 *
57
 * Revision 1.6  2007/06/07 14:53:30  jorpiell
58
 * Add the schema support
59
 *
60
 * Revision 1.5  2007/05/16 09:29:12  jorpiell
61
 * The polygons has to be closed
62
 *
63
 * Revision 1.4  2007/05/14 11:18:12  jorpiell
64
 * Add the ErrorHandler to all the methods
65
 *
66
 * Revision 1.3  2007/05/08 10:24:16  jorpiell
67
 * Add comments to create javadocs
68
 *
69
 * Revision 1.2  2007/04/14 16:07:30  jorpiell
70
 * The writer has been created
71
 *
72
 * Revision 1.1  2007/04/12 10:23:41  jorpiell
73
 * Add some writers and the GPEXml parser
74
 *
75
 *
76
 */
77
/**
78
 * It writes a gml:linearRingType object. Example:
79
 * <p>
80
 * <pre>
81
 * <code>
82
 * &lt;LinearRing&gt;
83
 * &lt;coordinates&gt;0.0,0.0 100.0,0.0 50.0,100.0 0.0,0.0&lt;/coordinates&gt;
84
 * &lt;/LinearRing&gt;
85
 * </code>
86
 * </pre>
87
 * </p> 
88
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
89
 */
90
public class LinearRingWriter extends GeometryWriter {
91
        
92
        
93
        /**
94
         * It writes a gml:linearRing init tag
95
         * @param writer
96
         * Writer to write the labels
97
          * @param handler
98
         * The writer handler implementor
99
         * @param id
100
         * Geometry ID
101
         * @param coords
102
         * A coordinates sequence
103
         * @param srs
104
         * Spatial reference system
105
         * @throws IOException
106
         */
107
        public void start(IXmlStreamWriter writer, GPEGmlWriterHandlerImplementor handler, String id, 
108
                        ICoordinateSequence coords, String srs) throws IOException{
109
                super.start(writer, handler, id, srs);
110
                handler.getProfile().getCoordinatesWriter().write(writer, handler, coords);                
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_LINEARRING.getLocalPart();
119
        }
120
}