Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libGPE-KML / src / org / gvsig / gpe / kml / reader / bindings / geometries / GeometryBinding.java @ 11573

History | View | Annotate | Download (2.4 KB)

1
package org.gvsig.gpe.kml.reader.bindings.geometries;
2

    
3
import org.gvsig.gpe.kml.GPEKmlParser;
4
import org.gvsig.gpe.kml.KmlTags;
5
import org.xmlpull.v1.XmlPullParser;
6

    
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47
/* CVS MESSAGES:
48
 *
49
 * $Id: GeometryBinding.java 11573 2007-05-11 07:06:29Z jorpiell $
50
 * $Log$
51
 * Revision 1.1  2007-05-11 07:06:29  jorpiell
52
 * Refactoring of some package names
53
 *
54
 * Revision 1.1  2007/05/08 08:22:37  jorpiell
55
 * Add comments to create javadocs
56
 *
57
 * Revision 1.1  2007/05/02 11:46:50  jorpiell
58
 * Writing tests updated
59
 *
60
 *
61
 */
62
/**
63
 * A Geometry element is an abstract element and cannot be used
64
 * directly in a KML file. It provides a placeholder object for
65
 * all derived Geometry objects.
66
 * <br>
67
 * This class parses the common parts. 
68
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
69
 * @see http://code.google.com/apis/kml/documentation/kml_tags_21.html#geometry
70
 */
71
public class GeometryBinding {
72
        
73
        /**
74
         * It returns the KML geometry id attribute value
75
         * @param parser
76
         * @param handler
77
         * @return
78
         */
79
        public static String getID(XmlPullParser parser,GPEKmlParser handler){
80
                String id = null;
81
                for (int i=0 ; i<parser.getAttributeCount() ; i++){
82
                        if (parser.getAttributeName(i).compareTo(KmlTags.GEOMETRY_ID) == 0){
83
                                id = parser.getAttributeValue(i);
84
                        }
85
                }
86
                return id;        
87
        }
88
}