Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.remoteclient / src / main / java / org / gvsig / remoteclient / wfs / schema / type / GMLGeometries.java @ 40559

History | View | Annotate | Download (6.13 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs.schema.type;
25

    
26
import java.util.Hashtable;
27

    
28
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
29
 *
30
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
31
 *
32
 * This program is free software; you can redistribute it and/or
33
 * modify it under the terms of the GNU General Public License
34
 * as published by the Free Software Foundation; either version 2
35
 * of the License, or (at your option) any later version.
36
 *
37
 * This program is distributed in the hope that it will be useful,
38
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
39
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
40
 * GNU General Public License for more details.
41
 *
42
 * You should have received a copy of the GNU General Public License
43
 * along with this program; if not, write to the Free Software
44
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
45
 *
46
 * For more information, contact:
47
 *
48
 *  Generalitat Valenciana
49
 *   Conselleria d'Infraestructures i Transport
50
 *   Av. Blasco Ib??ez, 50
51
 *   46010 VALENCIA
52
 *   SPAIN
53
 *
54
 *      +34 963862235
55
 *   gvsig@gva.es
56
 *      www.gvsig.gva.es
57
 *
58
 *    or
59
 *
60
 *   IVER T.I. S.A
61
 *   Salamanca 50
62
 *   46005 Valencia
63
 *   Spain
64
 *
65
 *   +34 963163400
66
 *   dac@iver.es
67
 */
68
/* CVS MESSAGES:
69
 *
70
 * $Id: GMLGeometries.java 9451 2006-12-22 11:25:44Z csanchez $
71
 * $Log$
72
 * Revision 1.1  2006-12-22 11:25:04  csanchez
73
 * Nuevo parser GML 2.x para gml's sin esquema
74
 *
75
 *
76
 */
77

    
78
/************************************************************
79
 * class < Geometries >                                                                                *
80
 * It contains the standard tags specified in GML 2.x                *
81
 * Also, it has functions to parse geometry tags.                        *
82
 * This class help us with the "gml" namespace.                                *
83
 *                                                                                                                         *
84
 * @author Carlos S?nchez Peri??n (sanchez_carper@gva.es)        *
85
 ************************************************************/
86
public class GMLGeometries{
87
        //It has all the drawable geometries
88
        private static Hashtable geometries = new Hashtable();
89
        //It has all the tags of GML that it specifies a feature
90
        private static Hashtable features = new Hashtable();
91
        
92
        static{
93
                //complex geometry elements
94
                geometries.put("_Geometry","");
95
                geometries.put("_GeometryCollection","");
96
                geometries.put("geometryMember","");
97
                geometries.put("pointMember","");
98
                geometries.put("lineStringMember","");
99
                geometries.put("polygonMember","");
100
                geometries.put("outerBoundaryIs","");
101
                geometries.put("innerBoundaryIs","");
102
                //primitive geometry elements
103
                geometries.put("Point","");
104
                geometries.put("LineString","");
105
                geometries.put("LinearRing","");
106
                geometries.put("Polygon","");
107
                geometries.put("Box","");
108
                //aggregate geometry elements
109
                geometries.put("MultiGeometry","");
110
                geometries.put("MultiPoint","");
111
                geometries.put("MultiLineString","");
112
                geometries.put("MultiPolygon","");
113
                //coordinate elements
114
                geometries.put("coord","");
115
                geometries.put("X","");
116
                geometries.put("Y","");
117
                geometries.put("Z","");
118
                geometries.put("coordinates","");
119
                //this attribute gives the location where an element is defined
120
                geometries.put("remoteSchema","");
121
        }
122
        static{
123
                //features
124
                features.put("_Feature","");
125
                features.put("_FeatureCollection","");
126
                features.put("featureMember","");
127
                //some basic geometric properties of features
128
                features.put("_geometryProperty","");
129
                features.put("geometryProperty","");
130
                features.put("boundedBy","");
131
                features.put("pointProperty","");
132
                features.put("polygonProperty","");
133
                features.put("lineStringProperty","");
134
                features.put("multiPointProperty","");
135
                features.put("multiLineStringProperty","");
136
                features.put("multiPolygonProperty","");
137
                features.put("multiGeometryProperty","");
138
                //common aliases for geometry properties
139
                features.put("location","");
140
                features.put("centerOf","");
141
                features.put("position","");
142
                features.put("extentOf","");
143
                features.put("coverage","");
144
                features.put("edgeOf","");
145
                features.put("centerLineOf","");
146
                features.put("multiLocation","");
147
                features.put("multiCenterOf","");
148
                features.put("multiPosition","");
149
                features.put("multiCenterLineOf","");
150
                features.put("multiEdgeOf","");
151
                features.put("multiCoverage","");
152
                features.put("multiExtentOf","");
153
                //common feature descriptors
154
                features.put("description","");
155
                features.put("name","");
156
        }
157

    
158
        private String tag;
159
        
160
        /**
161
         * Class constructor
162
         **/
163
        public GMLGeometries(String actual){
164
                this.tag = actual;
165
        }
166
        
167
        /**
168
         * It search a tag in the both of GML hashtables
169
         *         -if it isn't, then returns false.
170
         *         -else it is a GML 2.x stardard tag and return true
171
         * 
172
         * @return boolean
173
         **/
174
        public boolean isGML(){
175
                boolean ok;
176
                if (isGeometryGML()==true){
177
                        ok=true;
178
                }
179
                else if (isFeatureGML()==true){
180
                        ok=true;
181
                }
182
                else{
183
                        ok=false;
184
                }
185
                return (ok);
186
        }
187
        
188
        /**
189
         * It search a tag in the geometry hashtable
190
         *         -if it isn't, then returns false.
191
         *         -else it is a GML 2.x stardard geometry and return true
192
         * 
193
         * @return boolean
194
         **/
195
        public boolean isGeometryGML(){
196
                return (geometries.get(tag)!=null);
197
        }
198
        
199
        /**
200
         * It search a tag in the feature hashtable
201
         *         -if it isn't, then returns false.
202
         *         -else it is a GML 2.x stardard feature tag and return true
203
         * 
204
         * @return boolean
205
         **/
206
        public boolean isFeatureGML(){
207
                return (features.get(tag)!=null);
208
        }
209
}