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 @ 40769

History | View | Annotate | Download (4.75 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

    
29
/************************************************************
30
 * class < Geometries >                                                                                *
31
 * It contains the standard tags specified in GML 2.x                *
32
 * Also, it has functions to parse geometry tags.                        *
33
 * This class help us with the "gml" namespace.                                *
34
 *                                                                                                                         *
35
 * @author Carlos S?nchez Peri??n (sanchez_carper@gva.es)        *
36
 ************************************************************/
37
public class GMLGeometries{
38
        //It has all the drawable geometries
39
        private static Hashtable geometries = new Hashtable();
40
        //It has all the tags of GML that it specifies a feature
41
        private static Hashtable features = new Hashtable();
42
        
43
        static{
44
                //complex geometry elements
45
                geometries.put("_Geometry","");
46
                geometries.put("_GeometryCollection","");
47
                geometries.put("geometryMember","");
48
                geometries.put("pointMember","");
49
                geometries.put("lineStringMember","");
50
                geometries.put("polygonMember","");
51
                geometries.put("outerBoundaryIs","");
52
                geometries.put("innerBoundaryIs","");
53
                //primitive geometry elements
54
                geometries.put("Point","");
55
                geometries.put("LineString","");
56
                geometries.put("LinearRing","");
57
                geometries.put("Polygon","");
58
                geometries.put("Box","");
59
                //aggregate geometry elements
60
                geometries.put("MultiGeometry","");
61
                geometries.put("MultiPoint","");
62
                geometries.put("MultiLineString","");
63
                geometries.put("MultiPolygon","");
64
                //coordinate elements
65
                geometries.put("coord","");
66
                geometries.put("X","");
67
                geometries.put("Y","");
68
                geometries.put("Z","");
69
                geometries.put("coordinates","");
70
                //this attribute gives the location where an element is defined
71
                geometries.put("remoteSchema","");
72
        }
73
        static{
74
                //features
75
                features.put("_Feature","");
76
                features.put("_FeatureCollection","");
77
                features.put("featureMember","");
78
                //some basic geometric properties of features
79
                features.put("_geometryProperty","");
80
                features.put("geometryProperty","");
81
                features.put("boundedBy","");
82
                features.put("pointProperty","");
83
                features.put("polygonProperty","");
84
                features.put("lineStringProperty","");
85
                features.put("multiPointProperty","");
86
                features.put("multiLineStringProperty","");
87
                features.put("multiPolygonProperty","");
88
                features.put("multiGeometryProperty","");
89
                //common aliases for geometry properties
90
                features.put("location","");
91
                features.put("centerOf","");
92
                features.put("position","");
93
                features.put("extentOf","");
94
                features.put("coverage","");
95
                features.put("edgeOf","");
96
                features.put("centerLineOf","");
97
                features.put("multiLocation","");
98
                features.put("multiCenterOf","");
99
                features.put("multiPosition","");
100
                features.put("multiCenterLineOf","");
101
                features.put("multiEdgeOf","");
102
                features.put("multiCoverage","");
103
                features.put("multiExtentOf","");
104
                //common feature descriptors
105
                features.put("description","");
106
                features.put("name","");
107
        }
108

    
109
        private String tag;
110
        
111
        /**
112
         * Class constructor
113
         **/
114
        public GMLGeometries(String actual){
115
                this.tag = actual;
116
        }
117
        
118
        /**
119
         * It search a tag in the both of GML hashtables
120
         *         -if it isn't, then returns false.
121
         *         -else it is a GML 2.x stardard tag and return true
122
         * 
123
         * @return boolean
124
         **/
125
        public boolean isGML(){
126
                boolean ok;
127
                if (isGeometryGML()==true){
128
                        ok=true;
129
                }
130
                else if (isFeatureGML()==true){
131
                        ok=true;
132
                }
133
                else{
134
                        ok=false;
135
                }
136
                return (ok);
137
        }
138
        
139
        /**
140
         * It search a tag in the geometry hashtable
141
         *         -if it isn't, then returns false.
142
         *         -else it is a GML 2.x stardard geometry and return true
143
         * 
144
         * @return boolean
145
         **/
146
        public boolean isGeometryGML(){
147
                return (geometries.get(tag)!=null);
148
        }
149
        
150
        /**
151
         * It search a tag in the feature hashtable
152
         *         -if it isn't, then returns false.
153
         *         -else it is a GML 2.x stardard feature tag and return true
154
         * 
155
         * @return boolean
156
         **/
157
        public boolean isFeatureGML(){
158
                return (features.get(tag)!=null);
159
        }
160
}