Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / gvsig / javadocs / scripting / geom.java @ 775

History | View | Annotate | Download (7.98 KB)

1
package scripting;
2

    
3
import org.gvsig.fmap.geom.Geometry;
4
import org.gvsig.fmap.geom.primitive.Envelope;
5

    
6

    
7

    
8
/**
9
 * 
10
 * Utility functions to manage gvSIG geometries
11
 */
12
public class geom {
13
    
14
    // GeometryTypes
15
    public static final int AGGREGATE = Geometry.TYPES.AGGREGATE;
16
    public static final int ARC = Geometry.TYPES.ARC;
17
    public static final int CIRCLE = Geometry.TYPES.CIRCLE;
18
    public static final int CURVE = Geometry.TYPES.CURVE;
19
    public static final int ELLIPSE = Geometry.TYPES.ELLIPSE;
20
    public static final int ELLIPTICARC = Geometry.TYPES.ELLIPTICARC;
21
    public static final int GEOMETRY = Geometry.TYPES.GEOMETRY;
22
    public static final int MULTICURVE = Geometry.TYPES.MULTICURVE;
23
    public static final int MULTIPOINT = Geometry.TYPES.MULTIPOINT;
24
    public static final int MULTISOLID = Geometry.TYPES.MULTISOLID;
25
    public static final int MULTISURFACE = Geometry.TYPES.MULTISURFACE;
26
    public static final int NULL = Geometry.TYPES.NULL;
27
    public static final int POINT = Geometry.TYPES.POINT;
28
    public static final int SOLID =  Geometry.TYPES.SOLID;
29
    public static final int SPLINE = Geometry.TYPES.SPLINE;
30
    public static final int SURFACE = Geometry.TYPES.SURFACE;
31

    
32
    // Common named geometry types
33
    public static final int POLYGON = Geometry.TYPES.SURFACE;
34
    public static final int LINE = Geometry.TYPES.CURVE;
35
    public static final int MULTILINE = Geometry.TYPES.MULTICURVE;
36
    public static final int MULTIPOLYGON = Geometry.TYPES.MULTISURFACE;
37

    
38
    // geometrySubTypes 
39
    public static final int D2 = Geometry.SUBTYPES.GEOM2D;
40
    public static final int D2M = Geometry.SUBTYPES.GEOM2DM;
41
    public static final int D3 = Geometry.SUBTYPES.GEOM3D;
42
    public static final int D3M = Geometry.SUBTYPES.GEOM3DM;
43
    public static final int UNKNOWN = Geometry.SUBTYPES.UNKNOWN;
44

    
45
    /**
46
     * Returns a new geometry with a concrete type and subtype or None if can't
47
     * create geometry.
48
     *
49
     * @param type: geometry type
50
     * @type type: int
51
     * @param subtype, optional: geometry subtype
52
     * @type subtype: int
53
     * @return geometry
54
     * @rtype geometry
55
     *
56
     */
57
    public static Geometry createGeometry(int type, int subtype) {
58
        return null;
59
    }
60
  
61
    /**
62
     * Create a Point2D. If values of x and y are None, it will create an
63
     * empty Point2D geometry
64
     *
65
     * @param vertexes, optional: vertexes of a new line
66
     * @type vertexes, list of coordinates or list of geometry points
67
     * @return line geometry
68
     */
69
    public static Geometry createPoint2D(double x, double y, int subtype) {
70
        return null;
71
    }
72

    
73
    /**
74
     * Create a Line2D. If vertexes value is None it will 
75
     * create an empty Line2D geometry.
76
     *
77
     * @param vertexes, optional: vertexes of a new line
78
     * @type vertexes, list of coordinates or list of geometry points
79
     * @return line geometry
80
     */
81
    public static Geometry createLine2D(Object vertexes) {
82
        return null;
83
    }
84
    
85
    /**
86
     * Create a Polygon2D. If vertexes value is None it will 
87
     * create an empty Polygon2D.
88
     *
89
     * @param vertexes, optional: vertexes of a new line
90
     * @type vertexes, list of coordinates or list of geometry points
91
     * @return line geometry
92
     */
93
    public static Geometry createPolygon2D(Object vertexes) {
94
        return null;
95
    }
96
    
97
    /**
98
     * 
99
     * Returns a new point with a subtype and sets the value for the X, Y, Z and M
100
     * coordinates (default 0,0,0,0) or None if can't create point or none coordinates
101
     * are established.
102
     * 
103
     * If you pass a point geometry as a parameter, it will return the same geometry point.
104
     *
105
     *
106
     * Examples:
107
     *     createPoint(D2, 1, 2) -> Point2D(1, 2)
108
     *     createPoint(D2, [1, 2]) -> Point2D(1, 2)
109
     *
110
     *     createPoint(D3, 1, 2, 3) -> Point3D(1,2,3)
111
     *     createPoint(D2M, 1, 2, 4) -> Point (1, 2, 4)
112
     *     createPoint(D3M, 1, 2, 3, 4) -> Point (1, 2, 3, 4)
113
     *
114
     *     createPoint(D2, Point2D(1, 2) -> Point2D(1, 2)
115
     *     
116
     *
117
     * @param subtype, geometry subtype
118
     * @type subtype: int
119
     * @param coords, list of coordinates or points
120
     * @return 
121
     */
122
    public static Geometry createPoint(int subtype, double... coords)  {
123
        return null;
124
    }  
125
    
126
    /**
127
     * 
128
     * Returns a new multipoint with a subtype from a list of Points instancesor list
129
     * of coordinates.
130
     * If points are None, returns an empty multipoint geometry. If it can't create
131
     * the geometry, return None.
132
     *
133
     * @param subtype, geometry subtype
134
     * @type subtype, int
135
     * @param points, list of coordinates or points
136
     * @return 
137
     */
138
    public static Geometry createMultiPoint(int subtype, Object points) {
139
        return null;
140
    }
141

    
142
    /**
143
     * 
144
     * Returns a new polygon with a subtype from a list of Points instances or list
145
     * of tuples/lists like [[x1, y1], [x2, y2], ...., [xn, yn]] are
146
     * allowed. If points are None, returns an empty polygon geometry. If it can't create
147
     * the geometry, return None.
148
     *
149
     * Example:
150
     * createPolygon( D2, [point1, point2, [10, 10], point1])
151
     *
152
     * @param subtype, geometry subtype
153
     * @type subtype, int
154
     * @param vertexes, list of coordinates or points
155
     * @return 
156
     */
157
    public static Geometry createPolygon(int subtype, Object vertexes) {
158
        return null;
159
    }
160

    
161
    /**
162
     * 
163
     * Returns a new multipolygon with a subtype from a list of Polygon instances or list
164
     * of coordinates.
165
     * If polygons are None, returns an empty multipolygon geometry. If it can't create
166
     * the geometry, return None.
167
     *
168
     * Example:
169
     * createMultiPolygon( D2, [polygon1, [[0,0],[10,0],point1,[0,0]], polygon3])
170
     *
171
     * @param subtype, geometry subtype
172
     * @type subtype, int
173
     * @param polygons, list of polygons.
174
     * @return 
175
     */
176
    public static Geometry createMultiPolygon(int subtype, Object polygons) {
177
        return null;        
178
    }  
179
    
180
    /**
181
     * 
182
     * Returns a new line with a subtype from a list of Points instances or list 
183
     * of coordinates as tuples/lists like ([x1, y1], [x2, y2], ...., [xn, yn]) are
184
     * allowed. If points are None, returns an empty line geometry. If it can't create
185
     * the geometry, return None.
186
     *
187
     * Example:
188
     * createLine( D2, [point0, [10,0], [10, 10], point0]) 
189
     *
190
     * @param subtype, geometry subtype
191
     * @type subtype, int
192
     * @param vertexes, list of coordinates or points
193
     * @return 
194
     */
195
    public static Geometry createLine(int subtype, Object vertexes) {
196
        return null;        
197
    }  
198
    
199
    /**
200
     * 
201
     * Returns a new multiline with a subtype from a list of Line instances or list
202
     * of coordinates.
203
     * If polygons are None, returns an empty multipolygon geometry. If it can't create
204
     * the geometry, return None.
205
     *
206
     * Example:
207
     * createMultiLine( D2, [line1, [[0,0],[10,0],point1], line3])
208
     *
209
     * @param subtype, geometry subtype
210
     * @type subtype, int
211
     * @param lines, list of lines.
212
     * @return 
213
     */
214
    public static Geometry createMultiLine(int subtype, Object lines) {
215
        return null;        
216
    }  
217
    
218

    
219
    /**
220
     * Returns envelope as a minimum bounding box or rectangle. This envelope is
221
     * equivalent to the GM_Envelope specified in ISO 19107. If points are None it will
222
     * create an empty Envelope
223
     *
224
     * @param pointMax, optional, None by default
225
     * @type pointMax, list of coordinates or geometry point
226
     * @param pointMin, optional, None by default
227
     * @type pointMin, list of coordinates or geometry point
228
     * @param dimension
229
     * @return 
230
     */
231
    public static Envelope createEnvelope(Object pointMax, Object pointMin, int dimension) {
232
        return null;        
233
    }  
234
        
235
    /**
236
     * Create geometry from WKT (Well Known Text)
237
     *
238
     * @param WKT
239
     * @type WKT, string
240
     * @return 
241
     */
242
    public static Geometry createGeometryFromWKT(String WKT) {
243
        return null;
244
    }  
245
    
246
    
247
    
248
}