Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libRemoteServices / src / org / gvsig / remoteClient / kml / KmlFeaturesParser.java @ 10269

History | View | Annotate | Download (2.69 KB)

1
package org.gvsig.remoteClient.kml;
2

    
3
import java.io.IOException;
4

    
5
import org.gvsig.exceptions.BaseException;
6
import org.gvsig.remoteClient.gml.engine.AbstractFeaturesParser;
7
import org.gvsig.remoteClient.gml.engine.IFeaturesIterator;
8
import org.gvsig.remoteClient.gml.engine.readers.IReaderFile;
9
import org.gvsig.remoteClient.gml.factories.IGeometriesFactory;
10
import org.gvsig.remoteClient.kml.exceptions.KmlBodyParseException;
11
import org.xmlpull.v1.XmlPullParserException;
12

    
13
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
14
 *
15
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
16
 *
17
 * This program is free software; you can redistribute it and/or
18
 * modify it under the terms of the GNU General Public License
19
 * as published by the Free Software Foundation; either version 2
20
 * of the License, or (at your option) any later version.
21
 *
22
 * This program is distributed in the hope that it will be useful,
23
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25
 * GNU General Public License for more details.
26
 *
27
 * You should have received a copy of the GNU General Public License
28
 * along with this program; if not, write to the Free Software
29
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
30
 *
31
 * For more information, contact:
32
 *
33
 *  Generalitat Valenciana
34
 *   Conselleria d'Infraestructures i Transport
35
 *   Av. Blasco Ib??ez, 50
36
 *   46010 VALENCIA
37
 *   SPAIN
38
 *
39
 *      +34 963862235
40
 *   gvsig@gva.es
41
 *      www.gvsig.gva.es
42
 *
43
 *    or
44
 *
45
 *   IVER T.I. S.A
46
 *   Salamanca 50
47
 *   46005 Valencia
48
 *   Spain
49
 *
50
 *   +34 963163400
51
 *   dac@iver.es
52
 */
53
/* CVS MESSAGES:
54
 *
55
 * $Id: KmlFeaturesParser.java 10269 2007-02-12 13:51:08Z jorpiell $
56
 * $Log$
57
 * Revision 1.1  2007-02-12 13:49:18  jorpiell
58
 * A?adido el driver de KML
59
 *
60
 *
61
 */
62
/**
63
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
64
 */
65
public class KmlFeaturesParser extends AbstractFeaturesParser{
66
        
67
        public KmlFeaturesParser(IReaderFile reader, IGeometriesFactory gFactory)throws BaseException {
68
                super(reader, gFactory);
69
                parseHeader();
70
        }
71
        
72
        private void parseHeader()throws BaseException{
73
                try {
74
                        reader.nextTag();
75
                        String tag = reader.getName();
76
                        
77
                } catch (XmlPullParserException e) {
78
                        throw new KmlBodyParseException(e);
79
                } catch (IOException e) {
80
                        throw new KmlBodyParseException(e);
81
                }                
82
        }
83

    
84
        /*
85
         *  (non-Javadoc)
86
         * @see org.gvsig.remoteClient.gmlEngine.IFeaturesParser#getFeaturesIterator()
87
         */
88
        public IFeaturesIterator getFeaturesIterator() throws BaseException {
89
                return new KmlFeaturesIterator(getReader(),getGFactory());
90
        }
91

    
92
        /*
93
         *  (non-Javadoc)
94
         * @see org.gvsig.remoteClient.gmlEngine.IFeaturesParser#getVersion()
95
         */
96
        public String getVersion() {
97
                return "2.1";
98
        }
99

    
100
}